chore: update theme berry

This commit is contained in:
JustSong 2024-03-17 17:48:57 +08:00
parent 1d7470d6ad
commit 704ec1a827
11 changed files with 66 additions and 56 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -3,186 +3,186 @@ export const CHANNEL_OPTIONS = {
key: 1,
text: 'OpenAI',
value: 1,
color: 'primary'
color: 'success'
},
14: {
key: 14,
text: 'Anthropic Claude',
value: 14,
color: 'info'
color: 'primary'
},
3: {
key: 3,
text: 'Azure OpenAI',
value: 3,
color: 'secondary'
color: 'success'
},
11: {
key: 11,
text: 'Google PaLM2',
value: 11,
color: 'orange'
color: 'warning'
},
24: {
key: 24,
text: 'Google Gemini',
value: 24,
color: 'orange'
color: 'warning'
},
28: {
key: 28,
text: 'Mistral AI',
value: 28,
color: 'orange'
color: 'warning'
},
15: {
key: 15,
text: '百度文心千帆',
value: 15,
color: 'default'
color: 'primary'
},
17: {
key: 17,
text: '阿里通义千问',
value: 17,
color: 'default'
color: 'primary'
},
18: {
key: 18,
text: '讯飞星火认知',
value: 18,
color: 'default'
color: 'primary'
},
16: {
key: 16,
text: '智谱 ChatGLM',
value: 16,
color: 'default'
color: 'primary'
},
19: {
key: 19,
text: '360 智脑',
value: 19,
color: 'default'
color: 'primary'
},
25: {
key: 25,
text: 'Moonshot AI',
value: 25,
color: 'default'
color: 'primary'
},
23: {
key: 23,
text: '腾讯混元',
value: 23,
color: 'default'
color: 'primary'
},
26: {
key: 26,
text: '百川大模型',
value: 26,
color: 'default'
color: 'primary'
},
27: {
key: 27,
text: 'MiniMax',
value: 27,
color: 'default'
color: 'primary'
},
29: {
key: 29,
text: 'Groq',
value: 29,
color: 'default'
color: 'primary'
},
30: {
key: 30,
text: 'Ollama',
value: 30,
color: 'default'
color: 'primary'
},
31: {
key: 31,
text: '零一万物',
value: 31,
color: 'default'
color: 'primary'
},
8: {
key: 8,
text: '自定义渠道',
value: 8,
color: 'primary'
color: 'error'
},
22: {
key: 22,
text: '知识库FastGPT',
value: 22,
color: 'default'
color: 'success'
},
21: {
key: 21,
text: '知识库AI Proxy',
value: 21,
color: 'purple'
color: 'success'
},
20: {
key: 20,
text: '代理OpenRouter',
value: 20,
color: 'primary'
color: 'success'
},
2: {
key: 2,
text: '代理API2D',
value: 2,
color: 'primary'
color: 'success'
},
5: {
key: 5,
text: '代理OpenAI-SB',
value: 5,
color: 'primary'
color: 'success'
},
7: {
key: 7,
text: '代理OhMyGPT',
value: 7,
color: 'primary'
color: 'success'
},
10: {
key: 10,
text: '代理AI Proxy',
value: 10,
color: 'primary'
color: 'success'
},
4: {
key: 4,
text: '代理CloseAI',
value: 4,
color: 'primary'
color: 'success'
},
6: {
key: 6,
text: '代理OpenAI Max',
value: 6,
color: 'primary'
color: 'success'
},
9: {
key: 9,
text: '代理AI.LS',
value: 9,
color: 'primary'
color: 'success'
},
12: {
key: 12,
text: '代理API2GPT',
value: 12,
color: 'primary'
color: 'success'
},
13: {
key: 13,
text: '代理AIGC2D',
value: 13,
color: 'primary'
color: 'success'
}
};

View File

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

View File

