mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-21 23:40:15 +00:00
node network: refactor bond mode array generation
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
4211996ab0
commit
8311c0b1af
23
Utils.js
23
Utils.js
@ -99,6 +99,29 @@ Ext.define('Proxmox.Utils', { utilities: {
|
|||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
bond_mode_gettext_map: {
|
||||||
|
'802.3ad': 'LACP (802.3ad)',
|
||||||
|
'lacp-balance-slb': 'LACP (balance-slb)',
|
||||||
|
'lacp-balance-tcp': 'LACP (balance-tcp)',
|
||||||
|
},
|
||||||
|
|
||||||
|
render_bond_mode: function(value) {
|
||||||
|
var val = Proxmox.Utils.bond_mode_gettext_map[value];
|
||||||
|
if (!val) {
|
||||||
|
val = value || '';
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
|
bond_mode_array: function(modes) {
|
||||||
|
var arr = [];
|
||||||
|
var i;
|
||||||
|
for (i = 0; i < modes.length; i++) {
|
||||||
|
arr.push([modes[i], Proxmox.Utils.render_bond_mode(modes[i])]);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
},
|
||||||
|
|
||||||
getNoSubKeyHtml: function(url) {
|
getNoSubKeyHtml: function(url) {
|
||||||
// url http://www.proxmox.com/products/proxmox-ve/subscription-service-plans
|
// url http://www.proxmox.com/products/proxmox-ve/subscription-service-plans
|
||||||
return Ext.String.format('You do not have a valid subscription for this server. Please visit <a target="_blank" href="{0}">www.proxmox.com</a> to get a list of available options.', url || 'https://www.proxmox.com');
|
return Ext.String.format('You do not have a valid subscription for this server. Please visit <a target="_blank" href="{0}">www.proxmox.com</a> to get a list of available options.', url || 'https://www.proxmox.com');
|
||||||
|
@ -8,22 +8,22 @@ Ext.define('Proxmox.form.BondModeSelector', {
|
|||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
if (me.openvswitch) {
|
if (me.openvswitch) {
|
||||||
me.comboItems = [
|
me.comboItems = Proxmox.Utils.bond_mode_array([
|
||||||
['active-backup', 'active-backup'],
|
'active-backup',
|
||||||
['balance-slb', 'balance-slb'],
|
'balance-slb',
|
||||||
['lacp-balance-slb', 'LACP (balance-slb)'],
|
'lacp-balance-slb',
|
||||||
['lacp-balance-tcp', 'LACP (balance-tcp)']
|
'lacp-balance-tcp',
|
||||||
];
|
]);
|
||||||
} else {
|
} else {
|
||||||
me.comboItems = [
|
me.comboItems = Proxmox.Utils.bond_mode_array([
|
||||||
['balance-rr', 'balance-rr'],
|
'balance-rr',
|
||||||
['active-backup', 'active-backup'],
|
'active-backup',
|
||||||
['balance-xor', 'balance-xor'],
|
'balance-xor',
|
||||||
['broadcast', 'broadcast'],
|
'broadcast',
|
||||||
['802.3ad', 'LACP (802.3ad)'],
|
'802.3ad',
|
||||||
['balance-tlb', 'balance-tlb'],
|
'balance-tlb',
|
||||||
['balance-alb', 'balance-alb']
|
'balance-alb',
|
||||||
];
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
|
Loading…
Reference in New Issue
Block a user