From f0c8b7d34711d4c7ccff08f2650afe649fe58d8a Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 30 Sep 2024 22:16:02 +0800 Subject: [PATCH] Remove unused files --- .../src/main/resources/templates/setup.html | 4 +- ui/console-src/router/guards/check-states.ts | 37 ---- ui/console-src/router/index.ts | 2 - ui/console-src/router/routes.config.ts | 18 -- ui/console-src/views/system/Setup.vue | 135 ------------ .../views/system/SetupInitialData.vue | 202 ------------------ .../views/system/setup-data/category.json | 16 -- .../views/system/setup-data/menu-items.json | 62 ------ .../views/system/setup-data/menu.json | 14 -- .../views/system/setup-data/post.json | 35 --- .../views/system/setup-data/singlePage.json | 31 --- .../views/system/setup-data/tag.json | 13 -- ui/src/locales/en.yaml | 19 -- ui/src/locales/es.yaml | 19 -- ui/src/locales/zh-CN.yaml | 19 -- ui/src/locales/zh-TW.yaml | 19 -- 16 files changed, 2 insertions(+), 643 deletions(-) delete mode 100644 ui/console-src/router/guards/check-states.ts delete mode 100644 ui/console-src/views/system/Setup.vue delete mode 100644 ui/console-src/views/system/SetupInitialData.vue delete mode 100644 ui/console-src/views/system/setup-data/category.json delete mode 100644 ui/console-src/views/system/setup-data/menu-items.json delete mode 100644 ui/console-src/views/system/setup-data/menu.json delete mode 100644 ui/console-src/views/system/setup-data/post.json delete mode 100644 ui/console-src/views/system/setup-data/singlePage.json delete mode 100644 ui/console-src/views/system/setup-data/tag.json diff --git a/application/src/main/resources/templates/setup.html b/application/src/main/resources/templates/setup.html index c5ffaac57a..ef488a6a10 100644 --- a/application/src/main/resources/templates/setup.html +++ b/application/src/main/resources/templates/setup.html @@ -36,7 +36,7 @@

系统初始化

- +
@@ -55,7 +55,7 @@

系统初始化

