From 637f5b501ef28fccd8234e275ee4e07499619e8e Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 12 Sep 2024 17:31:19 +0900 Subject: [PATCH] Add about panel in settings dialog (#799) * basic about page * Remove frontend version from setting dialog header * Style about page * basic system stats * Basic styling * Reword * Format memory amount --- src/components/common/DeviceInfo.vue | 40 +++++++++++ src/components/common/SystemStatsPanel.vue | 55 +++++++++++++++ .../dialog/content/SettingDialogContent.vue | 17 ++++- .../dialog/content/setting/AboutPanel.vue | 68 +++++++++++++++++++ .../dialog/header/SettingDialogHeader.vue | 6 -- src/i18n.ts | 3 + src/stores/systemStatsStore.ts | 34 ++++++++++ src/types/apiTypes.ts | 24 ++++--- 8 files changed, 227 insertions(+), 20 deletions(-) create mode 100644 src/components/common/DeviceInfo.vue create mode 100644 src/components/common/SystemStatsPanel.vue create mode 100644 src/components/dialog/content/setting/AboutPanel.vue create mode 100644 src/stores/systemStatsStore.ts diff --git a/src/components/common/DeviceInfo.vue b/src/components/common/DeviceInfo.vue new file mode 100644 index 000000000..d89e8b9c6 --- /dev/null +++ b/src/components/common/DeviceInfo.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/components/common/SystemStatsPanel.vue b/src/components/common/SystemStatsPanel.vue new file mode 100644 index 000000000..29296e4d6 --- /dev/null +++ b/src/components/common/SystemStatsPanel.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/dialog/content/SettingDialogContent.vue b/src/components/dialog/content/SettingDialogContent.vue index e20f71bbc..3b529506d 100644 --- a/src/components/dialog/content/SettingDialogContent.vue +++ b/src/components/dialog/content/SettingDialogContent.vue @@ -51,6 +51,9 @@ }" /> + + + @@ -70,17 +73,25 @@ import SettingGroup from './setting/SettingGroup.vue' import SearchBox from '@/components/common/SearchBox.vue' import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue' import { flattenTree } from '@/utils/treeUtil' +import AboutPanel from './setting/AboutPanel.vue' interface ISettingGroup { label: string settings: SettingParams[] } +const aboutPanelNode: SettingTreeNode = { + key: 'about', + label: 'About', + children: [] +} + const settingStore = useSettingStore() const settingRoot = computed(() => settingStore.settingTree) -const categories = computed( - () => settingRoot.value.children || [] -) +const categories = computed(() => [ + ...(settingRoot.value.children || []), + aboutPanelNode +]) const activeCategory = ref(null) const searchResults = ref([]) diff --git a/src/components/dialog/content/setting/AboutPanel.vue b/src/components/dialog/content/setting/AboutPanel.vue new file mode 100644 index 000000000..cd30aff2c --- /dev/null +++ b/src/components/dialog/content/setting/AboutPanel.vue @@ -0,0 +1,68 @@ + + + diff --git a/src/components/dialog/header/SettingDialogHeader.vue b/src/components/dialog/header/SettingDialogHeader.vue index dfdf84d74..71744828e 100644 --- a/src/components/dialog/header/SettingDialogHeader.vue +++ b/src/components/dialog/header/SettingDialogHeader.vue @@ -3,16 +3,10 @@

{{ $t('settings') }} -

- -