From b99b24f27129467f1c9774b7911c1e8bae081b52 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Mon, 11 Dec 2023 20:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A4=E7=89=8C=E7=95=8C=E9=9D=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=81=8A=E5=A4=A9=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/TokensTable.js | 40 +++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/web/src/components/TokensTable.js b/web/src/components/TokensTable.js index 53883d603..aa8fd578f 100644 --- a/web/src/components/TokensTable.js +++ b/web/src/components/TokensTable.js @@ -4,7 +4,22 @@ import {API, copy, isAdmin, showError, showSuccess, showWarning, timestamp2strin import {ITEMS_PER_PAGE} from '../constants'; import {renderQuota, stringToColor} from '../helpers/render'; -import {Avatar, Tag, Table, Button, Popover, Form, Modal, Popconfirm} from "@douyinfe/semi-ui"; +import { + Avatar, + Tag, + Table, + Button, + Popover, + Form, + Modal, + Popconfirm, + SplitButtonGroup, + Dropdown +} from "@douyinfe/semi-ui"; + +import { + IconTreeTriangleDown, +} from '@douyinfe/semi-icons'; import EditToken from "../pages/Token/EditToken"; const {Column} = Table; @@ -44,6 +59,13 @@ function renderStatus(status) { } const TokensTable = () => { + + const link_menu = [ + {node: 'item', key: 'next', name: 'ChatGPT Next Web', onClick: () => {onOpenLink('next')}}, + {node: 'item', key: 'ama', name: 'AMA 问天', value: 'ama'}, + {node: 'item', key: 'opencat', name: 'OpenCat', value: 'opencat'}, + ]; + const columns = [ { title: '名称', @@ -124,6 +146,19 @@ const TokensTable = () => { await copyText('sk-' + record.key) }} >复制 + + + {onOpenLink('next', record.key)}}, + {node: 'item', key: 'ama', name: 'AMA 问天(BotGrem)', onClick: () => {onOpenLink('ama', record.key)}}, + {node: 'item', key: 'opencat', name: 'OpenCat', onClick: () => {onOpenLink('opencat', record.key)}}, + ] + } + > + + + { if (chatLink) { defaultUrl = chatLink + `/#/?settings={"key":"sk-${key}","url":"${serverAddress}"}`; } else { - defaultUrl = `https://chat.oneapi.pro/#/?settings={"key":"sk-${key}","url":"${serverAddress}"}`; + showError('管理员未设置聊天链接') + return } let url; switch (type) {