]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/lxc/Options.js
use Proxmox.Utils instead of PVE.Utils
[pve-manager.git] / www / manager6 / lxc / Options.js
index 8c45fb1c14b8dbcd6a884f72817e063a622b3dfa..c1da432f32564828155f37eed0090ca95d9c425d 100644 (file)
@@ -25,7 +25,7 @@ Ext.define('PVE.lxc.Options', {
            onboot: {
                header: gettext('Start at boot'),
                defaultValue: '',
-               renderer: PVE.Utils.format_boolean,
+               renderer: Proxmox.Utils.format_boolean,
                editor: caps.vms['VM.Config.Options'] ? {
                    xtype: 'pveWindowEdit',
                    subject: gettext('Start at boot'),
@@ -43,23 +43,26 @@ Ext.define('PVE.lxc.Options', {
                defaultValue: '',
                renderer: PVE.Utils.render_kvm_startup,
                editor: caps.vms['VM.Config.Options'] && caps.nodes['Sys.Modify'] ? 
-                   'PVE.qemu.StartupEdit' : undefined
+                   {
+                       xtype: 'pveWindowStartupEdit',
+                       onlineHelp: 'pct_startup_and_shutdown'
+                   } : undefined
            },
            ostype: {
                header: gettext('OS Type'),
-               defaultValue: PVE.Utils.unknownText
+               defaultValue: Proxmox.Utils.unknownText
            },
            arch: {
                header: gettext('Architecture'),
-               defaultValue: PVE.Utils.unknownText
+               defaultValue: Proxmox.Utils.unknownText
            },
            console: {
-               header: gettext('Enable /dev/console'),
+               header: '/dev/console',
                defaultValue: 1,
-               renderer: PVE.Utils.format_boolean,
+               renderer: Proxmox.Utils.format_enabled_toggle,
                editor: caps.vms['VM.Config.Options'] ? {
                    xtype: 'pveWindowEdit',
-                   subject: gettext('Enable /dev/console'),
+                   subject: '/dev/console',
                    items: {
                        xtype: 'pvecheckbox',
                        name: 'console',
@@ -67,7 +70,7 @@ Ext.define('PVE.lxc.Options', {
                        defaultValue: 1,
                        deleteDefaultValue: true,
                        checked: true,
-                       fieldLabel: gettext('Enable /dev/console')
+                       fieldLabel: '/dev/console'
                    }
                } : undefined
            },
@@ -78,23 +81,14 @@ Ext.define('PVE.lxc.Options', {
                    xtype: 'pveWindowEdit',
                    subject: gettext('TTY count'),
                    items: {
-                       xtype: 'pveIntegerField',
+                       xtype: 'proxmoxintegerfield',
                        name: 'tty',
                        minValue: 0,
                        maxValue: 6,
                        value: 2,
                        fieldLabel: gettext('TTY count'),
-                       allowEmpty: gettext('Default'),
-                       getSubmitData: function() {
-                           var me = this;
-                           var val = me.getSubmitValue();
-                           if (val !== null && val !== '' && val !== '2') {
-                               return { tty: val };
-                           } else {
-                               return { 'delete' : 'tty' };
-                           }
-                       }
-
+                       emptyText: gettext('Default'),
+                       deleteEmpty: true
                    }
                } : undefined
            },
@@ -110,7 +104,7 @@ Ext.define('PVE.lxc.Options', {
                        deleteEmpty: true,
                        value: '__default__',
                        comboItems: [
-                           ['__default__', PVE.Utils.defaultText + " (tty)"],
+                           ['__default__', Proxmox.Utils.defaultText + " (tty)"],
                            ['tty', "/dev/tty[X]"],
                            ['console', "/dev/console"],
                            ['shell', "shell"]
@@ -119,22 +113,27 @@ Ext.define('PVE.lxc.Options', {
                    }
                } : undefined
            },
-            protection: {
-                header: gettext('Protection'),
-                defaultValue: false,
-                renderer: PVE.Utils.format_boolean,
-                editor: caps.vms['VM.Config.Options'] ? {
-                    xtype: 'pveWindowEdit',
-                    subject: gettext('Protection'),
-                    items: {
-                        xtype: 'pvecheckbox',
-                        name: 'protection',
-                        uncheckedValue: 0,
-                        defaultValue: 0,
-                        deleteDefaultValue: true,
-                        fieldLabel: gettext('Enabled')
-                    }
-                } : undefined
+           protection: {
+               header: gettext('Protection'),
+               defaultValue: false,
+               renderer: Proxmox.Utils.format_boolean,
+               editor: caps.vms['VM.Config.Options'] ? {
+                   xtype: 'pveWindowEdit',
+                   subject: gettext('Protection'),
+                   items: {
+                       xtype: 'pvecheckbox',
+                       name: 'protection',
+                       uncheckedValue: 0,
+                       defaultValue: 0,
+                       deleteDefaultValue: true,
+                       fieldLabel: gettext('Enabled')
+                   }
+               } : undefined
+           },
+           unprivileged: {
+               header: gettext('Unprivileged container'),
+               renderer: Proxmox.Utils.format_boolean,
+               defaultValue: 0
            }
        };
 
@@ -178,7 +177,7 @@ Ext.define('PVE.lxc.Options', {
            win.on('destroy', reload);
        };
 
-       var edit_btn = new PVE.button.Button({
+       var edit_btn = new Proxmox.button.Button({
            text: gettext('Edit'),
            disabled: true,
            selModel: sm,