luci-app-wman3: show info if mwan3 is not global enabled
[project/luci.git] / applications / luci-app-mwan3 / luasrc / view / mwan / status_interface.htm
index 1c9123c..21e59a8 100644 (file)
@@ -1,3 +1,9 @@
+<%#
+ Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+ Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+ Licensed to the public under the GNU General Public License v2.
+-%>
+
 <%+header%>
 
 <ul class="cbi-tabmenu">
@@ -12,7 +18,9 @@
        XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
                function(x, status)
                {
-                       var statusDiv = document.getElementById('mwan_status_text');
+                       var legend = document.getElementById('diag-rc-legend');
+                       var statusDiv = document.getElementById('diag-rc-output');
+                       legend.style.display = 'none';
                        if (status.interfaces)
                        {
                                var statusview = '';
        );
 //]]></script>
 
-<div id="mwan_interface_status">
-       <fieldset id="interface_field" class="cbi-section">
-               <legend><%:MWAN status - Interface Live Status%></legend>
-               <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+<div class="cbi-map">
+       <h2 name="content"><%:MWAN Status - Interface%></h2>
+       <%if not require("luci.sys").init.enabled("mwan3") then%>
+       <div><strong><%:INFO: MWAN not running%></strong></div>
+       <%end%>
+       <fieldset class="cbi-section">
+               <legend id="diag-rc-legend"><%:Collecting data...%></legend>
+               <span id="diag-rc-output">
+                       <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" />
+               </span>
        </fieldset>
 </div>