luci-mod-admin-full: fix broken applyreboot page
authorAnsuel Smith <ansuelsmth@gmail.com>
Tue, 7 Aug 2018 15:37:48 +0000 (17:37 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Aug 2018 08:52:14 +0000 (10:52 +0200)
This improve applyreboot page and fix problem with luci-nginx that doesn't refresh the page when the router reboot.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 327e284b74bd272aa1afaa8b9728c36276440057)

modules/luci-mod-admin-full/luasrc/view/admin_system/applyreboot.htm
themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css
themes/luci-theme-freifunk-generic/htdocs/luci-static/freifunk-generic/cascade.css
themes/luci-theme-material/htdocs/luci-static/material/cascade.css
themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css

index e722a48096cb936f3918c27e08dce6247df3b707..66b80896e8c4160db2cd60f09c923c9daa37fce9 100644 (file)
@@ -6,36 +6,47 @@
 
 <html>
        <head>
-               <title><%=luci.sys.hostname()%> - <% if title then %><%=title%><% else %><%:Rebooting...%><% end %></title>
+               <title><%=luci.sys.hostname()%> - <%= title or translate("Rebooting...") %></title>
                <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
                <script type="text/javascript" src="<%=resource%>/xhr.js"></script>
                <script type="text/javascript">//<![CDATA[
                        var interval = window.setInterval(function() {
                                var img = new Image();
-
+                               var target = ('https:' == document.location.protocol ? 'https://' : 'http://') + <%=addr and "'%s'" % addr or "window.location.host"%>;
+               
                                img.onload = function() {
                                        window.clearInterval(interval);
-                                       location.href = ('https:' == document.location.protocol ? 'https://' : 'http://') + '<%=addr or luci.http.getenv("SERVER_NAME")%>/';
                                };
-
-                               img.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + '<%=addr or luci.http.getenv("SERVER_NAME")%><%=resource%>/icons/loading.gif?' + Math.random();
+                               
+                               img.src = target + '<%=resource%>/icons/loading.gif?' + Math.random();
+                               
                        }, 5000);
                //]]></script>
        </head>
        <body>
-               <div id="maincontainer">
-                       <div id="maincontent">
-                               <h2 name="content"><%:System%> - <% if title then %><%=title%><% else %><%:Rebooting...%><% end %></h2>
-                               <fieldset class="cbi-section">
-                                       <p>
-                                               <% if msg then %><%=msg%><% else %><%:Changes applied.%><% end %>
-                                       </p>
-                                       <p>
-                                               <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" />
-                                               <%:Waiting for changes to be applied...%>
-                                       </p>
-                               </fieldset>
+               <header>
+                       <div class="fill">
+                               <div class="container">
+                                       <p class="brand"><%=luci.sys.hostname() or "?"%></p>
+                               </div>
+                       </div>
+               </header>
+               &#160;
+               <div class="main">
+                       <div id="maincontainer">
+                               <div id="maincontent" class="container">
+                                       <h2 name="content" id="applyreboot-container" ><%:System%> - <%= title or translate("Rebooting...") %></h2>
+                                       <div class="cbi-section" id="applyreboot-section">
+                                               <div>
+                                                       <%= msg or translate("Changes applied.") %>
+                                               </div>
+                                               <div>
+                                                       <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" />
+                                                       <%:Waiting for changes to be applied...%>
+                                               </div>
+                                       </div>
+                               </div>
                        </div>
                </div>
        </body>
-</html>
+</html>
\ No newline at end of file
index e34b0b594a89079dc4086f86a45c8304079809d9..644a47fee1b8209d29fcd862ec62a0bcd2ac25db 100644 (file)
@@ -2027,3 +2027,7 @@ div.cbi-value var,
 html body.apply-overlay-active {
        height: calc(100vh - 63px);
 }
+
+#applyreboot-section {
+       line-height: 300%;
+}
index d5e87ebef0643b25c515e3ecdb96bee1c7e12714..3e1b1cd2f13e9f8305dce4b7cf4b1977e5633c23 100644 (file)
@@ -586,6 +586,10 @@ html #menubar a:visited.warning {
        margin-right: 2em;
 }
 
+#applyreboot-section {
+       line-height: 300%;
+}
+
 .lang_de #submenu_admin_uci {
        width: 12em;
 }
index 2d8bd10cc92e931f5ecf5e6bcc0e69b97584627e..4875c33f8db29eb988f21a860f36b292c3bf240a 100644 (file)
@@ -1732,6 +1732,17 @@ body.lang_pl.node-main-login .cbi-value-title {
     width: 12rem;
 }
 
+/* applyreboot fix */
+
+#applyreboot-container {
+       margin: 2rem;
+}
+
+#applyreboot-section {
+       margin: 2rem;
+       line-height: 300%;
+}
+
 @media screen and (max-width: 1600px) {
     .main-left {
         width: calc(0% + 13rem);
index 197166b73a729a8d666824093389322afeac794f..e7952338efbb5cd693ebee26947849faf3d38e0c 100644 (file)
@@ -379,6 +379,11 @@ textarea#syslog {
        border-color: #444444;
 }
 
+#applyreboot-section {
+       margin: 2rem;
+       line-height: 300%;
+}
+
 .lang_he #maincontent {
        direction: rtl;
 }