]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: garbage-collection: use different state-id for global and per-datastore view master
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 May 2024 09:30:07 +0000 (11:30 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 May 2024 09:34:21 +0000 (11:34 +0200)
For one these different views have different columns shown, and more
importantly: with the state being shared one could change sorting in
the global view and then have that applied in the per-datastore view
too, even if one cannot sort that view explicitly otherwise as there's
just one row anyway. This small glitch might lead to a bit of
confusion in the worst case and looks unpolished in any way.

Note that I explicitly decided against encoding the datastore in the
state-id for the per-datastore views for now, as most users will want
to adapt layout (like column width) for all per-datastores views.

Having to re-do that for every datastore separately can be quite a
nuisance while the same user wanting different layout for each
datastore in their per-datastore view seems rather to be an edge case.
And we can always change this, so starting out with the slightly more
restricted design that has less browser local data to be saved seems
better w.r.t. maintainability.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/config/GCView.js

index 7733c265093cfe00f168de199493d1c319011541..a6e79fb342728fc0d31a1e21be0c13767edb05f4 100644 (file)
@@ -16,7 +16,6 @@ Ext.define('PBS.config.GCJobView', {
     alias: 'widget.pbsGCJobView',
 
     stateful: true,
     alias: 'widget.pbsGCJobView',
 
     stateful: true,
-    stateId: 'grid-gc-jobs-v1',
     allowDeselect: false,
 
     title: gettext('Garbage Collect Jobs'),
     allowDeselect: false,
 
     title: gettext('Garbage Collect Jobs'),
@@ -218,6 +217,8 @@ Ext.define('PBS.config.GCJobView', {
        let me = this;
        let isSingleDatastore = !!me.datastore;
 
        let me = this;
        let isSingleDatastore = !!me.datastore;
 
+       me.stateId = isSingleDatastore ? 'grid-gc-jobs-single' : 'grid-gc-jobs-v1';
+
        for (let column of me.columns) {
            column.sortable = !isSingleDatastore;
            if (column.dataIndex === 'store') {
        for (let column of me.columns) {
            column.sortable = !isSingleDatastore;
            if (column.dataIndex === 'store') {