ui: Add storage name to delete primary/secondary storage dialog (#5359)

* Add storage name to delete primary/secondary storage dialog

* show display name in alert message

* Update AutogenView.vue
This commit is contained in:
Hoang Nguyen 2021-08-24 14:28:41 +07:00 committed by GitHub
parent 74b6332572
commit bc28ae4606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -111,7 +111,8 @@ export default {
label: 'label.action.delete.primary.storage',
dataView: true,
args: ['forced'],
show: (record) => { return (record.state === 'Down' || record.state === 'Maintenance' || record.state === 'Disconnected') }
show: (record) => { return (record.state === 'Down' || record.state === 'Maintenance' || record.state === 'Disconnected') },
displayName: (record) => { return record.name || record.displayName || record.id }
}
]
}

View File

@ -84,7 +84,8 @@ export default {
icon: 'delete',
label: 'label.action.delete.secondary.storage',
message: 'message.action.delete.secondary.storage',
dataView: true
dataView: true,
displayName: (record) => { return record.name || record.displayName || record.id }
}
]
}

View File

@ -143,9 +143,14 @@
</a>
</span>
<a-spin :spinning="actionLoading">
<span v-if="currentAction.message">
<span v-if="currentAction.message || 'displayName' in currentAction">
<a-alert type="warning">
<span slot="message" v-html="$t(currentAction.message)" />
<span slot="message">
<div v-if="currentAction.message" v-html="$t(currentAction.message)"></div>
<div v-if="'displayName' in currentAction">
<strong>{{ currentAction.displayName(resource) }}</strong>
</div>
</span>
</a-alert>
<br v-if="currentAction.paramFields.length > 0"/>
</span>