webui: menu in gui mode fixed

This commit is contained in:
zeners 2016-03-28 13:03:49 +02:00
parent a11cd25517
commit dfa2cba045
2 changed files with 10 additions and 7 deletions

View File

@ -62,10 +62,10 @@ function Page(menu){
}), }),
]); ]);
} else { } else {
if ("waiting_init|waiting_startup".match(runstate.runstate)) { if (runstate.runstate.match("waiting_init|waiting_startup")) {
return m("h2","server starting ...") return m("h2","server starting ...")
} else if("waiting_account_select|running_ok.*".match(runstate.runstate)) { } else if(runstate.runstate.match("waiting_account_select|running_ok.*")) {
if (runst === undefined || runst.match(runstate.runstate)) { if (runst === undefined || runstate.runstate.match(runst)) {
return m("div", { return m("div", {
style: { style: {
height: "100%", height: "100%",

View File

@ -11,8 +11,9 @@ function goback(){
function buildmenu(menu, tagname, runstate, ignore){ function buildmenu(menu, tagname, runstate, ignore){
if ( if (
(menu.runstate === undefined || runstate.match(menu.runstate)!=null) (menu.runstate === undefined
&& (!ignore.match(menu.name)) || runstate.match("^(" + menu.runstate + ")$")!=null)
&& (!menu.name.match(ignore))
&& (menu.path === undefined || menu.path.match(":")==null) && (menu.path === undefined || menu.path.match(":")==null)
&& (menu.show === undefined || menu.show) && (menu.show === undefined || menu.show)
) { ) {
@ -36,13 +37,15 @@ function buildmenu(menu, tagname, runstate, ignore){
module.exports = {view: function(){ module.exports = {view: function(){
var runstate = rs("control/runstate"); var runstate = rs("control/runstate");
if (runstate === undefined || runstate.runstate === undefined || runstate.runstate == null) if (runstate === undefined
|| runstate.runstate === undefined
|| runstate.runstate == null)
return m("div.nav","menu: waiting for server ..."); return m("div.nav","menu: waiting for server ...");
if (m.route() != "/") if (m.route() != "/")
return m("span",[ return m("span",[
m("span"," | "), m("span"," | "),
mnodes.nodes.map(function(menu){ mnodes.nodes.map(function(menu){
var item = buildmenu(menu,"span.menu", runstate.runstate, ""); var item = buildmenu(menu,"span.menu", runstate.runstate, "-");
if (item != null){ if (item != null){
return [ return [
item, item,