ui: datastore: use safe destroy as base for dialog
only ask the name of the current NS, not the full NS path to avoid too long input requirements on deep levels. needs a few smaller hacks, ideally we would pull out the basic stuff from Edit window in some EditBase window and let both, SafeDestroy and Edit window derive from that, for better common, in sync features. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -571,16 +571,16 @@ Ext.define('PBS.DataStoreContent', {
|
||||
let view = me.getView();
|
||||
if (!view.namespace || view.namespace === '') {
|
||||
console.warn('forgetNamespace called with root NS!');
|
||||
return;
|
||||
return;
|
||||
}
|
||||
let parentNS = view.namespace.split('/').slice(0, -1).join('/');
|
||||
let nsParts = view.namespace.split('/');
|
||||
let nsName = nsParts.pop();
|
||||
let parentNS = nsParts.join('/');
|
||||
|
||||
Ext.create('PBS.window.NamespaceDelete', {
|
||||
title: Ext.String.format(gettext("Destroy Namespace '{0}'"), view.namespace),
|
||||
url: `/admin/datastore/${view.datastore}/namespace`,
|
||||
datastore: view.datastore,
|
||||
namespace: view.namespace,
|
||||
autoShow: true,
|
||||
item: { id: nsName },
|
||||
apiCallDone: success => {
|
||||
if (success) {
|
||||
view.namespace = parentNS; // move up before reload to avoid "ENOENT" error
|
||||
|
Reference in New Issue
Block a user