luci2: render hostname when initializing the ui
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 1 Oct 2013 16:34:04 +0000 (16:34 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 1 Oct 2013 16:34:04 +0000 (16:34 +0000)
luci2/htdocs/luci2.html
luci2/htdocs/luci2/luci2.js

index f73c86b..d6fe09a 100644 (file)
@@ -27,7 +27,7 @@
         <header>
             <div class="fill">
                 <div class="container">
         <header>
             <div class="fill">
                 <div class="container">
-                    <a class="brand" href="#">&nbsp;</a>
+                    <a id="hostname" class="brand" href="#">&nbsp;</a>
                     <div id="mainmenu"></div>
     <!--
                     <div class="pull-right">
                     <div id="mainmenu"></div>
     <!--
                     <div class="pull-right">
index b8e9068..6ac9ca1 100644 (file)
@@ -2026,11 +2026,20 @@ function LuCI2()
                        });
                },
 
                        });
                },
 
+               updateHostname: function()
+               {
+                       return _luci2.system.getBoardInfo().then(function(info) {
+                               if (info.hostname)
+                                       $('#hostname').text(info.hostname);
+                       });
+               },
+
                init: function()
                {
                        _luci2.ui.loading(true);
 
                        $.when(
                init: function()
                {
                        _luci2.ui.loading(true);
 
                        $.when(
+                               _luci2.ui.updateHostname(),
                                _luci2.ui.renderMainMenu()
                        ).then(function() {
                                _luci2.ui.renderView(_luci2.globals.defaultNode).then(function() {
                                _luci2.ui.renderMainMenu()
                        ).then(function() {
                                _luci2.ui.renderView(_luci2.globals.defaultNode).then(function() {