ui: tape: only add tapestore and nav element once
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
f46573f8c3
commit
7d6f03a7fe
|
@ -119,25 +119,28 @@ Ext.define('PBS.view.main.NavigationTree', {
|
||||||
view.on('destroy', view.rstore.stopUpdate);
|
view.on('destroy', view.rstore.stopUpdate);
|
||||||
|
|
||||||
if (PBS.enableTapeUI) {
|
if (PBS.enableTapeUI) {
|
||||||
view.tapestore = Ext.create('Proxmox.data.UpdateStore', {
|
if (view.tapestore === undefined) {
|
||||||
autoStart: true,
|
view.tapestore = Ext.create('Proxmox.data.UpdateStore', {
|
||||||
interval: 2 * 1000,
|
autoStart: true,
|
||||||
storeid: 'pbs-tape-drive-list',
|
interval: 2 * 1000,
|
||||||
model: 'pbs-tape-drive-list',
|
storeid: 'pbs-tape-drive-list',
|
||||||
});
|
model: 'pbs-tape-drive-list',
|
||||||
|
});
|
||||||
|
view.tapestore.on('load', this.onTapeDriveLoad, this);
|
||||||
|
view.on('destroy', view.tapestore.stopUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
let root = view.getStore().getRoot();
|
let root = view.getStore().getRoot();
|
||||||
root.insertChild(3, {
|
if (root.findChild('id', 'tape_management', false) === null) {
|
||||||
text: "Tape Backup",
|
root.insertChild(3, {
|
||||||
iconCls: 'pbs-icon-tape',
|
text: "Tape Backup",
|
||||||
id: 'tape_management',
|
iconCls: 'pbs-icon-tape',
|
||||||
path: 'pbsTapeManagement',
|
id: 'tape_management',
|
||||||
expanded: true,
|
path: 'pbsTapeManagement',
|
||||||
children: [],
|
expanded: true,
|
||||||
});
|
children: [],
|
||||||
|
});
|
||||||
view.tapestore.on('load', this.onTapeDriveLoad, this);
|
}
|
||||||
view.on('destroy', view.tapestore.stopUpdate);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue