public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 0/2] removing of 'storeid'/refactor tapeStore
@ 2021-03-12 12:29 Dominik Csapak
  2021-03-12 12:29 ` [pbs-devel] [PATCH proxmox-backup 1/2] ui: remove unecessary storeids Dominik Csapak
  2021-03-12 12:29 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: refactor reloadTapeStore Dominik Csapak
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2021-03-12 12:29 UTC (permalink / raw)
  To: pbs-devel

since we do not need it anymore, remove it
patch 2/2 improves the tapeStore handling by using the StoreManager

note that this series can only be used if we bump widget-toolkit
and depend here on the new version

Dominik Csapak (2):
  ui: remove unecessary storeids
  ui: refactor reloadTapeStore

 www/Dashboard.js                     |  3 ---
 www/NavigationTree.js                | 12 +-----------
 www/Utils.js                         |  4 ++++
 www/config/ACLView.js                |  1 -
 www/config/RemoteView.js             |  1 -
 www/config/SyncView.js               |  1 -
 www/config/TfaView.js                |  2 --
 www/config/TokenView.js              |  3 ---
 www/config/UserView.js               |  1 -
 www/config/VerifyView.js             |  1 -
 www/dashboard/DataStoreStatistics.js |  1 -
 www/dashboard/LongestTasks.js        |  1 -
 www/data/RunningTasksStore.js        |  1 -
 www/datastore/DataStoreList.js       |  2 --
 www/tape/BackupJobs.js               |  1 -
 www/tape/ChangerConfig.js            |  8 +-------
 www/tape/DriveConfig.js              |  8 +-------
 www/tape/EncryptionKeys.js           |  1 -
 www/tape/PoolConfig.js               |  1 -
 www/tape/TapeInventory.js            |  1 -
 20 files changed, 7 insertions(+), 47 deletions(-)

-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 1/2] ui: remove unecessary storeids
  2021-03-12 12:29 [pbs-devel] [PATCH proxmox-backup 0/2] removing of 'storeid'/refactor tapeStore Dominik Csapak
@ 2021-03-12 12:29 ` Dominik Csapak
  2021-03-12 12:29 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: refactor reloadTapeStore Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2021-03-12 12:29 UTC (permalink / raw)
  To: pbs-devel

they are not required by the UpdateStore anymore and serve
no purpose

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/Dashboard.js                     | 3 ---
 www/NavigationTree.js                | 2 --
 www/config/ACLView.js                | 1 -
 www/config/RemoteView.js             | 1 -
 www/config/SyncView.js               | 1 -
 www/config/TfaView.js                | 2 --
 www/config/TokenView.js              | 3 ---
 www/config/UserView.js               | 1 -
 www/config/VerifyView.js             | 1 -
 www/dashboard/DataStoreStatistics.js | 1 -
 www/dashboard/LongestTasks.js        | 1 -
 www/data/RunningTasksStore.js        | 1 -
 www/datastore/DataStoreList.js       | 2 --
 www/tape/BackupJobs.js               | 1 -
 www/tape/ChangerConfig.js            | 1 -
 www/tape/DriveConfig.js              | 1 -
 www/tape/EncryptionKeys.js           | 1 -
 www/tape/PoolConfig.js               | 1 -
 www/tape/TapeInventory.js            | 1 -
 19 files changed, 26 deletions(-)

