pve-manager/www/manager6/sdn/Browser.js
Alexandre Derumier 1d9643f67c sdn: add subnet/ipam/sdn management
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2021-04-26 15:43:47 +02:00

52 lines
1012 B
JavaScript

Ext.define('PVE.sdn.Browser', {
extend: 'PVE.panel.Config',
alias: 'widget.PVE.sdn.Browser',
onlineHelp: 'chapter_pvesdn',
initComponent: function() {
var me = this;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
throw "no node name specified";
}
var sdnid = me.pveSelNode.data.sdn;
if (!sdnid) {
throw "no sdn ID specified";
}
me.items = [];
var caps = Ext.state.Manager.get('GuiCap');
Ext.apply(me, {
title: Ext.String.format(gettext("Zone {0} on node {1}"),
"'" + sdnid + "'", "'" + nodename + "'"),
hstateid: 'sdntab',
});
if (caps.sdn['SDN.Audit']) {
me.items.push({
xtype: 'pveSDNZoneContentView',
title: gettext('Content'),
iconCls: 'fa fa-th',
itemId: 'content',
});
}
if (caps.sdn['Permissions.Modify']) {
me.items.push({
xtype: 'pveACLView',
title: gettext('Permissions'),
iconCls: 'fa fa-unlock',
itemId: 'permissions',
path: '/sdn/zones/' + sdnid,
});
}
me.callParent();
},
});