From b2e46a33acee4439efef8a64fd49932dfa8d4e81 Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Fri, 17 Nov 2023 01:24:48 +0000 Subject: [PATCH] feat: token copy web url - Update `COPY_OPTIONS` object in `TokensTable.js` - Modify the `onCopy` function to use a different url variable - Fix pagination logic in the `onPaginationChange` function - Remove unnecessary code and comments in `TokensTable.js` --- web/src/components/TokensTable.js | 43 +++++++------------------------ 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/web/src/components/TokensTable.js b/web/src/components/TokensTable.js index 29ba19a2..295996aa 100644 --- a/web/src/components/TokensTable.js +++ b/web/src/components/TokensTable.js @@ -7,8 +7,7 @@ import { ITEMS_PER_PAGE } from '../constants'; import { renderQuota } from '../helpers/render'; const COPY_OPTIONS = [ - { key: 'next', text: 'ChatGPT Next Web', value: 'next' }, - { key: 'ama', text: 'AMA 问天', value: 'ama' }, + { key: 'web', text: 'Web', value: 'web' }, { key: 'opencat', text: 'OpenCat', value: 'opencat' }, ]; @@ -92,14 +91,14 @@ const TokensTable = () => { serverAddress = window.location.origin; } let encodedServerAddress = encodeURIComponent(serverAddress); - const nextLink = localStorage.getItem('chat_link'); - let nextUrl; + // const nextLink = localStorage.getItem('chat_link'); + // let nextUrl; - if (nextLink) { - nextUrl = nextLink + `/#/?settings={"key":"laisky-${key}","url":"${serverAddress}"}`; - } else { - nextUrl = `https://chat.oneapi.pro/#/?settings={"key":"laisky-${key}","url":"${serverAddress}"}`; - } + // if (nextLink) { + // nextUrl = nextLink + `/#/?settings={"key":"laisky-${key}","url":"${serverAddress}"}`; + // } else { + // nextUrl = `https://chat.oneapi.pro/#/?settings={"key":"laisky-${key}","url":"${serverAddress}"}`; + // } let url; switch (type) { @@ -109,8 +108,8 @@ const TokensTable = () => { case 'opencat': url = `opencat://team/join?domain=${encodedServerAddress}&token=laisky-${key}`; break; - case 'next': - url = nextUrl; + case 'web': + url = `https://chat.laisky.com?apikey=laisky-${key}`; break; default: url = `laisky-${key}`; @@ -353,28 +352,6 @@ const TokensTable = () => { /> {' '} - - - ({ - ...option, - onClick: async () => { - await onOpenLink(option.value, token.key); - } - }))} - trigger={<>} - /> - - {' '}