diff --git a/src/views/accounts/AccountPush/AccountAutoPush.vue b/src/components/AutomationParams/index.vue similarity index 95% rename from src/views/accounts/AccountPush/AccountAutoPush.vue rename to src/components/AutomationParams/index.vue index 615b52469..0e9fe520e 100644 --- a/src/views/accounts/AccountPush/AccountAutoPush.vue +++ b/src/components/AutomationParams/index.vue @@ -34,6 +34,7 @@ import { Dialog, AutoDataForm } from '@/components' export default { + componentName: 'AutomationParams', components: { Dialog, AutoDataForm @@ -57,6 +58,10 @@ export default { type: Array, default: () => [] }, + method: { + type: String, + default: '' + }, url: { type: String, default: `/api/v1/assets/platform-automation-methods/` @@ -110,18 +115,17 @@ export default { this.remoteMeta = data.actions[this.config.method.toUpperCase()] || {} }, async getFilterPlatforms() { - const res = await this.$axios.post( + return await this.$axios.post( '/api/v1/assets/platforms/filter-nodes-assets/', { 'node_ids': this.node_ids, 'asset_ids': this.asset_ids } ) - return res }, async onFieldChangeHandle() { const platforms = await this.getFilterPlatforms() - let pushAccountMethods = platforms.map(i => i.automation?.push_account_method) + let pushAccountMethods = platforms.map(i => i.automation[this.method]) pushAccountMethods = _.uniq(pushAccountMethods) // 检测是否有可设置的推送方式 const hasCanSettingPushMethods = _.intersection(pushAccountMethods, Object.keys(this.remoteMeta)) diff --git a/src/components/index.js b/src/components/index.js index 2313b94fb..f468e85e6 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -15,6 +15,7 @@ export { default as RelationCard } from './RelationCard' export { default as Select2 } from './FormFields/Select2' export { default as UploadKey } from './FormFields/UploadKey.vue' export { default as AssetSelect } from './AssetSelect' +export { default as AutomationParams } from './AutomationParams' export { default as SvgIcon } from './SvgIcon' export { default as TreeTable } from './TreeTable' export { default as AssetTreeTable } from './AssetTreeTable' diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 504b6954d..a489a2bd6 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -32,6 +32,7 @@ }, "AccountChangeSecret": { "Result": "Result", + "ParamsHelpText": "The change secret parameter settings are currently only effective for assets with a platform type of host.", "ExecutionTimes": "Execution times", "TaskList": "Task record", "TimerPeriod": "Timed execution cycle", @@ -93,7 +94,7 @@ "AccountPushExecutionList": "Execution list", "AccountPushCreate": "Account push create", "AccountPushUpdate": "Account push update", - "AutoPushHelpText": "The push parameter settings are currently only effective for assets with a platform type of host.", + "ParamsHelpText": "The push parameter settings are currently only effective for assets with a platform type of host.", "AccountPushList": "Account push list" }, "AccountBackup": { diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 05e30bd73..69a3a1d1e 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -32,6 +32,7 @@ }, "AccountChangeSecret": { "Result": "結果", + "ParamsHelpText": "改密パラメータの設定は、プラットフォームの種類がホストである資産に対してのみ有効です。", "ExecutionTimes": "実行時間", "TaskList": "タスク レコード", "TimerPeriod": "時限実行サイクル", @@ -93,7 +94,7 @@ "AccountPushExecutionList": "実行リスト", "AccountPushCreate": "アカウントのプッシュ作成", "AccountPushUpdate": "アカウントプッシュ更新", - "AutoPushHelpText": "Pushパラメータの設定は、プラットフォームの種類がホストである資産に対してのみ有効です。", + "ParamsHelpText": "Pushパラメータの設定は、プラットフォームの種類がホストである資産に対してのみ有効です。", "AccountPushList": "アカウントプッシュ" }, "AccountBackup": { diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index f29e88105..edce84e40 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -29,7 +29,7 @@ "AccountPushList": "账号推送", "AccountPushCreate": "账号推送创建", "AccountPushUpdate": "账号推送更新", - "AutoPushHelpText": "推送参数设置,目前仅对平台种类为主机的资产生效。", + "ParamsHelpText": "推送参数设置,目前仅对平台种类为主机的资产生效。", "AccountPushExecutionList": "执行列表" }, "AccountBackup": { @@ -45,6 +45,7 @@ "Reason": "原因" }, "AccountChangeSecret": { + "ParamsHelpText": "改密参数设置,目前仅对平台种类为主机的资产生效。", "ContainAttachment": "含附件", "AddAsset": "添加资产", "MailRecipient": "邮件收件人", diff --git a/src/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue b/src/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue index 6ea61076e..78cb74af0 100644 --- a/src/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue +++ b/src/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue @@ -5,6 +5,7 @@