repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/serviceWorker.js | web/berry/src/serviceWorker.js | // This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a p... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/Switch.js | web/berry/src/ui-component/Switch.js | import { styled } from '@mui/material/styles';
import Switch from '@mui/material/Switch';
const TableSwitch = styled(Switch)(({ theme }) => ({
padding: 8,
'& .MuiSwitch-track': {
borderRadius: 22 / 2,
'&:before, &:after': {
content: '""',
position: 'absolute',
top: '50%',
transform:... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/AdminContainer.js | web/berry/src/ui-component/AdminContainer.js | import { styled } from '@mui/material/styles';
import { Container } from '@mui/material';
const AdminContainer = styled(Container)(({ theme }) => ({
[theme.breakpoints.down('md')]: {
paddingLeft: '0px',
paddingRight: '0px'
}
}));
export default AdminContainer;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/Logo.js | web/berry/src/ui-component/Logo.js | // material-ui
import logoLight from 'assets/images/logo.svg';
import logoDark from 'assets/images/logo-white.svg';
import { useSelector } from 'react-redux';
import { useTheme } from '@mui/material/styles';
/**
* if you want to use image instead of <svg> uncomment following.
*
* import logoDark from 'assets/images... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/ThemeButton.js | web/berry/src/ui-component/ThemeButton.js | import { useDispatch, useSelector } from 'react-redux';
import { SET_THEME } from 'store/actions';
import { useTheme } from '@mui/material/styles';
import { Avatar, Box, ButtonBase } from '@mui/material';
import { IconSun, IconMoon } from '@tabler/icons-react';
export default function ThemeButton() {
const dispatch ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/Label.js | web/berry/src/ui-component/Label.js | /*
* Label.js
*
* This file uses code from the Minimal UI project, available at
* https://github.com/minimal-ui-kit/material-kit-react/blob/main/src/components/label/label.jsx
*
* Minimal UI is licensed under the MIT License. A copy of the license is included below:
*
* MIT License
*
* Copyright (c) 2021 Mini... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/Loadable.js | web/berry/src/ui-component/Loadable.js | import { Suspense } from 'react';
// project imports
import Loader from './Loader';
// ==============================|| LOADABLE - LAZY LOADING ||============================== //
const Loadable = (Component) => (props) =>
(
<Suspense fallback={<Loader />}>
<Component {...props} />
</Suspense>
);
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/Footer.js | web/berry/src/ui-component/Footer.js | // material-ui
import { Link, Container, Box } from '@mui/material';
import React from 'react';
import { useSelector } from 'react-redux';
// ==============================|| FOOTER - AUTHENTICATION 2 & 3 ||============================== //
const Footer = () => {
const siteInfo = useSelector((state) => state.siteIn... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/SvgColor.js | web/berry/src/ui-component/SvgColor.js | import PropTypes from 'prop-types';
import { forwardRef } from 'react';
import Box from '@mui/material/Box';
// ----------------------------------------------------------------------
const SvgColor = forwardRef(({ src, sx, ...other }, ref) => (
<Box
component="span"
className="svg-color"
ref={ref}
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/Loader.js | web/berry/src/ui-component/Loader.js | // material-ui
import LinearProgress from '@mui/material/LinearProgress';
import { styled } from '@mui/material/styles';
// styles
const LoaderWrapper = styled('div')({
position: 'fixed',
top: 0,
left: 0,
zIndex: 1301,
width: '100%'
});
// ==============================|| LOADER ||==========================... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/TableToolBar.js | web/berry/src/ui-component/TableToolBar.js | import PropTypes from 'prop-types';
import Toolbar from '@mui/material/Toolbar';
import OutlinedInput from '@mui/material/OutlinedInput';
import InputAdornment from '@mui/material/InputAdornment';
import { useTheme } from '@mui/material/styles';
import { IconSearch } from '@tabler/icons-react';
// ------------------... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/CardSecondaryAction.js | web/berry/src/ui-component/cards/CardSecondaryAction.js | import PropTypes from 'prop-types';
import { useTheme } from '@mui/material/styles';
import { ButtonBase, Link, Tooltip } from '@mui/material';
// project imports
import Avatar from '../extended/Avatar';
// ==============================|| CARD SECONDARY ACTION ||============================== //
const CardSecondary... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/UserCard.js | web/berry/src/ui-component/cards/UserCard.js | /*
* UserCard.js
*
* This file uses code from the Minimal UI project, available at
* https://github.com/minimal-ui-kit/material-kit-react/blob/main/src/sections/blog/post-card.jsx
*
* Minimal UI is licensed under the MIT License. A copy of the license is included below:
*
* MIT License
*
* Copyright (c) 2021 ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/MainCard.js | web/berry/src/ui-component/cards/MainCard.js | import PropTypes from 'prop-types';
import { forwardRef } from 'react';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Card, CardContent, CardHeader, Divider, Typography } from '@mui/material';
// constant
const headerSX = {
'& .MuiCardHeader-action': { mr: 0 }
};
// =====================... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/SubCard.js | web/berry/src/ui-component/cards/SubCard.js | import PropTypes from 'prop-types';
import { forwardRef } from 'react';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Card, CardContent, CardHeader, Divider, Typography } from '@mui/material';
// ==============================|| CUSTOM SUB CARD ||============================== //
const Sub... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/Skeleton/TotalGrowthBarChart.js | web/berry/src/ui-component/cards/Skeleton/TotalGrowthBarChart.js | // material-ui
import { Card, CardContent, Grid } from '@mui/material';
import Skeleton from '@mui/material/Skeleton';
// project imports
import { gridSpacing } from 'store/constant';
// ==============================|| SKELETON TOTAL GROWTH BAR CHART ||============================== //
const TotalGrowthBarChart = (... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/Skeleton/EarningCard.js | web/berry/src/ui-component/cards/Skeleton/EarningCard.js | // material-ui
import { Card, CardContent, Grid } from '@mui/material';
import Skeleton from '@mui/material/Skeleton';
// ==============================|| SKELETON - EARNING CARD ||============================== //
const EarningCard = () => (
<Card>
<CardContent>
<Grid container direction="column">
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/Skeleton/PopularCard.js | web/berry/src/ui-component/cards/Skeleton/PopularCard.js | // material-ui
import { Card, CardContent, Grid } from '@mui/material';
import Skeleton from '@mui/material/Skeleton';
// project imports
import { gridSpacing } from 'store/constant';
// ==============================|| SKELETON - POPULAR CARD ||============================== //
const PopularCard = () => (
<Card>
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/Skeleton/ProductPlaceholder.js | web/berry/src/ui-component/cards/Skeleton/ProductPlaceholder.js | // material-ui
import { CardContent, Grid, Skeleton, Stack } from '@mui/material';
// project import
import MainCard from '../MainCard';
// ===========================|| SKELETON TOTAL GROWTH BAR CHART ||=========================== //
const ProductPlaceholder = () => (
<MainCard content={false} boxShadow>
<Ske... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/Skeleton/ImagePlaceholder.js | web/berry/src/ui-component/cards/Skeleton/ImagePlaceholder.js | // material-ui
import Skeleton from '@mui/material/Skeleton';
// ==============================|| SKELETON IMAGE CARD ||============================== //
const ImagePlaceholder = ({ ...others }) => <Skeleton variant="rectangular" {...others} animation="wave" />;
export default ImagePlaceholder;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/cards/Skeleton/TotalIncomeCard.js | web/berry/src/ui-component/cards/Skeleton/TotalIncomeCard.js | // material-ui
import { Card, List, ListItem, ListItemAvatar, ListItemText, Skeleton } from '@mui/material';
// ==============================|| SKELETON - TOTAL INCOME DARK/LIGHT CARD ||============================== //
const TotalIncomeCard = () => (
<Card sx={{ p: 2 }}>
<List sx={{ py: 0 }}>
<ListItem ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/extended/Breadcrumbs.js | web/berry/src/ui-component/extended/Breadcrumbs.js | import PropTypes from 'prop-types';
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Box, Card, Divider, Grid, Typography } from '@mui/material';
import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
// pro... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/extended/Transitions.js | web/berry/src/ui-component/extended/Transitions.js | import PropTypes from 'prop-types';
import { forwardRef } from 'react';
// material-ui
import { Collapse, Fade, Box, Grow, Slide, Zoom } from '@mui/material';
// ==============================|| TRANSITIONS ||============================== //
const Transitions = forwardRef(({ children, position, type, direction, ...... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/extended/AnimateButton.js | web/berry/src/ui-component/extended/AnimateButton.js | import PropTypes from 'prop-types';
import { forwardRef } from 'react';
// third-party
import { motion, useCycle } from 'framer-motion';
// ==============================|| ANIMATION BUTTON ||============================== //
const AnimateButton = forwardRef(({ children, type, direction, offset, scale }, ref) => {
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/ui-component/extended/Avatar.js | web/berry/src/ui-component/extended/Avatar.js | import PropTypes from 'prop-types';
// material-ui
import { useTheme } from '@mui/material/styles';
import MuiAvatar from '@mui/material/Avatar';
// ==============================|| AVATAR ||============================== //
const Avatar = ({ color, outline, size, sx, ...others }) => {
const theme = useTheme();
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/menu-items/index.js | web/berry/src/menu-items/index.js | import panel from './panel';
// ==============================|| MENU ITEMS ||============================== //
const menuItems = {
items: [panel],
urlMap: {}
};
// Initialize urlMap
menuItems.urlMap = menuItems.items.reduce((map, item) => {
item.children.forEach((child) => {
map[child.url] = child;
});
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/menu-items/panel.js | web/berry/src/menu-items/panel.js | // assets
import {
IconDashboard,
IconSitemap,
IconArticle,
IconCoin,
IconAdjustments,
IconKey,
IconGardenCart,
IconUser,
IconUserScan
} from '@tabler/icons-react';
// constant
const icons = { IconDashboard, IconSitemap, IconArticle, IconCoin, IconAdjustments, IconKey, IconGardenCart, IconUser, IconU... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/store/constant.js | web/berry/src/store/constant.js | // theme constant
export const gridSpacing = 3;
export const drawerWidth = 260;
export const appDrawerWidth = 320;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/store/reducer.js | web/berry/src/store/reducer.js | import { combineReducers } from 'redux';
// reducer import
import customizationReducer from './customizationReducer';
import accountReducer from './accountReducer';
import siteInfoReducer from './siteInfoReducer';
// ==============================|| COMBINE REDUCER ||============================== //
const reducer =... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/store/customizationReducer.js | web/berry/src/store/customizationReducer.js | // project imports
import config from 'config';
// action - state management
import * as actionTypes from './actions';
export const initialState = {
isOpen: [], // for active default menu
defaultId: 'default',
fontFamily: config.fontFamily,
borderRadius: config.borderRadius,
opened: true,
theme: 'light'
}... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/store/index.js | web/berry/src/store/index.js | import { createStore } from 'redux';
import reducer from './reducer';
// ==============================|| REDUX - MAIN STORE ||============================== //
const store = createStore(reducer);
const persister = 'Free';
export { store, persister };
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/store/siteInfoReducer.js | web/berry/src/store/siteInfoReducer.js | import config from 'config';
import * as actionTypes from './actions';
export const initialState = config.siteInfo;
const siteInfoReducer = (state = initialState, action) => {
switch (action.type) {
case actionTypes.SET_SITE_INFO:
return {
...state,
...action.payload
};
default:
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/store/actions.js | web/berry/src/store/actions.js | // action - customization reducer
export const SET_MENU = '@customization/SET_MENU';
export const MENU_TOGGLE = '@customization/MENU_TOGGLE';
export const MENU_OPEN = '@customization/MENU_OPEN';
export const SET_FONT_FAMILY = '@customization/SET_FONT_FAMILY';
export const SET_BORDER_RADIUS = '@customization/SET_BORDER_... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/store/accountReducer.js | web/berry/src/store/accountReducer.js | import * as actionTypes from './actions';
export const initialState = {
user: undefined
};
const accountReducer = (state = initialState, action) => {
switch (action.type) {
case actionTypes.LOGIN:
return {
...state,
user: action.payload
};
case actionTypes.LOGOUT:
return ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/hooks/useLogin.js | web/berry/src/hooks/useLogin.js | import { API } from 'utils/api';
import { useDispatch } from 'react-redux';
import { LOGIN } from 'store/actions';
import { useNavigate } from 'react-router';
import { showSuccess } from 'utils/common';
const useLogin = () => {
const dispatch = useDispatch();
const navigate = useNavigate();
const login = async (... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/hooks/useAuth.js | web/berry/src/hooks/useAuth.js | import { isAdmin } from 'utils/common';
import { useNavigate } from 'react-router-dom';
const navigate = useNavigate();
const useAuth = () => {
const userIsAdmin = isAdmin();
if (!userIsAdmin) {
navigate('/panel/404');
}
};
export default useAuth;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/hooks/useRegister.js | web/berry/src/hooks/useRegister.js | import { API } from 'utils/api';
import { useNavigate } from 'react-router';
import { showSuccess } from 'utils/common';
const useRegister = () => {
const navigate = useNavigate();
const register = async (input, turnstile) => {
try {
let affCode = localStorage.getItem('aff');
if (affCode) {
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/hooks/useScriptRef.js | web/berry/src/hooks/useScriptRef.js | import { useEffect, useRef } from 'react';
// ==============================|| ELEMENT REFERENCE HOOKS ||============================== //
const useScriptRef = () => {
const scripted = useRef(true);
useEffect(
() => () => {
scripted.current = true;
},
[]
);
return scripted;
};
export def... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/routes/index.js | web/berry/src/routes/index.js | import { useRoutes } from 'react-router-dom';
// routes
import MainRoutes from './MainRoutes';
import OtherRoutes from './OtherRoutes';
// ==============================|| ROUTING RENDER ||============================== //
export default function ThemeRoutes() {
return useRoutes([MainRoutes, OtherRoutes]);
}
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/routes/OtherRoutes.js | web/berry/src/routes/OtherRoutes.js | import { lazy } from 'react';
// project imports
import Loadable from 'ui-component/Loadable';
import MinimalLayout from 'layout/MinimalLayout';
// login option 3 routing
const AuthLogin = Loadable(lazy(() => import('views/Authentication/Auth/Login')));
const AuthRegister = Loadable(lazy(() => import('views/Authentic... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/routes/MainRoutes.js | web/berry/src/routes/MainRoutes.js | import { lazy } from 'react';
// project imports
import MainLayout from 'layout/MainLayout';
import Loadable from 'ui-component/Loadable';
const Channel = Loadable(lazy(() => import('views/Channel')));
const Log = Loadable(lazy(() => import('views/Log')));
const Redemption = Loadable(lazy(() => import('views/Redempti... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/utils/password-strength.js | web/berry/src/utils/password-strength.js | /**
* Password validator for login pages
*/
import value from 'assets/scss/_themes-vars.module.scss';
// has number
const hasNumber = (number) => new RegExp(/[0-9]/).test(number);
// has mix of small and capitals
const hasMixed = (number) => new RegExp(/[a-z]/).test(number) && new RegExp(/[A-Z]/).test(number);
// ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/utils/common.js | web/berry/src/utils/common.js | import {enqueueSnackbar} from 'notistack';
import {snackbarConstants} from 'constants/SnackbarConstants';
import {API} from './api';
export function getSystemName() {
let system_name = localStorage.getItem('system_name');
if (!system_name) return 'One API';
return system_name;
}
export function isMobile()... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/utils/api.js | web/berry/src/utils/api.js | import { showError } from './common';
import axios from 'axios';
import { store } from 'store/index';
import { LOGIN } from 'store/actions';
import config from 'config';
export const API = axios.create({
baseURL: process.env.REACT_APP_SERVER ? process.env.REACT_APP_SERVER : '/'
});
API.interceptors.response.use(
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/utils/chart.js | web/berry/src/utils/chart.js | export function getLastSevenDays() {
const dates = [];
for (let i = 6; i >= 0; i--) {
const d = new Date();
d.setDate(d.getDate() - i);
const month = '' + (d.getMonth() + 1);
const day = '' + d.getDate();
const year = d.getFullYear();
const formattedDate = [year, month.padStart(2, '0'), day... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/utils/route-guard/AuthGuard.js | web/berry/src/utils/route-guard/AuthGuard.js | import { useSelector } from 'react-redux';
import { useEffect, useContext } from 'react';
import { UserContext } from 'contexts/UserContext';
import { useNavigate } from 'react-router-dom';
const AuthGuard = ({ children }) => {
const account = useSelector((state) => state.account);
const { isUserLoaded } = useCont... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Dashboard/index.js | web/berry/src/views/Dashboard/index.js | import { useEffect, useState } from 'react';
import { Grid, Typography } from '@mui/material';
import { gridSpacing } from 'store/constant';
import StatisticalLineChartCard from './component/StatisticalLineChartCard';
import StatisticalBarChart from './component/StatisticalBarChart';
import { generateChartOptions, getL... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Dashboard/component/StatisticalLineChartCard.js | web/berry/src/views/Dashboard/component/StatisticalLineChartCard.js | import PropTypes from 'prop-types';
// material-ui
import { useTheme, styled } from '@mui/material/styles';
import { Box, Grid, Typography } from '@mui/material';
// third-party
import Chart from 'react-apexcharts';
// project imports
import MainCard from 'ui-component/cards/MainCard';
import SkeletonTotalOrderCard ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Dashboard/component/StatisticalBarChart.js | web/berry/src/views/Dashboard/component/StatisticalBarChart.js | import PropTypes from 'prop-types';
// material-ui
import { Grid, Typography } from '@mui/material';
// third-party
import Chart from 'react-apexcharts';
// project imports
import SkeletonTotalGrowthBarChart from 'ui-component/cards/Skeleton/TotalGrowthBarChart';
import MainCard from 'ui-component/cards/MainCard';
i... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Dashboard/component/StatisticalCard.js | web/berry/src/views/Dashboard/component/StatisticalCard.js | import PropTypes from 'prop-types';
// material-ui
import { styled, useTheme } from '@mui/material/styles';
import { Avatar, Box, List, ListItem, ListItemAvatar, ListItemText, Typography } from '@mui/material';
// project imports
import MainCard from 'ui-component/cards/MainCard';
import TotalIncomeCard from 'ui-comp... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Token/index.js | web/berry/src/views/Token/index.js | import { useState, useEffect } from 'react';
import { showError, showSuccess } from 'utils/common';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableContainer from '@mui/material/TableContainer';
import PerfectScrollbar from 'react-perfect-scrollbar';
import TablePa... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Token/component/TableHead.js | web/berry/src/views/Token/component/TableHead.js | import { TableCell, TableHead, TableRow } from '@mui/material';
const TokenTableHead = () => {
return (
<TableHead>
<TableRow>
<TableCell>名称</TableCell>
<TableCell>状态</TableCell>
<TableCell>已用额度</TableCell>
<TableCell>剩余额度</TableCell>
<TableCell>创建时间</TableCell>
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Token/component/EditModal.js | web/berry/src/views/Token/component/EditModal.js | import PropTypes from 'prop-types';
import * as Yup from 'yup';
import { Formik } from 'formik';
import { useTheme } from '@mui/material/styles';
import { useState, useEffect } from 'react';
import dayjs from 'dayjs';
import {
Dialog,
DialogTitle,
DialogContent,
DialogActions,
Button,
Divider,
Alert,
Fo... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Token/component/TableRow.js | web/berry/src/views/Token/component/TableRow.js | import PropTypes from 'prop-types';
import { useState } from 'react';
import { useSelector } from 'react-redux';
import {
Popover,
TableRow,
MenuItem,
TableCell,
IconButton,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
Button,
Tooltip,
Stack,
ButtonGroup
} from '@mu... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Home/index.js | web/berry/src/views/Home/index.js | import React, { useEffect, useState } from 'react';
import { showError, showNotice } from 'utils/common';
import { API } from 'utils/api';
import { marked } from 'marked';
import BaseIndex from './baseIndex';
import { Box, Container } from '@mui/material';
const Home = () => {
const [homePageContentLoaded, setHomePa... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Home/baseIndex.js | web/berry/src/views/Home/baseIndex.js | import { Box, Typography, Button, Container, Stack } from '@mui/material';
import Grid from '@mui/material/Unstable_Grid2';
import { GitHub } from '@mui/icons-material';
const BaseIndex = () => (
<Box
sx={{
minHeight: 'calc(100vh - 136px)',
backgroundImage: 'linear-gradient(to right, #ff9966, #ff5e62... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/AuthCardWrapper.js | web/berry/src/views/Authentication/AuthCardWrapper.js | import PropTypes from 'prop-types';
// material-ui
import { Box } from '@mui/material';
// project import
import MainCard from 'ui-component/cards/MainCard';
// ==============================|| AUTHENTICATION CARD WRAPPER ||============================== //
const AuthCardWrapper = ({ children, ...other }) => (
<M... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/AuthWrapper.js | web/berry/src/views/Authentication/AuthWrapper.js | // material-ui
import { styled } from '@mui/material/styles';
import { useSelector } from 'react-redux';
import { useNavigate } from 'react-router';
import { useEffect, useContext } from 'react';
import { UserContext } from 'contexts/UserContext';
// ==============================|| AUTHENTICATION 1 WRAPPER ||========... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/Auth/ForgetPassword.js | web/berry/src/views/Authentication/Auth/ForgetPassword.js | import { Link } from 'react-router-dom';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Divider, Grid, Stack, Typography, useMediaQuery } from '@mui/material';
// project imports
import AuthWrapper from '../AuthWrapper';
import AuthCardWrapper from '../AuthCardWrapper';
import ForgetPassword... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/Auth/OidcOAuth.js | web/berry/src/views/Authentication/Auth/OidcOAuth.js | import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import React, { useEffect, useState } from 'react';
import { showError } from 'utils/common';
import useLogin from 'hooks/useLogin';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Grid, Stack, Typography, useMediaQuery, Ci... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/Auth/Register.js | web/berry/src/views/Authentication/Auth/Register.js | import { Link } from 'react-router-dom';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Divider, Grid, Stack, Typography, useMediaQuery } from '@mui/material';
// project imports
import AuthWrapper from '../AuthWrapper';
import AuthCardWrapper from '../AuthCardWrapper';
import Logo from 'ui-... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/Auth/GitHubOAuth.js | web/berry/src/views/Authentication/Auth/GitHubOAuth.js | import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import React, { useEffect, useState } from 'react';
import { showError } from 'utils/common';
import useLogin from 'hooks/useLogin';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Grid, Stack, Typography, useMediaQuery, Ci... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/Auth/ResetPassword.js | web/berry/src/views/Authentication/Auth/ResetPassword.js | import { Link } from 'react-router-dom';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Divider, Grid, Stack, Typography, useMediaQuery } from '@mui/material';
// project imports
import AuthWrapper from '../AuthWrapper';
import AuthCardWrapper from '../AuthCardWrapper';
import ResetPasswordF... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/Auth/LarkOAuth.js | web/berry/src/views/Authentication/Auth/LarkOAuth.js | import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import React, { useEffect, useState } from 'react';
import { showError } from 'utils/common';
import useLogin from 'hooks/useLogin';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Grid, Stack, Typography, useMediaQuery, Ci... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/Auth/Login.js | web/berry/src/views/Authentication/Auth/Login.js | import { Link } from 'react-router-dom';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Divider, Grid, Stack, Typography, useMediaQuery } from '@mui/material';
// project imports
import AuthWrapper from '../AuthWrapper';
import AuthCardWrapper from '../AuthCardWrapper';
import AuthLogin from... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/AuthForms/ForgetPasswordForm.js | web/berry/src/views/Authentication/AuthForms/ForgetPasswordForm.js | import { useState, useEffect } from "react";
import { useSelector } from "react-redux";
import Turnstile from "react-turnstile";
import { API } from "utils/api";
// material-ui
import { useTheme } from "@mui/material/styles";
import {
Box,
Button,
FormControl,
FormHelperText,
InputLabel,
OutlinedInput,
T... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/AuthForms/ResetPasswordForm.js | web/berry/src/views/Authentication/AuthForms/ResetPasswordForm.js | import { useState, useEffect } from 'react';
import { useSearchParams } from 'react-router-dom';
// material-ui
import { Button, Stack, Typography, Alert } from '@mui/material';
// assets
import { showError, copy } from 'utils/common';
import { API } from 'utils/api';
// ===========================|| FIREBASE - REGI... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/AuthForms/AuthLogin.js | web/berry/src/views/Authentication/AuthForms/AuthLogin.js | import { useState } from 'react';
import { useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
// material-ui
import { useTheme } from '@mui/material/styles';
import {
Box,
Button,
Divider,
FormControl,
FormHelperText,
Grid,
IconButton,
InputAdornment,
InputLabel,
OutlinedInp... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/AuthForms/AuthRegister.js | web/berry/src/views/Authentication/AuthForms/AuthRegister.js | import { useState, useEffect } from 'react';
import { useSelector } from 'react-redux';
import useRegister from 'hooks/useRegister';
import Turnstile from 'react-turnstile';
import { useSearchParams } from 'react-router-dom';
// import { useSelector } from 'react-redux';
// material-ui
import { useTheme } from '@mui/m... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Authentication/AuthForms/WechatModal.js | web/berry/src/views/Authentication/AuthForms/WechatModal.js | // WechatModal.js
import PropTypes from 'prop-types';
import React from 'react';
import { Dialog, DialogTitle, DialogContent, TextField, Button, Typography, Grid } from '@mui/material';
import { Formik, Form, Field } from 'formik';
import { showError } from 'utils/common';
import * as Yup from 'yup';
const validationS... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Setting/index.js | web/berry/src/views/Setting/index.js | import { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { Tabs, Tab, Box, Card } from '@mui/material';
import { IconSettings2, IconActivity, IconSettings } from '@tabler/icons-react';
import OperationSetting from './component/OperationSetting';
import SystemSetting from './component/Syst... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Setting/component/OtherSetting.js | web/berry/src/views/Setting/component/OtherSetting.js | import { useState, useEffect } from 'react';
import SubCard from 'ui-component/cards/SubCard';
import {
Stack,
FormControl,
InputLabel,
OutlinedInput,
Button,
Alert,
TextField,
Dialog,
DialogTitle,
DialogActions,
DialogContent,
Divider, Link
} from '@mui/material';
import... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Setting/component/SystemSetting.js | web/berry/src/views/Setting/component/SystemSetting.js | import { useState, useEffect } from 'react';
import SubCard from 'ui-component/cards/SubCard';
import {
Stack,
FormControl,
InputLabel,
OutlinedInput,
Checkbox,
Button,
FormControlLabel,
Dialog,
DialogTitle,
DialogContent,
DialogActions,
Divider,
Alert,
Autocomplete,
TextField
} from '@mui... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | true |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Setting/component/OperationSetting.js | web/berry/src/views/Setting/component/OperationSetting.js | import { useState, useEffect } from "react";
import SubCard from "ui-component/cards/SubCard";
import {
Stack,
FormControl,
InputLabel,
OutlinedInput,
Checkbox,
Button,
FormControlLabel,
TextField,
} from "@mui/material";
import { showSuccess, showError, verifyJSON } from "utils/common";
import { API } ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/index.js | web/berry/src/views/Channel/index.js | import { useState, useEffect } from 'react';
import { showError, showSuccess, showInfo, loadChannelModels } from 'utils/common';
import { useTheme } from '@mui/material/styles';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableContainer from '@mui/material/TableCont... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/type/Config.js | web/berry/src/views/Channel/type/Config.js | const defaultConfig = {
input: {
name: '',
type: 1,
key: '',
base_url: '',
other: '',
model_mapping: '',
models: [],
groups: ['default'],
config: {}
},
inputLabel: {
name: '渠道名称',
type: '渠道类型',
base_url: '渠道API地址',
key: '密钥',
other: '其他参数',
models: '模型',... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/component/GroupLabel.js | web/berry/src/views/Channel/component/GroupLabel.js | import PropTypes from "prop-types";
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 "... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/component/TableHead.js | web/berry/src/views/Channel/component/TableHead.js | import { TableCell, TableHead, TableRow } from '@mui/material';
const ChannelTableHead = () => {
return (
<TableHead>
<TableRow>
<TableCell>ID</TableCell>
<TableCell>名称</TableCell>
<TableCell>分组</TableCell>
<TableCell>类型</TableCell>
<TableCell>状态</TableCell>
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/component/ResponseTimeLabel.js | web/berry/src/views/Channel/component/ResponseTimeLabel.js | import PropTypes from 'prop-types';
import Label from 'ui-component/Label';
import Tooltip from '@mui/material/Tooltip';
import { timestamp2string } from 'utils/common';
const ResponseTimeLabel = ({ test_time, response_time, handle_action }) => {
let color = 'default';
let time = response_time / 1000;
time = tim... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/component/EditModal.js | web/berry/src/views/Channel/component/EditModal.js | import PropTypes from 'prop-types';
import { useState, useEffect } from 'react';
import { CHANNEL_OPTIONS } from 'constants/ChannelConstants';
import { useTheme } from '@mui/material/styles';
import { API } from 'utils/api';
import { showError, showSuccess, getChannelModels } from 'utils/common';
import {
Dialog,
D... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/component/NameLabel.js | web/berry/src/views/Channel/component/NameLabel.js | import PropTypes from 'prop-types';
import { Tooltip, Stack, Container } from '@mui/material';
import Label from 'ui-component/Label';
import { styled } from '@mui/material/styles';
import { showSuccess, copy } from 'utils/common';
const TooltipContainer = styled(Container)({
maxHeight: '250px',
overflow: 'auto',
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Channel/component/TableRow.js | web/berry/src/views/Channel/component/TableRow.js | import PropTypes from "prop-types";
import { useState } from "react";
import { showInfo, showError, renderNumber } from "utils/common";
import { API } from "utils/api";
import { CHANNEL_OPTIONS } from "constants/ChannelConstants";
import {
Popover,
TableRow,
MenuItem,
TableCell,
IconButton,
TextField,
D... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/User/index.js | web/berry/src/views/User/index.js | import { useState, useEffect } from 'react';
import { showError, showSuccess } from 'utils/common';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableContainer from '@mui/material/TableContainer';
import PerfectScrollbar from 'react-perfect-scrollbar';
import TablePa... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/User/component/TableHead.js | web/berry/src/views/User/component/TableHead.js | import { TableCell, TableHead, TableRow } from '@mui/material';
const UsersTableHead = () => {
return (
<TableHead>
<TableRow>
<TableCell>ID</TableCell>
<TableCell>用户名</TableCell>
<TableCell>分组</TableCell>
<TableCell>统计信息</TableCell>
<TableCell>用户角色</TableCell>
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/User/component/EditModal.js | web/berry/src/views/User/component/EditModal.js | import PropTypes from 'prop-types';
import * as Yup from 'yup';
import { Formik } from 'formik';
import { useTheme } from '@mui/material/styles';
import { useState, useEffect } from 'react';
import {
Dialog,
DialogTitle,
DialogContent,
DialogActions,
Button,
Divider,
FormControl,
InputLabel,
OutlinedI... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/User/component/TableRow.js | web/berry/src/views/User/component/TableRow.js | import PropTypes from 'prop-types';
import { useState } from 'react';
import {
Popover,
TableRow,
MenuItem,
TableCell,
IconButton,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
Button,
Tooltip,
Stack
} from '@mui/material';
import Label from 'ui-component/Label';
impo... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/About/index.js | web/berry/src/views/About/index.js | import React, { useEffect, useState } from 'react';
import { API } from 'utils/api';
import { showError } from 'utils/common';
import { marked } from 'marked';
import { Box, Container, Typography } from '@mui/material';
import MainCard from 'ui-component/cards/MainCard';
const About = () => {
const [about, setAbout]... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Error/index.js | web/berry/src/views/Error/index.js | import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Container from '@mui/material/Container';
import NotFound from 'assets/images/404.svg';
import { useNavigate } from 'react-router';
// ----------------------------------------------------------------------
export default function N... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Redemption/index.js | web/berry/src/views/Redemption/index.js | import { useState, useEffect } from 'react';
import { showError, showSuccess } from 'utils/common';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableContainer from '@mui/material/TableContainer';
import PerfectScrollbar from 'react-perfect-scrollbar';
import TablePa... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Redemption/component/TableHead.js | web/berry/src/views/Redemption/component/TableHead.js | import { TableCell, TableHead, TableRow } from '@mui/material';
const RedemptionTableHead = () => {
return (
<TableHead>
<TableRow>
<TableCell>ID</TableCell>
<TableCell>名称</TableCell>
<TableCell>状态</TableCell>
<TableCell>额度</TableCell>
<TableCell>创建时间</TableCell>
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Redemption/component/EditModal.js | web/berry/src/views/Redemption/component/EditModal.js | import PropTypes from 'prop-types';
import * as Yup from 'yup';
import { Formik } from 'formik';
import { useTheme } from '@mui/material/styles';
import { useState, useEffect } from 'react';
import {
Dialog,
DialogTitle,
DialogContent,
DialogActions,
Button,
Divider,
FormControl,
InputLabel,
OutlinedI... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Redemption/component/TableRow.js | web/berry/src/views/Redemption/component/TableRow.js | import PropTypes from 'prop-types';
import { useState } from 'react';
import {
Popover,
TableRow,
MenuItem,
TableCell,
IconButton,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
Button,
Stack
} from '@mui/material';
import Label from 'ui-component/Label';
import TableSwi... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Topup/index.js | web/berry/src/views/Topup/index.js | import { Stack, Alert } from '@mui/material';
import Grid from '@mui/material/Unstable_Grid2';
import TopupCard from './component/TopupCard';
import InviteCard from './component/InviteCard';
const Topup = () => {
return (
<Grid container spacing={2}>
<Grid xs={12}>
<Alert severity="warning">
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Topup/component/InviteCard.js | web/berry/src/views/Topup/component/InviteCard.js | import { Stack, Typography, Container, Box, OutlinedInput, InputAdornment, Button } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import SubCard from 'ui-component/cards/SubCard';
import inviteImage from 'assets/images/invite/cwok_casual_19.webp';
import { useState } from 'react';
import { API ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Topup/component/TopupCard.js | web/berry/src/views/Topup/component/TopupCard.js | import { Typography, Stack, OutlinedInput, InputAdornment, Button, InputLabel, FormControl } from '@mui/material';
import { IconWallet } from '@tabler/icons-react';
import { useTheme } from '@mui/material/styles';
import SubCard from 'ui-component/cards/SubCard';
import UserCard from 'ui-component/cards/UserCard';
imp... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Profile/index.js | web/berry/src/views/Profile/index.js | import { useState, useEffect } from 'react';
import UserCard from 'ui-component/cards/UserCard';
import {
Card,
Button,
InputLabel,
FormControl,
OutlinedInput,
Stack,
Alert,
Dialog,
DialogTitle,
DialogContent,
DialogActions,
Divider,
SvgIcon
} from '@mui/material';
import Grid from '@mui/mater... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Profile/component/EmailModal.js | web/berry/src/views/Profile/component/EmailModal.js | import { useState, useEffect } from "react";
import PropTypes from "prop-types";
import React from "react";
import {
Dialog,
DialogTitle,
DialogContent,
DialogActions,
OutlinedInput,
Button,
InputLabel,
Grid,
InputAdornment,
FormControl,
FormHelperText,
} from "@mui/material";
import { Formik } fr... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Log/index.js | web/berry/src/views/Log/index.js | import { useState, useEffect } from 'react';
import { showError } from 'utils/common';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableContainer from '@mui/material/TableContainer';
import PerfectScrollbar from 'react-perfect-scrollbar';
import TablePagination from... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Log/type/LogType.js | web/berry/src/views/Log/type/LogType.js | const LOG_TYPE = {
0: { value: '0', text: '全部', color: '' },
1: { value: '1', text: '充值', color: 'primary' },
2: { value: '2', text: '消费', color: 'orange' },
3: { value: '3', text: '管理', color: 'default' },
4: { value: '4', text: '系统', color: 'secondary' },
5: { value: '5', text: '测试', color: 'secondary' },... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/views/Log/component/TableHead.js | web/berry/src/views/Log/component/TableHead.js | import PropTypes from 'prop-types';
import { TableCell, TableHead, TableRow } from '@mui/material';
const LogTableHead = ({ userIsAdmin }) => {
return (
<TableHead>
<TableRow>
<TableCell>时间</TableCell>
{userIsAdmin && <TableCell>渠道</TableCell>}
{userIsAdmin && <TableCell>用户</TableCe... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.