mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
UI: decode userdata in EditVM dialog (#7796)
This commit is contained in:
parent
60ab494c25
commit
87f218c68c
@ -283,6 +283,10 @@ export default {
|
||||
this.$notifyError(error)
|
||||
}).finally(() => { this.groups.loading = false })
|
||||
},
|
||||
decodeUserData (userdata) {
|
||||
const decodedData = Buffer.from(userdata, 'base64')
|
||||
return decodedData.toString('utf-8')
|
||||
},
|
||||
fetchUserData () {
|
||||
const params = {
|
||||
id: this.resource.id,
|
||||
@ -290,7 +294,7 @@ export default {
|
||||
}
|
||||
|
||||
api('listVirtualMachines', params).then(json => {
|
||||
this.form.userdata = atob(json.listvirtualmachinesresponse.virtualmachine[0].userdata || '')
|
||||
this.form.userdata = this.decodeUserData(json.listvirtualmachinesresponse.virtualmachine[0].userdata || '')
|
||||
})
|
||||
},
|
||||
handleSubmit () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user