rootVisible: false,
+ title: gettext('Content'),
+
controller: {
xclass: 'Ext.app.ViewController',
groupField: 'backup-group',
});
- view.title = gettext('Data Store Content: ') + view.datastore;
-
Proxmox.Utils.monStoreErrors(view, view.store, true);
this.reload(); // initial load
},
--- /dev/null
+Ext.define('PBS.DataStorePanel', {
+ extend: 'Ext.tab.Panel',
+ alias: 'widget.pbsDataStorePanel',
+ mixins: ['Proxmox.Mixin.CBind'],
+
+ cbindData: function(initalConfig) {
+ let me = this;
+ return {
+ aclPath: `/datastore/${me.datastore}`,
+ };
+ },
+
+ border: false,
+ defaults: {
+ border: false,
+ },
+
+ items: [
+ {
+ xtype: 'pbsDataStoreContent',
+ cbind: {
+ datastore: '{datastore}',
+ },
+ },
+ {
+ itemId: 'acl',
+ xtype: 'pbsACLView',
+ aclExact: true,
+ cbind: {
+ aclPath: '{aclPath}',
+ },
+ },
+ ],
+
+ initComponent: function() {
+ let me = this;
+ me.title = `${gettext("Data Store")}: ${me.datastore}`;
+ me.callParent();
+ },
+});
beforeChangePath: function(path, subpath, action) {
var me = this;
- if (!Ext.ClassManager.getByAlias('widget.'+ path)) {
- console.warn('xtype "'+path+'" not found');
+ let xtype = path;
+ let datastore;
+ let isDataStore = PBS.Utils.isDataStorePath(path);
+ if (isDataStore) {
+ xtype = 'pbsDataStorePanel';
+ datastore = PBS.Utils.getDataStoreFromPath(path);
+ }
+
+ if (!Ext.ClassManager.getByAlias(`widget.${xtype}`)) {
+ console.warn(`xtype ${xtype} not found`);
action.stop();
return;
}
var lastpanel = me.lookupReference('contentpanel').getLayout().getActiveItem();
- if (lastpanel && lastpanel.xtype === path) {
- if (path === 'pbsDataStoreContent') {
- subpath = subpath || '';
- if (subpath === lastpanel.datastore) {
+ if (lastpanel && lastpanel.xtype === xtype) {
+ if (isDataStore) {
+ if (datastore === lastpanel.datastore) {
action.stop();
return;
}
var lastpanel = contentpanel.getLayout().getActiveItem();
var obj;
- if (path === 'pbsDataStoreContent') {
- obj = contentpanel.add({ xtype: path, datastore: subpath, border: false });
+ if (PBS.Utils.isDataStorePath(path)) {
+ let datastore = PBS.Utils.getDataStoreFromPath(path);
+ obj = contentpanel.add({
+ xtype: 'pbsDataStorePanel',
+ datastore,
+ });
} else {
obj = contentpanel.add({ xtype: path, border: false });
}
DataStoreConfig.js \
DataStoreStatus.js \
DataStoreContent.js \
+ DataStorePanel.js \
ServerStatus.js \
ServerAdministration.js \
Dashboard.js \
if (!list.findChild('text', name, false)) {
list.appendChild({
text: name,
- path: 'pbsDataStoreContent:' + name,
+ path: `DataStore-${name}`,
iconCls: 'fa fa-database',
leaf: true
});
Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, false);
},
+ dataStorePrefix: 'DataStore-',
+
+ getDataStoreFromPath: function(path) {
+ return path.slice(PBS.Utils.dataStorePrefix.length);
+ },
+
+ isDataStorePath: function(path) {
+ return path.indexOf(PBS.Utils.dataStorePrefix) === 0;
+ },
+
constructor: function() {
var me = this;