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{
DEFINES *= WINDOWS_SYS
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{

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,