]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/dc/PoolView.js
use Button from widget toolkit
[pve-manager.git] / www / manager6 / dc / PoolView.js
index a65944cc45281ed37001cefc46c3b676d1c58519..94b539384871bcbea5d19496b2bd8ada77e0ca2f 100644 (file)
@@ -3,6 +3,11 @@ Ext.define('PVE.dc.PoolView', {
 
     alias: ['widget.pvePoolView'],
 
+    onlineHelp: 'pveum_pools',
+
+    stateful: true,
+    stateId: 'grid-pools',
+
     initComponent : function() {
        var me = this;
 
@@ -20,26 +25,11 @@ Ext.define('PVE.dc.PoolView', {
 
        var sm = Ext.create('Ext.selection.RowModel', {});
 
-       var remove_btn = new PVE.button.Button({
-           text: gettext('Remove'),
-           disabled: true,
+       var remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
            selModel: sm,
-           confirmMsg: function (rec) {
-               return Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
-                                        "'" + rec.data.poolid + "'");
-           },
-           handler: function(btn, event, rec) {
-               PVE.Utils.API2Request({
-                   url: '/pools/' + rec.data.poolid,
-                   method: 'DELETE',
-                   waitMsgTarget: me,
-                   callback: function() {
-                       reload();
-                   },
-                   failure: function (response, opts) {
-                       Ext.Msg.alert(gettext('Error'), response.htmlStatus);
-                   }
-               });
+           baseurl: '/pools/',
+           callback: function () {
+               reload();
            }
        });
 
@@ -56,7 +46,7 @@ Ext.define('PVE.dc.PoolView', {
             win.show();
        };
 
-       var edit_btn = new PVE.button.Button({
+       var edit_btn = new Proxmox.button.Button({
            text: gettext('Edit'),
            disabled: true,
            selModel: sm,
@@ -80,7 +70,6 @@ Ext.define('PVE.dc.PoolView', {
        Ext.apply(me, {
            store: store,
            selModel: sm,
-           stateful: false,
            tbar: tbar,
            viewConfig: {
                trackOver: false