Skip to content

Commit 704ec1a

Browse files
committed
chore: update theme berry
1 parent 1d7470d commit 704ec1a

File tree

11 files changed

+66
-56
lines changed

11 files changed

+66
-56
lines changed

web/berry/public/favicon.ico

-36.1 KB
Binary file not shown.

web/berry/src/constants/ChannelConstants.js

+31-31
Original file line numberDiff line numberDiff line change
@@ -3,186 +3,186 @@ export const CHANNEL_OPTIONS = {
33
key: 1,
44
text: 'OpenAI',
55
value: 1,
6-
color: 'primary'
6+
color: 'success'
77
},
88
14: {
99
key: 14,
1010
text: 'Anthropic Claude',
1111
value: 14,
12-
color: 'info'
12+
color: 'primary'
1313
},
1414
3: {
1515
key: 3,
1616
text: 'Azure OpenAI',
1717
value: 3,
18-
color: 'secondary'
18+
color: 'success'
1919
},
2020
11: {
2121
key: 11,
2222
text: 'Google PaLM2',
2323
value: 11,
24-
color: 'orange'
24+
color: 'warning'
2525
},
2626
24: {
2727
key: 24,
2828
text: 'Google Gemini',
2929
value: 24,
30-
color: 'orange'
30+
color: 'warning'
3131
},
3232
28: {
3333
key: 28,
3434
text: 'Mistral AI',
3535
value: 28,
36-
color: 'orange'
36+
color: 'warning'
3737
},
3838
15: {
3939
key: 15,
4040
text: '百度文心千帆',
4141
value: 15,
42-
color: 'default'
42+
color: 'primary'
4343
},
4444
17: {
4545
key: 17,
4646
text: '阿里通义千问',
4747
value: 17,
48-
color: 'default'
48+
color: 'primary'
4949
},
5050
18: {
5151
key: 18,
5252
text: '讯飞星火认知',
5353
value: 18,
54-
color: 'default'
54+
color: 'primary'
5555
},
5656
16: {
5757
key: 16,
5858
text: '智谱 ChatGLM',
5959
value: 16,
60-
color: 'default'
60+
color: 'primary'
6161
},
6262
19: {
6363
key: 19,
6464
text: '360 智脑',
6565
value: 19,
66-
color: 'default'
66+
color: 'primary'
6767
},
6868
25: {
6969
key: 25,
7070
text: 'Moonshot AI',
7171
value: 25,
72-
color: 'default'
72+
color: 'primary'
7373
},
7474
23: {
7575
key: 23,
7676
text: '腾讯混元',
7777
value: 23,
78-
color: 'default'
78+
color: 'primary'
7979
},
8080
26: {
8181
key: 26,
8282
text: '百川大模型',
8383
value: 26,
84-
color: 'default'
84+
color: 'primary'
8585
},
8686
27: {
8787
key: 27,
8888
text: 'MiniMax',
8989
value: 27,
90-
color: 'default'
90+
color: 'primary'
9191
},
9292
29: {
9393
key: 29,
9494
text: 'Groq',
9595
value: 29,
96-
color: 'default'
96+
color: 'primary'
9797
},
9898
30: {
9999
key: 30,
100100
text: 'Ollama',
101101
value: 30,
102-
color: 'default'
102+
color: 'primary'
103103
},
104104
31: {
105105
key: 31,
106106
text: '零一万物',
107107
value: 31,
108-
color: 'default'
108+
color: 'primary'
109109
},
110110
8: {
111111
key: 8,
112112
text: '自定义渠道',
113113
value: 8,
114-
color: 'primary'
114+
color: 'error'
115115
},
116116
22: {
117117
key: 22,
118118
text: '知识库:FastGPT',
119119
value: 22,
120-
color: 'default'
120+
color: 'success'
121121
},
122122
21: {
123123
key: 21,
124124
text: '知识库:AI Proxy',
125125
value: 21,
126-
color: 'purple'
126+
color: 'success'
127127
},
128128
20: {
129129
key: 20,
130130
text: '代理:OpenRouter',
131131
value: 20,
132-
color: 'primary'
132+
color: 'success'
133133
},
134134
2: {
135135
key: 2,
136136
text: '代理:API2D',
137137
value: 2,
138-
color: 'primary'
138+
color: 'success'
139139
},
140140
5: {
141141
key: 5,
142142
text: '代理:OpenAI-SB',
143143
value: 5,
144-
color: 'primary'
144+
color: 'success'
145145
},
146146
7: {
147147
key: 7,
148148
text: '代理:OhMyGPT',
149149
value: 7,
150-
color: 'primary'
150+
color: 'success'
151151
},
152152
10: {
153153
key: 10,
154154
text: '代理:AI Proxy',
155155
value: 10,
156-
color: 'primary'
156+
color: 'success'
157157
},
158158
4: {
159159
key: 4,
160160
text: '代理:CloseAI',
161161
value: 4,
162-
color: 'primary'
162+
color: 'success'
163163
},
164164
6: {
165165
key: 6,
166166
text: '代理:OpenAI Max',
167167
value: 6,
168-
color: 'primary'
168+
color: 'success'
169169
},
170170
9: {
171171
key: 9,
172172
text: '代理:AI.LS',
173173
value: 9,
174-
color: 'primary'
174+
color: 'success'
175175
},
176176
12: {
177177
key: 12,
178178
text: '代理:API2GPT',
179179
value: 12,
180-
color: 'primary'
180+
color: 'success'
181181
},
182182
13: {
183183
key: 13,
184184
text: '代理:AIGC2D',
185185
value: 13,
186-
color: 'primary'
186+
color: 'success'
187187
}
188188
};

