generated from songquanpeng/gin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
157 changed files
with
13,925 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
# One API 的前端界面 | ||
|
||
> 每个文件夹代表一个主题,欢迎提交你的主题 | ||
## 提交新的主题 | ||
|
||
> 欢迎在页面底部保留你和 One API 的版权信息以及指向链接 | ||
1. 在 `web` 文件夹下新建一个文件夹,文件夹名为主题名。 | ||
2. 把你的主题文件放到这个文件夹下。 | ||
3. 修改 `package.json` 文件,把 `build` 命令改为:`"build": "react-scripts build && mv -f build ../build/default"`,其中 `default` 为你的主题名。 | ||
|
||
## 主题列表 | ||
|
||
### 主题:default | ||
|
||
默认主题,由 [JustSong](https://github.com/songquanpeng) 开发。 | ||
|
||
预览: | ||
|![image](https://github.com/songquanpeng/one-api/assets/39998050/ccfbc668-3a7f-4bc1-87da-7eacfd7bf371)|![image](https://github.com/songquanpeng/one-api/assets/39998050/a63ed547-44b9-45db-b43a-ecea07d60840)| | ||
|:---:|:---:| | ||
|
||
### 主题:berry | ||
|
||
由 [MartialBE](https://github.com/MartialBE) 开发。 | ||
|
||
预览: | ||
||| | ||
|:---:|:---:| | ||
|![image](https://github.com/songquanpeng/one-api/assets/42402987/36aff5c6-c5ff-4a90-8e3d-33d5cff34cbf)|![image](https://github.com/songquanpeng/one-api/assets/42402987/9ac63b36-5140-4064-8fad-fc9d25821509)| | ||
|![image](https://github.com/songquanpeng/one-api/assets/42402987/fb2b1c64-ef24-4027-9b80-0cd9d945a47f)|![image](https://github.com/songquanpeng/one-api/assets/42402987/b6b649ec-2888-4324-8b2d-d5e11554eed6)| | ||
|![image](https://github.com/songquanpeng/one-api/assets/42402987/6d3b22e0-436b-4e26-8911-bcc993c6a2bd)|![image](https://github.com/songquanpeng/one-api/assets/42402987/eef1e224-7245-44d7-804e-9d1c8fa3f29c)| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
default | ||
default | ||
berry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.idea | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# One API 前端界面 | ||
|
||
这个项目是 One API 的前端界面,它基于 [Berry Free React Admin Template](https://github.com/codedthemes/berry-free-react-admin-template) 进行开发。 | ||
|
||
## 使用的开源项目 | ||
|
||
使用了以下开源项目作为我们项目的一部分: | ||
|
||
- [Berry Free React Admin Template](https://github.com/codedthemes/berry-free-react-admin-template) | ||
- [minimal-ui-kit](minimal-ui-kit) | ||
|
||
## 许可证 | ||
|
||
本项目中使用的代码遵循 MIT 许可证。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "commonjs", | ||
"baseUrl": "src" | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"name": "one_api_web", | ||
"version": "1.0.0", | ||
"proxy": "http://127.0.0.1:3000", | ||
"private": true, | ||
"homepage": "", | ||
"dependencies": { | ||
"@emotion/cache": "^11.9.3", | ||
"@emotion/react": "^11.9.3", | ||
"@emotion/styled": "^11.9.3", | ||
"@mui/icons-material": "^5.8.4", | ||
"@mui/lab": "^5.0.0-alpha.88", | ||
"@mui/material": "^5.8.6", | ||
"@mui/system": "^5.8.6", | ||
"@mui/utils": "^5.8.6", | ||
"@mui/x-date-pickers": "^6.18.5", | ||
"@tabler/icons-react": "^2.44.0", | ||
"apexcharts": "^3.35.3", | ||
"axios": "^0.27.2", | ||
"dayjs": "^1.11.10", | ||
"formik": "^2.2.9", | ||
"framer-motion": "^6.3.16", | ||
"history": "^5.3.0", | ||
"marked": "^4.1.1", | ||
"material-ui-popup-state": "^4.0.1", | ||
"notistack": "^3.0.1", | ||
"prop-types": "^15.8.1", | ||
"react": "^18.2.0", | ||
"react-apexcharts": "^1.4.0", | ||
"react-device-detect": "^2.2.2", | ||
"react-dom": "^18.2.0", | ||
"react-perfect-scrollbar": "^1.5.8", | ||
"react-redux": "^8.0.2", | ||
"react-router": "6.3.0", | ||
"react-router-dom": "6.3.0", | ||
"react-scripts": "^5.0.1", | ||
"react-turnstile": "^1.1.2", | ||
"redux": "^4.2.0", | ||
"yup": "^0.32.11" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build && mv -f build ../build/berry", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app" | ||
] | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"@babel/preset-react" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
"defaults", | ||
"not IE 11" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.21.4", | ||
"@babel/eslint-parser": "^7.21.3", | ||
"eslint": "^8.38.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-config-react-app": "^7.0.1", | ||
"eslint-plugin-flowtype": "^8.0.3", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-jsx-a11y": "^6.7.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"immutable": "^4.3.0", | ||
"prettier": "^2.8.7", | ||
"sass": "^1.53.0" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>One API</title> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<!-- Meta Tags--> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#2296f3" /> | ||
<meta | ||
name="description" | ||
content="OpenAI 接口聚合管理,支持多种渠道包括 Azure,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用" | ||
/> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
|
||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useSelector } from 'react-redux'; | ||
|
||
import { ThemeProvider } from '@mui/material/styles'; | ||
import { CssBaseline, StyledEngineProvider } from '@mui/material'; | ||
|
||
// routing | ||
import Routes from 'routes'; | ||
|
||
// defaultTheme | ||
import themes from 'themes'; | ||
|
||
// project imports | ||
import NavigationScroll from 'layout/NavigationScroll'; | ||
|
||
// auth | ||
import UserProvider from 'contexts/UserContext'; | ||
import StatusProvider from 'contexts/StatusContext'; | ||
import { SnackbarProvider } from 'notistack'; | ||
|
||
// ==============================|| APP ||============================== // | ||
|
||
const App = () => { | ||
const customization = useSelector((state) => state.customization); | ||
|
||
return ( | ||
<StyledEngineProvider injectFirst> | ||
<ThemeProvider theme={themes(customization)}> | ||
<CssBaseline /> | ||
<NavigationScroll> | ||
<SnackbarProvider autoHideDuration={5000} maxSnack={3} anchorOrigin={{ vertical: 'top', horizontal: 'right' }}> | ||
<UserProvider> | ||
<StatusProvider> | ||
<Routes /> | ||
</StatusProvider> | ||
</UserProvider> | ||
</SnackbarProvider> | ||
</NavigationScroll> | ||
</ThemeProvider> | ||
</StyledEngineProvider> | ||
); | ||
}; | ||
|
||
export default App; |
Oops, something went wrong.