- +
diff --git a/ui/console-src/router/guards/check-states.ts b/ui/console-src/router/guards/check-states.ts deleted file mode 100644 index 4bfad5b019..0000000000 --- a/ui/console-src/router/guards/check-states.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { useGlobalInfoStore } from "@/stores/global-info"; -import { useUserStore } from "@/stores/user"; -import type { Router } from "vue-router"; - -export function setupCheckStatesGuard(router: Router) { - router.beforeEach(async (to, _, next) => { - const userStore = useUserStore(); - const { globalInfo } = useGlobalInfoStore(); - const { userInitialized, dataInitialized } = globalInfo || {}; - - if (to.name === "Setup" && userInitialized) { - next({ name: "Dashboard" }); - return; - } - - if (to.name === "SetupInitialData" && dataInitialized) { - next({ name: "Dashboard" }); - return; - } - - if (userInitialized === false && to.name !== "Setup") { - next({ name: "Setup" }); - return; - } - - if ( - dataInitialized === false && - !userStore.isAnonymous && - to.name !== "SetupInitialData" - ) { - next({ name: "SetupInitialData" }); - return; - } - - next(); - }); -} diff --git a/ui/console-src/router/index.ts b/ui/console-src/router/index.ts index d8afd9b5c9..b441c31f1f 100644 --- a/ui/console-src/router/index.ts +++ b/ui/console-src/router/index.ts @@ -6,7 +6,6 @@ import { type RouteLocationNormalizedLoaded, } from "vue-router"; import { setupAuthCheckGuard } from "./guards/auth-check"; -import { setupCheckStatesGuard } from "./guards/check-states"; import { setupPermissionGuard } from "./guards/permission"; const router = createRouter({ @@ -22,7 +21,6 @@ const router = createRouter({ }, }); -setupCheckStatesGuard(router); setupAuthCheckGuard(router); setupPermissionGuard(router); diff --git a/ui/console-src/router/routes.config.ts b/ui/console-src/router/routes.config.ts index d5fadd287b..e2fd53bf69 100644 --- a/ui/console-src/router/routes.config.ts +++ b/ui/console-src/router/routes.config.ts @@ -1,8 +1,6 @@ import Forbidden from "@/views/exceptions/Forbidden.vue"; import NotFound from "@/views/exceptions/NotFound.vue"; import BasicLayout from "@console/layouts/BasicLayout.vue"; -import Setup from "@console/views/system/Setup.vue"; -import SetupInitialData from "@console/views/system/SetupInitialData.vue"; import type { RouteRecordRaw } from "vue-router"; export const routes: Array = [ @@ -22,22 +20,6 @@ export const routes: Array = [ }, ], }, - { - path: "/setup", - component: Setup, - name: "Setup", - meta: { - title: "core.setup.title", - }, - }, - { - path: "/setup-initial-data", - name: "SetupInitialData", - component: SetupInitialData, - meta: { - title: "core.setup.title", - }, - }, ]; export default routes; diff --git a/ui/console-src/views/system/Setup.vue b/ui/console-src/views/system/Setup.vue deleted file mode 100644 index d1da4df5ae..0000000000 --- a/ui/console-src/views/system/Setup.vue +++ /dev/null @@ -1,135 +0,0 @@ - - - diff --git a/ui/console-src/views/system/SetupInitialData.vue b/ui/console-src/views/system/SetupInitialData.vue deleted file mode 100644 index 7af6125e2e..0000000000 --- a/ui/console-src/views/system/SetupInitialData.vue +++ /dev/null @@ -1,202 +0,0 @@ - - - diff --git a/ui/console-src/views/system/setup-data/category.json b/ui/console-src/views/system/setup-data/category.json deleted file mode 100644 index d65a2fab61..0000000000 --- a/ui/console-src/views/system/setup-data/category.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "spec": { - "displayName": "默认分类", - "slug": "default", - "description": "这是你的默认分类,如不需要,删除即可。", - "cover": "", - "template": "", - "priority": 0, - "children": [] - }, - "apiVersion": "content.halo.run/v1alpha1", - "kind": "Category", - "metadata": { - "name": "76514a40-6ef1-4ed9-b58a-e26945bde3ca" - } -} diff --git a/ui/console-src/views/system/setup-data/menu-items.json b/ui/console-src/views/system/setup-data/menu-items.json deleted file mode 100644 index 603f19dbd9..0000000000 --- a/ui/console-src/views/system/setup-data/menu-items.json +++ /dev/null @@ -1,62 +0,0 @@ -[ - { - "spec": { - "displayName": "首页", - "href": "/", - "children": [], - "priority": 0 - }, - "apiVersion": "v1alpha1", - "kind": "MenuItem", - "metadata": { "name": "88c3f10b-321c-4092-86a8-70db00251b74" } - }, - { - "spec": { - "children": [], - "priority": 1, - "targetRef": { - "group": "content.halo.run", - "version": "v1alpha1", - "kind": "Post", - "name": "5152aea5-c2e8-4717-8bba-2263d46e19d5" - } - }, - "apiVersion": "v1alpha1", - "kind": "MenuItem", - "metadata": { "name": "c4c814d1-0c2c-456b-8c96-4864965fee94" } - }, - { - "spec": { - "displayName": "", - "href": "", - "children": [], - "priority": 2, - "targetRef": { - "group": "content.halo.run", - "version": "v1alpha1", - "kind": "Tag", - "name": "c33ceabb-d8f1-4711-8991-bb8f5c92ad7c" - } - }, - "apiVersion": "v1alpha1", - "kind": "MenuItem", - "metadata": { "name": "35869bd3-33b5-448b-91ee-cf6517a59644" } - }, - { - "spec": { - "displayName": "", - "href": "", - "children": [], - "priority": 3, - "targetRef": { - "group": "content.halo.run", - "version": "v1alpha1", - "kind": "SinglePage", - "name": "373a5f79-f44f-441a-9df1-85a4f553ece8" - } - }, - "apiVersion": "v1alpha1", - "kind": "MenuItem", - "metadata": { "name": "b0d041fa-dc99-48f6-a193-8604003379cf" } - } -] diff --git a/ui/console-src/views/system/setup-data/menu.json b/ui/console-src/views/system/setup-data/menu.json deleted file mode 100644 index c1526b53a3..0000000000 --- a/ui/console-src/views/system/setup-data/menu.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "spec": { - "displayName": "主菜单", - "menuItems": [ - "88c3f10b-321c-4092-86a8-70db00251b74", - "c4c814d1-0c2c-456b-8c96-4864965fee94", - "35869bd3-33b5-448b-91ee-cf6517a59644", - "b0d041fa-dc99-48f6-a193-8604003379cf" - ] - }, - "apiVersion": "v1alpha1", - "kind": "Menu", - "metadata": { "name": "primary" } -} diff --git a/ui/console-src/views/system/setup-data/post.json b/ui/console-src/views/system/setup-data/post.json deleted file mode 100644 index d3f275546a..0000000000 --- a/ui/console-src/views/system/setup-data/post.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "post": { - "spec": { - "title": "Hello Halo", - "slug": "hello-halo", - "template": "", - "cover": "", - "deleted": false, - "publish": false, - "publishTime": "", - "pinned": false, - "allowComment": true, - "visible": "PUBLIC", - "version": 1, - "priority": 0, - "excerpt": { - "autoGenerate": false, - "raw": "如果你看到了这一篇文章,那么证明你已经安装成功了,感谢使用 Halo 进行创作,希望能够使用愉快。" - }, - "categories": ["76514a40-6ef1-4ed9-b58a-e26945bde3ca"], - "tags": ["c33ceabb-d8f1-4711-8991-bb8f5c92ad7c"], - "htmlMetas": [] - }, - "apiVersion": "content.halo.run/v1alpha1", - "kind": "Post", - "metadata": { - "name": "5152aea5-c2e8-4717-8bba-2263d46e19d5" - } - }, - "content": { - "raw": "

Hello Halo

如果你看到了这一篇文章,那么证明你已经安装成功了,感谢使用 Halo 进行创作,希望能够使用愉快。

相关链接

在使用过程中,有任何问题都可以通过以上链接找寻答案,或者联系我们。

这是一篇自动生成的文章,请删除这篇文章之后开始你的创作吧!

", - "content": "

Hello Halo

如果你看到了这一篇文章,那么证明你已经安装成功了,感谢使用 Halo 进行创作,希望能够使用愉快。

相关链接

在使用过程中,有任何问题都可以通过以上链接找寻答案,或者联系我们。

这是一篇自动生成的文章,请删除这篇文章之后开始你的创作吧!

", - "rawType": "HTML" - } -} diff --git a/ui/console-src/views/system/setup-data/singlePage.json b/ui/console-src/views/system/setup-data/singlePage.json deleted file mode 100644 index 3c605d8eb5..0000000000 --- a/ui/console-src/views/system/setup-data/singlePage.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "page": { - "spec": { - "title": "关于", - "slug": "about", - "template": "", - "cover": "", - "deleted": false, - "publish": false, - "publishTime": "", - "pinned": false, - "allowComment": true, - "visible": "PUBLIC", - "version": 1, - "priority": 0, - "excerpt": { - "autoGenerate": false, - "raw": "这是一个自定义页面,你可以在后台的 页面 -> 自定义页面 找到它,你可以用于新建关于页面、联系我们页面等等。" - }, - "htmlMetas": [] - }, - "apiVersion": "content.halo.run/v1alpha1", - "kind": "SinglePage", - "metadata": { "name": "373a5f79-f44f-441a-9df1-85a4f553ece8" } - }, - "content": { - "raw": "

关于页面

这是一个自定义页面,你可以在后台的 页面 -> 自定义页面 找到它,你可以用于新建关于页面、联系我们页面等等。

这是一篇自动生成的页面,你可以在后台删除它。

", - "content": "

关于页面

这是一个自定义页面,你可以在后台的 页面 -> 自定义页面 找到它,你可以用于新建关于页面、联系我们页面等等。

这是一篇自动生成的页面,你可以在后台删除它。

", - "rawType": "HTML" - } -} diff --git a/ui/console-src/views/system/setup-data/tag.json b/ui/console-src/views/system/setup-data/tag.json deleted file mode 100644 index c82a115616..0000000000 --- a/ui/console-src/views/system/setup-data/tag.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "spec": { - "displayName": "Halo", - "slug": "halo", - "color": "#ffffff", - "cover": "" - }, - "apiVersion": "content.halo.run/v1alpha1", - "kind": "Tag", - "metadata": { - "name": "c33ceabb-d8f1-4711-8991-bb8f5c92ad7c" - } -} diff --git a/ui/src/locales/en.yaml b/ui/src/locales/en.yaml index b56a699ba4..818ffc4da7 100644 --- a/ui/src/locales/en.yaml +++ b/ui/src/locales/en.yaml @@ -1426,25 +1426,6 @@ core: message: Unauthorized access to this page actions: home: Back to home - setup: - title: Setup - operations: - submit: - button: Setup - toast_success: Setup successfully - setup_initial_data: - loading: Initializing data, please wait... - fields: - site_title: - label: Site title - email: - label: Email - username: - label: Username - password: - label: Password - confirm_password: - label: Confirm password rbac: Attachments Management: Attachments Attachment Manage: Attachment Manage diff --git a/ui/src/locales/es.yaml b/ui/src/locales/es.yaml index b74a7dce1a..b849af5b2b 100644 --- a/ui/src/locales/es.yaml +++ b/ui/src/locales/es.yaml @@ -1104,25 +1104,6 @@ core: message: Acceso no autorizado a esta página actions: home: Ir a la página de inicio - setup: - title: Configuración - operations: - submit: - button: Configurar - toast_success: Configuración exitosa - setup_initial_data: - loading: Inicializando datos, por favor espera... - fields: - site_title: - label: Título del Sitio - email: - label: Correo Electrónico - username: - label: Nombre de Usuario - password: - label: Contraseña - confirm_password: - label: Confirmar Contraseña rbac: Attachments Management: Gestión de archivos adjuntos Attachment Manage: Gestor de adjuntos diff --git a/ui/src/locales/zh-CN.yaml b/ui/src/locales/zh-CN.yaml index ab84cece98..ec9016d7c0 100644 --- a/ui/src/locales/zh-CN.yaml +++ b/ui/src/locales/zh-CN.yaml @@ -1322,25 +1322,6 @@ core: message: 没有权限访问此页面 actions: home: 返回首页 - setup: - title: 系统初始化 - operations: - submit: - button: 初始化 - toast_success: 初始化成功 - setup_initial_data: - loading: 正在初始化数据,请稍后... - fields: - site_title: - label: 站点名称 - email: - label: 邮箱 - username: - label: 用户名 - password: - label: 密码 - confirm_password: - label: 确认密码 rbac: Attachments Management: 附件 Attachment Manage: 附件管理 diff --git a/ui/src/locales/zh-TW.yaml b/ui/src/locales/zh-TW.yaml index 45b8cafa9b..acd1410488 100644 --- a/ui/src/locales/zh-TW.yaml +++ b/ui/src/locales/zh-TW.yaml @@ -1301,25 +1301,6 @@ core: message: 沒有權限訪問此頁面 actions: home: 返回首頁 - setup: - title: 系統初始化 - operations: - submit: - button: 初始化 - toast_success: 初始化成功 - setup_initial_data: - loading: 正在初始化資料,請稍後... - fields: - site_title: - label: 站點名稱 - email: - label: 電子郵箱 - username: - label: 用戶名 - password: - label: 密碼 - confirm_password: - label: 確認密碼 rbac: Attachments Management: 附件 Attachment Manage: 附件管理