web/berry/src/views/Authentication/AuthForms/AuthLogin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const LoginForm = ({ ...others }) => {
180180
{({ errors, handleBlur, handleChange, handleSubmit, isSubmitting, touched, values }) => (
181181
<form noValidate onSubmit={handleSubmit} {...others}>
182182
<FormControl fullWidth error={Boolean(touched.username && errors.username)} sx={{ ...theme.typography.customInput }}>
183-
<InputLabel htmlFor="outlined-adornment-username-login">用户名</InputLabel>
183+
<InputLabel htmlFor="outlined-adornment-username-login">用户名 / 邮箱</InputLabel>
184184
<OutlinedInput
185185
id="outlined-adornment-username-login"
186186
type="text"

web/berry/src/views/Channel/component/GroupLabel.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ import Label from "ui-component/Label";
33
import Stack from "@mui/material/Stack";
44
import Divider from "@mui/material/Divider";
55

6+
function name2color(name) {
7+
switch (name) {
8+
case "default":
9+
return "info";
10+
case "vip":
11+
return "warning"
12+
case "svip":
13+
return "error"
14+
default:
15+
return "info"
16+
}
17+
}
18+
619
const GroupLabel = ({ group }) => {
720
let groups = [];
821
if (group === "") {
@@ -14,7 +27,7 @@ const GroupLabel = ({ group }) => {
1427
return (
1528
<Stack divider={<Divider orientation="vertical" flexItem />} spacing={0.5}>
1629
{groups.map((group, index) => {
17-
return <Label key={index}>{group}</Label>;
30+
return <Label key={index} color={name2color(group)}>{group}</Label>;
1831
})}
1932
</Stack>
2033
);

web/berry/src/views/Channel/component/TableHead.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const ChannelTableHead = () => {
1010
<TableCell>类型</TableCell>
1111
<TableCell>状态</TableCell>
1212
<TableCell>响应时间</TableCell>
13+
<TableCell>已消耗</TableCell>
1314
<TableCell>余额</TableCell>
1415
<TableCell>优先级</TableCell>
1516
<TableCell>操作</TableCell>

web/berry/src/views/Channel/component/TableRow.js

+3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ export default function ChannelTableRow({
170170
handle_action={handleResponseTime}
171171
/>
172172
</TableCell>
173+
<TableCell>
174+
{renderNumber(item.used_quota)}
175+
</TableCell>
173176
<TableCell>
174177
<Tooltip
175178
title={"点击更新余额"}

web/berry/src/views/Channel/index.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,14 @@ export default function ChannelPage() {
193193

194194
return (
195195
<>
196-
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={5}>
196+
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={2.5}>
197197
<Typography variant="h4">渠道</Typography>
198-
199198
<Button variant="contained" color="primary" startIcon={<IconPlus />} onClick={() => handleOpenModal(0)}>
200199
新建渠道
201200
</Button>
202201
</Stack>
203-
<Stack mb={5}>
204-
<Alert severity="info">
205-
OpenAI 渠道已经不再支持通过 key 获取余额,因此余额显示为 0。对于支持的渠道类型,请点击余额进行刷新。
206-
</Alert>
207-
</Stack>
208202
<Card>
209-
<Box component="form" onSubmit={searchChannels} noValidate>
203+
<Box component="form" onSubmit={searchChannels} noValidate sx={{marginTop: 2}}>
210204
<TableToolBar filterName={searchKeyword} handleFilterName={handleSearchKeyword} placeholder={'搜索渠道的 ID,名称和密钥 ...'} />
211205
</Box>
212206
<Toolbar
@@ -220,7 +214,7 @@ export default function ChannelPage() {
220214
>
221215
<Container>
222216
{matchUpMd ? (
223-
<ButtonGroup variant="outlined" aria-label="outlined small primary button group">
217+
<ButtonGroup variant="outlined" aria-label="outlined small primary button group" sx={{marginBottom: 2}}>
224218
<Button onClick={handleRefresh} startIcon={<IconRefresh width={'18px'} />}>
225219
刷新
226220
</Button>

web/berry/src/views/Log/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ export default function Log() {
102102

103103
return (
104104
<>
105-
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={5}>
105+
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={2.5}>
106106
<Typography variant="h4">日志</Typography>
107107
</Stack>
108108
<Card>
109-
<Box component="form" onSubmit={searchLogs} noValidate>
109+
<Box component="form" onSubmit={searchLogs} noValidate sx={{marginTop: 2}}>
110110
<TableToolBar filterName={searchKeyword} handleFilterName={handleSearchKeyword} userIsAdmin={userIsAdmin} />
111111
</Box>
112112
<Toolbar
@@ -119,7 +119,7 @@ export default function Log() {
119119
}}
120120
>
121121
<Container>
122-
<ButtonGroup variant="outlined" aria-label="outlined small primary button group">
122+
<ButtonGroup variant="outlined" aria-label="outlined small primary button group" sx={{marginBottom: 2}}>
123123
<Button onClick={handleRefresh} startIcon={<IconRefresh width={'18px'} />}>
124124
刷新/清除搜索条件
125125
</Button>

web/berry/src/views/Redemption/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ export default function Redemption() {
141141

142142
return (
143143
<>
144-
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={5}>
144+
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={2.5}>
145145
<Typography variant="h4">兑换</Typography>
146146

147147
<Button variant="contained" color="primary" startIcon={<IconPlus />} onClick={() => handleOpenModal(0)}>
148148
新建兑换码
149149
</Button>
150150
</Stack>
151151
<Card>
152-
<Box component="form" onSubmit={searchRedemptions} noValidate>
152+
<Box component="form" onSubmit={searchRedemptions} noValidate sx={{marginTop: 2}}>
153153
<TableToolBar filterName={searchKeyword} handleFilterName={handleSearchKeyword} placeholder={'搜索兑换码的ID和名称...'} />
154154
</Box>
155155
<Toolbar
@@ -162,7 +162,7 @@ export default function Redemption() {
162162
}}
163163
>
164164
<Container>
165-
<ButtonGroup variant="outlined" aria-label="outlined small primary button group">
165+
<ButtonGroup variant="outlined" aria-label="outlined small primary button group" sx={{marginBottom: 2}}>
166166
<Button onClick={handleRefresh} startIcon={<IconRefresh width={'18px'} />}>
167167
刷新
168168
</Button>

web/berry/src/views/Token/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ export default function Token() {
141141

142142
return (
143143
<>
144-
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={5}>
144+
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={2.5}>
145145
<Typography variant="h4">令牌</Typography>
146-
147146
<Button
148147
variant="contained"
149148
color="primary"
@@ -155,13 +154,13 @@ export default function Token() {
155154
新建令牌
156155
</Button>
157156
</Stack>
158-
<Stack mb={5}>
157+
<Stack mb={2}>
159158
<Alert severity="info">
160159
将 OpenAI API 基础地址 https://api.openai.com 替换为 <b>{siteInfo.server_address}</b>,复制下面的密钥即可使用
161160
</Alert>
162161
</Stack>
163162
<Card>
164-
<Box component="form" onSubmit={searchTokens} noValidate>
163+
<Box component="form" onSubmit={searchTokens} noValidate sx={{marginTop: 2}}>
165164
<TableToolBar filterName={searchKeyword} handleFilterName={handleSearchKeyword} placeholder={'搜索令牌的名称...'} />
166165
</Box>
167166
<Toolbar
@@ -174,7 +173,7 @@ export default function Token() {
174173
}}
175174
>
176175
<Container>
177-
<ButtonGroup variant="outlined" aria-label="outlined small primary button group">
176+
<ButtonGroup variant="outlined" aria-label="outlined small primary button group" sx={{marginBottom: 2}}>
178177
<Button onClick={handleRefresh} startIcon={<IconRefresh width={'18px'} />}>
179178
刷新
180179
</Button>

0 commit comments

Comments
 (0)