From 533955f928e7739fcec84adeca94ae36271298b1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 5 Jan 2022 03:09:20 +0900 Subject: [PATCH] tweak ui --- packages/client/src/pages/admin/index.vue | 6 -- .../client/src/pages/admin/other-settings.vue | 25 +----- packages/client/src/pages/admin/security.vue | 27 +++++++ .../client/src/pages/admin/service-worker.vue | 81 ------------------- packages/client/src/pages/admin/settings.vue | 48 +++++++++++ packages/client/src/pages/gallery/edit.vue | 2 +- 6 files changed, 77 insertions(+), 112 deletions(-) delete mode 100644 packages/client/src/pages/admin/service-worker.vue diff --git a/packages/client/src/pages/admin/index.vue b/packages/client/src/pages/admin/index.vue index a628ce87ae..b7160de11d 100644 --- a/packages/client/src/pages/admin/index.vue +++ b/packages/client/src/pages/admin/index.vue @@ -171,11 +171,6 @@ export default defineComponent({ text: i18n.locale.security, to: '/admin/security', active: page.value === 'security', - }, { - icon: 'fas fa-bolt', - text: 'ServiceWorker', - to: '/admin/service-worker', - active: page.value === 'service-worker', }, { icon: 'fas fa-globe', text: i18n.locale.relays, @@ -228,7 +223,6 @@ export default defineComponent({ case 'email-settings': return defineAsyncComponent(() => import('./email-settings.vue')); case 'object-storage': return defineAsyncComponent(() => import('./object-storage.vue')); case 'security': return defineAsyncComponent(() => import('./security.vue')); - case 'service-worker': return defineAsyncComponent(() => import('./service-worker.vue')); case 'relays': return defineAsyncComponent(() => import('./relays.vue')); case 'integrations': return defineAsyncComponent(() => import('./integrations.vue')); case 'instance-block': return defineAsyncComponent(() => import('./instance-block.vue')); diff --git a/packages/client/src/pages/admin/other-settings.vue b/packages/client/src/pages/admin/other-settings.vue index eb47a3fa1f..d21d0c5992 100644 --- a/packages/client/src/pages/admin/other-settings.vue +++ b/packages/client/src/pages/admin/other-settings.vue @@ -1,21 +1,7 @@ @@ -53,9 +39,6 @@ export default defineComponent({ handler: this.save, }], }, - summalyProxy: '', - deeplAuthKey: '', - deeplIsPro: false, } }, @@ -66,15 +49,9 @@ export default defineComponent({ methods: { async init() { const meta = await os.api('meta', { detail: true }); - this.summalyProxy = meta.summalyProxy; - this.deeplAuthKey = meta.deeplAuthKey; - this.deeplIsPro = meta.deeplIsPro; }, save() { os.apiWithDialog('admin/update-meta', { - summalyProxy: this.summalyProxy, - deeplAuthKey: this.deeplAuthKey, - deeplIsPro: this.deeplIsPro, }).then(() => { fetchInstance(); }); diff --git a/packages/client/src/pages/admin/security.vue b/packages/client/src/pages/admin/security.vue index d6ca9e0cba..276c514f16 100644 --- a/packages/client/src/pages/admin/security.vue +++ b/packages/client/src/pages/admin/security.vue @@ -11,6 +11,19 @@ + + + + +
+ + + + + + {{ $ts.save }} +
+
@@ -23,6 +36,8 @@ import FormSwitch from '@/components/form/switch.vue'; import FormInfo from '@/components/ui/info.vue'; import FormSuspense from '@/components/form/suspense.vue'; import FormSection from '@/components/form/section.vue'; +import FormInput from '@/components/form/input.vue'; +import FormButton from '@/components/ui/button.vue'; import XBotProtection from './bot-protection.vue'; import * as os from '@/os'; import * as symbols from '@/symbols'; @@ -35,6 +50,8 @@ export default defineComponent({ FormInfo, FormSection, FormSuspense, + FormButton, + FormInput, XBotProtection, }, @@ -47,6 +64,7 @@ export default defineComponent({ icon: 'fas fa-lock', bg: 'var(--bg)', }, + summalyProxy: '', enableHcaptcha: false, enableRecaptcha: false, } @@ -59,9 +77,18 @@ export default defineComponent({ methods: { async init() { const meta = await os.api('meta', { detail: true }); + this.summalyProxy = meta.summalyProxy; this.enableHcaptcha = meta.enableHcaptcha; this.enableRecaptcha = meta.enableRecaptcha; }, + + save() { + os.apiWithDialog('admin/update-meta', { + summalyProxy: this.summalyProxy, + }).then(() => { + fetchInstance(); + }); + } } }); diff --git a/packages/client/src/pages/admin/service-worker.vue b/packages/client/src/pages/admin/service-worker.vue deleted file mode 100644 index eb4c2bb9a0..0000000000 --- a/packages/client/src/pages/admin/service-worker.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index e20ce40c75..802d7463ec 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -94,6 +94,39 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +189,11 @@ export default defineComponent({ remoteDriveCapacityMb: 0, enableRegistration: false, emailRequiredForSignup: false, + enableServiceWorker: false, + swPublicKey: null, + swPrivateKey: null, + deeplAuthKey: '', + deeplIsPro: false, } }, @@ -184,6 +222,11 @@ export default defineComponent({ this.remoteDriveCapacityMb = meta.driveCapacityPerRemoteUserMb; this.enableRegistration = !meta.disableRegistration; this.emailRequiredForSignup = meta.emailRequiredForSignup; + this.enableServiceWorker = meta.enableServiceWorker; + this.swPublicKey = meta.swPublickey; + this.swPrivateKey = meta.swPrivateKey; + this.deeplAuthKey = meta.deeplAuthKey; + this.deeplIsPro = meta.deeplIsPro; }, save() { @@ -206,6 +249,11 @@ export default defineComponent({ remoteDriveCapacityMb: parseInt(this.remoteDriveCapacityMb, 10), disableRegistration: !this.enableRegistration, emailRequiredForSignup: this.emailRequiredForSignup, + enableServiceWorker: this.enableServiceWorker, + swPublicKey: this.swPublicKey, + swPrivateKey: this.swPrivateKey, + deeplAuthKey: this.deeplAuthKey, + deeplIsPro: this.deeplIsPro, }).then(() => { fetchInstance(); }); diff --git a/packages/client/src/pages/gallery/edit.vue b/packages/client/src/pages/gallery/edit.vue index d317da038f..e3fa1a0fcd 100644 --- a/packages/client/src/pages/gallery/edit.vue +++ b/packages/client/src/pages/gallery/edit.vue @@ -10,7 +10,7 @@ -
+
{{ file.name }}