[pve-devel] [PATCH manager] fix #1884: qemu vm: pending deletion of cdrom/dvd drive shows as hard disk in hardware tab
David Limbeck
d.limbeck at proxmox.com
Fri Aug 24 10:56:36 CEST 2018
On 08/24/2018 10:51 AM, Thomas Lamprecht wrote:
> On 8/23/18 3:50 PM, David Limbeck wrote:
>> Signed-off-by: David Limbeck <d.limbeck at proxmox.com>
>> ---
>> www/manager6/qemu/HardwareView.js | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
>> index a87a9df1..9b99f77e 100644
>> --- a/www/manager6/qemu/HardwareView.js
>> +++ b/www/manager6/qemu/HardwareView.js
>> @@ -14,7 +14,15 @@ Ext.define('PVE.qemu.HardwareView', {
>> if (rowdef.tdCls) {
>> metaData.tdCls = rowdef.tdCls;
>> if (rowdef.tdCls == 'pve-itype-icon-storage') {
>> - var value = me.getObjectValue(key, '', true);
>> + var oldValue = me.getObjectValue(key, '', false);
>> + var newValue = me.getObjectValue(key, '', true);
>> + var value;
>> + if(oldValue === '') {
>> + value = newValue;
>> + }
>> + else {
> coding style nit: we always place else on the same line as the closing bracket.
>
> [...]
> } else {
> [...]
Still getting used to this kind of style, sorry. Should have looked over
it a few more times.
Will send v2 in a few minutes.
> but why so complicate and not just somethingh alike:
>
> ----8<----
> diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
> index a87a9df1..df9847da 100644
> --- a/www/manager6/qemu/HardwareView.js
> +++ b/www/manager6/qemu/HardwareView.js
> @@ -14,7 +14,10 @@ Ext.define('PVE.qemu.HardwareView', {
> if (rowdef.tdCls) {
> metaData.tdCls = rowdef.tdCls;
> if (rowdef.tdCls == 'pve-itype-icon-storage') {
> - var value = me.getObjectValue(key, '', true);
> + var value = me.getObjectValue(key, '', false);
> + if(value === '') {
> + value = me.getObjectValue(key, '', true);
> + }
> if (value.match(/vm-.*-cloudinit/)) {
> metaData.tdCls = 'pve-itype-icon-cloud';
> return rowdef.cloudheader;
> ---->8----
>
> ?
>
>
>> + value = oldValue;
>> + }
>> if (value.match(/vm-.*-cloudinit/)) {
>> metaData.tdCls = 'pve-itype-icon-cloud';
>> return rowdef.cloudheader;
>>
More information about the pve-devel
mailing list