mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-17 19:39:53 +00:00
code cleanups, inline more, use arrow-fns
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b51cbf5a00
commit
99f3e147e4
@ -152,9 +152,7 @@ Ext.define('Proxmox.button.StdRemoveButton', {
|
|||||||
callback: function(options, success, response) {
|
callback: function(options, success, response) {
|
||||||
Ext.callback(me.callback, me.scope, [options, success, response], 0, me);
|
Ext.callback(me.callback, me.scope, [options, success, response], 0, me);
|
||||||
},
|
},
|
||||||
failure: function(response, opts) {
|
failure: response => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
|
||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
|
@ -40,7 +40,7 @@ Ext.define('Proxmox.node.NetworkView', {
|
|||||||
throw "no node name specified";
|
throw "no node name specified";
|
||||||
}
|
}
|
||||||
|
|
||||||
let baseUrl = '/nodes/' + me.nodename + '/network';
|
let baseUrl = `/nodes/${me.nodename}/network`;
|
||||||
|
|
||||||
let store = Ext.create('Ext.data.Store', {
|
let store = Ext.create('Ext.data.Store', {
|
||||||
model: 'proxmox-networks',
|
model: 'proxmox-networks',
|
||||||
@ -173,19 +173,6 @@ Ext.define('Proxmox.node.NetworkView', {
|
|||||||
del_btn.setDisabled(!rec);
|
del_btn.setDisabled(!rec);
|
||||||
};
|
};
|
||||||
|
|
||||||
let render_ports = function(value, metaData, record) {
|
|
||||||
if (value === 'bridge') {
|
|
||||||
return record.data.bridge_ports;
|
|
||||||
} else if (value === 'bond') {
|
|
||||||
return record.data.slaves;
|
|
||||||
} else if (value === 'OVSBridge') {
|
|
||||||
return record.data.ovs_ports;
|
|
||||||
} else if (value === 'OVSBond') {
|
|
||||||
return record.data.ovs_bonds;
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
|
|
||||||
let find_next_iface_id = function(prefix) {
|
let find_next_iface_id = function(prefix) {
|
||||||
let next;
|
let next;
|
||||||
for (next = 0; next <= 9999; next++) {
|
for (next = 0; next <= 9999; next++) {
|
||||||
@ -389,7 +376,18 @@ Ext.define('Proxmox.node.NetworkView', {
|
|||||||
{
|
{
|
||||||
header: gettext('Ports/Slaves'),
|
header: gettext('Ports/Slaves'),
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
renderer: render_ports,
|
renderer: (value, metaData, { data }) => {
|
||||||
|
if (value === 'bridge') {
|
||||||
|
return data.bridge_ports;
|
||||||
|
} else if (value === 'bond') {
|
||||||
|
return data.slaves;
|
||||||
|
} else if (value === 'OVSBridge') {
|
||||||
|
return data.ovs_ports;
|
||||||
|
} else if (value === 'OVSBond') {
|
||||||
|
return data.ovs_bonds;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: gettext('Bond Mode'),
|
header: gettext('Bond Mode'),
|
||||||
|
Loading…
Reference in New Issue
Block a user