From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id D5442629F3
 for <pbs-devel@lists.proxmox.com>; Tue, 27 Oct 2020 16:20:46 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id B92A518C3C
 for <pbs-devel@lists.proxmox.com>; Tue, 27 Oct 2020 16:20:16 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [212.186.127.180])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 156A318C0D
 for <pbs-devel@lists.proxmox.com>; Tue, 27 Oct 2020 16:20:14 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C067F45F6F
 for <pbs-devel@lists.proxmox.com>; Tue, 27 Oct 2020 16:20:13 +0100 (CET)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Date: Tue, 27 Oct 2020 16:20:08 +0100
Message-Id: <20201027152011.7373-6-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20201027152011.7373-1-d.csapak@proxmox.com>
References: <20201027152011.7373-1-d.csapak@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.458 Adjusted score from AWL reputation of From: address
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_DNSWL_MED        -2.3 Sender listed at https://www.dnswl.org/,
 medium trust
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pbs-devel] [PATCH proxmox-backup 5/8] ui: move sync/verify jobs to
 the datastores
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 27 Oct 2020 15:20:46 -0000

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       | 20 ++++++++++++++++++++
 www/NavigationTree.js       | 12 ------------
 www/config/SyncView.js      | 14 ++++++++++++--
 www/config/VerifyView.js    | 20 ++++++++++++--------
 www/window/SyncJobEdit.js   |  6 ++++--
 www/window/VerifyJobEdit.js |  6 ++++--
 6 files changed, 52 insertions(+), 26 deletions(-)

diff --git a/www/DataStorePanel.js b/www/DataStorePanel.js
index a00ccd47..059fd3b2 100644
--- a/www/DataStorePanel.js
+++ b/www/DataStorePanel.js
@@ -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}',
diff --git a/www/NavigationTree.js b/www/NavigationTree.js
index a2835cd2..c37e2613 100644
--- a/www/NavigationTree.js
+++ b/www/NavigationTree.js
@@ -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',
diff --git a/www/config/SyncView.js b/www/config/SyncView.js
index 679624a8..513ddd9b 100644
--- a/www/config/SyncView.js
+++ b/www/config/SyncView.js
@@ -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,
 	},
     },
diff --git a/www/config/VerifyView.js b/www/config/VerifyView.js
index db541cf4..7e391226 100644
--- a/www/config/VerifyView.js
+++ b/www/config/VerifyView.js
@@ -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,
diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js
index 08209e64..2002c2fa 100644
--- a/www/window/SyncJobEdit.js
+++ b/www/window/SyncJobEdit.js
@@ -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}',
+		},
 	    },
 	],
 
diff --git a/www/window/VerifyJobEdit.js b/www/window/VerifyJobEdit.js
index 9d29eba7..ddcf355b 100644
--- a/www/window/VerifyJobEdit.js
+++ b/www/window/VerifyJobEdit.js
@@ -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',
-- 
2.20.1