diff --git a/src/components/AccountCreateUpdateForm/index.vue b/src/components/AccountCreateUpdateForm/index.vue
index c82770883..d59c3f8ca 100644
--- a/src/components/AccountCreateUpdateForm/index.vue
+++ b/src/components/AccountCreateUpdateForm/index.vue
@@ -161,7 +161,7 @@ export default {
push_now: {
hidden: () => {
const automation = this.iPlatform.automation || {}
- return !automation.push_account_enabled || !automation.ansible_enabled || !this.$hasPerm('assets.push_assetaccount')
+ return !automation.push_account_enabled || !automation.ansible_enabled || !this.$hasPerm('accounts.push_account')
}
}
},
diff --git a/src/components/AccountListTable/AccountList.vue b/src/components/AccountListTable/AccountList.vue
index f058039dd..dc2eebe28 100644
--- a/src/components/AccountListTable/AccountList.vue
+++ b/src/components/AccountListTable/AccountList.vue
@@ -208,11 +208,11 @@ export default {
{
name: 'Test',
title: this.$t('common.Test'),
- can: this.$hasPerm('assets.test_account'),
+ can: this.$hasPerm('accounts.verify_account'),
callback: ({ row }) => {
this.$axios.post(
- `/api/v1/accounts/accounts/${row.id}/verify/`,
- { action: 'test' }
+ `/api/v1/accounts/accounts/tasks/`,
+ { action: 'verify', accounts: [row.id] }
).then(res => {
openTaskPage(res['task'])
})
diff --git a/src/components/AutoDataTable/index.vue b/src/components/AutoDataTable/index.vue
index b1a74c196..65e6dec9e 100644
--- a/src/components/AutoDataTable/index.vue
+++ b/src/components/AutoDataTable/index.vue
@@ -232,6 +232,16 @@ export default {
}
return col
},
+ addOrderingIfNeed(col) {
+ if (col.prop) {
+ const column = this.meta[col.prop] || {}
+ if (column.order) {
+ col.sortable = 'custom'
+ col['column-key'] = col.prop
+ }
+ }
+ return col
+ },
setDefaultFormatterIfNeed(col) {
if (!col.formatter) {
col.formatter = (row, column, cellValue) => {
@@ -247,6 +257,7 @@ export default {
}
return col
},
+
generateColumn(name) {
const colMeta = this.meta[name] || {}
const customMeta = this.config.columnsMeta ? this.config.columnsMeta[name] : {}
@@ -258,6 +269,7 @@ export default {
col = Object.assign(col, customMeta)
col = this.addHelpTipsIfNeed(col)
col = this.addFilterIfNeed(col)
+ col = this.addOrderingIfNeed(col)
return col
},
generateTotalColumns() {
diff --git a/src/components/DetailCard/ItemValue.vue b/src/components/DetailCard/ItemValue.vue
index 5ad55e6a5..2916b4ced 100644
--- a/src/components/DetailCard/ItemValue.vue
+++ b/src/components/DetailCard/ItemValue.vue
@@ -85,4 +85,7 @@ export default {
diff --git a/src/components/DetailCard/auto.vue b/src/components/DetailCard/auto.vue
index 02719300c..fc827a6f9 100644
--- a/src/components/DetailCard/auto.vue
+++ b/src/components/DetailCard/auto.vue
@@ -29,6 +29,10 @@ export default {
showUndefine: {
type: Boolean,
default: true
+ },
+ formatters: {
+ type: Object,
+ default: () => ({})
}
},
data() {
@@ -103,7 +107,7 @@ export default {
value = toSafeLocalDateStr(value)
} else if (fieldMeta.type === 'labeled_choice') {
value = value?.['label']
- } else if (fieldMeta.type === 'related_field') {
+ } else if (fieldMeta.type === 'related_field' || fieldMeta.type === 'nested object') {
value = value['name']
} else if (fieldMeta.type === 'm2m_related_field') {
value = value.map(item => item['name']).join(', ')
@@ -121,7 +125,8 @@ export default {
const item = {
key: label,
- value: value
+ value: value,
+ formatter: this.formatters[name]
}
this.items.push(item)
}
diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json
index 4ec8e174e..c5c5d7b77 100644
--- a/src/i18n/langs/en.json
+++ b/src/i18n/langs/en.json
@@ -197,6 +197,7 @@
"NoSQLProtocol": "NoSQL Protocol"
},
"assets": {
+ "PushAccount": "Push account",
"AuthUsername": "Auth using username",
"Secure": "Secure",
"AssetBulkUpdateTips": "device、cloud、web,Batch update of domain is not supported",
diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json
index fcf9941f1..538cbac9c 100644
--- a/src/i18n/langs/ja.json
+++ b/src/i18n/langs/ja.json
@@ -197,6 +197,7 @@
"NoSQLProtocol": "非リレーショナルデータベース"
},
"assets": {
+ "PushAccount": "アカウント情報をプッシュ",
"AuthUsername": "ユーザー名を使用した認証",
"Secure": "安全である",
"AssetBulkUpdateTips": "ネットワークデバイス、クラウドサービス、Web、一括更新ネットワークドメインはサポートされていません",
diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json
index 09d153091..162866927 100644
--- a/src/i18n/langs/zh.json
+++ b/src/i18n/langs/zh.json
@@ -197,6 +197,7 @@
"NoSQLProtocol": "非关系数据库"
},
"assets": {
+ "PushAccount": "推送账号",
"SSHPort": "SSH 端口",
"AuthUsername": "使用用户名认证",
"Secure": "安全",
diff --git a/src/router/console/accounts.js b/src/router/console/accounts.js
index feb27701c..ad4f79556 100644
--- a/src/router/console/accounts.js
+++ b/src/router/console/accounts.js
@@ -15,7 +15,7 @@ export default [
{
path: '',
name: 'AssetAccountList',
- component: () => import('@/views/accounts/AssetAccount/AssetAccountList'),
+ component: () => import('@/views/accounts/Account/AccountList.vue'),
meta: {
title: i18n.t('route.AssetAccount'),
app: 'accounts',
@@ -24,7 +24,7 @@ export default [
},
{
path: ':id',
- component: () => import('@/views/accounts/AssetAccount/AssetAccountDetail/index.vue'),
+ component: () => import('@/views/accounts/Account/AccountDetail/index.vue'),
name: 'AssetAccountDetail',
meta: { title: i18n.t('route.AssetAccount') },
hidden: true
diff --git a/src/views/accounts/AssetAccount/AssetAccountDetail/Detail.vue b/src/views/accounts/Account/AccountDetail/Detail.vue
similarity index 69%
rename from src/views/accounts/AssetAccount/AssetAccountDetail/Detail.vue
rename to src/views/accounts/Account/AccountDetail/Detail.vue
index 851d598e7..a1a4049e4 100644
--- a/src/views/accounts/AssetAccount/AssetAccountDetail/Detail.vue
+++ b/src/views/accounts/Account/AccountDetail/Detail.vue
@@ -1,10 +1,10 @@