From 066c840efe5f1f658035f9923b1c751c285df7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Mon, 19 May 2025 00:34:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E5=8A=A8=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=AE=B1=E5=92=8C=E8=B7=91=E5=88=86=E4=B8=BA=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/apps/benchmark/index.ts | 6 ---- web/src/api/apps/toolbox/index.ts | 31 ---------------- web/src/api/panel/toolbox-benchmark/index.ts | 6 ++++ web/src/api/panel/toolbox-system/index.ts | 31 ++++++++++++++++ web/src/locales/menu.ts | 7 ++-- web/src/views/apps/benchmark/route.ts | 23 ------------ web/src/views/apps/toolbox/route.ts | 23 ------------ .../BenchmarkView.vue} | 4 +-- .../IndexView.vue => toolbox/SystemView.vue} | 30 ++++++++-------- web/src/views/toolbox/route.ts | 36 +++++++++++++++++++ 10 files changed, 94 insertions(+), 103 deletions(-) delete mode 100644 web/src/api/apps/benchmark/index.ts delete mode 100644 web/src/api/apps/toolbox/index.ts create mode 100644 web/src/api/panel/toolbox-benchmark/index.ts create mode 100644 web/src/api/panel/toolbox-system/index.ts delete mode 100644 web/src/views/apps/benchmark/route.ts delete mode 100644 web/src/views/apps/toolbox/route.ts rename web/src/views/{apps/benchmark/IndexView.vue => toolbox/BenchmarkView.vue} (99%) rename web/src/views/{apps/toolbox/IndexView.vue => toolbox/SystemView.vue} (87%) create mode 100644 web/src/views/toolbox/route.ts diff --git a/web/src/api/apps/benchmark/index.ts b/web/src/api/apps/benchmark/index.ts deleted file mode 100644 index 85af8d38..00000000 --- a/web/src/api/apps/benchmark/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { http } from '@/utils' - -export default { - // 运行评分 - test: (name: string, multi: boolean): any => http.Post('/apps/benchmark/test', { name, multi }) -} diff --git a/web/src/api/apps/toolbox/index.ts b/web/src/api/apps/toolbox/index.ts deleted file mode 100644 index a04509bf..00000000 --- a/web/src/api/apps/toolbox/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { http } from '@/utils' - -export default { - // DNS - dns: (): any => http.Get('/apps/toolbox/dns'), - // 设置 DNS - updateDns: (dns1: string, dns2: string): any => http.Post('/apps/toolbox/dns', { dns1, dns2 }), - // SWAP - swap: (): any => http.Get('/apps/toolbox/swap'), - // 设置 SWAP - updateSwap: (size: number): any => http.Post('/apps/toolbox/swap', { size }), - // 时区 - timezone: (): any => http.Get('/apps/toolbox/timezone'), - // 设置时区 - updateTimezone: (timezone: string): any => http.Post('/apps/toolbox/timezone', { timezone }), - // 设置时间 - updateTime: (time: string): any => http.Post('/apps/toolbox/time', { time }), - // 同步时间 - syncTime: (): any => http.Post('/apps/toolbox/sync_time'), - // 主机名 - hostname: (): any => http.Get('/apps/toolbox/hostname'), - // Hosts - hosts: (): any => http.Get('/apps/toolbox/hosts'), - // 设置主机名 - updateHostname: (hostname: string): any => http.Post('/apps/toolbox/hostname', { hostname }), - // 设置 Hosts - updateHosts: (hosts: string): any => http.Post('/apps/toolbox/hosts', { hosts }), - // 设置 Root 密码 - updateRootPassword: (password: string): any => - http.Post('/apps/toolbox/root_password', { password }) -} diff --git a/web/src/api/panel/toolbox-benchmark/index.ts b/web/src/api/panel/toolbox-benchmark/index.ts new file mode 100644 index 00000000..5861f278 --- /dev/null +++ b/web/src/api/panel/toolbox-benchmark/index.ts @@ -0,0 +1,6 @@ +import { http } from '@/utils' + +export default { + // 运行评分 + test: (name: string, multi: boolean): any => http.Post('/toolbox_benchmark/test', { name, multi }) +} diff --git a/web/src/api/panel/toolbox-system/index.ts b/web/src/api/panel/toolbox-system/index.ts new file mode 100644 index 00000000..a406c489 --- /dev/null +++ b/web/src/api/panel/toolbox-system/index.ts @@ -0,0 +1,31 @@ +import { http } from '@/utils' + +export default { + // DNS + dns: (): any => http.Get('/toolbox_system/dns'), + // 设置 DNS + updateDns: (dns1: string, dns2: string): any => http.Post('/toolbox_system/dns', { dns1, dns2 }), + // SWAP + swap: (): any => http.Get('/toolbox_system/swap'), + // 设置 SWAP + updateSwap: (size: number): any => http.Post('/toolbox_system/swap', { size }), + // 时区 + timezone: (): any => http.Get('/toolbox_system/timezone'), + // 设置时区 + updateTimezone: (timezone: string): any => http.Post('/toolbox_system/timezone', { timezone }), + // 设置时间 + updateTime: (time: string): any => http.Post('/toolbox_system/time', { time }), + // 同步时间 + syncTime: (): any => http.Post('/toolbox_system/sync_time'), + // 主机名 + hostname: (): any => http.Get('/toolbox_system/hostname'), + // Hosts + hosts: (): any => http.Get('/toolbox_system/hosts'), + // 设置主机名 + updateHostname: (hostname: string): any => http.Post('/toolbox_system/hostname', { hostname }), + // 设置 Hosts + updateHosts: (hosts: string): any => http.Post('/toolbox_system/hosts', { hosts }), + // 设置 Root 密码 + updateRootPassword: (password: string): any => + http.Post('/toolbox_system/root_password', { password }) +} diff --git a/web/src/locales/menu.ts b/web/src/locales/menu.ts index 532c02f7..fa571289 100644 --- a/web/src/locales/menu.ts +++ b/web/src/locales/menu.ts @@ -17,6 +17,9 @@ export function translateTitle(key: string): string { Settings: $gettext('Settings'), Terminal: $gettext('Terminal'), Tasks: $gettext('Tasks'), + Toolbox: $gettext('Toolbox'), + System: $gettext('System'), + Benchmark: $gettext('Benchmark'), Website: $gettext('Website'), 'Website Edit': $gettext('Website Edit'), // 应用标题 @@ -24,9 +27,7 @@ export function translateTitle(key: string): string { 'S3fs Manager': $gettext('S3fs Manager'), 'Supervisor Manager': $gettext('Supervisor Manager'), 'Rsync Manager': $gettext('Rsync Manager'), - 'Frp Manager': $gettext('Frp Manager'), - 'Rat Benchmark': $gettext('Rat Benchmark'), - 'System Toolbox': $gettext('System Toolbox') + 'Frp Manager': $gettext('Frp Manager') } return titles[key] || key diff --git a/web/src/views/apps/benchmark/route.ts b/web/src/views/apps/benchmark/route.ts deleted file mode 100644 index bf35ebfd..00000000 --- a/web/src/views/apps/benchmark/route.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { RouteType } from '~/types/router' - -const Layout = () => import('@/layout/IndexView.vue') - -export default { - name: 'benchmark', - path: '/apps/benchmark', - component: Layout, - isHidden: true, - children: [ - { - name: 'apps-benchmark-index', - path: '', - component: () => import('./IndexView.vue'), - meta: { - title: 'Rat Benchmark', - icon: 'dashicons:performance', - role: ['admin'], - requireAuth: true - } - } - ] -} as RouteType diff --git a/web/src/views/apps/toolbox/route.ts b/web/src/views/apps/toolbox/route.ts deleted file mode 100644 index 8a52fd0b..00000000 --- a/web/src/views/apps/toolbox/route.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { RouteType } from '~/types/router' - -const Layout = () => import('@/layout/IndexView.vue') - -export default { - name: 'toolbox', - path: '/apps/toolbox', - component: Layout, - isHidden: true, - children: [ - { - name: 'apps-toolbox-index', - path: '', - component: () => import('./IndexView.vue'), - meta: { - title: 'System Toolbox', - icon: 'mdi:tools', - role: ['admin'], - requireAuth: true - } - } - ] -} as RouteType diff --git a/web/src/views/apps/benchmark/IndexView.vue b/web/src/views/toolbox/BenchmarkView.vue similarity index 99% rename from web/src/views/apps/benchmark/IndexView.vue rename to web/src/views/toolbox/BenchmarkView.vue index 116ca2f9..51fc5e44 100644 --- a/web/src/views/apps/benchmark/IndexView.vue +++ b/web/src/views/toolbox/BenchmarkView.vue @@ -1,9 +1,9 @@