Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
726de039
authored
Jul 13, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui
parent
b4d46ff3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
16 deletions
+13
-16
client/src/components/Layout/index.tsx
+1
-1
client/src/components/SideTabs/index.tsx
+2
-2
client/src/pages/app/detail/components/Charts/TokenUsage.tsx
+0
-8
client/src/pages/app/detail/index.tsx
+2
-2
client/src/pages/app/list/index.tsx
+7
-2
client/src/service/models/bill.ts
+1
-1
No files found.
client/src/components/Layout/index.tsx
View file @
726de039
...
@@ -57,7 +57,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
...
@@ -57,7 +57,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
const
{
data
:
unread
=
0
}
=
useQuery
([
'getUnreadCount'
],
getUnreadCount
,
{
const
{
data
:
unread
=
0
}
=
useQuery
([
'getUnreadCount'
],
getUnreadCount
,
{
enabled
:
!!
userInfo
,
enabled
:
!!
userInfo
,
refetchInterval
:
5
000
refetchInterval
:
10
000
});
});
return
(
return
(
...
...
client/src/components/S
l
ideTabs/index.tsx
→
client/src/components/SideTabs/index.tsx
View file @
726de039
...
@@ -11,7 +11,7 @@ export interface Props extends GridProps {
...
@@ -11,7 +11,7 @@ export interface Props extends GridProps {
onChange
:
(
id
:
string
)
=>
void
;
onChange
:
(
id
:
string
)
=>
void
;
}
}
const
S
l
ideTabs
=
({
list
,
size
=
'md'
,
activeId
,
onChange
,
...
props
}:
Props
)
=>
{
const
SideTabs
=
({
list
,
size
=
'md'
,
activeId
,
onChange
,
...
props
}:
Props
)
=>
{
const
sizeMap
=
useMemo
(()
=>
{
const
sizeMap
=
useMemo
(()
=>
{
switch
(
size
)
{
switch
(
size
)
{
case
'sm'
:
case
'sm'
:
...
@@ -68,4 +68,4 @@ const SlideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) =
...
@@ -68,4 +68,4 @@ const SlideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) =
);
);
};
};
export
default
React
.
memo
(
S
l
ideTabs
);
export
default
React
.
memo
(
SideTabs
);
client/src/pages/app/detail/components/Charts/TokenUsage.tsx
View file @
726de039
...
@@ -110,8 +110,6 @@ const TokenUsage = ({ appId }: { appId: string }) => {
...
@@ -110,8 +110,6 @@ const TokenUsage = ({ appId }: { appId: string }) => {
},
},
yAxis
:
{
yAxis
:
{
type
:
'value'
,
type
:
'value'
,
boundaryGap
:
false
,
splitNumber
:
5
,
max
:
Math
.
max
(...
data
.
map
((
item
)
=>
item
.
tokenLen
)),
max
:
Math
.
max
(...
data
.
map
((
item
)
=>
item
.
tokenLen
)),
min
:
0
min
:
0
},
},
...
@@ -180,12 +178,6 @@ const TokenUsage = ({ appId }: { appId: string }) => {
...
@@ -180,12 +178,6 @@ const TokenUsage = ({ appId }: { appId: string }) => {
myChart.current.setOption(option);
myChart.current.setOption(option);
}, [data, option]);
}, [data, option]);
// limit changed, update
useEffect(() => {
if (!myChart.current || !myChart?.current?.getOption()) return;
myChart.current.setOption(option);
}, [option]);
// resize chart
// resize chart
useEffect(() => {
useEffect(() => {
if (!myChart.current || !myChart.current.getOption()) return;
if (!myChart.current || !myChart.current.getOption()) return;
...
...
client/src/pages/app/detail/index.tsx
View file @
726de039
...
@@ -6,7 +6,7 @@ import dynamic from 'next/dynamic';
...
@@ -6,7 +6,7 @@ import dynamic from 'next/dynamic';
import
{
defaultApp
}
from
'@/constants/model'
;
import
{
defaultApp
}
from
'@/constants/model'
;
import
Tabs
from
'@/components/Tabs'
;
import
Tabs
from
'@/components/Tabs'
;
import
S
lideTabs
from
'@/components/Sl
ideTabs'
;
import
S
ideTabs
from
'@/components/S
ideTabs'
;
import
Settings
from
'./components/Settings'
;
import
Settings
from
'./components/Settings'
;
import
Avatar
from
'@/components/Avatar'
;
import
Avatar
from
'@/components/Avatar'
;
import
MyIcon
from
'@/components/Icon'
;
import
MyIcon
from
'@/components/Icon'
;
...
@@ -81,7 +81,7 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
...
@@ -81,7 +81,7 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
{
appDetail
.
name
}
{
appDetail
.
name
}
</
Box
>
</
Box
>
</
Flex
>
</
Flex
>
<
S
l
ideTabs
<
SideTabs
flex=
{
1
}
flex=
{
1
}
mx=
{
'auto'
}
mx=
{
'auto'
}
mt=
{
2
}
mt=
{
2
}
...
...
client/src/pages/app/list/index.tsx
View file @
726de039
...
@@ -23,6 +23,7 @@ import PageContainer from '@/components/PageContainer';
...
@@ -23,6 +23,7 @@ import PageContainer from '@/components/PageContainer';
import
Avatar
from
'@/components/Avatar'
;
import
Avatar
from
'@/components/Avatar'
;
const
CreateModal
=
dynamic
(()
=>
import
(
'./component/CreateModal'
));
const
CreateModal
=
dynamic
(()
=>
import
(
'./component/CreateModal'
));
import
styles
from
'./index.module.scss'
;
import
styles
from
'./index.module.scss'
;
import
MyTooltip
from
'@/components/MyTooltip'
;
const
MyApps
=
()
=>
{
const
MyApps
=
()
=>
{
const
{
toast
}
=
useToast
();
const
{
toast
}
=
useToast
();
...
@@ -117,7 +118,7 @@ const MyApps = () => {
...
@@ -117,7 +118,7 @@ const MyApps = () => {
aria
-
label=
{
'delete'
}
aria
-
label=
{
'delete'
}
display=
{
[
''
,
'none'
]
}
display=
{
[
''
,
'none'
]
}
_hover=
{
{
_hover=
{
{
bg
:
'
myGray
.100'
bg
:
'
red
.100'
}
}
}
}
onClick=
{
(
e
)
=>
{
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
...
@@ -140,7 +141,11 @@ const MyApps = () => {
...
@@ -140,7 +141,11 @@ const MyApps = () => {
right=
{
4
}
right=
{
4
}
bottom=
{
4
}
bottom=
{
4
}
size=
{
'sm'
}
size=
{
'sm'
}
icon=
{
<
MyIcon
name=
{
'chatLight'
}
w=
{
'14px'
}
/>
}
icon=
{
<
MyTooltip
label=
{
'去聊天'
}
>
<
MyIcon
name=
{
'chatLight'
}
w=
{
'14px'
}
/>
</
MyTooltip
>
}
variant=
{
'base'
}
variant=
{
'base'
}
borderRadius=
{
'md'
}
borderRadius=
{
'md'
}
aria
-
label=
{
'delete'
}
aria
-
label=
{
'delete'
}
...
...
client/src/service/models/bill.ts
View file @
726de039
...
@@ -45,7 +45,7 @@ const BillSchema = new Schema({
...
@@ -45,7 +45,7 @@ const BillSchema = new Schema({
try
{
try
{
BillSchema
.
index
({
userId
:
1
});
BillSchema
.
index
({
userId
:
1
});
// BillSchema.index({ time: -1 });
// BillSchema.index({ time: -1 });
//
BillSchema.index({ time: 1 }, { expireAfterSeconds: 90 * 24 * 60 });
BillSchema
.
index
({
time
:
1
},
{
expireAfterSeconds
:
90
*
24
*
60
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
}
}
...
...
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