diff --git a/src/components/FormFields/JsonEditor.vue b/src/components/FormFields/JsonEditor.vue
index f85ba4b60..6d90fb684 100644
--- a/src/components/FormFields/JsonEditor.vue
+++ b/src/components/FormFields/JsonEditor.vue
@@ -18,7 +18,7 @@ export default {
components: { JsonEditor },
props: {
value: {
- type: String,
+ type: [String, Object],
default: () => ''
}
},
@@ -29,7 +29,7 @@ export default {
}
},
created() {
- this.resultInfo = JSON.parse(this.value)
+ this.resultInfo = typeof this.value === 'string' ? JSON.parse(this.value) : this.value
},
methods: {
// 数据改变
diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json
index 52da551c0..b9b45c91b 100644
--- a/src/i18n/langs/en.json
+++ b/src/i18n/langs/en.json
@@ -188,6 +188,11 @@
"Pending": "Pending",
"Platform": "Platform",
"PlatformDetail": "Platform detail",
+ "DomainEnabled": "Enable domain",
+ "ProtocolsEnabled": "Enable protocol",
+ "AccountEnabled": "Enable account switching",
+ "AutoEnabled": "Enable Automation",
+ "SupportedProtocol": "Supported protocol",
"PriorityHelpMessage": "1-100, High level will be using login asset as default, if user was granted more than 2 system user",
"Protocol": "Protocol",
"Protocols": "Protocols",
diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json
index fdd7a7f43..67d989d51 100644
--- a/src/i18n/langs/ja.json
+++ b/src/i18n/langs/ja.json
@@ -191,6 +191,11 @@
"Pending": "待つ",
"Platform": "システムプラットフォーム",
"PlatformDetail": "プラットフォームの詳細",
+ "DomainEnabled": "ドメインを有効化",
+ "ProtocolsEnabled": "プロトコルの有効化",
+ "AccountEnabled": "アカウントを有効にする",
+ "AutoEnabled": "自動化の有効化",
+ "SupportedProtocol": "サポートされるプロトコル",
"PriorityHelpMessage": "1-100、1最低優先度、100最高優先度。複数のユーザーを許可する場合、優先度の高いシステムユーザーはデフォルトのログインユーザーになります",
"Protocol": "プロトコル",
"Protocols": "プロトコルグループ",
diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json
index 9c7fc3824..02478be55 100644
--- a/src/i18n/langs/zh.json
+++ b/src/i18n/langs/zh.json
@@ -192,6 +192,11 @@
"Pending": "等待",
"Platform": "系统平台",
"PlatformDetail": "平台详情",
+ "DomainEnabled": "启用网域",
+ "ProtocolsEnabled": "启用协议",
+ "AccountEnabled": "启用切换账号",
+ "AutoEnabled": "启用自动化",
+ "SupportedProtocol": "支持的协议",
"PriorityHelpMessage": "1-100, 1最低优先级,100最高优先级。授权多个用户时,高优先级的系统用户将会作为默认登录用户",
"Protocol": "协议",
"Protocols": "协议",
diff --git a/src/router/console/assets.js b/src/router/console/assets.js
index 4b4f22cfd..fb55c7caa 100644
--- a/src/router/console/assets.js
+++ b/src/router/console/assets.js
@@ -278,7 +278,7 @@ export default [
},
{
path: ':id',
- component: () => import('@/views/assets/Platform/PlatformDetail.vue'), // Parent router-view
+ component: () => import('@/views/assets/Platform/PlatformDetail'), // Parent router-view
name: 'PlatformDetail',
hidden: true,
meta: { title: i18n.t('route.PlatformDetail') }
diff --git a/src/views/assets/Platform/Detail.vue b/src/views/assets/Platform/Detail.vue
deleted file mode 100644
index 9a2634c9f..000000000
--- a/src/views/assets/Platform/Detail.vue
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/assets/Platform/PlatformCreateUpdate.vue b/src/views/assets/Platform/PlatformCreateUpdate.vue
index 9167da713..a61e1b40a 100644
--- a/src/views/assets/Platform/PlatformCreateUpdate.vue
+++ b/src/views/assets/Platform/PlatformCreateUpdate.vue
@@ -13,9 +13,7 @@
+
+
diff --git a/src/views/assets/Platform/PlatformDetail/PlatformDetailUpdateDialog.vue b/src/views/assets/Platform/PlatformDetail/PlatformDetailUpdateDialog.vue
new file mode 100644
index 000000000..cd02ef79e
--- /dev/null
+++ b/src/views/assets/Platform/PlatformDetail/PlatformDetailUpdateDialog.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
diff --git a/src/views/assets/Platform/PlatformDetail.vue b/src/views/assets/Platform/PlatformDetail/index.vue
similarity index 100%
rename from src/views/assets/Platform/PlatformDetail.vue
rename to src/views/assets/Platform/PlatformDetail/index.vue
diff --git a/src/views/assets/Platform/const.js b/src/views/assets/Platform/const.js
new file mode 100644
index 000000000..319c14712
--- /dev/null
+++ b/src/views/assets/Platform/const.js
@@ -0,0 +1,75 @@
+import i18n from '@/i18n/i18n'
+import rules from '@/components/DataForm/rules'
+import { JsonEditor } from '@/components/FormFields'
+import { assetFieldsMeta } from '@/views/assets/const'
+const assetMeta = assetFieldsMeta()
+
+export const fieldsMeta = {
+ automation: {
+ initial: {
+ ansible_config: ''
+ },
+ fields: [
+ 'ansible_enabled', 'ansible_config',
+ 'ping_enabled', 'ping_method',
+ 'gather_facts_enabled', 'gather_facts_method',
+ 'create_account_enabled', 'create_account_method',
+ 'change_password_enabled', 'change_password_method',
+ 'verify_account_enabled', 'verify_account_method'
+ ],
+ fieldsMeta: {
+ ansible_config: {
+ component: JsonEditor,
+ el: {
+ value: '{}'
+ },
+ hidden: (formValue) => !formValue['ansible_enabled']
+ },
+ ping_method: {},
+ gather_facts_method: {},
+ create_account_method: {},
+ change_password_method: {},
+ verify_account_method: {}
+ }
+ },
+ category_type: {
+ type: 'cascader',
+ label: i18n.t('assets.Type'),
+ rules: [
+ rules.Required
+ ],
+ el: {
+ multiple: false,
+ options: [],
+ disabled: true
+ },
+ hidden: (formValue) => {
+ if (formValue.category_type[0] === undefined) {
+ formValue.category_type = this.initial.category_type
+ }
+ }
+ },
+ charset: {},
+ protocols_enabled: {
+ el: {
+ disabled: false
+ }
+ },
+ domain_enabled: {
+ el: {
+ disabled: false
+ }
+ },
+ protocols: {
+ label: i18n.t('assets.SupportedProtocol'),
+ ...assetMeta.protocols,
+ el: {
+ choices: []
+ },
+ hidden: (formValue) => !formValue['protocols_enabled']
+ },
+ su_method: {
+ type: 'select',
+ hidden: (form) => !form['su_enabled']
+ }
+}