From 49f924c8d5f37ab47b2c8b28296db0337c255fe3 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Thu, 5 Jun 2025 12:50:52 +0800 Subject: [PATCH] vuetify stuff --- next-ui/.prettierrc.json | 8 + next-ui/dir2json.d.ts | 8 +- next-ui/eslint.config.js | 25 +- next-ui/index.html | 31 +- next-ui/package-lock.json | 132 +- next-ui/package.json | 10 +- next-ui/src/App.vue | 10 +- next-ui/src/api/komga-client.ts | 33 +- next-ui/src/auto-imports.d.ts | 261 +- next-ui/src/colada/mutations/logout.ts | 9 +- .../mutations/mark-announcements-read.ts | 8 +- next-ui/src/colada/mutations/update-user.ts | 20 +- next-ui/src/colada/queries/actuator-info.ts | 16 +- next-ui/src/colada/queries/announcements.ts | 21 +- next-ui/src/colada/queries/app-releases.ts | 22 +- next-ui/src/colada/queries/current-user.ts | 18 +- next-ui/src/colada/queries/libraries.ts | 12 +- next-ui/src/colada/queries/referential.ts | 12 +- next-ui/src/colada/queries/users.ts | 12 +- next-ui/src/components.d.ts | 2 - next-ui/src/components/AppFooter.vue | 50 +- next-ui/src/components/BuildCommit.vue | 4 +- next-ui/src/components/BuildVersion.vue | 4 +- next-ui/src/components/HelloWorld.vue | 18 +- next-ui/src/components/LocaleSelector.vue | 23 +- next-ui/src/components/LoginForm.vue | 113 - next-ui/src/components/README.md | 16 +- next-ui/src/components/ThemeSelector.vue | 21 +- next-ui/src/components/app/bar/AppBar.vue | 9 +- .../src/components/app/drawer/AppDrawer.vue | 6 +- .../components/app/drawer/AppDrawerFooter.vue | 18 +- .../components/app/drawer/AppDrawerMenu.vue | 4 +- .../app/drawer/AppDrawerMenuAccount.vue | 70 +- .../app/drawer/AppDrawerMenuHistory.vue | 12 +- .../app/drawer/AppDrawerMenuImport.vue | 36 +- .../app/drawer/AppDrawerMenuLogout.vue | 16 +- .../app/drawer/AppDrawerMenuMedia.vue | 88 +- .../app/drawer/AppDrawerMenuServer.vue | 88 +- .../src/components/dialogs/DialogConfirm.vue | 36 +- .../components/dialogs/DialogConfirmEdit.vue | 38 +- .../forms/user/FormUserChangePassword.vue | 41 +- .../components/forms/user/FormUserEdit.vue | 176 +- next-ui/src/generated/openapi/komga.d.ts | 18969 ++++++++-------- next-ui/src/layouts/default.vue | 4 +- next-ui/src/layouts/single.vue | 2 +- next-ui/src/main.ts | 4 +- next-ui/src/pages/account/activity.vue | 2 +- next-ui/src/pages/account/api-keys.vue | 2 +- next-ui/src/pages/account/details.vue | 2 +- next-ui/src/pages/account/ui.vue | 2 +- next-ui/src/pages/history.vue | 2 +- next-ui/src/pages/import/books.vue | 2 +- next-ui/src/pages/import/readlist.vue | 2 +- next-ui/src/pages/index.vue | 2 +- next-ui/src/pages/login.vue | 145 +- next-ui/src/pages/media/analysis.vue | 2 +- next-ui/src/pages/media/duplicate-files.vue | 2 +- .../src/pages/media/duplicate-pages/known.vue | 2 +- .../pages/media/duplicate-pages/unknown.vue | 2 +- next-ui/src/pages/media/missing-posters.vue | 2 +- next-ui/src/pages/server/announcements.vue | 105 +- next-ui/src/pages/server/metrics.vue | 2 +- next-ui/src/pages/server/settings.vue | 2 +- next-ui/src/pages/server/ui.vue | 2 +- next-ui/src/pages/server/updates.vue | 60 +- next-ui/src/pages/server/users.vue | 125 +- next-ui/src/pages/startup.vue | 12 +- next-ui/src/plugins/index.ts | 16 +- next-ui/src/plugins/vue-intl.ts | 6 +- next-ui/src/plugins/vuetify.ts | 36 +- next-ui/src/router/index.ts | 6 +- next-ui/src/router/login-guard.ts | 12 +- next-ui/src/router/role-guard.ts | 10 +- next-ui/src/stores/app.ts | 4 +- next-ui/src/styles/global.scss | 2 +- next-ui/src/styles/settings.scss | 1 - next-ui/src/types/Actuator.ts | 14 +- next-ui/src/types/RouterMeta.d.ts | 2 +- next-ui/src/types/UserRoles.ts | 2 +- next-ui/src/utils/common-messages.ts | 14 - next-ui/src/utils/i18n/common-messages.ts | 14 + next-ui/src/utils/{ => i18n}/locale-helper.ts | 19 +- next-ui/src/utils/utils.ts | 1 + next-ui/tsconfig.app.json | 23 +- 84 files changed, 10846 insertions(+), 10351 deletions(-) create mode 100644 next-ui/.prettierrc.json delete mode 100644 next-ui/src/components/LoginForm.vue delete mode 100644 next-ui/src/utils/common-messages.ts create mode 100644 next-ui/src/utils/i18n/common-messages.ts rename next-ui/src/utils/{ => i18n}/locale-helper.ts (77%) create mode 100644 next-ui/src/utils/utils.ts diff --git a/next-ui/.prettierrc.json b/next-ui/.prettierrc.json new file mode 100644 index 000000000..e56a16218 --- /dev/null +++ b/next-ui/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "singleQuote": true, + "printWidth": 100, + "trailingComma": "all", + "semi": false, + "singleAttributePerLine": true +} diff --git a/next-ui/dir2json.d.ts b/next-ui/dir2json.d.ts index 62b995213..952f99656 100644 --- a/next-ui/dir2json.d.ts +++ b/next-ui/dir2json.d.ts @@ -8,7 +8,7 @@ declare module "*i18n?dir2json&ext=.json&1" { export default json; } -declare module "*dir2json" { - const json: any; - export default json; -} \ No newline at end of file +declare module '*dir2json' { + const json: any + export default json +} diff --git a/next-ui/eslint.config.js b/next-ui/eslint.config.js index 49601a7a6..43a8a31ca 100644 --- a/next-ui/eslint.config.js +++ b/next-ui/eslint.config.js @@ -5,8 +5,9 @@ */ import pluginVue from 'eslint-plugin-vue' -import {defineConfigWithVueTs, vueTsConfigs} from '@vue/eslint-config-typescript' +import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' import formatjs from 'eslint-plugin-formatjs' +import eslintConfigPrettier from 'eslint-config-prettier' export default defineConfigWithVueTs( { @@ -16,14 +17,21 @@ export default defineConfigWithVueTs( { name: 'app/files-to-ignore', - ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', 'openapi-generator.mts'], + ignores: [ + '**/dist/**', + '**/dist-ssr/**', + '**/coverage/**', + 'openapi-generator.mts', + '**/generated/openapi/komga.d.ts', + ], }, - ...pluginVue.configs['flat/recommended'], + ...pluginVue.configs['flat/essential'], vueTsConfigs.recommendedTypeChecked, { rules: { + 'prefer-promise-reject-errors': 'off', '@typescript-eslint/no-unused-expressions': [ 'error', { @@ -31,8 +39,13 @@ export default defineConfigWithVueTs( allowTernary: true, }, ], + '@typescript-eslint/no-unused-vars': [ + 'error', + { caughtErrors: 'all', caughtErrorsIgnorePattern: '^ignore' }, + ], + 'no-empty': ['error', { allowEmptyCatch: true }], 'vue/multi-word-component-names': 'off', - } + }, }, formatjs.configs.recommended, @@ -46,9 +59,11 @@ export default defineConfigWithVueTs( 'error', { idInterpolationPattern: '[sha512:contenthash:base64:6]', - idWhitelist: ['app.*'] + idWhitelist: ['app.*'], }, ], }, }, + + eslintConfigPrettier, ) diff --git a/next-ui/index.html b/next-ui/index.html index 8abc79c03..e8ef89efc 100644 --- a/next-ui/index.html +++ b/next-ui/index.html @@ -1,13 +1,22 @@ - + - - - - - Welcome to Vuetify 3 - - -
- - + + + + + Welcome to Vuetify 3 + + +
+ + diff --git a/next-ui/package-lock.json b/next-ui/package-lock.json index 17aca35fb..a11b5e387 100644 --- a/next-ui/package-lock.json +++ b/next-ui/package-lock.json @@ -14,6 +14,7 @@ "core-js": "^3.37.1", "marked": "^15.0.12", "openapi-fetch": "^0.14.0", + "pinia": "^3.0.2", "pinia-plugin-persistedstate": "^4.3.0", "vue": "^3.5.14", "vue-intl": "^6.5.25", @@ -26,14 +27,16 @@ "@tsconfig/node22": "^22.0.2", "@types/node": "^22.15.21", "@vitejs/plugin-vue": "^5.1.4", + "@vue/eslint-config-prettier": "^10.2.0", "@vue/eslint-config-typescript": "^14.1.3", "@vue/tsconfig": "^0.7.0", "eslint": "^9.27.0", + "eslint-config-prettier": "^10.1.5", "eslint-plugin-formatjs": "^5.3.1", "eslint-plugin-vue": "^10.1.0", "npm-run-all2": "^8.0.3", "openapi-typescript": "^7.8.0", - "pinia": "^3.0.2", + "prettier": "^3.5.3", "sass": "^1.89.0", "sass-embedded": "^1.89.0", "typescript": "^5.8.3", @@ -1384,6 +1387,19 @@ "@pinia/colada": ">=0.16.0" } }, + "node_modules/@pkgr/core": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.7.tgz", + "integrity": "sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, "node_modules/@redocly/ajv": { "version": "8.11.2", "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.2.tgz", @@ -2140,6 +2156,21 @@ "rfdc": "^1.4.1" } }, + "node_modules/@vue/eslint-config-prettier": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-10.2.0.tgz", + "integrity": "sha512-GL3YBLwv/+b86yHcNNfPJxOTtVFJ4Mbc9UU3zR+KVoG7SwGTjPT+32fXamscNumElhcpXW3mT0DgzS9w32S7Bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-config-prettier": "^10.0.1", + "eslint-plugin-prettier": "^5.2.2" + }, + "peerDependencies": { + "eslint": ">= 8.21.0", + "prettier": ">= 3.0.0" + } + }, "node_modules/@vue/eslint-config-typescript": { "version": "14.5.0", "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-14.5.0.tgz", @@ -3110,6 +3141,22 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", + "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-plugin-formatjs": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/eslint-plugin-formatjs/-/eslint-plugin-formatjs-5.3.1.tgz", @@ -3131,6 +3178,37 @@ "eslint": "^9.23.0" } }, + "node_modules/eslint-plugin-prettier": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz", + "integrity": "sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.11.7" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-vue": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-10.1.0.tgz", @@ -3316,6 +3394,13 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", @@ -4639,6 +4724,35 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -5439,6 +5553,22 @@ "node": ">=16.0.0" } }, + "node_modules/synckit": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.8.tgz", + "integrity": "sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.4" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, "node_modules/tinyexec": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", diff --git a/next-ui/package.json b/next-ui/package.json index e6bc5ae11..d4944a5da 100644 --- a/next-ui/package.json +++ b/next-ui/package.json @@ -9,7 +9,10 @@ "preview": "vite preview", "build-only": "vite build", "type-check": "vue-tsc --build --force", - "lint": "eslint . --fix", + "lint": "eslint .", + "lint:fix": "npm run lint -- --fix", + "prettier": "prettier --check \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore", + "prettier:fix": "npm run prettier -- --write", "openapi-generate": "npx tsx ./openapi-generator.mts", "i18n-extract": "formatjs extract \"src/**/*.{ts,tsx,vue}\" --ignore=\"**/*.d.ts\" --out-file i18n/en.json", "i18n-compile": "formatjs compile-folder i18n src/i18n", @@ -22,6 +25,7 @@ "core-js": "^3.37.1", "marked": "^15.0.12", "openapi-fetch": "^0.14.0", + "pinia": "^3.0.2", "pinia-plugin-persistedstate": "^4.3.0", "vue": "^3.5.14", "vue-intl": "^6.5.25", @@ -34,14 +38,16 @@ "@tsconfig/node22": "^22.0.2", "@types/node": "^22.15.21", "@vitejs/plugin-vue": "^5.1.4", + "@vue/eslint-config-prettier": "^10.2.0", "@vue/eslint-config-typescript": "^14.1.3", "@vue/tsconfig": "^0.7.0", "eslint": "^9.27.0", + "eslint-config-prettier": "^10.1.5", "eslint-plugin-formatjs": "^5.3.1", "eslint-plugin-vue": "^10.1.0", "npm-run-all2": "^8.0.3", "openapi-typescript": "^7.8.0", - "pinia": "^3.0.2", + "prettier": "^3.5.3", "sass": "^1.89.0", "sass-embedded": "^1.89.0", "typescript": "^5.8.3", diff --git a/next-ui/src/App.vue b/next-ui/src/App.vue index 6e9dab958..f803f41a4 100644 --- a/next-ui/src/App.vue +++ b/next-ui/src/App.vue @@ -6,7 +6,7 @@ diff --git a/next-ui/src/api/komga-client.ts b/next-ui/src/api/komga-client.ts index 0f9d76b64..4de9d9c86 100644 --- a/next-ui/src/api/komga-client.ts +++ b/next-ui/src/api/komga-client.ts @@ -1,17 +1,32 @@ -import type {Middleware} from 'openapi-fetch' +import type { Middleware } from 'openapi-fetch' import createClient from 'openapi-fetch' -import type {paths} from '@/generated/openapi/komga' +import type { paths } from '@/generated/openapi/komga' // Middleware that throws on error, so it works with Pinia Colada const coladaMiddleware: Middleware = { - async onResponse({response}: { response: Response }) { + async onResponse({ response }: { response: Response }) { if (!response.ok) { - const body = await response.json() - throw new Error(`${response.url}: ${response.status} ${response.statusText}`, {cause: body}) + let body: unknown + try { + body = await response.json() + } catch (ignoreErr) {} + throw new Error(`${response.url}: ${response.status} ${response.statusText}`, { + cause: { + body: body, + status: response.status, + }, + }) } // return response untouched return undefined }, + onError() { + throw new Error('error', { + cause: { + message: 'Server is unreachable', + }, + }) + }, } const client = createClient({ @@ -19,8 +34,14 @@ const client = createClient({ // required to pass the session cookie on all requests credentials: 'include', // required to avoid browser basic-auth popups - headers: {'X-Requested-With': 'XMLHttpRequest'}, + headers: { 'X-Requested-With': 'XMLHttpRequest' }, }) client.use(coladaMiddleware) +export interface ErrorCause { + body?: unknown + status?: number + message?: string +} + export const komgaClient = client diff --git a/next-ui/src/auto-imports.d.ts b/next-ui/src/auto-imports.d.ts index 4bd7d7e1a..3e3542f04 100644 --- a/next-ui/src/auto-imports.d.ts +++ b/next-ui/src/auto-imports.d.ts @@ -1,77 +1,94 @@ /* eslint-disable */ -/* prettier-ignore */ +// prettier-ignore // @ts-nocheck // noinspection JSUnusedGlobalSymbols // Generated by unplugin-auto-import // biome-ignore lint: disable export {} declare global { - const EffectScope: typeof import('vue')['EffectScope'] - const computed: typeof import('vue')['computed'] - const createApp: typeof import('vue')['createApp'] - const customRef: typeof import('vue')['customRef'] - const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] - const defineComponent: typeof import('vue')['defineComponent'] - const effectScope: typeof import('vue')['effectScope'] - const getCurrentInstance: typeof import('vue')['getCurrentInstance'] - const getCurrentScope: typeof import('vue')['getCurrentScope'] - const h: typeof import('vue')['h'] - const inject: typeof import('vue')['inject'] - const isProxy: typeof import('vue')['isProxy'] - const isReactive: typeof import('vue')['isReactive'] - const isReadonly: typeof import('vue')['isReadonly'] - const isRef: typeof import('vue')['isRef'] - const markRaw: typeof import('vue')['markRaw'] - const nextTick: typeof import('vue')['nextTick'] - const onActivated: typeof import('vue')['onActivated'] - const onBeforeMount: typeof import('vue')['onBeforeMount'] - const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] - const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] - const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] - const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] - const onDeactivated: typeof import('vue')['onDeactivated'] - const onErrorCaptured: typeof import('vue')['onErrorCaptured'] - const onMounted: typeof import('vue')['onMounted'] - const onRenderTracked: typeof import('vue')['onRenderTracked'] - const onRenderTriggered: typeof import('vue')['onRenderTriggered'] - const onScopeDispose: typeof import('vue')['onScopeDispose'] - const onServerPrefetch: typeof import('vue')['onServerPrefetch'] - const onUnmounted: typeof import('vue')['onUnmounted'] - const onUpdated: typeof import('vue')['onUpdated'] - const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] - const provide: typeof import('vue')['provide'] - const reactive: typeof import('vue')['reactive'] - const readonly: typeof import('vue')['readonly'] - const ref: typeof import('vue')['ref'] - const resolveComponent: typeof import('vue')['resolveComponent'] - const shallowReactive: typeof import('vue')['shallowReactive'] - const shallowReadonly: typeof import('vue')['shallowReadonly'] - const shallowRef: typeof import('vue')['shallowRef'] - const toRaw: typeof import('vue')['toRaw'] - const toRef: typeof import('vue')['toRef'] - const toRefs: typeof import('vue')['toRefs'] - const toValue: typeof import('vue')['toValue'] - const triggerRef: typeof import('vue')['triggerRef'] - const unref: typeof import('vue')['unref'] - const useAttrs: typeof import('vue')['useAttrs'] - const useCssModule: typeof import('vue')['useCssModule'] - const useCssVars: typeof import('vue')['useCssVars'] - const useId: typeof import('vue')['useId'] - const useLink: typeof import('vue-router')['useLink'] - const useModel: typeof import('vue')['useModel'] - const useRoute: typeof import('vue-router/auto')['useRoute'] - const useRouter: typeof import('vue-router/auto')['useRouter'] - const useSlots: typeof import('vue')['useSlots'] - const useTemplateRef: typeof import('vue')['useTemplateRef'] - const watch: typeof import('vue')['watch'] - const watchEffect: typeof import('vue')['watchEffect'] - const watchPostEffect: typeof import('vue')['watchPostEffect'] - const watchSyncEffect: typeof import('vue')['watchSyncEffect'] + const EffectScope: (typeof import('vue'))['EffectScope'] + const computed: (typeof import('vue'))['computed'] + const createApp: (typeof import('vue'))['createApp'] + const customRef: (typeof import('vue'))['customRef'] + const defineAsyncComponent: (typeof import('vue'))['defineAsyncComponent'] + const defineComponent: (typeof import('vue'))['defineComponent'] + const effectScope: (typeof import('vue'))['effectScope'] + const getCurrentInstance: (typeof import('vue'))['getCurrentInstance'] + const getCurrentScope: (typeof import('vue'))['getCurrentScope'] + const h: (typeof import('vue'))['h'] + const inject: (typeof import('vue'))['inject'] + const isProxy: (typeof import('vue'))['isProxy'] + const isReactive: (typeof import('vue'))['isReactive'] + const isReadonly: (typeof import('vue'))['isReadonly'] + const isRef: (typeof import('vue'))['isRef'] + const markRaw: (typeof import('vue'))['markRaw'] + const nextTick: (typeof import('vue'))['nextTick'] + const onActivated: (typeof import('vue'))['onActivated'] + const onBeforeMount: (typeof import('vue'))['onBeforeMount'] + const onBeforeRouteLeave: (typeof import('vue-router'))['onBeforeRouteLeave'] + const onBeforeRouteUpdate: (typeof import('vue-router'))['onBeforeRouteUpdate'] + const onBeforeUnmount: (typeof import('vue'))['onBeforeUnmount'] + const onBeforeUpdate: (typeof import('vue'))['onBeforeUpdate'] + const onDeactivated: (typeof import('vue'))['onDeactivated'] + const onErrorCaptured: (typeof import('vue'))['onErrorCaptured'] + const onMounted: (typeof import('vue'))['onMounted'] + const onRenderTracked: (typeof import('vue'))['onRenderTracked'] + const onRenderTriggered: (typeof import('vue'))['onRenderTriggered'] + const onScopeDispose: (typeof import('vue'))['onScopeDispose'] + const onServerPrefetch: (typeof import('vue'))['onServerPrefetch'] + const onUnmounted: (typeof import('vue'))['onUnmounted'] + const onUpdated: (typeof import('vue'))['onUpdated'] + const onWatcherCleanup: (typeof import('vue'))['onWatcherCleanup'] + const provide: (typeof import('vue'))['provide'] + const reactive: (typeof import('vue'))['reactive'] + const readonly: (typeof import('vue'))['readonly'] + const ref: (typeof import('vue'))['ref'] + const resolveComponent: (typeof import('vue'))['resolveComponent'] + const shallowReactive: (typeof import('vue'))['shallowReactive'] + const shallowReadonly: (typeof import('vue'))['shallowReadonly'] + const shallowRef: (typeof import('vue'))['shallowRef'] + const toRaw: (typeof import('vue'))['toRaw'] + const toRef: (typeof import('vue'))['toRef'] + const toRefs: (typeof import('vue'))['toRefs'] + const toValue: (typeof import('vue'))['toValue'] + const triggerRef: (typeof import('vue'))['triggerRef'] + const unref: (typeof import('vue'))['unref'] + const useAttrs: (typeof import('vue'))['useAttrs'] + const useCssModule: (typeof import('vue'))['useCssModule'] + const useCssVars: (typeof import('vue'))['useCssVars'] + const useId: (typeof import('vue'))['useId'] + const useLink: (typeof import('vue-router'))['useLink'] + const useModel: (typeof import('vue'))['useModel'] + const useRoute: (typeof import('vue-router/auto'))['useRoute'] + const useRouter: (typeof import('vue-router/auto'))['useRouter'] + const useSlots: (typeof import('vue'))['useSlots'] + const useTemplateRef: (typeof import('vue'))['useTemplateRef'] + const watch: (typeof import('vue'))['watch'] + const watchEffect: (typeof import('vue'))['watchEffect'] + const watchPostEffect: (typeof import('vue'))['watchPostEffect'] + const watchSyncEffect: (typeof import('vue'))['watchSyncEffect'] } // for type re-export declare global { // @ts-ignore - export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + export type { + Component, + Slot, + Slots, + ComponentPublicInstance, + ComputedRef, + DirectiveBinding, + ExtractDefaultPropTypes, + ExtractPropTypes, + ExtractPublicPropTypes, + InjectionKey, + PropType, + Ref, + MaybeRef, + MaybeRefOrGetter, + VNode, + WritableComputedRef, + } from 'vue' import('vue') } @@ -80,63 +97,63 @@ import { UnwrapRef } from 'vue' declare module 'vue' { interface GlobalComponents {} interface ComponentCustomProperties { - readonly EffectScope: UnwrapRef - readonly computed: UnwrapRef - readonly createApp: UnwrapRef - readonly customRef: UnwrapRef - readonly defineAsyncComponent: UnwrapRef - readonly defineComponent: UnwrapRef - readonly effectScope: UnwrapRef - readonly getCurrentInstance: UnwrapRef - readonly getCurrentScope: UnwrapRef - readonly h: UnwrapRef - readonly inject: UnwrapRef - readonly isProxy: UnwrapRef - readonly isReactive: UnwrapRef - readonly isReadonly: UnwrapRef - readonly isRef: UnwrapRef - readonly markRaw: UnwrapRef - readonly nextTick: UnwrapRef - readonly onActivated: UnwrapRef - readonly onBeforeMount: UnwrapRef - readonly onBeforeUnmount: UnwrapRef - readonly onBeforeUpdate: UnwrapRef - readonly onDeactivated: UnwrapRef - readonly onErrorCaptured: UnwrapRef - readonly onMounted: UnwrapRef - readonly onRenderTracked: UnwrapRef - readonly onRenderTriggered: UnwrapRef - readonly onScopeDispose: UnwrapRef - readonly onServerPrefetch: UnwrapRef - readonly onUnmounted: UnwrapRef - readonly onUpdated: UnwrapRef - readonly onWatcherCleanup: UnwrapRef - readonly provide: UnwrapRef - readonly reactive: UnwrapRef - readonly readonly: UnwrapRef - readonly ref: UnwrapRef - readonly resolveComponent: UnwrapRef - readonly shallowReactive: UnwrapRef - readonly shallowReadonly: UnwrapRef - readonly shallowRef: UnwrapRef - readonly toRaw: UnwrapRef - readonly toRef: UnwrapRef - readonly toRefs: UnwrapRef - readonly toValue: UnwrapRef - readonly triggerRef: UnwrapRef - readonly unref: UnwrapRef - readonly useAttrs: UnwrapRef - readonly useCssModule: UnwrapRef - readonly useCssVars: UnwrapRef - readonly useId: UnwrapRef - readonly useModel: UnwrapRef - readonly useRoute: UnwrapRef - readonly useRouter: UnwrapRef - readonly useSlots: UnwrapRef - readonly useTemplateRef: UnwrapRef - readonly watch: UnwrapRef - readonly watchEffect: UnwrapRef - readonly watchPostEffect: UnwrapRef - readonly watchSyncEffect: UnwrapRef + readonly EffectScope: UnwrapRef<(typeof import('vue'))['EffectScope']> + readonly computed: UnwrapRef<(typeof import('vue'))['computed']> + readonly createApp: UnwrapRef<(typeof import('vue'))['createApp']> + readonly customRef: UnwrapRef<(typeof import('vue'))['customRef']> + readonly defineAsyncComponent: UnwrapRef<(typeof import('vue'))['defineAsyncComponent']> + readonly defineComponent: UnwrapRef<(typeof import('vue'))['defineComponent']> + readonly effectScope: UnwrapRef<(typeof import('vue'))['effectScope']> + readonly getCurrentInstance: UnwrapRef<(typeof import('vue'))['getCurrentInstance']> + readonly getCurrentScope: UnwrapRef<(typeof import('vue'))['getCurrentScope']> + readonly h: UnwrapRef<(typeof import('vue'))['h']> + readonly inject: UnwrapRef<(typeof import('vue'))['inject']> + readonly isProxy: UnwrapRef<(typeof import('vue'))['isProxy']> + readonly isReactive: UnwrapRef<(typeof import('vue'))['isReactive']> + readonly isReadonly: UnwrapRef<(typeof import('vue'))['isReadonly']> + readonly isRef: UnwrapRef<(typeof import('vue'))['isRef']> + readonly markRaw: UnwrapRef<(typeof import('vue'))['markRaw']> + readonly nextTick: UnwrapRef<(typeof import('vue'))['nextTick']> + readonly onActivated: UnwrapRef<(typeof import('vue'))['onActivated']> + readonly onBeforeMount: UnwrapRef<(typeof import('vue'))['onBeforeMount']> + readonly onBeforeUnmount: UnwrapRef<(typeof import('vue'))['onBeforeUnmount']> + readonly onBeforeUpdate: UnwrapRef<(typeof import('vue'))['onBeforeUpdate']> + readonly onDeactivated: UnwrapRef<(typeof import('vue'))['onDeactivated']> + readonly onErrorCaptured: UnwrapRef<(typeof import('vue'))['onErrorCaptured']> + readonly onMounted: UnwrapRef<(typeof import('vue'))['onMounted']> + readonly onRenderTracked: UnwrapRef<(typeof import('vue'))['onRenderTracked']> + readonly onRenderTriggered: UnwrapRef<(typeof import('vue'))['onRenderTriggered']> + readonly onScopeDispose: UnwrapRef<(typeof import('vue'))['onScopeDispose']> + readonly onServerPrefetch: UnwrapRef<(typeof import('vue'))['onServerPrefetch']> + readonly onUnmounted: UnwrapRef<(typeof import('vue'))['onUnmounted']> + readonly onUpdated: UnwrapRef<(typeof import('vue'))['onUpdated']> + readonly onWatcherCleanup: UnwrapRef<(typeof import('vue'))['onWatcherCleanup']> + readonly provide: UnwrapRef<(typeof import('vue'))['provide']> + readonly reactive: UnwrapRef<(typeof import('vue'))['reactive']> + readonly readonly: UnwrapRef<(typeof import('vue'))['readonly']> + readonly ref: UnwrapRef<(typeof import('vue'))['ref']> + readonly resolveComponent: UnwrapRef<(typeof import('vue'))['resolveComponent']> + readonly shallowReactive: UnwrapRef<(typeof import('vue'))['shallowReactive']> + readonly shallowReadonly: UnwrapRef<(typeof import('vue'))['shallowReadonly']> + readonly shallowRef: UnwrapRef<(typeof import('vue'))['shallowRef']> + readonly toRaw: UnwrapRef<(typeof import('vue'))['toRaw']> + readonly toRef: UnwrapRef<(typeof import('vue'))['toRef']> + readonly toRefs: UnwrapRef<(typeof import('vue'))['toRefs']> + readonly toValue: UnwrapRef<(typeof import('vue'))['toValue']> + readonly triggerRef: UnwrapRef<(typeof import('vue'))['triggerRef']> + readonly unref: UnwrapRef<(typeof import('vue'))['unref']> + readonly useAttrs: UnwrapRef<(typeof import('vue'))['useAttrs']> + readonly useCssModule: UnwrapRef<(typeof import('vue'))['useCssModule']> + readonly useCssVars: UnwrapRef<(typeof import('vue'))['useCssVars']> + readonly useId: UnwrapRef<(typeof import('vue'))['useId']> + readonly useModel: UnwrapRef<(typeof import('vue'))['useModel']> + readonly useRoute: UnwrapRef<(typeof import('vue-router/auto'))['useRoute']> + readonly useRouter: UnwrapRef<(typeof import('vue-router/auto'))['useRouter']> + readonly useSlots: UnwrapRef<(typeof import('vue'))['useSlots']> + readonly useTemplateRef: UnwrapRef<(typeof import('vue'))['useTemplateRef']> + readonly watch: UnwrapRef<(typeof import('vue'))['watch']> + readonly watchEffect: UnwrapRef<(typeof import('vue'))['watchEffect']> + readonly watchPostEffect: UnwrapRef<(typeof import('vue'))['watchPostEffect']> + readonly watchSyncEffect: UnwrapRef<(typeof import('vue'))['watchSyncEffect']> } -} \ No newline at end of file +} diff --git a/next-ui/src/colada/mutations/logout.ts b/next-ui/src/colada/mutations/logout.ts index c58cc8ff5..4da07bc6c 100644 --- a/next-ui/src/colada/mutations/logout.ts +++ b/next-ui/src/colada/mutations/logout.ts @@ -1,13 +1,12 @@ -import {defineMutation, useMutation, useQueryCache} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' +import { defineMutation, useMutation, useQueryCache } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' export const useLogout = defineMutation(() => { const queryCache = useQueryCache() return useMutation({ - mutation: () => - komgaClient.POST('/api/logout'), + mutation: () => komgaClient.POST('/api/logout'), onSuccess: () => { - void queryCache.invalidateQueries({key: ['current-user']}) + void queryCache.invalidateQueries({ key: ['current-user'] }) }, onError: (error) => { console.log('logout error', error) diff --git a/next-ui/src/colada/mutations/mark-announcements-read.ts b/next-ui/src/colada/mutations/mark-announcements-read.ts index 08e610fc9..e1b7bb78e 100644 --- a/next-ui/src/colada/mutations/mark-announcements-read.ts +++ b/next-ui/src/colada/mutations/mark-announcements-read.ts @@ -1,13 +1,13 @@ -import {defineMutation, useMutation, useQueryCache} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' +import { defineMutation, useMutation, useQueryCache } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' export const useMarkAnnouncementsRead = defineMutation(() => { const queryCache = useQueryCache() return useMutation({ mutation: (announcementIds: string[]) => - komgaClient.PUT('/api/v1/announcements', {body: announcementIds}), + komgaClient.PUT('/api/v1/announcements', { body: announcementIds }), onSuccess: () => { - void queryCache.invalidateQueries({key: ['announcements']}) + void queryCache.invalidateQueries({ key: ['announcements'] }) }, onError: (error) => { console.log('announcements mark read error', error) diff --git a/next-ui/src/colada/mutations/update-user.ts b/next-ui/src/colada/mutations/update-user.ts index 1f20342e4..bdc74a244 100644 --- a/next-ui/src/colada/mutations/update-user.ts +++ b/next-ui/src/colada/mutations/update-user.ts @@ -1,6 +1,6 @@ -import {defineMutation, useMutation, useQueryCache} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' -import type {components} from '@/generated/openapi/komga' +import { defineMutation, useMutation, useQueryCache } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' +import type { components } from '@/generated/openapi/komga' export const useCreateUser = defineMutation(() => { const queryCache = useQueryCache() @@ -10,7 +10,7 @@ export const useCreateUser = defineMutation(() => { body: user, }), onSuccess: () => { - void queryCache.invalidateQueries({key: ['users']}) + void queryCache.invalidateQueries({ key: ['users'] }) }, onError: (error) => { console.log('create user error', error) @@ -22,11 +22,11 @@ export const useUpdateUser = defineMutation(() => { return useMutation({ mutation: (user: components['schemas']['UserDto']) => komgaClient.PATCH('/api/v2/users/{id}', { - params: {path: {id: user.id}}, + params: { path: { id: user.id } }, body: user, }), onSuccess: () => { - void queryCache.invalidateQueries({key: ['users']}) + void queryCache.invalidateQueries({ key: ['users'] }) }, onError: (error) => { console.log('update user error', error) @@ -36,9 +36,9 @@ export const useUpdateUser = defineMutation(() => { export const useUpdateUserPassword = defineMutation(() => { return useMutation({ - mutation: ({userId, newPassword}: { userId: string, newPassword: string }) => + mutation: ({ userId, newPassword }: { userId: string; newPassword: string }) => komgaClient.PATCH('/api/v2/users/{id}/password', { - params: {path: {id: userId}}, + params: { path: { id: userId } }, body: { password: newPassword, }, @@ -54,10 +54,10 @@ export const useDeleteUser = defineMutation(() => { return useMutation({ mutation: (userId: string) => komgaClient.DELETE('/api/v2/users/{id}', { - params: {path: {id: userId}}, + params: { path: { id: userId } }, }), onSuccess: () => { - void queryCache.invalidateQueries({key: ['users']}) + void queryCache.invalidateQueries({ key: ['users'] }) }, onError: (error) => { console.log('delete user error', error) diff --git a/next-ui/src/colada/queries/actuator-info.ts b/next-ui/src/colada/queries/actuator-info.ts index b7ec551b5..e8b9a7f4f 100644 --- a/next-ui/src/colada/queries/actuator-info.ts +++ b/next-ui/src/colada/queries/actuator-info.ts @@ -1,13 +1,15 @@ -import {defineQuery, useQuery} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' -import type {ActuatorInfo} from '@/types/Actuator' +import { defineQuery, useQuery } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' +import type { ActuatorInfo } from '@/types/Actuator' export const useActuatorInfo = defineQuery(() => { - const {data, ...rest} = useQuery({ + const { data, ...rest } = useQuery({ key: () => ['actuator-info'], - query: () => komgaClient.GET('/actuator/info') - // unwrap the openapi-fetch structure on success - .then((res) => res.data as ActuatorInfo), + query: () => + komgaClient + .GET('/actuator/info') + // unwrap the openapi-fetch structure on success + .then((res) => res.data as ActuatorInfo), // 1 hour staleTime: 60 * 60 * 1000, gcTime: false, diff --git a/next-ui/src/colada/queries/announcements.ts b/next-ui/src/colada/queries/announcements.ts index 78d431ddc..782048af0 100644 --- a/next-ui/src/colada/queries/announcements.ts +++ b/next-ui/src/colada/queries/announcements.ts @@ -1,21 +1,22 @@ -import {defineQuery, useQuery} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' +import { defineQuery, useQuery } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' export const useAnnouncements = defineQuery(() => { - const {data, ...rest} = useQuery({ + const { data, ...rest } = useQuery({ key: () => ['announcements'], - query: () => komgaClient.GET('/api/v1/announcements') - // unwrap the openapi-fetch structure on success - .then((res) => res.data), + query: () => + komgaClient + .GET('/api/v1/announcements') + // unwrap the openapi-fetch structure on success + .then((res) => res.data), // 1 hour staleTime: 60 * 60 * 1000, gcTime: false, }) - const unreadCount = computed(() => data.value?.items - ?.filter((x) => false == x._komga?.read) - ?.length || 0 + const unreadCount = computed( + () => data.value?.items?.filter((x) => false == x._komga?.read)?.length || 0, ) - return {...rest, data, unreadCount} + return { ...rest, data, unreadCount } }) diff --git a/next-ui/src/colada/queries/app-releases.ts b/next-ui/src/colada/queries/app-releases.ts index 805e835fc..0fc93e4ad 100644 --- a/next-ui/src/colada/queries/app-releases.ts +++ b/next-ui/src/colada/queries/app-releases.ts @@ -1,23 +1,25 @@ -import {defineQuery, useQuery} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' -import {useActuatorInfo} from '@/colada/queries/actuator-info.ts' +import { defineQuery, useQuery } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' +import { useActuatorInfo } from '@/colada/queries/actuator-info' export const useAppReleases = defineQuery(() => { - const {data, ...rest} = useQuery({ + const { data, ...rest } = useQuery({ key: () => ['app-releases'], - query: () => komgaClient.GET('/api/v1/releases') - // unwrap the openapi-fetch structure on success - .then((res) => res.data), + query: () => + komgaClient + .GET('/api/v1/releases') + // unwrap the openapi-fetch structure on success + .then((res) => res.data), // 1 hour staleTime: 60 * 60 * 1000, gcTime: false, }) - const {buildVersion} = useActuatorInfo() - const latestRelease = computed(() => data.value?.find(x => x.latest)) + const { buildVersion } = useActuatorInfo() + const latestRelease = computed(() => data.value?.find((x) => x.latest)) const isLatestVersion = computed(() => { - if(buildVersion.value && latestRelease.value) + if (buildVersion.value && latestRelease.value) return buildVersion.value == latestRelease.value?.version else return undefined }) diff --git a/next-ui/src/colada/queries/current-user.ts b/next-ui/src/colada/queries/current-user.ts index 1a61b1b9a..59340ec66 100644 --- a/next-ui/src/colada/queries/current-user.ts +++ b/next-ui/src/colada/queries/current-user.ts @@ -1,20 +1,22 @@ -import {defineQuery, useQuery} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' -import {UserRoles} from '@/types/UserRoles.ts' +import { defineQuery, useQuery } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' +import { UserRoles } from '@/types/UserRoles' export const useCurrentUser = defineQuery(() => { - const {data, ...rest} = useQuery({ + const { data, ...rest } = useQuery({ key: () => ['current-user'], - query: () => komgaClient.GET('/api/v2/users/me') - // unwrap the openapi-fetch structure on success - .then((res) => res.data), + query: () => + komgaClient + .GET('/api/v2/users/me') + // unwrap the openapi-fetch structure on success + .then((res) => res.data), // 10 minutes staleTime: 10 * 60 * 1000, gcTime: false, autoRefetch: true, }) - const hasRole =(role: UserRoles) => data.value?.roles.includes(role) + const hasRole = (role: UserRoles) => data.value?.roles.includes(role) const isAdmin = computed(() => hasRole(UserRoles.ADMIN)) return { diff --git a/next-ui/src/colada/queries/libraries.ts b/next-ui/src/colada/queries/libraries.ts index db7d9c085..71833ffdb 100644 --- a/next-ui/src/colada/queries/libraries.ts +++ b/next-ui/src/colada/queries/libraries.ts @@ -1,12 +1,14 @@ -import {defineQuery, useQuery} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' +import { defineQuery, useQuery } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' export const useLibraries = defineQuery(() => { return useQuery({ key: () => ['libraries'], - query: () => komgaClient.GET('/api/v1/libraries') - // unwrap the openapi-fetch structure on success - .then((res) => res.data), + query: () => + komgaClient + .GET('/api/v1/libraries') + // unwrap the openapi-fetch structure on success + .then((res) => res.data), // 1 hour staleTime: 60 * 60 * 1000, gcTime: false, diff --git a/next-ui/src/colada/queries/referential.ts b/next-ui/src/colada/queries/referential.ts index 3623e810f..f60ea4a83 100644 --- a/next-ui/src/colada/queries/referential.ts +++ b/next-ui/src/colada/queries/referential.ts @@ -1,12 +1,14 @@ -import {defineQuery, useQuery} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' +import { defineQuery, useQuery } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' export const useSharingLabels = defineQuery(() => { return useQuery({ key: () => ['sharing-labels'], - query: () => komgaClient.GET('/api/v1/sharing-labels') - // unwrap the openapi-fetch structure on success - .then((res) => res.data), + query: () => + komgaClient + .GET('/api/v1/sharing-labels') + // unwrap the openapi-fetch structure on success + .then((res) => res.data), // 1 hour staleTime: 60 * 60 * 1000, gcTime: false, diff --git a/next-ui/src/colada/queries/users.ts b/next-ui/src/colada/queries/users.ts index 713081ac2..281bf43a4 100644 --- a/next-ui/src/colada/queries/users.ts +++ b/next-ui/src/colada/queries/users.ts @@ -1,11 +1,13 @@ -import {defineQuery, useQuery} from '@pinia/colada' -import {komgaClient} from '@/api/komga-client' +import { defineQuery, useQuery } from '@pinia/colada' +import { komgaClient } from '@/api/komga-client' export const useUsers = defineQuery(() => { return useQuery({ key: () => ['users'], - query: () => komgaClient.GET('/api/v2/users') - // unwrap the openapi-fetch structure on success - .then((res) => res.data), + query: () => + komgaClient + .GET('/api/v2/users') + // unwrap the openapi-fetch structure on success + .then((res) => res.data), }) }) diff --git a/next-ui/src/components.d.ts b/next-ui/src/components.d.ts index 4d85c48a4..9910b61c9 100644 --- a/next-ui/src/components.d.ts +++ b/next-ui/src/components.d.ts @@ -23,12 +23,10 @@ declare module 'vue' { BuildVersion: typeof import('./components/BuildVersion.vue')['default'] DialogConfirm: typeof import('./components/dialogs/DialogConfirm.vue')['default'] DialogConfirmEdit: typeof import('./components/dialogs/DialogConfirmEdit.vue')['default'] - Discord: typeof import('./components/icons/discord.vue')['default'] FormUserChangePassword: typeof import('./components/forms/user/FormUserChangePassword.vue')['default'] FormUserEdit: typeof import('./components/forms/user/FormUserEdit.vue')['default'] HelloWorld: typeof import('./components/HelloWorld.vue')['default'] LocaleSelector: typeof import('./components/LocaleSelector.vue')['default'] - LoginForm: typeof import('./components/LoginForm.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] ThemeSelector: typeof import('./components/ThemeSelector.vue')['default'] diff --git a/next-ui/src/components/AppFooter.vue b/next-ui/src/components/AppFooter.vue index 1fb981135..ecc44d368 100644 --- a/next-ui/src/components/AppFooter.vue +++ b/next-ui/src/components/AppFooter.vue @@ -24,37 +24,41 @@ class="text-caption" href="https://komga.org" target="_blank" - :text="$formatMessage({ - description:'Drawer menu footer: documentation link', - defaultMessage:'Documentation', - id: 'ccAMWS', - })" + :text=" + $formatMessage({ + description: 'Drawer menu footer: documentation link', + defaultMessage: 'Documentation', + id: 'ccAMWS', + }) + " /> diff --git a/next-ui/src/components/BuildCommit.vue b/next-ui/src/components/BuildCommit.vue index bb4e3c28d..004aad7b5 100644 --- a/next-ui/src/components/BuildCommit.vue +++ b/next-ui/src/components/BuildCommit.vue @@ -15,7 +15,7 @@ diff --git a/next-ui/src/components/BuildVersion.vue b/next-ui/src/components/BuildVersion.vue index 3356b6b3d..4ec17c7fd 100644 --- a/next-ui/src/components/BuildVersion.vue +++ b/next-ui/src/components/BuildVersion.vue @@ -20,7 +20,7 @@ diff --git a/next-ui/src/components/HelloWorld.vue b/next-ui/src/components/HelloWorld.vue index 888bc2c3d..684ceafea 100644 --- a/next-ui/src/components/HelloWorld.vue +++ b/next-ui/src/components/HelloWorld.vue @@ -27,22 +27,16 @@ - + - + diff --git a/next-ui/src/components/LocaleSelector.vue b/next-ui/src/components/LocaleSelector.vue index 5d1a81b7c..fedbc8d2b 100644 --- a/next-ui/src/components/LocaleSelector.vue +++ b/next-ui/src/components/LocaleSelector.vue @@ -12,11 +12,13 @@ color="primary" > @@ -37,7 +39,7 @@ $formatMessage({ description: 'Translations pop-up menu footer', defaultMessage: 'Help us translate', - id: 'FLqm9f' + id: 'FLqm9f', }) }} @@ -47,7 +49,7 @@ - + - + diff --git a/next-ui/src/components/LoginForm.vue b/next-ui/src/components/LoginForm.vue deleted file mode 100644 index 75a9234b2..000000000 --- a/next-ui/src/components/LoginForm.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - diff --git a/next-ui/src/components/README.md b/next-ui/src/components/README.md index d1dc92f5e..6d678ae02 100644 --- a/next-ui/src/components/README.md +++ b/next-ui/src/components/README.md @@ -10,13 +10,13 @@ The following example assumes a component located at `src/components/MyComponent ```vue ``` @@ -24,12 +24,12 @@ When your template is rendered, the component's import will automatically be inl ```vue ``` diff --git a/next-ui/src/components/ThemeSelector.vue b/next-ui/src/components/ThemeSelector.vue index a32c50d9b..0b0a87bf6 100644 --- a/next-ui/src/components/ThemeSelector.vue +++ b/next-ui/src/components/ThemeSelector.vue @@ -6,39 +6,36 @@ - + - + diff --git a/next-ui/src/components/app/bar/AppBar.vue b/next-ui/src/components/app/bar/AppBar.vue index c29ea7c30..f8b70e57f 100644 --- a/next-ui/src/components/app/bar/AppBar.vue +++ b/next-ui/src/components/app/bar/AppBar.vue @@ -17,14 +17,11 @@ - + - + diff --git a/next-ui/src/components/app/drawer/AppDrawer.vue b/next-ui/src/components/app/drawer/AppDrawer.vue index bfab9c04f..cee175f79 100644 --- a/next-ui/src/components/app/drawer/AppDrawer.vue +++ b/next-ui/src/components/app/drawer/AppDrawer.vue @@ -1,7 +1,5 @@ diff --git a/next-ui/src/components/app/drawer/AppDrawerMenu.vue b/next-ui/src/components/app/drawer/AppDrawerMenu.vue index db4f5bf61..d17fb2c90 100644 --- a/next-ui/src/components/app/drawer/AppDrawerMenu.vue +++ b/next-ui/src/components/app/drawer/AppDrawerMenu.vue @@ -10,7 +10,7 @@ diff --git a/next-ui/src/components/app/drawer/AppDrawerMenuAccount.vue b/next-ui/src/components/app/drawer/AppDrawerMenuAccount.vue index 70ad67988..66c6ee57c 100644 --- a/next-ui/src/components/app/drawer/AppDrawerMenuAccount.vue +++ b/next-ui/src/components/app/drawer/AppDrawerMenuAccount.vue @@ -3,56 +3,62 @@ - + - + - + diff --git a/next-ui/src/components/app/drawer/AppDrawerMenuHistory.vue b/next-ui/src/components/app/drawer/AppDrawerMenuHistory.vue index 45973bd34..4cd9354f6 100644 --- a/next-ui/src/components/app/drawer/AppDrawerMenuHistory.vue +++ b/next-ui/src/components/app/drawer/AppDrawerMenuHistory.vue @@ -1,11 +1,13 @@ diff --git a/next-ui/src/components/app/drawer/AppDrawerMenuImport.vue b/next-ui/src/components/app/drawer/AppDrawerMenuImport.vue index e60f6a046..620790150 100644 --- a/next-ui/src/components/app/drawer/AppDrawerMenuImport.vue +++ b/next-ui/src/components/app/drawer/AppDrawerMenuImport.vue @@ -3,31 +3,37 @@ diff --git a/next-ui/src/components/app/drawer/AppDrawerMenuLogout.vue b/next-ui/src/components/app/drawer/AppDrawerMenuLogout.vue index 159296eb8..87d3aa160 100644 --- a/next-ui/src/components/app/drawer/AppDrawerMenuLogout.vue +++ b/next-ui/src/components/app/drawer/AppDrawerMenuLogout.vue @@ -1,20 +1,22 @@ + diff --git a/next-ui/src/components/app/drawer/AppDrawerMenuServer.vue b/next-ui/src/components/app/drawer/AppDrawerMenuServer.vue index 0dfad535e..725362286 100644 --- a/next-ui/src/components/app/drawer/AppDrawerMenuServer.vue +++ b/next-ui/src/components/app/drawer/AppDrawerMenuServer.vue @@ -6,11 +6,13 @@ diff --git a/next-ui/src/main.ts b/next-ui/src/main.ts index da6ef2e42..c8fc17224 100644 --- a/next-ui/src/main.ts +++ b/next-ui/src/main.ts @@ -5,13 +5,13 @@ */ // Plugins -import {registerPlugins} from '@/plugins' +import { registerPlugins } from '@/plugins' // Components import App from './App.vue' // Composables -import {createApp} from 'vue' +import { createApp } from 'vue' const app = createApp(App) diff --git a/next-ui/src/pages/account/activity.vue b/next-ui/src/pages/account/activity.vue index 1ed758b3a..f71929a78 100644 --- a/next-ui/src/pages/account/activity.vue +++ b/next-ui/src/pages/account/activity.vue @@ -3,5 +3,5 @@ diff --git a/next-ui/src/pages/account/api-keys.vue b/next-ui/src/pages/account/api-keys.vue index 0bc52828a..43d4d2c77 100644 --- a/next-ui/src/pages/account/api-keys.vue +++ b/next-ui/src/pages/account/api-keys.vue @@ -3,5 +3,5 @@ diff --git a/next-ui/src/pages/account/details.vue b/next-ui/src/pages/account/details.vue index 71dc72233..10bf19ab6 100644 --- a/next-ui/src/pages/account/details.vue +++ b/next-ui/src/pages/account/details.vue @@ -3,5 +3,5 @@ diff --git a/next-ui/src/pages/account/ui.vue b/next-ui/src/pages/account/ui.vue index 03d3636d3..f64cf8046 100644 --- a/next-ui/src/pages/account/ui.vue +++ b/next-ui/src/pages/account/ui.vue @@ -3,5 +3,5 @@ diff --git a/next-ui/src/pages/history.vue b/next-ui/src/pages/history.vue index 75b135785..256e54e5f 100644 --- a/next-ui/src/pages/history.vue +++ b/next-ui/src/pages/history.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/import/books.vue b/next-ui/src/pages/import/books.vue index 931874edc..c432a3a5f 100644 --- a/next-ui/src/pages/import/books.vue +++ b/next-ui/src/pages/import/books.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/import/readlist.vue b/next-ui/src/pages/import/readlist.vue index c0feb9e92..afd407a57 100644 --- a/next-ui/src/pages/import/readlist.vue +++ b/next-ui/src/pages/import/readlist.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/index.vue b/next-ui/src/pages/index.vue index dac59c780..40b477861 100644 --- a/next-ui/src/pages/index.vue +++ b/next-ui/src/pages/index.vue @@ -3,5 +3,5 @@ diff --git a/next-ui/src/pages/login.vue b/next-ui/src/pages/login.vue index 38d2bfaaa..a6433b64c 100644 --- a/next-ui/src/pages/login.vue +++ b/next-ui/src/pages/login.vue @@ -1,9 +1,150 @@ diff --git a/next-ui/src/pages/media/analysis.vue b/next-ui/src/pages/media/analysis.vue index cd46a0524..8210b0cde 100644 --- a/next-ui/src/pages/media/analysis.vue +++ b/next-ui/src/pages/media/analysis.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/media/duplicate-files.vue b/next-ui/src/pages/media/duplicate-files.vue index 29ad21ab3..d2e45ee99 100644 --- a/next-ui/src/pages/media/duplicate-files.vue +++ b/next-ui/src/pages/media/duplicate-files.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/media/duplicate-pages/known.vue b/next-ui/src/pages/media/duplicate-pages/known.vue index d7205db7b..c5ee65c04 100644 --- a/next-ui/src/pages/media/duplicate-pages/known.vue +++ b/next-ui/src/pages/media/duplicate-pages/known.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/media/duplicate-pages/unknown.vue b/next-ui/src/pages/media/duplicate-pages/unknown.vue index 2ad3447fe..0edc4680f 100644 --- a/next-ui/src/pages/media/duplicate-pages/unknown.vue +++ b/next-ui/src/pages/media/duplicate-pages/unknown.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/media/missing-posters.vue b/next-ui/src/pages/media/missing-posters.vue index b01072ee3..8faa176db 100644 --- a/next-ui/src/pages/media/missing-posters.vue +++ b/next-ui/src/pages/media/missing-posters.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/server/announcements.vue b/next-ui/src/pages/server/announcements.vue index f2716b54d..274b6d0c4 100644 --- a/next-ui/src/pages/server/announcements.vue +++ b/next-ui/src/pages/server/announcements.vue @@ -16,60 +16,47 @@ v-for="(item, index) in announcements.items" :key="index" > - - - -
- {{ $formatDate(item.date_modified, {dateStyle: 'long'}) }} -
-
- - + + - - + diff --git a/next-ui/src/pages/server/ui.vue b/next-ui/src/pages/server/ui.vue index fdab4b915..a257db412 100644 --- a/next-ui/src/pages/server/ui.vue +++ b/next-ui/src/pages/server/ui.vue @@ -3,7 +3,7 @@ diff --git a/next-ui/src/pages/server/updates.vue b/next-ui/src/pages/server/updates.vue index 1436ae1a3..25efa2cec 100644 --- a/next-ui/src/pages/server/updates.vue +++ b/next-ui/src/pages/server/updates.vue @@ -23,7 +23,7 @@ $formatMessage({ description: 'Updates view: banner shown at the top', defaultMessage: 'The latest version of Komga is already installed', - id: 'WNY0pu' + id: 'WNY0pu', }) }} @@ -37,7 +37,7 @@ $formatMessage({ description: 'Updates view: banner shown at the top', defaultMessage: 'Updates are available', - id: 'n1Ik+L' + id: 'n1Ik+L', }) }} @@ -49,19 +49,15 @@ v-for="(release, index) in releases" :key="index" > - - + + - - + + + +