luci-base: widget.js: use firewall.getZoneColorStyle() in zone widgets
Use the new `firewall.getZoneColorStyle()` helper to apply background color styles. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
d775279dbd
commit
a812b26cb8
1 changed files with 5 additions and 5 deletions
|
@ -62,7 +62,7 @@ var CBIZoneSelect = form.ListValue.extend({
|
||||||
if (this.allowlocal) {
|
if (this.allowlocal) {
|
||||||
choices[''] = E('span', {
|
choices[''] = E('span', {
|
||||||
'class': 'zonebadge',
|
'class': 'zonebadge',
|
||||||
'style': 'background-color:' + firewall.getColorForName(null)
|
'style': firewall.getZoneColorStyle(null)
|
||||||
}, [
|
}, [
|
||||||
E('strong', _('Device')),
|
E('strong', _('Device')),
|
||||||
(this.allowany || this.allowlocal)
|
(this.allowany || this.allowlocal)
|
||||||
|
@ -72,14 +72,14 @@ var CBIZoneSelect = form.ListValue.extend({
|
||||||
else if (!this.multiple && (this.rmempty || this.optional)) {
|
else if (!this.multiple && (this.rmempty || this.optional)) {
|
||||||
choices[''] = E('span', {
|
choices[''] = E('span', {
|
||||||
'class': 'zonebadge',
|
'class': 'zonebadge',
|
||||||
'style': 'background-color:' + firewall.getColorForName(null)
|
'style': firewall.getZoneColorStyle(null)
|
||||||
}, E('em', _('unspecified')));
|
}, E('em', _('unspecified')));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.allowany) {
|
if (this.allowany) {
|
||||||
choices['*'] = E('span', {
|
choices['*'] = E('span', {
|
||||||
'class': 'zonebadge',
|
'class': 'zonebadge',
|
||||||
'style': 'background-color:' + firewall.getColorForName(null)
|
'style': firewall.getZoneColorStyle(null)
|
||||||
}, [
|
}, [
|
||||||
E('strong', _('Any zone')),
|
E('strong', _('Any zone')),
|
||||||
(this.allowany && this.allowlocal && !isOutputOnly) ? E('span', ' (%s)'.format(_('forward'))) : ''
|
(this.allowany && this.allowlocal && !isOutputOnly) ? E('span', ' (%s)'.format(_('forward'))) : ''
|
||||||
|
@ -125,7 +125,7 @@ var CBIZoneSelect = form.ListValue.extend({
|
||||||
|
|
||||||
choices[name] = E('span', {
|
choices[name] = E('span', {
|
||||||
'class': 'zonebadge',
|
'class': 'zonebadge',
|
||||||
'style': 'background-color:' + zone.getColor()
|
'style': firewall.getZoneColorStyle(zone)
|
||||||
}, [ E('strong', name) ].concat(ifaces));
|
}, [ E('strong', name) ].concat(ifaces));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ var CBIZoneForwards = form.DummyValue.extend({
|
||||||
|
|
||||||
return E('label', {
|
return E('label', {
|
||||||
'class': 'zonebadge cbi-tooltip-container',
|
'class': 'zonebadge cbi-tooltip-container',
|
||||||
'style': 'background-color:' + zone.getColor()
|
'style': firewall.getZoneColorStyle(zone)
|
||||||
}, [
|
}, [
|
||||||
E('strong', name),
|
E('strong', name),
|
||||||
E('div', { 'class': 'cbi-tooltip' }, ifaces)
|
E('div', { 'class': 'cbi-tooltip' }, ifaces)
|
||||||
|
|
Loading…
Reference in a new issue