@ -3,6 +3,19 @@ import Label from "ui-component/Label";
import Stack from "@mui/material/Stack";
import Divider from "@mui/material/Divider";
function name2color(name) {
switch (name) {
case "default":
return "info";
case "vip":
return "warning"
case "svip":
return "error"
default:
return "info"
}
}
const GroupLabel = ({ group }) => {
let groups = [];
if (group === "") {
@ -14,7 +27,7 @@ const GroupLabel = ({ group }) => {
return (
<Stack divider={<Divider orientation="vertical" flexItem />} spacing={0.5}>
{groups.map((group, index) => {
return <Label key={index}>{group}</Label>;
return <Label key={index} color={name2color(group)}>{group}</Label>;
})}
</Stack>
);

View File

@ -10,6 +10,7 @@ const ChannelTableHead = () => {
<TableCell>类型</TableCell>
<TableCell>状态</TableCell>
<TableCell>响应时间</TableCell>
<TableCell>已消耗</TableCell>
<TableCell>余额</TableCell>
<TableCell>优先级</TableCell>
<TableCell>操作</TableCell>

View File

@ -170,6 +170,9 @@ export default function ChannelTableRow({
handle_action={handleResponseTime}
/>
</TableCell>
<TableCell>
{renderNumber(item.used_quota)}
</TableCell>
<TableCell>
<Tooltip
title={"点击更新余额"}

View File

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

View File

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

View File

@ -141,7 +141,7 @@ export default function Redemption() {
return (
<>
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={5}>
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={2.5}>
<Typography variant="h4">兑换</Typography>
<Button variant="contained" color="primary" startIcon={<IconPlus />} onClick={() => handleOpenModal(0)}>
@ -149,7 +149,7 @@ export default function Redemption() {
</Button>
</Stack>
<Card>
<Box component="form" onSubmit={searchRedemptions} noValidate>
<Box component="form" onSubmit={searchRedemptions} noValidate sx={{marginTop: 2}}>
<TableToolBar filterName={searchKeyword} handleFilterName={handleSearchKeyword} placeholder={'搜索兑换码的ID和名称...'} />
</Box>
<Toolbar
@ -162,7 +162,7 @@ export default function Redemption() {
}}
>
<Container>
<ButtonGroup variant="outlined" aria-label="outlined small primary button group">
<ButtonGroup variant="outlined" aria-label="outlined small primary button group" sx={{marginBottom: 2}}>
<Button onClick={handleRefresh} startIcon={<IconRefresh width={'18px'} />}>
刷新
</Button>

View File

@ -141,9 +141,8 @@ export default function Token() {
return (
<>
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={5}>
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={2.5}>
<Typography variant="h4">令牌</Typography>
<Button
variant="contained"
color="primary"
@ -155,13 +154,13 @@ export default function Token() {
新建令牌
</Button>
</Stack>
<Stack mb={5}>
<Stack mb={2}>
<Alert severity="info">
OpenAI API 基础地址 https://api.openai.com 替换为 <b>{siteInfo.server_address}</b>,复制下面的密钥即可使用
</Alert>
</Stack>
<Card>
<Box component="form" onSubmit={searchTokens} noValidate>
<Box component="form" onSubmit={searchTokens} noValidate sx={{marginTop: 2}}>
<TableToolBar filterName={searchKeyword} handleFilterName={handleSearchKeyword} placeholder={'搜索令牌的名称...'} />
</Box>
<Toolbar
@ -174,7 +173,7 @@ export default function Token() {
}}
>
<Container>
<ButtonGroup variant="outlined" aria-label="outlined small primary button group">
<ButtonGroup variant="outlined" aria-label="outlined small primary button group" sx={{marginBottom: 2}}>
<Button onClick={handleRefresh} startIcon={<IconRefresh width={'18px'} />}>
刷新
</Button>

View File

@ -139,7 +139,7 @@ export default function Users() {
return (
<>
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={5}>
<Stack direction="row" alignItems="center" justifyContent="space-between" mb={2.5}>
<Typography variant="h4">用户</Typography>
<Button variant="contained" color="primary" startIcon={<IconPlus />} onClick={() => handleOpenModal(0)}>
@ -147,7 +147,7 @@ export default function Users() {
</Button>
</Stack>
<Card>
<Box component="form" onSubmit={searchUsers} noValidate>
<Box component="form" onSubmit={searchUsers} noValidate sx={{marginTop: 2}}>
<TableToolBar
filterName={searchKeyword}
handleFilterName={handleSearchKeyword}
@ -164,7 +164,7 @@ export default function Users() {
}}
>
<Container>
<ButtonGroup variant="outlined" aria-label="outlined small primary button group">
<ButtonGroup variant="outlined" aria-label="outlined small primary button group" sx={{marginBottom: 2}}>
<Button onClick={handleRefresh} startIcon={<IconRefresh width={'18px'} />}>
刷新
</Button>