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 {
if ("waiting_init|waiting_startup".match(runstate.runstate)) {
if (runstate.runstate.match("waiting_init|waiting_startup")) {
return m("h2","server starting ...")
} else if("waiting_account_select|running_ok.*".match(runstate.runstate)) {
if (runst === undefined || runst.match(runstate.runstate)) {
} else if(runstate.runstate.match("waiting_account_select|running_ok.*")) {
if (runst === undefined || runstate.runstate.match(runst)) {
return m("div", {
style: {
height: "100%",

View File

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