Skip to content

Commit

Permalink
luci-app-keepalived: split state into separate columns
Browse files Browse the repository at this point in the history
This commit distinguishes between active state (how it is at the moment)
and how the keepalived was configured initially (Initial State).
These states are separated in two columns.

Signed-off-by: Christian Korber <ck@dev.tdt.de>
  • Loading branch information
Christian Korber committed Feb 12, 2025
1 parent 8843810 commit 6c562f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ return view.extend({
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Name')),
E('th', { 'class': 'th' }, _('Interface')),
E('th', { 'class': 'th' }, _('Active State/State')),
E('th', { 'class': 'th' }, _('Active State')),
E('th', { 'class': 'th' }, _('Initial State')),
E('th', { 'class': 'th' }, _('Probes Sent')),
E('th', { 'class': 'th' }, _('Probes Received')),
E('th', { 'class': 'th' }, _('Last Transition')),
Expand All @@ -40,6 +41,7 @@ return view.extend({
cbi_update_table(table,
targets.map(function(target) {
var state;
var state_initial;
var instance_state = target.data.state;

if (instance_state === 2) {
Expand All @@ -57,7 +59,8 @@ return view.extend({
if (instances != '') {
for (var i = 0; i < instances.length; i++) {
if (instances[i]['name'] == target.data.iname) {
state = state + '/' + instances[i]['state'];
state = state;
state_initial = instances[i]['state'];
break;
}
}
Expand All @@ -66,6 +69,7 @@ return view.extend({
target.data.iname,
target.data.ifp_ifname,
state,
state_initial,
target.stats.advert_sent,
target.stats.advert_rcvd,
new Date(target.data.last_transition * 1000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ return baseclass.extend({
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Name')),
E('th', { 'class': 'th' }, _('Interface')),
E('th', { 'class': 'th' }, _('Active State/State')),
E('th', { 'class': 'th' }, _('Active State')),
E('th', { 'class': 'th' }, _('Initial State')),
E('th', { 'class': 'th' }, _('Probes Sent')),
E('th', { 'class': 'th' }, _('Probes Received')),
E('th', { 'class': 'th' }, _('Last Transition')),
Expand All @@ -39,6 +40,7 @@ return baseclass.extend({
cbi_update_table(table,
targets.map(function(target) {
var state;
var state_initial;
var instance_state = target.data.state;

if (instance_state === 2) {
Expand All @@ -56,7 +58,8 @@ return baseclass.extend({
if (instances != '') {
for (var i = 0; i < instances.length; i++) {
if (instances[i]['name'] == target.data.iname) {
state = state + '/' + instances[i]['state'];
state = state;
state_initial = instances[i]['state'];
break;
}
}
Expand All @@ -65,6 +68,7 @@ return baseclass.extend({
target.data.iname,
target.data.ifp_ifname,
state,
state_initial,
target.stats.advert_sent,
target.stats.advert_rcvd,
new Date(target.data.last_transition * 1000)
Expand Down

0 comments on commit 6c562f3

Please sign in to comment.