]> git.proxmox.com Git - pve-manager.git/commitdiff
copy dc/PoolEdit.js from manager to manager5
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 16 Jun 2015 15:42:36 +0000 (17:42 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 16 Jun 2015 15:42:36 +0000 (17:42 +0200)
www/manager5/dc/PoolEdit.js [new file with mode: 0644]

diff --git a/www/manager5/dc/PoolEdit.js b/www/manager5/dc/PoolEdit.js
new file mode 100644 (file)
index 0000000..42196e7
--- /dev/null
@@ -0,0 +1,48 @@
+Ext.define('PVE.dc.PoolEdit', {
+    extend: 'PVE.window.Edit',
+    alias: ['widget.pveDcPoolEdit'],
+
+    initComponent : function() {
+        var me = this;
+
+        me.create = !me.poolid;
+
+        var url;
+        var method;
+
+        if (me.create) {
+            url = '/api2/extjs/pools';
+            method = 'POST';
+        } else {
+            url = '/api2/extjs/pools/' + me.poolid;
+            method = 'PUT';
+        }
+
+        Ext.applyIf(me, {
+            subject: gettext('Pool'),
+            url: url,
+            method: method,
+            items: [
+                {
+                   xtype: me.create ? 'pvetextfield' : 'displayfield',
+                   fieldLabel: gettext('Name'),
+                   name: 'poolid',
+                   value: me.poolid,
+                   allowBlank: false
+               },
+                {
+                   xtype: 'textfield',
+                   fieldLabel: gettext('Comment'),
+                   name: 'comment',
+                   allowBlank: true
+               }
+            ]
+        });
+
+        me.callParent();
+
+        if (!me.create) {
+            me.load();
+        }
+    }
+});