diff --git a/www/Dashboard.js b/www/Dashboard.js
index 52107a8e..80a0702f 100644
--- a/www/Dashboard.js
+++ b/www/Dashboard.js
@@ -193,7 +193,6 @@ Ext.define('PBS.Dashboard', {
 
 	stores: {
 	    usage: {
-		storeid: 'dash-usage',
 		type: 'update',
 		interval: 3000,
 		autoStart: true,
@@ -208,7 +207,6 @@ Ext.define('PBS.Dashboard', {
 		},
 	    },
 	    subscription: {
-		storeid: 'dash-subscription',
 		type: 'update',
 		interval: 10000,
 		autoStart: true,
@@ -223,7 +221,6 @@ Ext.define('PBS.Dashboard', {
 		},
 	    },
 	    tasks: {
-		storeid: 'dash-tasks',
 		type: 'update',
 		interval: 15000,
 		autoStart: true,
diff --git a/www/NavigationTree.js b/www/NavigationTree.js
index 6d288f09..c609d9a4 100644
--- a/www/NavigationTree.js
+++ b/www/NavigationTree.js
@@ -111,7 +111,6 @@ Ext.define('PBS.view.main.NavigationTree', {
 	    view.rstore = Ext.create('Proxmox.data.UpdateStore', {
 		autoStart: true,
 		interval: 15 * 1000,
-		storeid: 'pbs-datastore-list',
 		model: 'pbs-datastore-list',
 	    });
 
@@ -123,7 +122,6 @@ Ext.define('PBS.view.main.NavigationTree', {
 		    view.tapestore = Ext.create('Proxmox.data.UpdateStore', {
 			autoStart: true,
 			interval: 60 * 1000,
-			storeid: 'pbs-tape-drive-list',
 			model: 'pbs-tape-drive-list',
 		    });
 		    view.tapestore.on('load', this.onTapeDriveLoad, this);
diff --git a/www/config/ACLView.js b/www/config/ACLView.js
index bab929a2..a3da8b50 100644
--- a/www/config/ACLView.js
+++ b/www/config/ACLView.js
@@ -141,7 +141,6 @@ Ext.define('PBS.config.ACLView', {
 	sorters: 'aclid',
 	rstore: {
 	    type: 'update',
-	    storeid: 'pmx-acls',
 	    model: 'pmx-acls',
 	    interval: 5000,
 	},
diff --git a/www/config/RemoteView.js b/www/config/RemoteView.js
index bf55e02c..646d3ea7 100644
--- a/www/config/RemoteView.js
+++ b/www/config/RemoteView.js
@@ -83,7 +83,6 @@ Ext.define('PBS.config.RemoteView', {
 	sorters: 'name',
 	rstore: {
 	    type: 'update',
-	    storeid: 'pmx-remotes',
 	    model: 'pmx-remotes',
 	    autoStart: true,
 	    interval: 5000,
diff --git a/www/config/SyncView.js b/www/config/SyncView.js
index 7d7e751c..fdf6d256 100644
--- a/www/config/SyncView.js
+++ b/www/config/SyncView.js
@@ -134,7 +134,6 @@ Ext.define('PBS.config.SyncJobView', {
 	sorters: 'id',
 	rstore: {
 	    type: 'update',
-	    storeid: 'pbs-sync-jobs-status',
 	    model: 'pbs-sync-jobs-status',
 	    interval: 5000,
 	},
diff --git a/www/config/TfaView.js b/www/config/TfaView.js
index 26f0e7b2..4fbccc03 100644
--- a/www/config/TfaView.js
+++ b/www/config/TfaView.js
@@ -30,7 +30,6 @@ Ext.define('PBS.config.TfaView', {
 	rstore: {
 	    type: 'store',
 	    proxy: 'memory',
-	    storeid: 'pbs-tfa-entry',
 	    model: 'pbs-tfa-entry',
 	},
     },
@@ -43,7 +42,6 @@ Ext.define('PBS.config.TfaView', {
 	    view.tfaStore = Ext.create('Proxmox.data.UpdateStore', {
 		autoStart: true,
 		interval: 5 * 1000,
-		storeid: 'pbs-tfa-users',
 		model: 'pbs-tfa-users',
 	    });
 	    view.tfaStore.on('load', this.onLoad, this);
diff --git a/www/config/TokenView.js b/www/config/TokenView.js
index 6282a4d4..6cd1d7c2 100644
--- a/www/config/TokenView.js
+++ b/www/config/TokenView.js
@@ -39,8 +39,6 @@ Ext.define('PBS.config.TokenView', {
 	    view.userStore = Ext.create('Proxmox.data.UpdateStore', {
 		autoStart: true,
 		interval: 5 * 1000,
-		storeId: 'pbs-users-with-tokens',
-		storeid: 'pbs-users-with-tokens',
 		model: 'pbs-users-with-tokens',
 	    });
 	    view.userStore.on('load', this.onLoad, this);
@@ -137,7 +135,6 @@ Ext.define('PBS.config.TokenView', {
 	rstore: {
 	    type: 'store',
 	    proxy: 'memory',
-	    storeid: 'pbs-tokens',
 	    model: 'pbs-tokens',
 	},
     },
diff --git a/www/config/UserView.js b/www/config/UserView.js
index ae313776..9d58e0a7 100644
--- a/www/config/UserView.js
+++ b/www/config/UserView.js
@@ -114,7 +114,6 @@ Ext.define('PBS.config.UserView', {
 	sorters: 'userid',
 	rstore: {
 	    type: 'update',
-	    storeid: 'pmx-users',
 	    model: 'pmx-users',
 	    autoStart: true,
 	    interval: 5000,
diff --git a/www/config/VerifyView.js b/www/config/VerifyView.js
index 91ce3a43..fd599cb3 100644
--- a/www/config/VerifyView.js
+++ b/www/config/VerifyView.js
@@ -129,7 +129,6 @@ Ext.define('PBS.config.VerifyJobView', {
 	sorters: 'id',
 	rstore: {
 	    type: 'update',
-	    storeid: 'pbs-verify-jobs-status',
 	    model: 'pbs-verify-jobs-status',
 	    interval: 5000,
 	},
diff --git a/www/dashboard/DataStoreStatistics.js b/www/dashboard/DataStoreStatistics.js
index 13e1d160..eebbcfaa 100644
--- a/www/dashboard/DataStoreStatistics.js
+++ b/www/dashboard/DataStoreStatistics.js
@@ -125,7 +125,6 @@ Ext.define('PBS.DatastoreStatistics', {
 	sorters: 'store',
 	rstore: {
 	    type: 'update',
-	    storeid: 'pbs-datastore-statistics',
 	    model: 'pbs-datastore-statistics',
 	    autoStart: true,
 	    interval: 30000,
diff --git a/www/dashboard/LongestTasks.js b/www/dashboard/LongestTasks.js
index 20cf1183..b5488684 100644
--- a/www/dashboard/LongestTasks.js
+++ b/www/dashboard/LongestTasks.js
@@ -66,7 +66,6 @@ Ext.define('PBS.LongestTasks', {
 	    },
 	],
 	rstore: {
-	    storeid: 'proxmox-tasks-dash',
 	    type: 'store',
 	    model: 'proxmox-tasks',
 	    proxy: {
diff --git a/www/data/RunningTasksStore.js b/www/data/RunningTasksStore.js
index 1f8cf04c..2a007236 100644
--- a/www/data/RunningTasksStore.js
+++ b/www/data/RunningTasksStore.js
@@ -8,7 +8,6 @@ Ext.define('PBS.data.RunningTasksStore', {
 	config = config || {};
 	Ext.apply(config, {
 	    interval: 3000,
-	    storeid: 'pbs-running-tasks-dash',
 	    model: 'proxmox-tasks',
 	    proxy: {
 		type: 'proxmox',
diff --git a/www/datastore/DataStoreList.js b/www/datastore/DataStoreList.js
index 353709d3..0d5f934f 100644
--- a/www/datastore/DataStoreList.js
+++ b/www/datastore/DataStoreList.js
@@ -133,7 +133,6 @@ Ext.define('PBS.datastore.DataStoreList', {
 	me.since = (Date.now()/1000 - 30 * 24*3600).toFixed(0);
 
 	me.usageStore = Ext.create('Proxmox.data.UpdateStore', {
-	    storeid: 'datastore-overview-usage',
 	    interval: 5000,
 	    proxy: {
 		type: 'proxmox',
@@ -148,7 +147,6 @@ Ext.define('PBS.datastore.DataStoreList', {
 	});
 
 	me.taskStore = Ext.create('Proxmox.data.UpdateStore', {
-	    storeid: 'datastore-overview-tasks',
 	    interval: 15000,
 	    model: 'proxmox-tasks',
 	    proxy: {
diff --git a/www/tape/BackupJobs.js b/www/tape/BackupJobs.js
index 84b260b9..badc7c6c 100644
--- a/www/tape/BackupJobs.js
+++ b/www/tape/BackupJobs.js
@@ -128,7 +128,6 @@ Ext.define('PBS.config.TapeBackupJobView', {
 	sorters: 'id',
 	rstore: {
 	    type: 'update',
-	    storeid: 'pbs-tape-backup-job-status',
 	    model: 'pbs-tape-backup-job-status',
 	    interval: 5000,
 	},
diff --git a/www/tape/ChangerConfig.js b/www/tape/ChangerConfig.js
index 1c048b23..0d9f6db6 100644
--- a/www/tape/ChangerConfig.js
+++ b/www/tape/ChangerConfig.js
@@ -72,7 +72,6 @@ Ext.define('PBS.TapeManagement.ChangerPanel', {
 	type: 'diff',
 	rstore: {
 	    type: 'update',
-	    storeid: 'proxmox-tape-changers',
 	    model: 'pbs-model-changers',
 	    proxy: {
 		type: 'proxmox',
diff --git a/www/tape/DriveConfig.js b/www/tape/DriveConfig.js
index 40d4b2a9..a65de63a 100644
--- a/www/tape/DriveConfig.js
+++ b/www/tape/DriveConfig.js
@@ -89,7 +89,6 @@ Ext.define('PBS.TapeManagement.DrivePanel', {
 	type: 'diff',
 	rstore: {
 	    type: 'update',
-	    storeid: 'proxmox-tape-drives',
 	    model: 'pbs-model-drives',
 	    proxy: {
 		type: 'proxmox',
diff --git a/www/tape/EncryptionKeys.js b/www/tape/EncryptionKeys.js
index a4f91ccc..6420f10f 100644
--- a/www/tape/EncryptionKeys.js
+++ b/www/tape/EncryptionKeys.js
@@ -84,7 +84,6 @@ Ext.define('PBS.TapeManagement.EncryptionPanel', {
 	type: 'diff',
 	rstore: {
 	    type: 'update',
-	    storeid: 'proxmox-tape-encryption-keys',
 	    model: 'pbs-tape-encryption-keys',
 	    proxy: {
 		type: 'proxmox',
diff --git a/www/tape/PoolConfig.js b/www/tape/PoolConfig.js
index 3f3e1a18..9b09bae5 100644
--- a/www/tape/PoolConfig.js
+++ b/www/tape/PoolConfig.js
@@ -75,7 +75,6 @@ Ext.define('PBS.TapeManagement.PoolPanel', {
 	type: 'diff',
 	rstore: {
 	    type: 'update',
-	    storeid: 'proxmox-tape-media-pools',
 	    model: 'pbs-model-media-pool',
 	    proxy: {
 		type: 'proxmox',
diff --git a/www/tape/TapeInventory.js b/www/tape/TapeInventory.js
index 555445ff..b23d04e1 100644
--- a/www/tape/TapeInventory.js
+++ b/www/tape/TapeInventory.js
@@ -171,7 +171,6 @@ Ext.define('PBS.TapeManagement.TapeInventory', {
     },
 
     store: {
-	storeid: 'proxmox-tape-tapes',
 	model: 'pbs-model-tapes',
 	sorters: 'label-text',
 	groupField: 'pool',
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 2/2] ui: refactor reloadTapeStore
  2021-03-12 12:29 [pbs-devel] [PATCH proxmox-backup 0/2] removing of 'storeid'/refactor tapeStore Dominik Csapak
  2021-03-12 12:29 ` [pbs-devel] [PATCH proxmox-backup 1/2] ui: remove unecessary storeids Dominik Csapak
@ 2021-03-12 12:29 ` Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2021-03-12 12:29 UTC (permalink / raw)
  To: pbs-devel

by making use of the Ext.StoreManager and moving the code to PBS.Utils.
This is ok since the store exists for the whole time of the UI (if it does at
all).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/NavigationTree.js     | 10 +---------
 www/Utils.js              |  4 ++++
 www/tape/ChangerConfig.js |  7 +------
 www/tape/DriveConfig.js   |  7 +------
 4 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/www/NavigationTree.js b/www/NavigationTree.js
index c609d9a4..35edacc5 100644
--- a/www/NavigationTree.js
+++ b/www/NavigationTree.js
@@ -121,6 +121,7 @@ Ext.define('PBS.view.main.NavigationTree', {
 		if (view.tapestore === undefined) {
 		    view.tapestore = Ext.create('Proxmox.data.UpdateStore', {
 			autoStart: true,
+			storeId: 'pbs-tape-drive-list',
 			interval: 60 * 1000,
 			model: 'pbs-tape-drive-list',
 		    });
@@ -267,15 +268,6 @@ Ext.define('PBS.view.main.NavigationTree', {
 	},
     },
 
-    reloadTapeStore: function() {
-	let me = this;
-	if (!PBS.enableTapeUI) {
-	    return;
-	}
-
-	me.tapestore.load();
-    },
-
     select: function(path, silent) {
 	var me = this;
 	if (me.rstore.isLoaded() && (!PBS.enableTapeUI || me.tapestore.isLoaded())) {
diff --git a/www/Utils.js b/www/Utils.js
index 6c8ca5cb..7c54ca41 100644
--- a/www/Utils.js
+++ b/www/Utils.js
@@ -620,6 +620,10 @@ Ext.define('PBS.Utils', {
 	return `${icon} ${value}`;
     },
 
+    reloadTapeStore() {
+	Ext.StoreManager.get('pbs-tape-drive-list').load();
+    },
+
 });
 
 Ext.define('PBS.Async', {
diff --git a/www/tape/ChangerConfig.js b/www/tape/ChangerConfig.js
index 0d9f6db6..8de61ff0 100644
--- a/www/tape/ChangerConfig.js
+++ b/www/tape/ChangerConfig.js
@@ -11,11 +11,6 @@ Ext.define('PBS.TapeManagement.ChangerPanel', {
     controller: {
 	xclass: 'Ext.app.ViewController',
 
-	reloadTapeStore: function() {
-	    let navtree = Ext.ComponentQuery.query('navigationtree')[0];
-	    navtree.reloadTapeStore();
-	},
-
 	onAdd: function() {
 	    let me = this;
 	    Ext.create('PBS.TapeManagement.ChangerEditWindow', {
@@ -45,7 +40,7 @@ Ext.define('PBS.TapeManagement.ChangerPanel', {
 
 	reload: function() {
 	    this.getView().getStore().rstore.load();
-	    this.reloadTapeStore();
+	    PBS.Utils.reloadTapeStore();
 	},
 
 	stopStore: function() {
diff --git a/www/tape/DriveConfig.js b/www/tape/DriveConfig.js
index a65de63a..ed73d028 100644
--- a/www/tape/DriveConfig.js
+++ b/www/tape/DriveConfig.js
@@ -19,11 +19,6 @@ Ext.define('PBS.TapeManagement.DrivePanel', {
     controller: {
 	xclass: 'Ext.app.ViewController',
 
-	reloadTapeStore: function() {
-	    let navtree = Ext.ComponentQuery.query('navigationtree')[0];
-	    navtree.reloadTapeStore();
-	},
-
 	onAdd: function() {
 	    let me = this;
 	    Ext.create('PBS.TapeManagement.DriveEditWindow', {
@@ -62,7 +57,7 @@ Ext.define('PBS.TapeManagement.DrivePanel', {
 
 	reload: function() {
 	    this.getView().getStore().rstore.load();
-	    this.reloadTapeStore();
+	    PBS.Utils.reloadTapeStore();
 	},
 
 	stopStore: function() {
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-12 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 12:29 [pbs-devel] [PATCH proxmox-backup 0/2] removing of 'storeid'/refactor tapeStore Dominik Csapak
2021-03-12 12:29 ` [pbs-devel] [PATCH proxmox-backup 1/2] ui: remove unecessary storeids Dominik Csapak
2021-03-12 12:29 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: refactor reloadTapeStore Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal