Merge pull request #327 from zeners/webui

Webui
This commit is contained in:
electron128 2016-03-28 14:07:19 +02:00
commit 3701366078
3 changed files with 18 additions and 7 deletions

View File

@ -33,6 +33,14 @@ unix {
win32{ win32{
DEFINES *= WINDOWS_SYS DEFINES *= WINDOWS_SYS
INCLUDEPATH += . $$INC_DIR INCLUDEPATH += . $$INC_DIR
# create_webfiles.commands = $$_PRO_FILE_PWD_/webui-src/make-src/build.bat $$_PRO_FILE_PWD_
# QMAKE_EXTRA_TARGETS += create_webfiles
# PRE_TARGETDEPS += create_webfiles
# # create dummy files
# system(webui-src/make-src/init.bat .)
} }
libmicrohttpd{ libmicrohttpd{

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,