UI bug fix: 'Invalid ip address' when change vm ip address (#5744)

This commit is contained in:
Wei Zhou 2021-12-03 06:58:42 +01:00 committed by GitHub
parent 14d09a9fab
commit 46fa7f473d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -586,10 +586,13 @@ export default {
if (this.loadingNic) return
this.loadingNic = true
this.showUpdateIpModal = false
api('updateVmNicIp', {
nicId: this.editIpAddressNic,
ipaddress: this.editIpAddressValue
}).then(response => {
const params = {
nicId: this.editIpAddressNic
}
if (this.editIpAddressValue) {
params.ipaddress = this.editIpAddressValue
}
api('updateVmNicIp', params).then(response => {
this.$pollJob({
jobId: response.updatevmnicipresponse.jobid,
successMessage: this.$t('message.success.update.ipaddress'),