]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
Hide 'Include RAM' when VM isn't running
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 6 Feb 2020 12:26:36 +0000 (13:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 6 Feb 2020 21:31:39 +0000 (22:31 +0100)
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
www/manager6/tree/SnapshotTree.js
www/manager6/window/Snapshot.js

index 0636ef68aadf2d4c8bb2a207ce7d2e6abb01a3e6..7b5ac3ed84dfd344b8d0318559e705aa30f1f800 100644 (file)
@@ -14,6 +14,7 @@ Ext.define('PVE.guest.SnapshotTree', {
            snapshotAllowed: false,
            rollbackAllowed: false,
            snapshotFeature: false,
+           running: false,
            selected: '',
            load_delay: 3000,
        },
@@ -54,6 +55,7 @@ Ext.define('PVE.guest.SnapshotTree', {
                isCreate: !edit,
                submitText: !edit ? gettext('Take Snapshot') : undefined,
                snapname: snapname,
+               running: vm.get('running'),
            });
            win.show();
            me.mon(win, 'destroy', me.reload, me);
@@ -129,6 +131,7 @@ Ext.define('PVE.guest.SnapshotTree', {
                        item.leaf = true;
                        item.children = [];
                        if (item.name === 'current') {
+                           vm.set('running', !!item.running);
                            digest = item.digest + item.running;
                            item.iconCls = PVE.Utils.get_object_icon_class(vm.get('type'), item);
                        } else {
index e4355106d6ea5ac89ef175bdb4424d6e70d85d0a..1a08637f9d238d4801fe94333a291702172e0327 100644 (file)
@@ -45,8 +45,8 @@ Ext.define('PVE.window.Snapshot', {
            },
            {
                xtype: 'proxmoxcheckbox',
-               hidden: me.type !== 'qemu' || !me.isCreate,
-               disabled: me.type !== 'qemu' || !me.isCreate,
+               hidden: me.type !== 'qemu' || !me.isCreate || !me.running,
+               disabled: me.type !== 'qemu' || !me.isCreate || !me.running,
                name: 'vmstate',
                uncheckedValue: 0,
                defaultValue: 0,