]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/storage/DirEdit.js
use Checkbox from widget toolkit
[pve-manager.git] / www / manager6 / storage / DirEdit.js
index ec20c60e0c535c21d2be4203f96b0bd66756da0f..625cf0ce8c77b24a592325db4df7b41499093f0e 100644 (file)
@@ -1,10 +1,11 @@
 Ext.define('PVE.storage.DirInputPanel', {
     extend: 'PVE.panel.InputPanel',
+    controller: 'storageEdit',
 
     onGetValues: function(values) {
        var me = this;
 
-       if (me.create) {
+       if (me.isCreate) {
            values.type = 'dir';
        } else {
            delete values.storage;
@@ -22,17 +23,15 @@ Ext.define('PVE.storage.DirInputPanel', {
 
        me.column1 = [
            {
-               xtype: me.create ? 'textfield' : 'displayfield',
+               xtype: me.isCreate ? 'textfield' : 'displayfield',
                name: 'storage',
-               height: 22, // hack: set same height as text fields
                value: me.storageId || '',
                fieldLabel: 'ID',
                vtype: 'StorageId',
                allowBlank: false
            },
            {
-               xtype: me.create ? 'textfield' : 'displayfield',
-               height: 22, // hack: set same height as text fields
+               xtype: me.isCreate ? 'textfield' : 'displayfield',
                name: 'path',
                value: '',
                fieldLabel: gettext('Directory'),
@@ -50,30 +49,32 @@ Ext.define('PVE.storage.DirInputPanel', {
 
        me.column2 = [
            {
-               xtype: 'pvecheckbox',
+               xtype: 'proxmoxcheckbox',
                name: 'enable',
                checked: true,
                uncheckedValue: 0,
                fieldLabel: gettext('Enable')
            },
            {
-               xtype: 'pvecheckbox',
+               xtype: 'proxmoxcheckbox',
                name: 'shared',
                uncheckedValue: 0,
                fieldLabel: gettext('Shared')
            },
            {
-               xtype: 'numberfield',
+               xtype: 'proxmoxintegerfield',
                fieldLabel: gettext('Max Backups'),
+               disabled: true,
                name: 'maxfiles',
+               reference: 'maxfiles',
                minValue: 0,
                maxValue: 365,
-               value: me.create ? '1' : undefined,
+               value: me.isCreate ? '1' : undefined,
                allowBlank: false
            }
        ];
 
-       if (me.create || me.storageId !== 'local') {
+       if (me.isCreate || me.storageId !== 'local') {
            me.column2.unshift({
                xtype: 'pveNodeSelector',
                name: 'nodes',
@@ -95,9 +96,9 @@ Ext.define('PVE.storage.DirEdit', {
     initComponent : function() {
        var me = this;
 
-       me.create = !me.storageId;
+       me.isCreate = !me.storageId;
 
-       if (me.create) {
+       if (me.isCreate) {
             me.url = '/api2/extjs/storage';
             me.method = 'POST';
         } else {
@@ -106,7 +107,7 @@ Ext.define('PVE.storage.DirEdit', {
         }
 
        var ipanel = Ext.create('PVE.storage.DirInputPanel', {
-           create: me.create,
+           isCreate: me.isCreate,
            storageId: me.storageId
        });
 
@@ -118,7 +119,7 @@ Ext.define('PVE.storage.DirEdit', {
 
        me.callParent();
 
-       if (!me.create) {
+       if (!me.isCreate) {
            me.load({
                success:  function(response, options) {
                    var values = response.result.data;