Przeglądaj źródła

fix:修改内部有些名称为new API的改成 Linwit API;禁用到排行傍(rankings)和关于(/about)入口

韩洋 1 miesiąc temu
rodzic
commit
734bca1b0c

+ 2 - 2
classic/index.html

@@ -17,10 +17,10 @@
       content="A unified AI model hub for aggregation & distribution. It supports cross-converting various LLMs into OpenAI-compatible, Claude-compatible, or Gemini-compatible formats. A centralized gateway for personal and enterprise model management."
     />
     <meta name="generator" content="new-api" />
-    <title>New API</title>
+    <title>Linwit API</title>
     <!--umami-->
     <!--Google Analytics-->
-  </head>
+  </head> 
 
   <body>
     <noscript>You need to enable JavaScript to run this app.</noscript>

+ 2 - 2
classic/src/components/layout/Footer.jsx

@@ -205,7 +205,7 @@ const FooterBar = () => {
               rel='noopener noreferrer'
               className='!text-semi-color-primary font-medium'
             >
-              New API
+              Linwit API
             </a>
           </div>
         </div>
@@ -237,7 +237,7 @@ const FooterBar = () => {
                 rel='noopener noreferrer'
                 className='!text-semi-color-primary font-medium'
               >
-                New API
+                Linwit API
               </a>
             </div>
           </div>

+ 3 - 3
classic/src/components/table/channels/modals/EditChannelModal.jsx

@@ -149,7 +149,7 @@ function type2secretPrompt(type) {
     case 45:
       return '请输入渠道对应的鉴权密钥, 豆包语音输入:AppId|AccessToken';
     case 50:
-      return '按照如下格式输入: AccessKey|SecretKey, 如果上游是New API,则直接输ApiKey';
+      return '按照如下格式输入: AccessKey|SecretKey, 如果上游是Linwit API,则直接输入ApiKey';
     case 51:
       return '按照如下格式输入: AccessKey|SecretAccessKey';
     case 57:
@@ -618,7 +618,7 @@ const EditChannelModal = (props) => {
       Modal.confirm({
         title: '警告',
         content:
-          '不需要在末尾加/v1,New API会自动处理,添加后可能导致请求失败,是否继续?',
+          '不需要在末尾加/v1,Linwit API会自动处理,添加后可能导致请求失败,是否继续?',
         onOk: () => {
           setInputs((inputs) => ({ ...inputs, [name]: value }));
         },
@@ -3304,7 +3304,7 @@ const EditChannelModal = (props) => {
                           <Banner
                             type='warning'
                             description={t(
-                              '如果你对接的是上游One API或者New API等转发项目,请使用OpenAI类型,不要使用此类型,除非你知道你在做什么。',
+                              '如果你对接的是上游One API或者Linwit API等转发项目,请使用OpenAI类型,不要使用此类型,除非你知道你在做什么。',
                             )}
                             className='!rounded-lg'
                           />

+ 1 - 1
classic/src/helpers/utils.jsx

@@ -48,7 +48,7 @@ export function isRoot() {
 
 export function getSystemName() {
   let system_name = localStorage.getItem('system_name');
-  if (!system_name) return 'New API';
+  if (!system_name) return 'Linwit API';
   return system_name;
 }
 

+ 2 - 2
default/src/features/system-settings/general/system-info-section.tsx

@@ -244,7 +244,7 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
                   <FormItem>
                     <FormLabel>{t('System Name')}</FormLabel>
                     <FormControl>
-                      <Input placeholder={t('New API')} {...field} />
+                      <Input placeholder={t('API')} {...field} />
                     </FormControl>
                     <FormDescription>
                       {t('The name displayed across the application')}
@@ -442,7 +442,7 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
                       <FormLabel>{t('Home Page Content')}</FormLabel>
                       <FormControl>
                         <Textarea
-                          placeholder={t('Welcome to our New API...')}
+                          placeholder={t('Welcome to our Linwit API...')}
                           rows={6}
                           {...field}
                         />

+ 1 - 1
default/src/features/system-settings/integrations/email-settings-section.tsx

@@ -370,7 +370,7 @@ export function EmailSettingsSection({
                 <FormControl>
                   <Input
                     autoComplete='off'
-                    placeholder={t('New API &lt;noreply@example.com&gt;')}
+                    placeholder={t('Linwit API &lt;noreply@example.com&gt;')}
                     {...field}
                     onChange={(event) => field.onChange(event.target.value)}
                   />

+ 0 - 12
default/src/hooks/use-top-nav-links.ts

@@ -79,13 +79,6 @@ export function useTopNavLinks(): TopNavLink[] {
     links.push({ title: t('Model Square'), href: '/pricing', requiresAuth })
   }
 
-  // Rankings
-  const rankings = modules?.rankings
-  if (rankings && typeof rankings === 'object' && rankings.enabled) {
-    const requiresAuth = rankings.requireAuth && !isAuthed
-    links.push({ title: t('Rankings'), href: '/rankings', requiresAuth })
-  }
-
   // Docs (supports external links)
   if (modules?.docs !== false) {
     if (docsLink) {
@@ -95,10 +88,5 @@ export function useTopNavLinks(): TopNavLink[] {
     }
   }
 
-  // About
-  if (modules?.about !== false) {
-    links.push({ title: t('About'), href: '/about' })
-  }
-
   return links
 }

+ 1 - 1
default/src/i18n/locales/zh-TW.json

@@ -1471,7 +1471,7 @@
     "e.g. llama3.1:8b": "例如 llama3.1:8b",
     "e.g. My GitLab": "例如:My GitLab",
     "e.g. my-gitlab": "例如:my-gitlab",
-    "e.g. New API Console": "例如,New API 控制台",
+    "e.g. New API Console": "例如,API 控制台",
     "e.g. openid profile email": "例如:openid profile email",
     "e.g. Suitable for light usage": "例如:適合輕度使用",
     "e.g. This request does not meet access policy": "例如:該請求不滿足准入策略",

+ 4 - 1
default/src/routes/about/index.tsx

@@ -16,10 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
 
 For commercial licensing, please contact support@quantumnous.com
 */
-import { createFileRoute } from '@tanstack/react-router'
+import { createFileRoute, redirect } from '@tanstack/react-router'
 
 import { About } from '@/features/about'
 
 export const Route = createFileRoute('/about/')({
+  beforeLoad: () => {
+    throw redirect({ to: '/' })
+  },
   component: About,
 })

+ 2 - 16
default/src/routes/rankings/index.tsx

@@ -20,8 +20,6 @@ import { createFileRoute, redirect } from '@tanstack/react-router'
 import z from 'zod'
 
 import { Rankings } from '@/features/rankings'
-import { getFreshModuleAccess } from '@/lib/nav-modules'
-import { useAuthStore } from '@/stores/auth-store'
 
 const rankingsSearchSchema = z.object({
   period: z
@@ -32,20 +30,8 @@ const rankingsSearchSchema = z.object({
 
 export const Route = createFileRoute('/rankings/')({
   validateSearch: rankingsSearchSchema,
-  beforeLoad: async ({ location }) => {
-    const access = await getFreshModuleAccess('rankings')
-    if (!access.enabled) {
-      throw redirect({ to: '/' })
-    }
-    if (access.requireAuth) {
-      const { auth } = useAuthStore.getState()
-      if (!auth.user) {
-        throw redirect({
-          to: '/sign-in',
-          search: { redirect: location.href },
-        })
-      }
-    }
+  beforeLoad: () => {
+    throw redirect({ to: '/' })
   },
   component: Rankings,
 })