diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json
index 5c26b9971..0564d3208 100644
--- a/src/i18n/langs/en.json
+++ b/src/i18n/langs/en.json
@@ -201,6 +201,8 @@
"NoSQLProtocol": "NoSQL Protocol"
},
"assets": {
+ "BulkUpdatePlatformHelpText": "Modify only assets of the same type",
+ "ImportMessage": "Please go to the page of mapping type to import data",
"PushAccount": "Push account",
"AuthUsername": "Auth using username",
"Secure": "Secure",
diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json
index 3a9c9e247..0ab104de8 100644
--- a/src/i18n/langs/ja.json
+++ b/src/i18n/langs/ja.json
@@ -201,6 +201,8 @@
"NoSQLProtocol": "非リレーショナルデータベース"
},
"assets": {
+ "BulkUpdatePlatformHelpText": "同じタイプの資産のみ変更",
+ "ImportMessage": "ミラータイプのページにデータをインポートしてください",
"PushAccount": "アカウント情報をプッシュ",
"AuthUsername": "ユーザー名を使用した認証",
"Secure": "安全である",
diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json
index a655bd363..9013f440c 100644
--- a/src/i18n/langs/zh.json
+++ b/src/i18n/langs/zh.json
@@ -202,6 +202,8 @@
"NoSQLProtocol": "非关系数据库"
},
"assets": {
+ "BulkUpdatePlatformHelpText": "只修改相同类型的资产",
+ "ImportMessage": "请前往对映类型的页面导入数据",
"PushAccount": "推送账号",
"SSHPort": "SSH 端口",
"AuthUsername": "使用用户名认证",
diff --git a/src/views/assets/Asset/AssetList/AllList.vue b/src/views/assets/Asset/AssetList/AllList.vue
index 81d0cef20..d73263978 100644
--- a/src/views/assets/Asset/AssetList/AllList.vue
+++ b/src/views/assets/Asset/AssetList/AllList.vue
@@ -50,7 +50,11 @@ export default {
category: 'all'
},
headerActions: {
- hasImport: false
+ handleImportClick: ({ selectedRows }) => {
+ this.$message.warning({
+ message: this.$t('assets.ImportMessage')
+ })
+ }
},
addExtraMoreActions: [],
helpMessage: this.$t('assets.AssetListHelpMessage')
diff --git a/src/views/assets/Asset/AssetList/components/AssetBulkUpdateDialog.vue b/src/views/assets/Asset/AssetList/components/AssetBulkUpdateDialog.vue
index a375feca4..f627530f9 100644
--- a/src/views/assets/Asset/AssetList/components/AssetBulkUpdateDialog.vue
+++ b/src/views/assets/Asset/AssetList/components/AssetBulkUpdateDialog.vue
@@ -35,14 +35,30 @@ export default {
data() {
const meta = assetFieldsMeta(this)
const exclude = ['device', 'cloud', 'web']
+ const platformQuery = this.category === 'all' ? '' : this.category
return {
tips: this.$t('assets.AssetBulkUpdateTips'),
formSetting: {
url: '/api/v1/assets/assets/',
hasSaveContinue: false,
- initial: {},
- fields: ['nodes', 'domain', 'labels', 'is_active', 'comment'],
+ fields: ['platform', 'nodes', 'domain', 'labels', 'is_active', 'comment'],
fieldsMeta: {
+ platform: {
+ el: {
+ multiple: false,
+ ajax: {
+ url: `/api/v1/assets/platforms/?category=${platformQuery}`,
+ transformOption: (item) => {
+ return { label: item.name, value: item.id }
+ }
+ }
+ },
+ rules: [
+ { required: false }
+ ],
+ label: this.$t('assets.Platform'),
+ helpText: this.$t('assets.BulkUpdatePlatformHelpText')
+ },
nodes: {
...meta.nodes,
label: this.$t('assets.Node')
diff --git a/src/views/assets/Asset/AssetList/components/BaseList.vue b/src/views/assets/Asset/AssetList/components/BaseList.vue
index ae3a06fa2..1df71ce44 100644
--- a/src/views/assets/Asset/AssetList/components/BaseList.vue
+++ b/src/views/assets/Asset/AssetList/components/BaseList.vue
@@ -8,6 +8,7 @@