]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: move sync/verify jobs to the datastores
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 27 Oct 2020 15:20:08 +0000 (16:20 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Oct 2020 16:41:30 +0000 (17:41 +0100)
add the datastore as parameter for the store, remove
the datastore selector for the edit windows and give the datastore
to it instead

also remove the autostart from the rstore, since we only want to start
it when we change to the relevant tab

and add icons for all other datastore tabs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/DataStorePanel.js
www/NavigationTree.js
www/config/SyncView.js
www/config/VerifyView.js
www/window/SyncJobEdit.js
www/window/VerifyJobEdit.js

index a00ccd476938bc7951cdbd353a07c413df2375ce..059fd3b2c1a1beac802f1df63f8d680fd0cf5bae 100644 (file)
@@ -20,6 +20,7 @@ Ext.define('PBS.DataStorePanel', {
            xtype: 'pbsDataStoreSummary',
            title: gettext('Summary'),
            itemId: 'summary',
+           iconCls: 'fa fa-book',
            cbind: {
                datastore: '{datastore}',
            },
@@ -27,6 +28,7 @@ Ext.define('PBS.DataStorePanel', {
        {
            xtype: 'pbsDataStoreContent',
            itemId: 'content',
+           iconCls: 'fa fa-th',
            cbind: {
                datastore: '{datastore}',
            },
@@ -35,6 +37,23 @@ Ext.define('PBS.DataStorePanel', {
            title: gettext('Prune & Garbage collection'),
            xtype: 'pbsDataStorePruneAndGC',
            itemId: 'prunegc',
+           iconCls: 'fa fa-trash-o',
+           cbind: {
+               datastore: '{datastore}',
+           },
+       },
+       {
+           iconCls: 'fa fa-refresh',
+           itemId: 'syncjobs',
+           xtype: 'pbsSyncJobView',
+           cbind: {
+               datastore: '{datastore}',
+           },
+       },
+       {
+           iconCls: 'fa fa-check-circle',
+           itemId: 'verifyjobs',
+           xtype: 'pbsVerifyJobView',
            cbind: {
                datastore: '{datastore}',
            },
@@ -42,6 +61,7 @@ Ext.define('PBS.DataStorePanel', {
        {
            itemId: 'acl',
            xtype: 'pbsACLView',
+           iconCls: 'fa fa-unlock',
            aclExact: true,
            cbind: {
                aclPath: '{aclPath}',
index a2835cd2c4b59f9aa606473ad5a55eabe9996e73..c37e26130c6099737be56a758acc93643f0f520c 100644 (file)
@@ -36,18 +36,6 @@ Ext.define('PBS.store.NavigationStore', {
                        path: 'pbsRemoteView',
                        leaf: true,
                    },
-                   {
-                       text: gettext('Sync Jobs'),
-                       iconCls: 'fa fa-refresh',
-                       path: 'pbsSyncJobView',
-                       leaf: true,
-                   },
-                   {
-                       text: gettext('Verify Jobs'),
-                       iconCls: 'fa fa-check-circle',
-                       path: 'pbsVerifyJobView',
-                       leaf: true,
-                   },
                    {
                        text: gettext('Subscription'),
                        iconCls: 'fa fa-support',
index 679624a816bed3bebaebcdc2cba6ca73fe26567f..513ddd9b384fd6043d9e63a4ec17e4c674ba690d 100644 (file)
@@ -12,6 +12,7 @@ Ext.define('pbs-sync-jobs-status', {
                return endtime - task.starttime;
            },
        },
+       'comment',
     ],
     idProperty: 'id',
     proxy: {
@@ -34,7 +35,9 @@ Ext.define('PBS.config.SyncJobView', {
 
        addSyncJob: function() {
            let me = this;
+           let view = me.getView();
             Ext.create('PBS.window.SyncJobEdit', {
+               datastore: view.datastore,
                listeners: {
                    destroy: function() {
                        me.reload();
@@ -50,6 +53,7 @@ Ext.define('PBS.config.SyncJobView', {
            if (selection.length < 1) return;
 
             Ext.create('PBS.window.SyncJobEdit', {
+               datastore: view.datastore,
                 id: selection[0].data.id,
                listeners: {
                    destroy: function() {
@@ -147,15 +151,22 @@ Ext.define('PBS.config.SyncJobView', {
            return Proxmox.Utils.render_timestamp(value);
        },
 
+       startStore: function() { this.getView().getStore().rstore.startUpdate(); },
+       stopStore: function() { this.getView().getStore().rstore.stopUpdate(); },
+
        reload: function() { this.getView().getStore().rstore.load(); },
 
        init: function(view) {
+           view.getStore().rstore.getProxy().setExtraParams({
+               store: view.datastore,
+           });
            Proxmox.Utils.monStoreErrors(view, view.getStore().rstore);
        },
     },
 
     listeners: {
-       activate: 'reload',
+       activate: 'startStore',
+       deactivate: 'stopStore',
        itemdblclick: 'editSyncJob',
     },
 
@@ -168,7 +179,6 @@ Ext.define('PBS.config.SyncJobView', {
            type: 'update',
            storeid: 'pbs-sync-jobs-status',
            model: 'pbs-sync-jobs-status',
-           autoStart: true,
            interval: 5000,
        },
     },
index db541cf421a23d7bea62bb3087c61731fc69780f..7e391226956e27347b220bb4aeaf5c0ef0cc38cd 100644 (file)
@@ -12,6 +12,7 @@ Ext.define('pbs-verify-jobs-status', {
                return endtime - task.starttime;
            },
        },
+       'comment',
     ],
     idProperty: 'id',
     proxy: {
@@ -34,7 +35,9 @@ Ext.define('PBS.config.VerifyJobView', {
 
        addVerifyJob: function() {
            let me = this;
+           let view = me.getView();
            Ext.create('PBS.window.VerifyJobEdit', {
+               datastore: view.datastore,
                listeners: {
                    destroy: function() {
                        me.reload();
@@ -50,6 +53,7 @@ Ext.define('PBS.config.VerifyJobView', {
            if (selection.length < 1) return;
 
            Ext.create('PBS.window.VerifyJobEdit', {
+               datastore: view.datastore,
                id: selection[0].data.id,
                listeners: {
                    destroy: function() {
@@ -147,15 +151,22 @@ Ext.define('PBS.config.VerifyJobView', {
            return Proxmox.Utils.render_timestamp(value);
        },
 
+       startStore: function() { this.getView().getStore().rstore.startUpdate(); },
+       stopStore: function() { this.getView().getStore().rstore.stopUpdate(); },
+
        reload: function() { this.getView().getStore().rstore.load(); },
 
        init: function(view) {
+           view.getStore().rstore.getProxy().setExtraParams({
+               store: view.datastore,
+           });
            Proxmox.Utils.monStoreErrors(view, view.getStore().rstore);
        },
     },
 
     listeners: {
-       activate: 'reload',
+       activate: 'startStore',
+       deactivate: 'stopStore',
        itemdblclick: 'editVerifyJob',
     },
 
@@ -168,7 +179,6 @@ Ext.define('PBS.config.VerifyJobView', {
            type: 'update',
            storeid: 'pbs-verify-jobs-status',
            model: 'pbs-verify-jobs-status',
-           autoStart: true,
            interval: 5000,
        },
     },
@@ -219,12 +229,6 @@ Ext.define('PBS.config.VerifyJobView', {
            renderer: Ext.String.htmlEncode,
            dataIndex: 'id',
        },
-       {
-           header: gettext('Datastore'),
-           width: 100,
-           sortable: true,
-           dataIndex: 'store',
-       },
        {
            header: gettext('Days valid'),
            width: 125,
index 08209e64ab4df0e0a33a889c654bf60ea1258f51..2002c2fad5e0094574b4cf4d45528ab4dbfb4ff8 100644 (file)
@@ -53,10 +53,12 @@ Ext.define('PBS.window.SyncJobEdit', {
                name: 'remote-store',
            },
            {
-               fieldLabel: gettext('Local Datastore'),
-               xtype: 'pbsDataStoreSelector',
+               xtype: 'hiddenfield',
                allowBlank: false,
                name: 'store',
+               cbind: {
+                   value: '{datastore}',
+               },
            },
        ],
 
index 9d29eba78a7dd88964fe185f9ef9bde7df4b6c1d..ddcf355bb6423970aa5dd02dac55f903c1b8a1cb 100644 (file)
@@ -41,10 +41,12 @@ Ext.define('PBS.window.VerifyJobEdit', {
                },
            },
            {
-               fieldLabel: gettext('Datastore'),
-               xtype: 'pbsDataStoreSelector',
+               xtype: 'hiddenfield',
                allowBlank: false,
                name: 'store',
+               cbind: {
+                   value: '{datastore}',
+               },
            },
            {
                xtype: 'proxmoxintegerfield',