perf: 资产全局导入提示及批量更新平台

This commit is contained in:
feng
2023-03-15 16:17:25 +08:00
parent 4e89c8d53f
commit 24a5c6be43
6 changed files with 30 additions and 3 deletions

View File

@@ -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",

View File

@@ -201,6 +201,8 @@
"NoSQLProtocol": "非リレーショナルデータベース"
},
"assets": {
"BulkUpdatePlatformHelpText": "同じタイプの資産のみ変更",
"ImportMessage": "ミラータイプのページにデータをインポートしてください",
"PushAccount": "アカウント情報をプッシュ",
"AuthUsername": "ユーザー名を使用した認証",
"Secure": "安全である",

View File

@@ -202,6 +202,8 @@
"NoSQLProtocol": "非关系数据库"
},
"assets": {
"BulkUpdatePlatformHelpText": "只修改相同类型的资产",
"ImportMessage": "请前往对映类型的页面导入数据",
"PushAccount": "推送账号",
"SSHPort": "SSH 端口",
"AuthUsername": "使用用户名认证",

View File

@@ -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')

View File

@@ -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')

View File

@@ -8,6 +8,7 @@
<AssetBulkUpdateDialog
:visible.sync="updateSelectedDialogSetting.visible"
v-bind="updateSelectedDialogSetting"
:category="category"
/>
<GatewayDialog
:cell="GatewayCell"