ui: adapt to s/backup-ns/ns/ api param change

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-05-13 14:21:52 +02:00
parent b70a12e723
commit cf99333b83
4 changed files with 15 additions and 15 deletions

View File

@ -114,7 +114,7 @@ Ext.define('PBS.DataStoreContent', {
let url = `/api2/json/admin/datastore/${view.datastore}/snapshots`; let url = `/api2/json/admin/datastore/${view.datastore}/snapshots`;
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
url += `?backup-ns=${encodeURIComponent(view.namespace)}`; url += `?ns=${encodeURIComponent(view.namespace)}`;
} }
this.store.setProxy({ this.store.setProxy({
type: 'proxmox', type: 'proxmox',
@ -160,7 +160,7 @@ Ext.define('PBS.DataStoreContent', {
try { try {
let url = `/api2/extjs/admin/datastore/${view.datastore}/groups`; let url = `/api2/extjs/admin/datastore/${view.datastore}/groups`;
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
url += `?backup-ns=${encodeURIComponent(view.namespace)}`; url += `?ns=${encodeURIComponent(view.namespace)}`;
} }
let { result: { data: groups } } = await Proxmox.Async.api2({ url }); let { result: { data: groups } } = await Proxmox.Async.api2({ url });
let map = {}; let map = {};
@ -514,7 +514,7 @@ Ext.define('PBS.DataStoreContent', {
}; };
} }
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
params['backup-ns'] = view.namespace; params.ns = view.namespace;
} }
Proxmox.Utils.API2Request({ Proxmox.Utils.API2Request({
@ -552,7 +552,7 @@ Ext.define('PBS.DataStoreContent', {
}; };
} }
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
params['backup-ns'] = view.namespace; params.ns = view.namespace;
} }
Ext.create('PBS.window.NotesEdit', { Ext.create('PBS.window.NotesEdit', {
@ -572,7 +572,7 @@ Ext.define('PBS.DataStoreContent', {
"backup-id": data.backup_id, "backup-id": data.backup_id,
}; };
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
params['backup-ns'] = view.namespace; params.ns = view.namespace;
} }
Ext.create('Proxmox.window.SafeDestroy', { Ext.create('Proxmox.window.SafeDestroy', {
@ -609,7 +609,7 @@ Ext.define('PBS.DataStoreContent', {
"backup-time": (data['backup-time'].getTime()/1000).toFixed(0), "backup-time": (data['backup-time'].getTime()/1000).toFixed(0),
}; };
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
params['backup-ns'] = view.namespace; params.ns = view.namespace;
} }
Proxmox.Utils.API2Request({ Proxmox.Utils.API2Request({
@ -644,7 +644,7 @@ Ext.define('PBS.DataStoreContent', {
'backup-time': time, 'backup-time': time,
}; };
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
params['backup-ns'] = view.namespace; params.ns = view.namespace;
} }
let url = `/api2/extjs/admin/datastore/${view.datastore}/protected`; let url = `/api2/extjs/admin/datastore/${view.datastore}/protected`;
@ -719,7 +719,7 @@ Ext.define('PBS.DataStoreContent', {
'file-name': file, 'file-name': file,
}; };
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
params['backup-ns'] = view.namespace; params.ns = view.namespace;
} }
let idx = file.lastIndexOf('.'); let idx = file.lastIndexOf('.');
@ -759,7 +759,7 @@ Ext.define('PBS.DataStoreContent', {
'backup-type': type, 'backup-type': type,
}; };
if (view.namespace && view.namespace !== '') { if (view.namespace && view.namespace !== '') {
extraParams['backup-ns'] = view.namespace; extraParams.ns = view.namespace;
} }
Ext.create('Proxmox.window.FileBrowser', { Ext.create('Proxmox.window.FileBrowser', {
title: `${type}/${id}/${timetext}`, title: `${type}/${id}/${timetext}`,

View File

@ -50,7 +50,7 @@ Ext.define('PBS.Datastore.PruneInputPanel', {
values["backup-type"] = me.backup_type; values["backup-type"] = me.backup_type;
values["backup-id"] = me.backup_id; values["backup-id"] = me.backup_id;
if (me.ns && me.ns !== '') { if (me.ns && me.ns !== '') {
values['backup-ns'] = me.ns; values.ns = me.ns;
} }
return values; return values;
}, },
@ -126,7 +126,7 @@ Ext.define('PBS.Datastore.PruneInputPanel', {
let params = view.getValues(); let params = view.getValues();
params["dry-run"] = true; params["dry-run"] = true;
if (view.ns && view.ns !== '') { if (view.ns && view.ns !== '') {
params['backup-ns'] = view.ns; params.ns = view.ns;
} }
Proxmox.Utils.API2Request({ Proxmox.Utils.API2Request({

View File

@ -30,7 +30,7 @@ Ext.define('PBS.BackupGroupChangeOwner', {
values["backup-type"] = me.backup_type; values["backup-type"] = me.backup_type;
values["backup-id"] = me.backup_id; values["backup-id"] = me.backup_id;
if (me.ns && me.ns !== '') { if (me.ns && me.ns !== '') {
values['backup-ns'] = me.ns; values.ns = me.ns;
} }
return values; return values;
}, },

View File

@ -24,15 +24,15 @@ Ext.define('PBS.window.VerifyAll', {
data: { ignoreVerified: true }, data: { ignoreVerified: true },
}, },
onGetValues: values => { onGetValues: values => {
if (!values['backup-ns'] || values['backup-ns'] === '') { if (!values.ns || values.ns === '') {
delete values['backup-ns']; delete values.ns;
} }
return values; return values;
}, },
items: [ items: [
{ {
xtype: 'pbsNamespaceSelector', xtype: 'pbsNamespaceSelector',
name: 'backup-ns', name: 'ns',
fieldLabel: gettext('Namespace'), fieldLabel: gettext('Namespace'),
cbind: { cbind: {
datastore: '{datastore}', datastore: '{datastore}',