Merge pull request #5031 from TDT-AG/pr/20200503-luci-app-mwan3
luci-app-mwan3: update status page for no tracked interfaces
This commit is contained in:
commit
d18b087b8a
1 changed files with 19 additions and 5 deletions
|
@ -33,7 +33,7 @@ XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface
|
|||
case 'online':
|
||||
state = '<%:Online%>';
|
||||
time = String.format(
|
||||
'<div><strong>Uptime: </strong>%s</div>',
|
||||
'<div><strong><%:Uptime%>: </strong>%s</div>',
|
||||
secondsToString(status.interfaces[iface].online)
|
||||
);
|
||||
css = 'success';
|
||||
|
@ -41,11 +41,25 @@ XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface
|
|||
case 'offline':
|
||||
state = '<%:Offline%>';
|
||||
time = String.format(
|
||||
'<div><strong>Downtime: </strong>%s</div>',
|
||||
'<div><strong><%:Downtime%>: </strong>%s</div>',
|
||||
secondsToString(status.interfaces[iface].offline)
|
||||
);
|
||||
css = 'danger';
|
||||
break;
|
||||
case 'notracking':
|
||||
state = '<%:No Tracking%>';
|
||||
if ((status.interfaces[iface].uptime) > 0) {
|
||||
time = String.format(
|
||||
'<div><strong><%:Uptime%>: </strong>%s</div>',
|
||||
secondsToString(status.interfaces[iface].uptime)
|
||||
);
|
||||
css = 'success';
|
||||
}
|
||||
else {
|
||||
time = '<div> </div>'
|
||||
css = 'warning';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
state = '<%:Disabled%>';
|
||||
time = '<div> </div>'
|
||||
|
@ -57,11 +71,11 @@ XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface
|
|||
css
|
||||
);
|
||||
statusview += String.format(
|
||||
'<div><strong>Interface: </strong>%s</div>',
|
||||
'<div><strong><%:Interface%>: </strong>%s</div>',
|
||||
iface
|
||||
);
|
||||
statusview += String.format(
|
||||
'<div><strong>Status: </strong>%s</div>',
|
||||
'<div><strong><%:Status%>: </strong>%s</div>',
|
||||
state
|
||||
);
|
||||
if (time)
|
||||
|
@ -85,7 +99,7 @@ XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface
|
|||
display: inline-block;
|
||||
margin: 1rem;
|
||||
padding: 1rem;
|
||||
width: 10rem;
|
||||
width: 15rem;
|
||||
float: left;
|
||||
line-height: 125%;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue