Merge pull request #1697 from TDT-AG/pr/20180323-luci-base-fix-tblsection
authorDirk Brenken <dev@brenken.org>
Tue, 27 Mar 2018 20:45:57 +0000 (22:45 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Mar 2018 20:45:57 +0000 (22:45 +0200)
luci-base: add missing colspan in tblsection if table is empty

applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm
applications/luci-app-wireguard/Makefile
themes/luci-theme-material/htdocs/luci-static/material/css/style.css

index 86b5ac6..4ec0edf 100644 (file)
@@ -15,29 +15,35 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_
                                for ( var iface in status.interfaces)
                                {
                                        var state = '';
+                                       var css = ''
                                        switch (status.interfaces[iface].status)
                                        {
                                                case 'online':
                                                        state = '<%:Online (tracking active)%>';
-                                                       break;
-                                               case 'notMonitored':
-                                                       state = '<%:Online (tracking off)%>';
+                                                       css = 'success';
                                                        break;
                                                case 'offline':
                                                        state = '<%:Offline%>';
+                                                       css = 'danger';
                                                        break;
                                                default:
                                                        state = '<%:Disabled%>';
+                                                       css = 'warning';
                                                        break;
                                        }
                                        statusview += String.format(
+                                               '<div class="alert-message %s">',
+                                               css
+                                       );
+                                       statusview += String.format(
                                                '<div><strong>Interface: </strong>%s</div>',
                                                iface
                                        );
                                        statusview += String.format(
-                                               '<div><strong>Status: </strong>%s</div></br></br>',
+                                               '<div><strong>Status: </strong>%s</div>',
                                                state
                                        );
+                                       statusview += '</div>'
                                }
                                statusDiv.innerHTML = statusview;
                        }
@@ -49,6 +55,17 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_
        );
 //]]></script>
 
+<style type="text/css">
+       #mwan_status_text > div {
+               display: inline-block;
+               margin: 1rem;
+               padding: 1rem;
+               width: 10rem;
+               float: left;
+               line-height: 125%;
+       }
+</style>
+
 <fieldset id="interface_field" class="cbi-section">
        <legend><%:MWAN Interfaces%></legend>
        <div id="mwan_status_text">
index 92cdcf2..ae315bd 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 LUCI_TITLE:=WireGuard Status
-LUCI_DEPENDS:=+wireguard-tools +kmod-wireguard
+LUCI_DEPENDS:=+wireguard-tools +kmod-wireguard +luci-proto-wireguard
 LUCI_PKGARCH:=all
 
 PKG_MAINTAINER:=Dan Luedtke <mail@danrl.com>
index 545c5fb..57bbaf6 100755 (executable)
@@ -253,9 +253,19 @@ header > .container > .brand {
     vertical-align: text-bottom;
 }
 
+.danger {
+    background-color: #FA8072 !important;
+    color: black;
+}
+
 .warning {
-    background-color: #FF7D60 !important;
-    color: #FFF;
+    background-color:  #F0E68C !important;
+    color: black;
+}
+
+.success {
+    background-color: #90EE90 !important;
+    color: black;
 }
 
 .errorbox,
@@ -1546,4 +1556,4 @@ body.lang_pl.node-main-login .cbi-value-title {
     .cbi-value-field .cbi-input-select {
         min-width: 25rem;
     }
-}
\ No newline at end of file
+}