From 28634a3f300db07f5c962a1c4a193d8f3c7c81c5 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 3 Aug 2023 10:02:21 -0700 Subject: [PATCH] admin: add apps section Signed-off-by: Varun Patil --- src/components/admin/AdminMain.vue | 30 ++++++++++++++++++-- src/components/admin/AdminMixin.ts | 7 ++++- src/components/admin/sections/Apps.vue | 38 ++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 src/components/admin/sections/Apps.vue diff --git a/src/components/admin/AdminMain.vue b/src/components/admin/AdminMain.vue index e697eb85..bac83942 100644 --- a/src/components/admin/AdminMain.vue +++ b/src/components/admin/AdminMain.vue @@ -2,7 +2,15 @@
- +
@@ -14,17 +22,20 @@ import { showError } from '@nextcloud/dialogs'; import { API } from '../../services/API'; import * as utils from '../../services/Utils'; +import staticConfig from '../../services/static-config'; import Exif from './sections/Exif.vue'; import Indexing from './sections/Indexing.vue'; import FileSupport from './sections/FileSupport.vue'; import Performance from './sections/Performance.vue'; +import Apps from './sections/Apps.vue'; import Places from './sections/Places.vue'; import Video from './sections/Video.vue'; import VideoTranscoder from './sections/VideoTranscoder.vue'; import VideoAccel from './sections/VideoAccel.vue'; -import { ISystemConfig, ISystemStatus } from './AdminTypes'; +import type { ISystemConfig, ISystemStatus } from './AdminTypes'; +import type { IConfig } from '../../types'; export default defineComponent({ name: 'Admin', @@ -35,13 +46,15 @@ export default defineComponent({ status: null as ISystemStatus | null, config: null as ISystemConfig | null, + sconfig: null as IConfig | null, - components: [Exif, Indexing, FileSupport, Performance, Places, Video, VideoTranscoder, VideoAccel], + components: [Exif, Indexing, FileSupport, Performance, Apps, Places, Video, VideoTranscoder, VideoAccel], }), mounted() { this.refreshSystemConfig(); this.refreshStatus(); + this.refreshStaticConfig(); }, methods: { @@ -70,6 +83,17 @@ export default defineComponent({ } }, + async refreshStaticConfig() { + try { + this.loading++; + this.sconfig = await staticConfig.getAll(); + } catch (e) { + showError(JSON.stringify(e)); + } finally { + this.loading--; + } + }, + async update(key: keyof ISystemConfig, value: any = null) { if (!this.config?.hasOwnProperty(key)) { console.error('Unknown setting', key); diff --git a/src/components/admin/AdminMixin.ts b/src/components/admin/AdminMixin.ts index eef02fc7..358776da 100644 --- a/src/components/admin/AdminMixin.ts +++ b/src/components/admin/AdminMixin.ts @@ -1,5 +1,6 @@ import { defineComponent, PropType } from 'vue'; -import { ISystemStatus, ISystemConfig, IBinaryStatus } from './AdminTypes'; +import type { ISystemStatus, ISystemConfig, IBinaryStatus } from './AdminTypes'; +import type { IConfig } from '../../types'; import axios from '@nextcloud/axios'; const NcCheckboxRadioSwitch = () => import('@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch'); @@ -26,6 +27,10 @@ export default defineComponent({ type: Object as PropType, required: true, }, + sconfig: { + type: Object as PropType, + required: true, + }, }, methods: { diff --git a/src/components/admin/sections/Apps.vue b/src/components/admin/sections/Apps.vue new file mode 100644 index 00000000..e140a369 --- /dev/null +++ b/src/components/admin/sections/Apps.vue @@ -0,0 +1,38 @@ + + +