1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 00:46:05 +00:00

fix(instances): a running VM's options and CPU edits keep the pending changes

On an active VM the options and CPU forms write the persistent definition
but showed the running VM's title, description and vCPUs, so saving one
posted the live values back over a pending change. They now read the
persistent definition (get_vcpu, get_cur_vcpu, get_title and
get_description take config=).

Buttons in the settings and resize tabs that were disabled only by class
get the disabled attribute: Enter in a field no longer submits a form
the page shows as unavailable while the VM runs.
This commit is contained in:
catborise 2026-10-11 11:00:49 +03:00
parent ea9424ee1f
commit 042530fbfd
8 changed files with 106 additions and 37 deletions

View file

@ -166,6 +166,25 @@ class Instance(models.Model):
"""QoS of the persistent definition, which the QoS form changes."""
return self.proxy.get_all_qos(config=True)
@cached_property
def config_vcpu(self) -> int:
"""vCPUs of the persistent definition, which the CPU form changes."""
return self.proxy.get_vcpu(config=True)
@cached_property
def config_cur_vcpu(self) -> int:
return self.proxy.get_cur_vcpu(config=True)
@cached_property
def config_title(self) -> str:
"""Title and description of the persistent definition, which the
options form changes."""
return self.proxy.get_title(config=True)
@cached_property
def config_description(self) -> str:
return self.proxy.get_description(config=True)
@cached_property
def telnet_port(self):
return self.proxy.get_telnet_port()