From 8a53033cac585e819af08245abc6d2bdec6efbf7 Mon Sep 17 00:00:00 2001 From: Rewrite0 <49576640+Rewrite0@users.noreply.github.com> Date: Mon, 24 Apr 2023 23:07:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +- pnpm-lock.yaml | 54 +++------------ src/api/config.ts | 5 ++ src/api/program.ts | 4 ++ src/auto-imports.d.ts | 1 + src/hooks/useDialog.ts | 1 + src/main.ts | 4 ++ src/pages/YLayout.vue | 23 ++----- src/pages/YMenu.vue | 71 +++++++++----------- src/pages/bangumi/components/AddBangumi.vue | 1 - src/pages/bangumi/components/BangumiData.vue | 1 - src/pages/bangumi/index.vue | 10 ++- src/pages/config/index.vue | 24 ++++++- src/pages/debug/index.vue | 29 +++++++- src/pages/journal/index.vue | 20 +----- src/store/config.ts | 55 +++++++++++++++ vite.config.ts | 1 + 17 files changed, 179 insertions(+), 128 deletions(-) create mode 100644 src/api/config.ts create mode 100644 src/api/program.ts create mode 100644 src/hooks/useDialog.ts create mode 100644 src/store/config.ts diff --git a/package.json b/package.json index 5d80f8de..b081d999 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,10 @@ }, "devDependencies": { "@antfu/eslint-config": "^0.38.5", + "@iconify-json/carbon": "^1.1.16", "@types/node": "^18.16.0", "@unocss/preset-rem-to-px": "^0.51.8", "@unocss/reset": "^0.51.8", - "@vicons/carbon": "^0.12.0", - "@vicons/utils": "^0.1.4", "@vitejs/plugin-vue": "^3.2.0", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9dfac868..a9fc5fd8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,9 @@ devDependencies: '@antfu/eslint-config': specifier: ^0.38.5 version: 0.38.5(eslint@8.39.0)(typescript@4.9.5) + '@iconify-json/carbon': + specifier: ^1.1.16 + version: 1.1.16 '@types/node': specifier: ^18.16.0 version: 18.16.0 @@ -36,12 +39,6 @@ devDependencies: '@unocss/reset': specifier: ^0.51.8 version: 0.51.8 - '@vicons/carbon': - specifier: ^0.12.0 - version: 0.12.0 - '@vicons/utils': - specifier: ^0.1.4 - version: 0.1.4(vue@3.2.47) '@vitejs/plugin-vue': specifier: ^3.2.0 version: 3.2.0(vite@3.2.6)(vue@3.2.47) @@ -249,10 +246,6 @@ packages: vue: 3.2.47 dev: false - /@emotion/hash@0.8.0: - resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==} - dev: true - /@esbuild/android-arm@0.15.18: resolution: {integrity: sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==} engines: {node: '>=12'} @@ -338,6 +331,12 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true + /@iconify-json/carbon@1.1.16: + resolution: {integrity: sha512-AD8bcnRSGA0WfcGEass2FbA0sagrUzrpFx5WchuDy3uf7yKBWumdypdQK121DH321fQDl5+zZQ26T6gC9knwUQ==} + dependencies: + '@iconify/types': 2.0.0 + dev: true + /@iconify/types@2.0.0: resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} dev: true @@ -468,10 +467,6 @@ packages: '@types/unist': 2.0.6 dev: true - /@types/node@14.14.45: - resolution: {integrity: sha512-DssMqTV9UnnoxDWu959sDLZzfvqCF0qDNRjaWeYSui9xkFe61kKo4l1TWNTQONpuXEm+gLMRvdlzvNHBamzmEw==} - dev: true - /@types/node@18.16.0: resolution: {integrity: sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ==} dev: true @@ -820,19 +815,6 @@ packages: - rollup dev: true - /@vicons/carbon@0.12.0: - resolution: {integrity: sha512-kCOgr/ZOhZzoiFLJ8pwxMa2TMxrkCUOA22qExPabus35F4+USqzcsxaPoYtqRd9ROOYiHrSqwapak/ywF0D9bg==} - dev: true - - /@vicons/utils@0.1.4(vue@3.2.47): - resolution: {integrity: sha512-OHI19qVNN6i+uPQ+Y3f2s0dUxwsYnOCcKBW7XOU4yXXO1aU3ZoKpblCc3+4N0qmgoJs5rWKRAaMisipqEXJwAg==} - peerDependencies: - vue: ^3.0.6 - dependencies: - '@xicons/utils': 0.1.4 - vue: 3.2.47 - dev: true - /@vitejs/plugin-vue@3.2.0(vite@3.2.6)(vue@3.2.47): resolution: {integrity: sha512-E0tnaL4fr+qkdCNxJ+Xd0yM31UwMkQje76fsDVBBUCoGOUPexu2VDUYHL8P4CwV+zMvWw6nlRw19OnRKmYAJpw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -1010,12 +992,6 @@ packages: - vue dev: false - /@xicons/utils@0.1.4: - resolution: {integrity: sha512-uXxKDLz9abr80yJC05XSTq6wlyFcdW+N/1IYJkeHjzzXVc4VQ0sEYMoMMTjAH7HQBOyOkzOB4pf5NGF72lwa8Q==} - dependencies: - css-render: 0.13.9 - dev: true - /acorn-jsx@5.3.2(acorn@8.8.2): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -1301,14 +1277,6 @@ packages: which: 2.0.2 dev: true - /css-render@0.13.9: - resolution: {integrity: sha512-n3C4ZH59rveBrUlAD7n0Ze9/gUMKa4dlH1C9CWKpGcIHR/xRcIVXzBGy1iw8WWq2ySmn2/ZqOpySQNAK5Pb6sw==} - dependencies: - '@emotion/hash': 0.8.0 - '@types/node': 14.14.45 - csstype: 3.0.11 - dev: true - /css-tree@2.3.1: resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} @@ -1326,10 +1294,6 @@ packages: /csstype@2.6.21: resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==} - /csstype@3.0.11: - resolution: {integrity: sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==} - dev: true - /dayjs@1.11.7: resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==} dev: false diff --git a/src/api/config.ts b/src/api/config.ts new file mode 100644 index 00000000..9b144bbd --- /dev/null +++ b/src/api/config.ts @@ -0,0 +1,5 @@ +import axios from 'axios'; + +export const setConfig = () => axios.post('/api/v1/updateConfig'); + +export const getConfig = () => axios.post('/api/v1/getConfig'); diff --git a/src/api/program.ts b/src/api/program.ts new file mode 100644 index 00000000..7f57d0cb --- /dev/null +++ b/src/api/program.ts @@ -0,0 +1,4 @@ +import axios from 'axios'; + +/** 重启 */ +export const appRestart = () => axios.get('/api/v1/restart'); diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 7566552c..661057ea 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -3,6 +3,7 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] const computed: typeof import('vue')['computed'] + const configStore: typeof import('./store/config')['configStore'] const createApp: typeof import('vue')['createApp'] const customRef: typeof import('vue')['customRef'] const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] diff --git a/src/hooks/useDialog.ts b/src/hooks/useDialog.ts new file mode 100644 index 00000000..15bae10b --- /dev/null +++ b/src/hooks/useDialog.ts @@ -0,0 +1 @@ +export function useDialog() {} diff --git a/src/main.ts b/src/main.ts index c3631712..9bbf5b68 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,12 +1,16 @@ import { createApp } from 'vue'; import { Icon } from '@vicons/utils'; +import { createPinia } from 'pinia'; import router from './router'; import App from './App.vue'; import '@unocss/reset/tailwind-compat.css'; import 'virtual:uno.css'; +const pinia = createPinia(); + const app = createApp(App); app.component('Icon', Icon); app.use(router); +app.use(pinia); app.mount('#app'); diff --git a/src/pages/YLayout.vue b/src/pages/YLayout.vue index 2836243c..40479643 100644 --- a/src/pages/YLayout.vue +++ b/src/pages/YLayout.vue @@ -1,15 +1,15 @@ -