mirror of https://github.com/apache/cloudstack.git
ui: fix update vm details wrt backend changes (#4670)
PR #4629 made changes in updateVirtualMachine behaviour wrt readonly details. This change updates UI wrt new behaviour. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
8aa765ac39
commit
a691e87f0c
|
|
@ -176,6 +176,13 @@ export default {
|
|||
})
|
||||
this.disableSettings = (this.$route.meta.name === 'vm' && this.resource.state !== 'Stopped')
|
||||
},
|
||||
filterOrReadOnlyDetails () {
|
||||
for (var i = 0; i < this.details.length; i++) {
|
||||
if (!this.allowEditOfDetail(this.details[i].name)) {
|
||||
this.details.splice(i, 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
allowEditOfDetail (name) {
|
||||
if (this.resource.readonlyuidetails) {
|
||||
if (this.resource.readonlyuidetails.split(',').map(item => item.trim()).includes(name)) {
|
||||
|
|
@ -257,13 +264,16 @@ export default {
|
|||
}
|
||||
this.error = false
|
||||
this.details.push({ name: this.newKey, value: this.newValue })
|
||||
this.filterOrReadOnlyDetails()
|
||||
this.runApi()
|
||||
},
|
||||
updateDetail (index) {
|
||||
this.filterOrReadOnlyDetails()
|
||||
this.runApi()
|
||||
},
|
||||
deleteDetail (index) {
|
||||
this.details.splice(index, 1)
|
||||
this.filterOrReadOnlyDetails()
|
||||
this.runApi()
|
||||
},
|
||||
onShowAddDetail () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue