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
0f00b898
Commit
0f00b898
authored
Jul 28, 2023
by
Joel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/add-stat-tps' into deploy/dev
parents
21cb5ffe
6a3cdc58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
basic.tsx
web/app/components/app-sidebar/basic.tsx
+4
-3
appChart.tsx
web/app/components/app/overview/appChart.tsx
+1
-0
No files found.
web/app/components/app-sidebar/basic.tsx
View file @
0f00b898
...
@@ -2,9 +2,9 @@ import React from 'react'
...
@@ -2,9 +2,9 @@ import React from 'react'
import
{
import
{
InformationCircleIcon
,
InformationCircleIcon
,
}
from
'@heroicons/react/24/outline'
}
from
'@heroicons/react/24/outline'
import
cn
from
'classnames'
import
Tooltip
from
'../base/tooltip'
import
Tooltip
from
'../base/tooltip'
import
AppIcon
from
'../base/app-icon'
import
AppIcon
from
'../base/app-icon'
const
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'
const
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'
export
function
randomString
(
length
:
number
)
{
export
function
randomString
(
length
:
number
)
{
...
@@ -21,6 +21,7 @@ export type IAppBasicProps = {
...
@@ -21,6 +21,7 @@ export type IAppBasicProps = {
type
:
string
|
React
.
ReactNode
type
:
string
|
React
.
ReactNode
hoverTip
?:
string
hoverTip
?:
string
textStyle
?:
{
main
?:
string
;
extra
?:
string
}
textStyle
?:
{
main
?:
string
;
extra
?:
string
}
isExtraInLine
?:
boolean
}
}
const
ApiSvg
=
<
svg
width=
"18"
height=
"18"
viewBox=
"0 0 18 18"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
const
ApiSvg
=
<
svg
width=
"18"
height=
"18"
viewBox=
"0 0 18 18"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
...
@@ -61,7 +62,7 @@ const ICON_MAP = {
...
@@ -61,7 +62,7 @@ const ICON_MAP = {
notion
:
<
AppIcon
innerIcon=
{
NotionSvg
}
className=
'!border-[0.5px] !border-indigo-100 !bg-white'
/>,
notion
:
<
AppIcon
innerIcon=
{
NotionSvg
}
className=
'!border-[0.5px] !border-indigo-100 !bg-white'
/>,
}
}
export
default
function
AppBasic
({
icon
,
icon_background
,
name
,
type
,
hoverTip
,
textStyle
,
iconType
=
'app'
}:
IAppBasicProps
)
{
export
default
function
AppBasic
({
icon
,
icon_background
,
name
,
type
,
hoverTip
,
textStyle
,
iconType
=
'app'
,
isExtraInLine
}:
IAppBasicProps
)
{
return
(
return
(
<
div
className=
"flex items-start"
>
<
div
className=
"flex items-start"
>
{
icon
&&
icon_background
&&
iconType
===
'app'
&&
(
{
icon
&&
icon_background
&&
iconType
===
'app'
&&
(
...
@@ -75,7 +76,7 @@ export default function AppBasic({ icon, icon_background, name, type, hoverTip,
...
@@ -75,7 +76,7 @@ export default function AppBasic({ icon, icon_background, name, type, hoverTip,
</
div
>
</
div
>
}
}
<
div
className=
"group"
>
<
div
className=
{
cn
(
'group'
,
isExtraInLine
&&
'flex items-end space-x-2'
)
}
>
<
div
className=
{
`flex flex-row items-center text-sm font-semibold text-gray-700 group-hover:text-gray-900 ${textStyle?.main}`
}
>
<
div
className=
{
`flex flex-row items-center text-sm font-semibold text-gray-700 group-hover:text-gray-900 ${textStyle?.main}`
}
>
{
name
}
{
name
}
{
hoverTip
{
hoverTip
...
...
web/app/components/app/overview/appChart.tsx
View file @
0f00b898
...
@@ -231,6 +231,7 @@ const Chart: React.FC<IChartProps> = ({
...
@@ -231,6 +231,7 @@ const Chart: React.FC<IChartProps> = ({
</
div
>
</
div
>
<
div
className=
'mb-4'
>
<
div
className=
'mb-4'
>
<
Basic
<
Basic
isExtraInLine=
{
CHART_TYPE_CONFIG
[
chartType
].
showTokens
}
name=
{
chartType
!==
'costs'
?
(
sumData
.
toLocaleString
()
+
unit
)
:
`${sumData < 1000 ? sumData : (`
$
{
formatNumber
(
Math
.
round
(
sumData
/
1000
))}
k
`)}`
}
name=
{
chartType
!==
'costs'
?
(
sumData
.
toLocaleString
()
+
unit
)
:
`${sumData < 1000 ? sumData : (`
$
{
formatNumber
(
Math
.
round
(
sumData
/
1000
))}
k
`)}`
}
type=
{
!
CHART_TYPE_CONFIG
[
chartType
].
showTokens
type=
{
!
CHART_TYPE_CONFIG
[
chartType
].
showTokens
?
''
?
''
...
...
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