add qemu BIOS option
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Dec 2015 10:40:02 +0000 (11:40 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Dec 2015 10:41:08 +0000 (11:41 +0100)
www/manager/Makefile
www/manager/Utils.js
www/manager/form/QemuBiosSelector.js [new file with mode: 0644]
www/manager/qemu/Options.js
www/manager/qemu/QemuBiosEdit.js [new file with mode: 0644]

index 55a7ef5232f918a6af970ebc3124ca9b569e07f5..deeb9cb409d16884074d29777e75c3849e2548d2 100644 (file)
@@ -62,6 +62,7 @@ JSSRC=                                                        \
        form/BackupModeSelector.js                      \
        form/ScsiHwSelector.js                          \
        form/FirewallPolicySelector.js                  \
+       form/QemuBiosSelector.js                        \
        dc/Tasks.js                                     \
        dc/Log.js                                       \
        panel/StatusPanel.js                            \
@@ -133,6 +134,7 @@ JSSRC=                                                      \
        qemu/HardwareView.js                            \
        qemu/StartupEdit.js                             \
        qemu/ScsiHwEdit.js                              \
+       qemu/QemuBiosEdit.js                            \
        qemu/Options.js                                 \
        qemu/Snapshot.js                                \
        qemu/Clone.js                                   \
index 8158cc7099dd000f3559a1eadcd5fe6ba3c91132..9fd4eb3fc61f1d5bac35c68c851402a9c7bd8b36 100644 (file)
@@ -139,6 +139,18 @@ Ext.define('PVE.Utils', { statics: {
            PVE.Utils.unknownText;
     },
 
+    render_qemu_bios: function(value) {
+       if (!value) {
+           return PVE.Utils.defaultText + ' (SeaBIOS)';
+       } else if (value === 'seabios') {
+           return "SeaBIOS";
+       } else if (value === 'ovmf') {
+           return "OVMF (UEFI)";
+       } else {
+           return value;
+       }
+    },
+
     render_scsihw: function(value) {
        if (!value) {
            return PVE.Utils.defaultText + ' (LSI 53C895A)';
diff --git a/www/manager/form/QemuBiosSelector.js b/www/manager/form/QemuBiosSelector.js
new file mode 100644 (file)
index 0000000..5fda02e
--- /dev/null
@@ -0,0 +1,16 @@
+Ext.define('PVE.form.QemuBiosSelector', {
+    extend: 'PVE.form.KVComboBox',
+    alias: ['widget.pveQemuBiosSelector'],
+
+    initComponent: function() {
+       var me = this;
+
+        me.data = [
+           ['', PVE.Utils.render_qemu_bios('')],
+           ['seabios', PVE.Utils.render_qemu_bios('seabios')],
+           ['ovmf', PVE.Utils.render_qemu_bios('ovmf')]
+       ];
+
+       me.callParent();
+    }
+});
index 5d9846fe339daab5086f706e51e427cbbf752049..c31af13b570a88b346d8326d753cad0e4f7c57a3 100644 (file)
@@ -162,6 +162,12 @@ Ext.define('PVE.qemu.Options', {
                renderer: PVE.Utils.render_scsihw,
                defaultValue: ''
            },
+           bios: {
+               header: 'BIOS',
+               editor: caps.vms['VM.Config.Options'] ? 'PVE.qemu.BiosEdit' : undefined,
+               renderer: PVE.Utils.render_qemu_bios,
+               defaultValue: ''
+           },
            kvm: {
                header: gettext('KVM hardware virtualization'),
                defaultValue: true,
diff --git a/www/manager/qemu/QemuBiosEdit.js b/www/manager/qemu/QemuBiosEdit.js
new file mode 100644 (file)
index 0000000..f3e9bd0
--- /dev/null
@@ -0,0 +1,21 @@
+Ext.define('PVE.qemu.BiosEdit', {
+    extend: 'PVE.window.Edit',
+
+    initComponent : function() {
+       var me = this;
+
+       Ext.applyIf(me, {
+           subject: 'BIOS',
+           items: {
+               xtype: 'pveQemuBiosSelector',
+               name: 'bios',
+               value: '',
+               fieldLabel: 'BIOS'
+           }
+       });
+
+       me.callParent();
+
+       me.load();
+    }
+});