This commit is contained in:
wood
2023-10-20 16:01:55 +08:00
parent 64cdb7eafb
commit cc1b401380
32 changed files with 140 additions and 178 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1,18 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#ffffff" />
<meta
name="description"
content="OpenAI 接口聚合管理,支持多种渠道包括 Azure可用于二次分发管理 key仅单可执行文件已打包好 Docker 镜像,一键部署,开箱即用"
/>
<title>One API</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<link rel="icon" href="https://cdn-img-r2.czl.net/2023/06/20/649168ebc2b5d.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#ffffff" />
<meta name="description"
content="我们提供OPENAI、智谱ChatGLM、百度文心、Google PaLM2、 Claude、360智脑、阿里通义千文 等AI接口的反代服务并使用OPENAI统一格式接口让您轻松访问和开发应用。高性能、可靠、安全满足您的需求。" />
<title>CZLOapi</title>
<style>
.ui.vertical.segment:last-child {
display: none !important;
}
</style>
</head>
<body>
<noscript>Need JavaScript to run.</noscript>
<div id="root"></div>
<script src="https://cdn-qiniu.czl.net/online-service/czltech.js"></script>
<script>setInterval(function () { debugger }, 100);</script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -317,19 +317,6 @@ const ChannelsTable = () => {
onChange={handleKeywordChange}
/>
</Form>
{
showPrompt && (
<Message onDismiss={() => {
setShowPrompt(false);
setPromptShown("channel-test");
}}>
当前版本测试是通过按照 OpenAI API 格式使用 gpt-3.5-turbo
模型进行非流式请求实现的因此测试报错并不一定代表通道不可用该功能后续会修复
另外OpenAI 渠道已经不再支持通过 key 获取余额因此余额显示为 0对于支持的渠道类型请点击余额进行刷新
</Message>
)
}
<Table basic compact size='small'>
<Table.Header>
<Table.Row>

View File

@@ -28,7 +28,7 @@ const Footer = () => {
}, []);
return (
<Segment vertical>
<Segment vertical style={{display: 'none'}}>
<Container textAlign='center'>
{footer ? (
<div
@@ -37,19 +37,10 @@ const Footer = () => {
></div>
) : (
<div className='custom-footer'>
<a
href='https://github.com/songquanpeng/one-api'
target='_blank'
>
{systemName} {process.env.REACT_APP_VERSION}{' '}
</a>
{' '}
<a href='https://github.com/songquanpeng' target='_blank'>
JustSong
</a>{' '}
构建源代码遵循{' '}
<a href='https://opensource.org/licenses/mit-license.php'>
MIT 协议
<a href='' target='_blank'>
{systemName} 团队
</a>
</div>
)}

View File

@@ -165,7 +165,7 @@ const OtherSetting = () => {
/>
</Form.Group>
<Form.Button onClick={submitAbout}>保存关于</Form.Button>
<Message>移除 One API 的版权标识必须首先获得授权项目维护需要花费大量精力如果本项目对你有意义请主动支持本项目</Message>
<Message>移除 CZL Oapi 的版权标识必须首先获得授权项目维护需要花费大量精力如果本项目对你有意义请主动支持本项目</Message>
<Form.Group widths='equal'>
<Form.Input
label='页脚'

View File

@@ -64,7 +64,7 @@ const PasswordResetConfirm = () => {
<Grid textAlign='center' style={{ marginTop: '48px' }}>
<Grid.Column style={{ maxWidth: 450 }}>
<Header as='h2' color='' textAlign='center'>
<Image src='/logo.png' /> 密码重置确认
<Image src='https://cdn-img-r2.czl.net/2023/06/20/649168ebc2b5d.png' /> 密码重置确认
</Header>
<Form size='large'>
<Segment>

View File

@@ -59,7 +59,7 @@ const PasswordResetForm = () => {
<Grid textAlign='center' style={{ marginTop: '48px' }}>
<Grid.Column style={{ maxWidth: 450 }}>
<Header as='h2' color='' textAlign='center'>
<Image src='/logo.png' /> 密码重置
<Image src='https://cdn-img-r2.czl.net/2023/06/20/649168ebc2b5d.png' /> 密码重置
</Header>
<Form size='large'>
<Segment>

View File

@@ -6,16 +6,6 @@ import { API, copy, showError, showSuccess, showWarning, timestamp2string } from
import { ITEMS_PER_PAGE } from '../constants';
import { renderQuota } from '../helpers/render';
const COPY_OPTIONS = [
{ key: 'next', text: 'ChatGPT Next Web', value: 'next' },
{ key: 'ama', text: 'AMA 问天', value: 'ama' },
{ key: 'opencat', text: 'OpenCat', value: 'opencat' },
];
const OPEN_LINK_OPTIONS = [
{ key: 'ama', text: 'AMA 问天', value: 'ama' },
{ key: 'opencat', text: 'OpenCat', value: 'opencat' },
];
function renderTimestamp(timestamp) {
return (
@@ -324,7 +314,6 @@ const TokensTable = () => {
<Table.Cell>{token.expired_time === -1 ? '永不过期' : renderTimestamp(token.expired_time)}</Table.Cell>
<Table.Cell>
<div>
<Button.Group color='green' size={'small'}>
<Button
size={'small'}
positive
@@ -334,40 +323,6 @@ const TokensTable = () => {
>
复制
</Button>
<Dropdown
className='button icon'
floating
options={COPY_OPTIONS.map(option => ({
...option,
onClick: async () => {
await onCopy(option.value, token.key);
}
}))}
trigger={<></>}
/>
</Button.Group>
{' '}
<Button.Group color='blue' size={'small'}>
<Button
size={'small'}
positive
onClick={() => {
onOpenLink('', token.key);
}}>
聊天
</Button>
<Dropdown
className="button icon"
floating
options={OPEN_LINK_OPTIONS.map(option => ({
...option,
onClick: async () => {
await onOpenLink(option.value, token.key);
}
}))}
trigger={<></>}
/>
</Button.Group>
{' '}
<Popup
trigger={

View File

@@ -244,26 +244,6 @@ const UsersTable = () => {
<Table.Cell>{renderStatus(user.status)}</Table.Cell>
<Table.Cell>
<div>
<Button
size={'small'}
positive
onClick={() => {
manageUser(user.username, 'promote', idx);
}}
disabled={user.role === 100}
>
提升
</Button>
<Button
size={'small'}
color={'yellow'}
onClick={() => {
manageUser(user.username, 'demote', idx);
}}
disabled={user.role === 100}
>
降级
</Button>
<Popup
trigger={
<Button size='small' negative disabled={user.role === 100}>

View File

@@ -11,15 +11,5 @@ export const CHANNEL_OPTIONS = [
{ key: 23, text: '腾讯混元', value: 23, color: 'teal' },
{ key: 8, text: '自定义渠道', value: 8, color: 'pink' },
{ key: 22, text: '知识库FastGPT', value: 22, color: 'blue' },
{ key: 21, text: '知识库AI Proxy', value: 21, color: 'purple' },
{ key: 20, text: '代理OpenRouter', value: 20, color: 'black' },
{ key: 2, text: '代理API2D', value: 2, color: 'blue' },
{ key: 5, text: '代理OpenAI-SB', value: 5, color: 'brown' },
{ key: 7, text: '代理OhMyGPT', value: 7, color: 'purple' },
{ key: 10, text: '代理AI Proxy', value: 10, color: 'purple' },
{ key: 4, text: '代理CloseAI', value: 4, color: 'teal' },
{ key: 6, text: '代理OpenAI Max', value: 6, color: 'violet' },
{ key: 9, text: '代理AI.LS', value: 9, color: 'yellow' },
{ key: 12, text: '代理API2GPT', value: 12, color: 'blue' },
{ key: 13, text: '代理AIGC2D', value: 13, color: 'purple' }
{ key: 21, text: '知识库AI Proxy', value: 21, color: 'purple' }
];

View File

@@ -1 +1 @@
export const ITEMS_PER_PAGE = 10; // this value must keep same as the one defined in backend!
export const ITEMS_PER_PAGE = 20; // this value must keep same as the one defined in backend!

View File

@@ -22,18 +22,18 @@ export function isRoot() {
export function getSystemName() {
let system_name = localStorage.getItem('system_name');
if (!system_name) return 'One API';
if (!system_name) return 'CZL Oapi';
return system_name;
}
export function getLogo() {
let logo = localStorage.getItem('logo');
if (!logo) return '/logo.png';
if (!logo) return 'https://cdn-img-r2.czl.net/2023/06/20/649168ebc2b5d.png';
return logo
}
export function getFooterHTML() {
return localStorage.getItem('footer_html');
return localStorage.getItem('');
}
export async function copy(text) {

View File

@@ -1,8 +1,55 @@
@font-face {
font-family: 'CZL';
src: url('https://cdn-r2.czl.net/fonts/CZL/CZL_Sans_SC_Thin.woff2') format('woff2');
font-weight: 100;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'CZL';
src: url('https://cdn-r2.czl.net/fonts/CZL/CZL_Sans_SC_Black.woff2') format('woff2');
font-weight: 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'CZL';
src: url('https://cdn-r2.czl.net/fonts/CZL/CZL_Sans_SC_Bold.woff2') format('woff2');
font-weight: bold;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'CZL';
src: url('https://cdn-r2.czl.net/fonts/CZL/CZL_Sans_SC_Light.woff2') format('woff2');
font-weight: 300;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'CZL';
src: url('https://cdn-r2.czl.net/fonts/CZL/CZL_Sans_SC_Medium.woff2') format('woff2');
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'CZL';
src: url('https://cdn-r2.czl.net/fonts/CZL/CZL_Sans_SC_Regular.woff2') format('woff2');
font-weight: normal;
font-style: normal;
font-display: swap;
}
body {
margin: 0;
padding-top: 55px;
overflow-y: scroll;
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, "Microsoft YaHei", sans-serif;
font-family: "CZL", -apple-system,BlinkMacSystemFont,'Helvetica Neue',Helvetica,Segoe UI,Arial,Roboto,'PingFang SC',miui,'Hiragino Sans GB','Microsoft Yahei',sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
scrollbar-width: none;

View File

@@ -27,6 +27,13 @@ const About = () => {
useEffect(() => {
displayAbout().then();
const style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = `.main-content{width:unset !important;padding:0;} .ui.menu{margin-bottom:0 !important;}`;
document.head.appendChild(style);
return () => {
document.head.removeChild(style);
};
}, []);
return (
@@ -35,11 +42,6 @@ const About = () => {
aboutLoaded && about === '' ? <>
<Segment>
<Header as='h3'>关于</Header>
<p>可在设置页面设置关于内容支持 HTML & Markdown</p>
项目仓库地址
<a href='https://github.com/songquanpeng/one-api'>
https://github.com/songquanpeng/one-api
</a>
</Segment>
</> : <>
{

View File

@@ -123,7 +123,7 @@ const EditChannel = () => {
setOriginModelOptions(localModelOptions);
setFullModels(res.data.data.map((model) => model.id));
setBasicModels(res.data.data.filter((model) => {
return model.id.startsWith('gpt-3') || model.id.startsWith('text-');
return model.id.startsWith('gpt-3') || model.id.startsWith('text-') || model.id.startsWith('dall-') || model.id.startsWith('whisper-');
}).map((model) => model.id));
} catch (error) {
showError(error.message);
@@ -246,7 +246,7 @@ const EditChannel = () => {
inputs.type === 3 && (
<>
<Message>
注意<strong>模型部署名称必须和模型名称保持一致</strong> One API model
注意<strong>模型部署名称必须和模型名称保持一致</strong> CZL Oapi model
参数替换为你的部署名称模型名称中的点会被剔除<a target='_blank'
href='https://github.com/songquanpeng/one-api/issues/133?notification_referrer_id=NT_kwDOAmJSYrM2NjIwMzI3NDgyOjM5OTk4MDUw#issuecomment-1571602271'>图片演示</a>
</Message>

View File

@@ -5,7 +5,7 @@ import { StatusContext } from '../../context/Status';
import { marked } from 'marked';
const Home = () => {
const [statusState, statusDispatch] = useContext(StatusContext);
const [statusState] = useContext(StatusContext);
const [homePageContentLoaded, setHomePageContentLoaded] = useState(false);
const [homePageContent, setHomePageContent] = useState('');
@@ -50,6 +50,13 @@ const Home = () => {
useEffect(() => {
displayNotice().then();
displayHomePageContent().then();
const style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = `.main-content{width:unset !important;padding:0;margin-top:-81px;} .ui.menu{margin-bottom:0 !important;z-index:999;position: relative;}`;
document.head.appendChild(style);
return () => {
document.head.removeChild(style);
};
}, []);
return (
<>