Commit 872b15d9 authored by Dietmar Maurer's avatar Dietmar Maurer

copy form/BridgeSelector.js from manager to manager5

parent 227a708e
Ext.define('PVE.form.BridgeSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.PVE.form.BridgeSelector'],
bridgeType: 'any_bridge', // bridge, OVSBridge or any_bridge
setNodename: function(nodename) {
var me = this;
if (!nodename || (me.nodename === nodename)) {
return;
}
me.nodename = nodename;
me.store.setProxy({
type: 'pve',
url: '/api2/json/nodes/' + me.nodename + '/network?type=' +
me.bridgeType
});
me.store.load();
},
initComponent: function() {
var me = this;
var nodename = me.nodename;
me.nodename = undefined;
var store = Ext.create('Ext.data.Store', {
fields: [ 'iface', 'active', 'type' ],
filterOnLoad: true,
sorters: [
{
property : 'iface',
direction: 'ASC'
}
]
});
Ext.apply(me, {
store: store,
valueField: 'iface',
displayField: 'iface',
listConfig: {
columns: [
{
header: gettext('Bridge'),
dataIndex: 'iface',
hideable: false,
flex: 1
},
{
header: gettext('Active'),
width: 60,
dataIndex: 'active',
renderer: PVE.Utils.format_boolean
}
]
}
});
me.callParent();
if (nodename) {
me.setNodename(nodename);
}
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment