luci-app-mwan3: rename mwan3 status overview plugin
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 12 Jan 2018 09:49:45 +0000 (10:49 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 18 Jan 2018 14:09:04 +0000 (15:09 +0100)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-mwan3/luasrc/view/admin_status/index/mwan.htm
applications/luci-app-mwan3/luasrc/view/mwan/openwrt_overview_status.htm [deleted file]
applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm [new file with mode: 0644]

index 53b997af90bb46d25299729d967d4c68484d6b66..d76db724bd504bf463af428e9a4e10362c9989d3 100644 (file)
@@ -1 +1 @@
-<%+mwan/openwrt_overview_status%>
+<%+mwan/overview_status_interface%>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/openwrt_overview_status.htm b/applications/luci-app-mwan3/luasrc/view/mwan/openwrt_overview_status.htm
deleted file mode 100644 (file)
index 335c95c..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
-               function(x, mArray)
-               {
-                       var status = document.getElementById('mwan_status_text');
-                       if (mArray.wans)
-                       {
-                               var temp = '';
-                               for ( var i = 0; i < mArray.wans.length; i++ )
-                               {
-                                       var stat = '';
-                                       var cssc = '';
-                                       switch (mArray.wans[i].status)
-                                       {
-                                               case 'online':
-                                                       stat = '<%:Online (tracking active)%>';
-                                                       cssc = 'wanon';
-                                                       break;
-                                               case 'notMonitored':
-                                                       stat = '<%:Online (tracking off)%>';
-                                                       cssc = 'wanon';
-                                                       break;
-                                               case 'offline':
-                                                       stat = '<%:Offline%>';
-                                                       cssc = 'wanoff';
-                                                       break;
-                                               case 'notEnabled':
-                                                       stat = '<%:Disabled%>';
-                                                       cssc = 'wanoff';
-                                                       break;
-                                       }
-                                       temp += String.format(
-                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
-                                               cssc, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, stat
-                                       );
-                               }
-                               status.innerHTML = temp;
-                       }
-                       else
-                       {
-                               status.innerHTML = '<strong><%:No MWAN interfaces found%></strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<fieldset id="interface_field" class="cbi-section">
-       <legend><%:MWAN Interface Live Status%></legend>
-       <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
-</fieldset>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: 1044px;
-  }
-  #mwan_status_text {
-       display: table;
-       font-size: 14px;
-       margin: auto;
-       max-width: 1044px;
-       min-width: 246px;
-       width: 100%;
-  }
-  .wanon {
-       background-color: rgb(144, 240, 144);
-  }
-  .wanoff {
-       background-color: rgb(240, 144, 144);
-  }
-  .wanon, .wanoff {
-       border-radius: 60px;
-       box-shadow: 0px 2px 5px -3px;
-       float: left;
-       margin: 8px 3px 0px 3px;
-       min-height: 30px;
-       min-width: 235px;
-       padding: 5px 10px 8px 10px;
-       text-align: center;
-  }
-</style>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm
new file mode 100644 (file)
index 0000000..335c95c
--- /dev/null
@@ -0,0 +1,80 @@
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
+               function(x, mArray)
+               {
+                       var status = document.getElementById('mwan_status_text');
+                       if (mArray.wans)
+                       {
+                               var temp = '';
+                               for ( var i = 0; i < mArray.wans.length; i++ )
+                               {
+                                       var stat = '';
+                                       var cssc = '';
+                                       switch (mArray.wans[i].status)
+                                       {
+                                               case 'online':
+                                                       stat = '<%:Online (tracking active)%>';
+                                                       cssc = 'wanon';
+                                                       break;
+                                               case 'notMonitored':
+                                                       stat = '<%:Online (tracking off)%>';
+                                                       cssc = 'wanon';
+                                                       break;
+                                               case 'offline':
+                                                       stat = '<%:Offline%>';
+                                                       cssc = 'wanoff';
+                                                       break;
+                                               case 'notEnabled':
+                                                       stat = '<%:Disabled%>';
+                                                       cssc = 'wanoff';
+                                                       break;
+                                       }
+                                       temp += String.format(
+                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
+                                               cssc, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, stat
+                                       );
+                               }
+                               status.innerHTML = temp;
+                       }
+                       else
+                       {
+                               status.innerHTML = '<strong><%:No MWAN interfaces found%></strong>';
+                       }
+               }
+       );
+//]]></script>
+
+<fieldset id="interface_field" class="cbi-section">
+       <legend><%:MWAN Interface Live Status%></legend>
+       <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+</fieldset>
+
+<style type="text/css">
+  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
+       max-width: 1044px;
+  }
+  #mwan_status_text {
+       display: table;
+       font-size: 14px;
+       margin: auto;
+       max-width: 1044px;
+       min-width: 246px;
+       width: 100%;
+  }
+  .wanon {
+       background-color: rgb(144, 240, 144);
+  }
+  .wanoff {
+       background-color: rgb(240, 144, 144);
+  }
+  .wanon, .wanoff {
+       border-radius: 60px;
+       box-shadow: 0px 2px 5px -3px;
+       float: left;
+       margin: 8px 3px 0px 3px;
+       min-height: 30px;
+       min-width: 235px;
+       padding: 5px 10px 8px 10px;
+       text-align: center;
+  }
+</style>