From 93edcd216a453b89aae7bf117479e9f4de11cf20 Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Thu, 28 Sep 2023 01:30:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E7=89=87=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/global-setting/index.vue | 12 +- orion-ops-ui/src/store/modules/app/index.ts | 6 +- orion-ops-ui/src/store/modules/app/types.ts | 8 +- .../asset/host/components/host-card-list.vue | 108 ++++++++++++++++++ .../host/components/host-config-ssh-form.vue | 5 +- orion-ops-ui/src/views/asset/host/index.vue | 21 +++- 6 files changed, 140 insertions(+), 20 deletions(-) create mode 100644 orion-ops-ui/src/views/asset/host/components/host-card-list.vue diff --git a/orion-ops-ui/src/components/global-setting/index.vue b/orion-ops-ui/src/components/global-setting/index.vue index 5b2c9e52..b8cd5548 100644 --- a/orion-ops-ui/src/components/global-setting/index.vue +++ b/orion-ops-ui/src/components/global-setting/index.vue @@ -76,23 +76,23 @@ const viewsOpts = computed(() => [ { name: '主机列表', - key: 'host', + key: 'hostView', type: 'radio-group', - defaultVal: appStore.host, + defaultVal: appStore.hostView, options: [{ value: 'table', label: '表格' }, { value: 'card', label: '卡片' }] }, { name: '主机秘钥', - key: 'hostKeys', + key: 'hostKeyView', type: 'radio-group', - defaultVal: appStore.hostKeys, + defaultVal: appStore.hostKeyView, options: [{ value: 'table', label: '表格' }, { value: 'card', label: '卡片' }] }, { name: '主机身份', - key: 'hostIdentity', + key: 'hostIdentityView', type: 'radio-group', - defaultVal: appStore.hostIdentity, + defaultVal: appStore.hostIdentityView, options: [{ value: 'table', label: '表格' }, { value: 'card', label: '卡片' }] }, ]); diff --git a/orion-ops-ui/src/store/modules/app/index.ts b/orion-ops-ui/src/store/modules/app/index.ts index f69c3b1a..d081fe16 100644 --- a/orion-ops-ui/src/store/modules/app/index.ts +++ b/orion-ops-ui/src/store/modules/app/index.ts @@ -16,9 +16,9 @@ const defaultConfig: AppState = { menuWidth: 220, colorWeak: false, // 用户偏好-页面视图 - host: 'table', - hostKeys: 'table', - hostIdentity: 'table', + hostView: 'table', + hostKeyView: 'table', + hostIdentityView: 'table', }; export default defineStore('app', { diff --git a/orion-ops-ui/src/store/modules/app/types.ts b/orion-ops-ui/src/store/modules/app/types.ts index 41d2c784..53f74623 100644 --- a/orion-ops-ui/src/store/modules/app/types.ts +++ b/orion-ops-ui/src/store/modules/app/types.ts @@ -1,6 +1,6 @@ export type Theme = 'light' | 'dark' export type Device = 'desktop' | 'mobile' -export type ViewType = 'table' | 'card' +export type ViewType = 'table' | 'card' | undefined /** * 应用状态 @@ -36,7 +36,7 @@ export interface UserPreferenceLayout { * 用户偏好 - 页面视图 */ export interface UserPreferenceViews { - host: ViewType | string; - hostKeys: ViewType | string; - hostIdentity: ViewType | string; + hostView: ViewType; + hostKeyView: ViewType; + hostIdentityView: ViewType; } diff --git a/orion-ops-ui/src/views/asset/host/components/host-card-list.vue b/orion-ops-ui/src/views/asset/host/components/host-card-list.vue new file mode 100644 index 00000000..a50780f9 --- /dev/null +++ b/orion-ops-ui/src/views/asset/host/components/host-card-list.vue @@ -0,0 +1,108 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/asset/host/components/host-config-ssh-form.vue b/orion-ops-ui/src/views/asset/host/components/host-config-ssh-form.vue index b2acf0ee..b7bac3c5 100644 --- a/orion-ops-ui/src/views/asset/host/components/host-config-ssh-form.vue +++ b/orion-ops-ui/src/views/asset/host/components/host-config-ssh-form.vue @@ -138,8 +138,7 @@