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/views/Log/component/TableRow.js | web/berry/src/views/Log/component/TableRow.js | import PropTypes from 'prop-types';
import { TableRow, TableCell } from '@mui/material';
import { timestamp2string, renderQuota } from 'utils/common';
import Label from 'ui-component/Label';
import LogType from '../type/LogType';
function renderType(type) {
const typeOption = LogType[type];
if (typeOption) {
... | 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/TableToolBar.js | web/berry/src/views/Log/component/TableToolBar.js | import PropTypes from "prop-types";
import { useTheme } from "@mui/material/styles";
import {
IconUser,
IconKey,
IconBrandGithubCopilot,
IconSitemap,
} from "@tabler/icons-react";
import {
InputAdornment,
OutlinedInput,
Stack,
FormControl,
InputLabel,
Select,
MenuItem,
} from "@mui/material";
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/layout/NavMotion.js | web/berry/src/layout/NavMotion.js | import PropTypes from 'prop-types';
import { motion } from 'framer-motion';
// ==============================|| ANIMATION FOR CONTENT ||============================== //
const NavMotion = ({ children }) => {
const motionVariants = {
initial: {
opacity: 0,
scale: 0.99
},
in: {
opacity: ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/NavigationScroll.js | web/berry/src/layout/NavigationScroll.js | import PropTypes from 'prop-types';
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
// ==============================|| NAVIGATION SCROLL TO TOP ||============================== //
const NavigationScroll = ({ children }) => {
const location = useLocation();
const { pathname } = ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MinimalLayout/index.js | web/berry/src/layout/MinimalLayout/index.js | import { Outlet } from 'react-router-dom';
import { useTheme } from '@mui/material/styles';
import { AppBar, Box, CssBaseline, Toolbar, Container } from '@mui/material';
import Header from './Header';
import Footer from 'ui-component/Footer';
// ==============================|| MINIMAL LAYOUT ||=======================... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MinimalLayout/Header/index.js | web/berry/src/layout/MinimalLayout/Header/index.js | // material-ui
import { useState } from 'react';
import { useTheme } from '@mui/material/styles';
import {
Box,
Button,
Stack,
Popper,
IconButton,
List,
ListItemButton,
Paper,
ListItemText,
Typography,
Divider,
ClickAwayListener
} from '@mui/material';
import LogoSection from 'layout/MainLayout/... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/index.js | web/berry/src/layout/MainLayout/index.js | import { useDispatch, useSelector } from 'react-redux';
import { Outlet } from 'react-router-dom';
import AuthGuard from 'utils/route-guard/AuthGuard';
// material-ui
import { styled, useTheme } from '@mui/material/styles';
import { AppBar, Box, CssBaseline, Toolbar, useMediaQuery } from '@mui/material';
import AdminC... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/LogoSection/index.js | web/berry/src/layout/MainLayout/LogoSection/index.js | import { Link } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
// material-ui
import { ButtonBase } from '@mui/material';
// project imports
import Logo from 'ui-component/Logo';
import { MENU_OPEN } from 'store/actions';
// ==============================|| MAIN LOGO ||=============... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Header/index.js | web/berry/src/layout/MainLayout/Header/index.js | import PropTypes from 'prop-types';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Avatar, Box, ButtonBase } from '@mui/material';
// project imports
import LogoSection from '../LogoSection';
import ProfileSection from './ProfileSection';
import ThemeButton from 'ui-component/ThemeButton';
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Header/ProfileSection/index.js | web/berry/src/layout/MainLayout/Header/ProfileSection/index.js | import { useState, useRef, useEffect } from 'react';
import { useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
// material-ui
import { useTheme } from '@mui/material/styles';
import {
Avatar,
Chip,
ClickAwayListener,
List,
ListItemButton,
ListItemIcon,
ListItemText,
Pap... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Sidebar/index.js | web/berry/src/layout/MainLayout/Sidebar/index.js | import PropTypes from 'prop-types';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Box, Chip, Drawer, Stack, useMediaQuery } from '@mui/material';
// third-party
import PerfectScrollbar from 'react-perfect-scrollbar';
import { BrowserView, MobileView } from 'react-device-detect';
// project... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Sidebar/MenuCard/index.js | web/berry/src/layout/MainLayout/Sidebar/MenuCard/index.js | // import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
// material-ui
import { styled, useTheme } from '@mui/material/styles';
import {
Avatar,
Card,
CardContent,
// Grid,
// LinearProgress,
List,
ListItem,
ListItemAvatar,
ListItemText,
Typography
// linearProgressClass... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Sidebar/MenuList/index.js | web/berry/src/layout/MainLayout/Sidebar/MenuList/index.js | // material-ui
import { Typography } from '@mui/material';
// project imports
import NavGroup from './NavGroup';
import menuItem from 'menu-items';
import { isAdmin } from 'utils/common';
// ==============================|| SIDEBAR MENU LIST ||============================== //
const MenuList = () => {
const userIsA... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Sidebar/MenuList/NavCollapse/index.js | web/berry/src/layout/MainLayout/Sidebar/MenuList/NavCollapse/index.js | import PropTypes from 'prop-types';
import { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { useLocation, useNavigate } from 'react-router';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Collapse, List, ListItemButton, ListItemIcon, ListItemText, Typog... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Sidebar/MenuList/NavItem/index.js | web/berry/src/layout/MainLayout/Sidebar/MenuList/NavItem/index.js | import PropTypes from 'prop-types';
import { forwardRef, useEffect } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Avatar, Chip, ListItemButton, ListItemIcon, ListItemT... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/layout/MainLayout/Sidebar/MenuList/NavGroup/index.js | web/berry/src/layout/MainLayout/Sidebar/MenuList/NavGroup/index.js | import PropTypes from 'prop-types';
// material-ui
import { useTheme } from '@mui/material/styles';
import { Divider, List, Typography } from '@mui/material';
// project imports
import NavItem from '../NavItem';
import NavCollapse from '../NavCollapse';
// ==============================|| SIDEBAR MENU LIST GROUP ||=... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/themes/index.js | web/berry/src/themes/index.js | import { createTheme } from '@mui/material/styles';
// assets
import colors from 'assets/scss/_themes-vars.module.scss';
// project imports
import componentStyleOverrides from './compStyleOverride';
import themePalette from './palette';
import themeTypography from './typography';
/**
* Represent theme style and str... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/themes/typography.js | web/berry/src/themes/typography.js | /**
* Typography used in theme
* @param {JsonObject} theme theme customization object
*/
export default function themeTypography(theme) {
return {
fontFamily: theme?.customization?.fontFamily,
h6: {
fontWeight: 500,
color: theme.heading,
fontSize: '0.75rem'
},
h5: {
fontSiz... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/themes/palette.js | web/berry/src/themes/palette.js | /**
* Color intention that you want to used in your theme
* @param {JsonObject} theme Theme customization object
*/
export default function themePalette(theme) {
return {
mode: theme.mode,
common: {
black: theme.colors?.darkPaper
},
primary: {
light: theme.colors?.primaryLight,
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/themes/compStyleOverride.js | web/berry/src/themes/compStyleOverride.js | export default function componentStyleOverrides(theme) {
const bgColor = theme.mode === 'dark' ? theme.backgroundDefault : theme.colors?.grey50;
return {
MuiButton: {
styleOverrides: {
root: {
fontWeight: 500,
borderRadius: '4px',
'&.Mui-disabled': {
color... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/constants/ChannelConstants.js | web/berry/src/constants/ChannelConstants.js | export const CHANNEL_OPTIONS = {
1: {
key: 1,
text: 'OpenAI',
value: 1,
color: 'success'
},
14: {
key: 14,
text: 'Anthropic Claude',
value: 14,
color: 'primary'
},
33: {
key: 33,
text: 'AWS',
value: 33,
color: 'primary'
},
37: {
key: 37,
text: 'Cloud... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/constants/index.js | web/berry/src/constants/index.js | export * from './SnackbarConstants';
export * from './CommonConstants';
export * from './ChannelConstants';
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/constants/SnackbarConstants.js | web/berry/src/constants/SnackbarConstants.js | import { closeSnackbar } from 'notistack';
import { IconX } from '@tabler/icons-react';
import { IconButton } from '@mui/material';
const action = (snackbarId) => (
<>
<IconButton
onClick={() => {
closeSnackbar(snackbarId);
}}
>
<IconX stroke={1.5} size="1.25rem" />
</IconButton>... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/constants/CommonConstants.js | web/berry/src/constants/CommonConstants.js | export const ITEMS_PER_PAGE = 10; // this value must keep same as the one defined in backend!
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/berry/src/contexts/UserContext.js | web/berry/src/contexts/UserContext.js | // contexts/User/index.jsx
import React, { useEffect, useCallback, createContext, useState } from 'react';
import { LOGIN } from 'store/actions';
import { useDispatch } from 'react-redux';
export const UserContext = createContext();
// eslint-disable-next-line
const UserProvider = ({ children }) => {
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/contexts/StatusContext.js | web/berry/src/contexts/StatusContext.js | import { useEffect, useCallback, createContext } from "react";
import { API } from "utils/api";
import { showNotice, showError } from "utils/common";
import { SET_SITE_INFO } from "store/actions";
import { useDispatch } from "react-redux";
export const LoadStatusContext = createContext();
// eslint-disable-next-line
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/index.js | web/air/src/index.js | import { initVChartSemiTheme } from '@visactor/vchart-semi-theme';
import React from 'react';
import ReactDOM from 'react-dom/client';
import {BrowserRouter} from 'react-router-dom';
import App from './App';
import HeaderBar from './components/HeaderBar';
import Footer from './components/Footer';
import 'semantic-ui-cs... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/App.js | web/air/src/App.js | import React, { lazy, Suspense, useContext, useEffect } from 'react';
import { Route, Routes } from 'react-router-dom';
import Loading from './components/Loading';
import User from './pages/User';
import { PrivateRoute } from './components/PrivateRoute';
import RegisterForm from './components/RegisterForm';
import Logi... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/helpers/history.js | web/air/src/helpers/history.js | import { createBrowserHistory } from 'history';
export const history = createBrowserHistory(); | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/helpers/index.js | web/air/src/helpers/index.js | export * from './history';
export * from './auth-header';
export * from './utils';
export * from './api'; | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/helpers/api.js | web/air/src/helpers/api.js | import { showError } from './utils';
import axios from 'axios';
export const API = axios.create({
baseURL: process.env.REACT_APP_SERVER ? process.env.REACT_APP_SERVER : '',
});
API.interceptors.response.use(
(response) => response,
(error) => {
showError(error);
}
);
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/helpers/auth-header.js | web/air/src/helpers/auth-header.js | export function authHeader() {
// return authorization header with jwt token
let user = JSON.parse(localStorage.getItem('user'));
if (user && user.token) {
return { 'Authorization': 'Bearer ' + user.token };
} else {
return {};
}
} | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/helpers/render.js | web/air/src/helpers/render.js | import {Label} from 'semantic-ui-react';
import {Tag} from "@douyinfe/semi-ui";
export function renderText(text, limit) {
if (text.length > limit) {
return text.slice(0, limit - 3) + '...';
}
return text;
}
export function renderGroup(group) {
if (group === '') {
return <Tag size='larg... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/helpers/utils.js | web/air/src/helpers/utils.js | import { Toast } from '@douyinfe/semi-ui';
import { toastConstants } from '../constants';
import React from 'react';
import {toast} from "react-toastify";
const HTMLToastContent = ({ htmlContent }) => {
return <div dangerouslySetInnerHTML={{ __html: htmlContent }} />;
};
export default HTMLToastContent;
export funct... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Detail/index.js | web/air/src/pages/Detail/index.js | import React, {useEffect, useRef, useState} from 'react';
import {Button, Col, Form, Layout, Row, Spin} from "@douyinfe/semi-ui";
import VChart from '@visactor/vchart';
import {API, isAdmin, showError, timestamp2string, timestamp2string1} from "../../helpers";
import {
getQuotaWithUnit, modelColorMap,
renderNum... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Token/index.js | web/air/src/pages/Token/index.js | import React from 'react';
import TokensTable from '../../components/TokensTable';
import {Layout} from "@douyinfe/semi-ui";
const Token = () => (
<>
<Layout>
<Layout.Header>
<h3>我的令牌</h3>
</Layout.Header>
<Layout.Content>
<TokensTable/>
</Layout.Content>
</Layout>
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Token/EditToken.js | web/air/src/pages/Token/EditToken.js | import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { API, isMobile, showError, showSuccess, timestamp2string } from '../../helpers';
import { renderQuotaWithPrompt } from '../../helpers/render';
import {
AutoComplete,
Banner,
Button,
Checkbox,
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Home/index.js | web/air/src/pages/Home/index.js | import React, { useContext, useEffect, useState } from 'react';
import { Card, Col, Row } from '@douyinfe/semi-ui';
import { API, showError, showNotice, timestamp2string } from '../../helpers';
import { StatusContext } from '../../context/Status';
import { marked } from 'marked';
const Home = () => {
const [statusSt... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Chat/index.js | web/air/src/pages/Chat/index.js | import React from 'react';
const Chat = () => {
const chatLink = localStorage.getItem('chat_link');
return (
<iframe
src={chatLink}
style={{ width: '100%', height: '85vh', border: 'none' }}
/>
);
};
export default Chat;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Setting/index.js | web/air/src/pages/Setting/index.js | import React from 'react';
import SystemSetting from '../../components/SystemSetting';
import {isRoot} from '../../helpers';
import OtherSetting from '../../components/OtherSetting';
import PersonalSetting from '../../components/PersonalSetting';
import OperationSetting from '../../components/OperationSetting';
import ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Channel/index.js | web/air/src/pages/Channel/index.js | import React from 'react';
import ChannelsTable from '../../components/ChannelsTable';
import {Layout} from "@douyinfe/semi-ui";
const File = () => (
<>
<Layout>
<Layout.Header>
<h3>管理渠道</h3>
</Layout.Header>
<Layout.Content>
<ChannelsTabl... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Channel/EditChannel.js | web/air/src/pages/Channel/EditChannel.js | import React, {useEffect, useRef, useState} from 'react';
import {useNavigate, useParams} from 'react-router-dom';
import {API, isMobile, showError, showInfo, showSuccess, verifyJSON} from '../../helpers';
import {CHANNEL_OPTIONS} from '../../constants';
import Title from "@douyinfe/semi-ui/lib/es/typography/title";
im... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/User/index.js | web/air/src/pages/User/index.js | import React from 'react';
import UsersTable from '../../components/UsersTable';
import {Layout} from "@douyinfe/semi-ui";
const User = () => (
<>
<Layout>
<Layout.Header>
<h3>管理用户</h3>
</Layout.Header>
<Layout.Content>
<UsersTable/>
</Layout.Content>
<... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/User/EditUser.js | web/air/src/pages/User/EditUser.js | import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { API, isMobile, showError, showSuccess } from '../../helpers';
import { renderQuotaWithPrompt } from '../../helpers/render';
import Title from '@douyinfe/semi-ui/lib/es/typography/title';
import { Button, Divider... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/User/AddUser.js | web/air/src/pages/User/AddUser.js | import React, { useState } from 'react';
import { API, isMobile, showError, showSuccess } from '../../helpers';
import Title from '@douyinfe/semi-ui/lib/es/typography/title';
import { Button, Input, SideSheet, Space, Spin } from '@douyinfe/semi-ui';
const AddUser = (props) => {
const originInputs = {
username: '... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/About/index.js | web/air/src/pages/About/index.js | import React, { useEffect, useState } from 'react';
import { Header, Segment } from 'semantic-ui-react';
import { API, showError } from '../../helpers';
import { marked } from 'marked';
const About = () => {
const [about, setAbout] = useState('');
const [aboutLoaded, setAboutLoaded] = useState(false);
const dis... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/NotFound/index.js | web/air/src/pages/NotFound/index.js | import React from 'react';
import { Message } from 'semantic-ui-react';
const NotFound = () => (
<>
<Message negative>
<Message.Header>页面不存在</Message.Header>
<p>请检查你的浏览器地址是否正确</p>
</Message>
</>
);
export default NotFound;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Redemption/index.js | web/air/src/pages/Redemption/index.js | import React from 'react';
import RedemptionsTable from '../../components/RedemptionsTable';
import {Layout} from "@douyinfe/semi-ui";
const Redemption = () => (
<>
<Layout>
<Layout.Header>
<h3>管理兑换码</h3>
</Layout.Header>
<Layout.Content>
<RedemptionsTa... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Redemption/EditRedemption.js | web/air/src/pages/Redemption/EditRedemption.js | import React, { useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { API, downloadTextAsFile, isMobile, showError, showSuccess } from '../../helpers';
import { renderQuotaWithPrompt } from '../../helpers/render';
import { AutoComplete, Button, Input, Modal, SideSheet, ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Midjourney/index.js | web/air/src/pages/Midjourney/index.js | import React from 'react';
import MjLogsTable from '../../components/MjLogsTable';
const Midjourney = () => (
<>
<MjLogsTable />
</>
);
export default Midjourney;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/TopUp/index.js | web/air/src/pages/TopUp/index.js | import React, {useEffect, useState} from 'react';
import {API, isMobile, showError, showInfo, showSuccess} from '../../helpers';
import {renderNumber, renderQuota} from '../../helpers/render';
import {Col, Layout, Row, Typography, Card, Button, Form, Divider, Space, Modal} from "@douyinfe/semi-ui";
import Title from "@... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/pages/Log/index.js | web/air/src/pages/Log/index.js | import React from 'react';
import LogsTable from '../../components/LogsTable';
const Token = () => (
<>
<LogsTable />
</>
);
export default Token;
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/OtherSetting.js | web/air/src/components/OtherSetting.js | import React, { useEffect, useState } from 'react';
import { Button, Divider, Form, Grid, Header, Message, Modal } from 'semantic-ui-react';
import { API, showError, showSuccess } from '../helpers';
import { marked } from 'marked';
import { Link } from 'react-router-dom';
const OtherSetting = () => {
let [inputs, se... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/SiderBar.js | web/air/src/components/SiderBar.js | import React, { useContext, useEffect, useMemo, useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { UserContext } from '../context/User';
import { StatusContext } from '../context/Status';
import { API, getLogo, getSystemName, isAdmin, isMobile, showError } from '../helpers';
import... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/MjLogsTable.js | web/air/src/components/MjLogsTable.js | import React, { useEffect, useState } from 'react';
import { API, copy, isAdmin, showError, showSuccess, timestamp2string } from '../helpers';
import { Banner, Button, Form, ImagePreview, Layout, Modal, Progress, Table, Tag, Typography } from '@douyinfe/semi-ui';
import { ITEMS_PER_PAGE } from '../constants';
const ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/PasswordResetForm.js | web/air/src/components/PasswordResetForm.js | import React, { useEffect, useState } from 'react';
import { Button, Form, Grid, Header, Image, Segment } from 'semantic-ui-react';
import { API, showError, showInfo, showSuccess } from '../helpers';
import Turnstile from 'react-turnstile';
const PasswordResetForm = () => {
const [inputs, setInputs] = useState({
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/PasswordResetConfirm.js | web/air/src/components/PasswordResetConfirm.js | import React, { useEffect, useState } from 'react';
import { Button, Form, Grid, Header, Image, Segment } from 'semantic-ui-react';
import { API, copy, showError, showNotice } from '../helpers';
import { useSearchParams } from 'react-router-dom';
const PasswordResetConfirm = () => {
const [inputs, setInputs] = useSt... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/TokensTable.js | web/air/src/components/TokensTable.js | import React, { useEffect, useState } from 'react';
import { API, copy, showError, showSuccess, timestamp2string } from '../helpers';
import { ITEMS_PER_PAGE } from '../constants';
import { renderQuota } from '../helpers/render';
import { Button, Dropdown, Form, Modal, Popconfirm, Popover, SplitButtonGroup, Table, Tag... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/ChannelsTable.js | web/air/src/components/ChannelsTable.js | import React, { useEffect, useState } from 'react';
import { API, isMobile, shouldShowPrompt, showError, showInfo, showSuccess, timestamp2string } from '../helpers';
import { CHANNEL_OPTIONS, ITEMS_PER_PAGE } from '../constants';
import { renderGroup, renderNumberWithPoint, renderQuota } from '../helpers/render';
impo... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/PersonalSetting.js | web/air/src/components/PersonalSetting.js | import React, { useContext, useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { API, copy, isRoot, showError, showInfo, showSuccess } from '../helpers';
import Turnstile from 'react-turnstile';
import { UserContext } from '../context/User';
import { onGitHubOAuthClicked } from '... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/LoginForm.js | web/air/src/components/LoginForm.js | import React, { useContext, useEffect, useState } from 'react';
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import { UserContext } from '../context/User';
import { API, getLogo, showError, showInfo, showSuccess } from '../helpers';
import { onGitHubOAuthClicked } from './utils';
import Turnst... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/SystemSetting.js | web/air/src/components/SystemSetting.js | import React, { useEffect, useState } from 'react';
import { Button, Divider, Form, Grid, Header, Modal, Message } from 'semantic-ui-react';
import { API, removeTrailingSlash, showError } from '../helpers';
const SystemSetting = () => {
let [inputs, setInputs] = useState({
PasswordLoginEnabled: '',
PasswordR... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/RegisterForm.js | web/air/src/components/RegisterForm.js | import React, { useEffect, useState } from 'react';
import { Button, Form, Grid, Header, Image, Message, Segment } from 'semantic-ui-react';
import { Link, useNavigate } from 'react-router-dom';
import { API, getLogo, showError, showInfo, showSuccess } from '../helpers';
import Turnstile from 'react-turnstile';
const ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/OperationSetting.js | web/air/src/components/OperationSetting.js | import React, { useEffect, useState } from 'react';
import { Divider, Form, Grid, Header } from 'semantic-ui-react';
import { API, showError, showSuccess, timestamp2string, verifyJSON } from '../helpers';
const OperationSetting = () => {
let now = new Date();
let [inputs, setInputs] = useState({
QuotaForNewUse... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/Footer.js | web/air/src/components/Footer.js | import React, { useEffect, useState } from 'react';
import { Container, Segment } from 'semantic-ui-react';
import { getFooterHTML, getSystemName } from '../helpers';
const Footer = () => {
const systemName = getSystemName();
const [footer, setFooter] = useState(getFooterHTML());
let remainCheckTimes = 5;
co... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/GitHubOAuth.js | web/air/src/components/GitHubOAuth.js | import React, { useContext, useEffect, useState } from 'react';
import { Dimmer, Loader, Segment } from 'semantic-ui-react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { API, showError, showSuccess } from '../helpers';
import { UserContext } from '../context/User';
const GitHubOAuth = () =... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/PrivateRoute.js | web/air/src/components/PrivateRoute.js | import { Navigate } from 'react-router-dom';
import { history } from '../helpers';
function PrivateRoute({ children }) {
if (!localStorage.getItem('user')) {
return <Navigate to="/login" state={{ from: history.location }} />;
}
return children;
}
export { PrivateRoute }; | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/UsersTable.js | web/air/src/components/UsersTable.js | import React, { useEffect, useState } from 'react';
import { API, showError, showSuccess } from '../helpers';
import { Button, Form, Popconfirm, Space, Table, Tag, Tooltip, Dropdown } from '@douyinfe/semi-ui';
import { ITEMS_PER_PAGE } from '../constants';
import { renderGroup, renderNumber, renderQuota } from '../help... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/Loading.js | web/air/src/components/Loading.js | import React from 'react';
import { Dimmer, Loader, Segment } from 'semantic-ui-react';
const Loading = ({ prompt: name = 'page' }) => {
return (
<Segment style={{ height: 100 }}>
<Dimmer active inverted>
<Loader indeterminate>加载{name}中...</Loader>
</Dimmer>
</Segment>
);
};
export def... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/LogsTable.js | web/air/src/components/LogsTable.js | import React, { useEffect, useState } from 'react';
import { API, copy, isAdmin, showError, showSuccess, timestamp2string } from '../helpers';
import { Avatar, Button, Form, Layout, Modal, Select, Space, Spin, Table, Tag } from '@douyinfe/semi-ui';
import { ITEMS_PER_PAGE } from '../constants';
import { renderNumber, ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/WeChatIcon.js | web/air/src/components/WeChatIcon.js | import React from 'react';
import { Icon } from '@douyinfe/semi-ui';
const WeChatIcon = () => {
function CustomIcon() {
return <svg t="1709714447384" className="icon" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="5091" width="16" height="16">
<path
d... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/HeaderBar.js | web/air/src/components/HeaderBar.js | import React, { useContext, useEffect, useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { UserContext } from '../context/User';
import { API, getLogo, getSystemName, showSuccess } from '../helpers';
import '../index.css';
import fireworks from 'react-fireworks';
import { IconHelp... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/RedemptionsTable.js | web/air/src/components/RedemptionsTable.js | import React, { useEffect, useState } from 'react';
import { API, copy, showError, showSuccess, timestamp2string } from '../helpers';
import { ITEMS_PER_PAGE } from '../constants';
import { renderQuota } from '../helpers/render';
import { Button, Form, Modal, Popconfirm, Popover, Table, Tag } from '@douyinfe/semi-ui';... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/components/utils.js | web/air/src/components/utils.js | import { API, showError } from '../helpers';
export async function getOAuthState() {
const res = await API.get('/api/oauth/state');
const { success, message, data } = res.data;
if (success) {
return data;
} else {
showError(message);
return '';
}
}
export async function onGitHubOAuthClicked(gith... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/constants/toast.constants.js | web/air/src/constants/toast.constants.js | export const toastConstants = {
SUCCESS_TIMEOUT: 1500,
INFO_TIMEOUT: 3000,
ERROR_TIMEOUT: 5000,
WARNING_TIMEOUT: 10000,
NOTICE_TIMEOUT: 20000
};
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/constants/index.js | web/air/src/constants/index.js | export * from './toast.constants';
export * from './user.constants';
export * from './common.constant';
export * from './channel.constants'; | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/constants/user.constants.js | web/air/src/constants/user.constants.js | export const userConstants = {
REGISTER_REQUEST: 'USERS_REGISTER_REQUEST',
REGISTER_SUCCESS: 'USERS_REGISTER_SUCCESS',
REGISTER_FAILURE: 'USERS_REGISTER_FAILURE',
LOGIN_REQUEST: 'USERS_LOGIN_REQUEST',
LOGIN_SUCCESS: 'USERS_LOGIN_SUCCESS',
LOGIN_FAILURE: 'USERS_LOGIN_FAILURE',
LOGOUT: '... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/constants/common.constant.js | web/air/src/constants/common.constant.js | export const ITEMS_PER_PAGE = 10; // this value must keep same as the one defined in backend!
| javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/constants/channel.constants.js | web/air/src/constants/channel.constants.js | export const CHANNEL_OPTIONS = [
{ key: 1, text: 'OpenAI', value: 1, color: 'green' },
{ key: 14, text: 'Anthropic Claude', value: 14, color: 'black' },
{ key: 33, text: 'AWS', value: 33, color: 'black' },
{ key: 3, text: 'Azure OpenAI', value: 3, color: 'olive' },
{ key: 11, text: 'Google PaLM2', value: 11, ... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/context/User/reducer.js | web/air/src/context/User/reducer.js | export const reducer = (state, action) => {
switch (action.type) {
case 'login':
return {
...state,
user: action.payload
};
case 'logout':
return {
...state,
user: undefined
};
default:
return state;
}
};
export const initialState = {
use... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/context/User/index.js | web/air/src/context/User/index.js | // contexts/User/index.jsx
import React from "react"
import { reducer, initialState } from "./reducer"
export const UserContext = React.createContext({
state: initialState,
dispatch: () => null
})
export const UserProvider = ({ children }) => {
const [state, dispatch] = React.useReducer(reducer, initialState)
... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/context/Status/reducer.js | web/air/src/context/Status/reducer.js | export const reducer = (state, action) => {
switch (action.type) {
case 'set':
return {
...state,
status: action.payload,
};
case 'unset':
return {
...state,
status: undefined,
};
default:
return state;
}
};
export const initialState = {
s... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
songquanpeng/one-api | https://github.com/songquanpeng/one-api/blob/8df4a2670b98266bd287c698243fff327d9748cf/web/air/src/context/Status/index.js | web/air/src/context/Status/index.js | // contexts/User/index.jsx
import React from 'react';
import { initialState, reducer } from './reducer';
export const StatusContext = React.createContext({
state: initialState,
dispatch: () => null,
});
export const StatusProvider = ({ children }) => {
const [state, dispatch] = React.useReducer(reducer, initia... | javascript | MIT | 8df4a2670b98266bd287c698243fff327d9748cf | 2026-01-04T15:01:58.337509Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/vue.config.js | vue.config.js | /*
Copyright 2022 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/mount.js | src/nginxconfig/mount.js | /*
Copyright 2024 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/php_path.js | src/nginxconfig/util/php_path.js | /*
Copyright 2021 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/ssl_profiles.js | src/nginxconfig/util/ssl_profiles.js | /*
Copyright 2020 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/prism_bundle.js | src/nginxconfig/util/prism_bundle.js | /*
Copyright 2024 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/language_packs.js | src/nginxconfig/util/language_packs.js | /*
Copyright 2024 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/camel_to_snake.js | src/nginxconfig/util/camel_to_snake.js | /*
Copyright 2020 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/php_upstream.js | src/nginxconfig/util/php_upstream.js | /*
Copyright 2021 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/get_ssl_certificate.js | src/nginxconfig/util/get_ssl_certificate.js | /*
Copyright 2020 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/is_changed.js | src/nginxconfig/util/is_changed.js | /*
Copyright 2020 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/types_extensions.js | src/nginxconfig/util/types_extensions.js | /*
Copyright 2022 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/analytics.js | src/nginxconfig/util/analytics.js | /*
Copyright 2024 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/snake_to_camel.js | src/nginxconfig/util/snake_to_camel.js | /*
Copyright 2020 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/share_query.js | src/nginxconfig/util/share_query.js | /*
Copyright 2024 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/angular_backwards_compatibility.js | src/nginxconfig/util/angular_backwards_compatibility.js | /*
Copyright 2024 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/export_data.js | src/nginxconfig/util/export_data.js | /*
Copyright 2020 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
digitalocean/nginxconfig.io | https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/util/defaults.js | src/nginxconfig/util/defaults.js | /*
Copyright 2022 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... | javascript | MIT | dd290c0b706b8a8c2f86cfbffaae9c17715b431d | 2026-01-04T15:02:09.359615Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.