Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
30090934
Commit
30090934
authored
Mar 14, 2024
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use app store in overview
parent
277d21cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
chartView.tsx
...out)/app/(appDetailLayout)/[appId]/overview/chartView.tsx
+4
-6
No files found.
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chartView.tsx
View file @
30090934
...
...
@@ -3,13 +3,12 @@ import React, { useState } from 'react'
import
dayjs
from
'dayjs'
import
quarterOfYear
from
'dayjs/plugin/quarterOfYear'
import
{
useTranslation
}
from
'react-i18next'
import
useSWR
from
'swr'
import
{
fetchAppDetail
}
from
'@/service/apps'
import
type
{
PeriodParams
}
from
'@/app/components/app/overview/appChart'
import
{
AvgResponseTime
,
AvgSessionInteractions
,
ConversationsChart
,
CostChart
,
EndUsersChart
,
TokenPerSecond
,
UserSatisfactionRate
}
from
'@/app/components/app/overview/appChart'
import
type
{
Item
}
from
'@/app/components/base/select'
import
{
SimpleSelect
}
from
'@/app/components/base/select'
import
{
TIME_PERIOD_LIST
}
from
'@/app/components/app/log/filter'
import
{
useStore
as
useAppStore
}
from
'@/app/components/app/store'
dayjs
.
extend
(
quarterOfYear
)
...
...
@@ -22,10 +21,9 @@ export type IChartViewProps = {
}
export
default
function
ChartView
({
appId
}:
IChartViewProps
)
{
const
detailParams
=
{
url
:
'/apps'
,
id
:
appId
}
const
{
data
:
response
}
=
useSWR
(
detailParams
,
fetchAppDetail
)
const
isChatApp
=
response
?.
mode
===
'chat'
const
{
t
}
=
useTranslation
()
const
{
appDetail
}
=
useAppStore
()
const
isChatApp
=
appDetail
?.
mode
!==
'completion'
&&
appDetail
?.
mode
!==
'workflow'
const
[
period
,
setPeriod
]
=
useState
<
PeriodParams
>
({
name
:
t
(
'appLog.filter.period.last7days'
),
query
:
{
start
:
today
.
subtract
(
7
,
'day'
).
format
(
queryDateFormat
),
end
:
today
.
format
(
queryDateFormat
)
}
})
const
onSelect
=
(
item
:
Item
)
=>
{
...
...
@@ -42,7 +40,7 @@ export default function ChartView({ appId }: IChartViewProps) {
}
}
if
(
!
response
)
if
(
!
appDetail
)
return
null
return
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment