From 0ad5eaa1388cac6efb78a6d7d4a201b2d016109c Mon Sep 17 00:00:00 2001 From: lxsang Date: Tue, 9 Oct 2018 12:14:33 +0200 Subject: [PATCH] fix stuff --- Makefile | 2 +- apps/assets/coffee/WebVNC.coffee | 2 ++ apps/assets/scripts/main.js | 3 +++ apps/router.lua | 10 +++++----- blog/router.lua | 8 ++++---- info/router.lua | 4 ++-- mimes.json | 4 ++++ os/router.lua | 4 ++-- 8 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 1bcf105..ee9b7cf 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BUILDDIR = ./build -projs = grs info blog apps +projs = grs info blog apps os copyfiles = index.ls mimes.json main: clean copy for f in $(projs); do make -C "$${f}" ; done diff --git a/apps/assets/coffee/WebVNC.coffee b/apps/assets/coffee/WebVNC.coffee index a7cb2bb..93db32f 100644 --- a/apps/assets/coffee/WebVNC.coffee +++ b/apps/assets/coffee/WebVNC.coffee @@ -29,6 +29,8 @@ class WebVNC extends window.classes.BaseObject r('demo', 'demo') @client.oncopy = (text) -> cosole.log text + @client.onerror = (m) -> + alert(m) @client.init() .then () -> $("#connect").click (e) -> diff --git a/apps/assets/scripts/main.js b/apps/assets/scripts/main.js index 0137e8a..f027ed0 100644 --- a/apps/assets/scripts/main.js +++ b/apps/assets/scripts/main.js @@ -199,6 +199,9 @@ this.client.oncopy = function(text) { return cosole.log(text); }; + this.client.onerror = function(m) { + return alert(m); + }; return this.client.init().then(function() { $("#connect").click(function(e) { return me.client.connect("/opt/www/vnc.conf", { diff --git a/apps/router.lua b/apps/router.lua index 8cec404..83247d0 100644 --- a/apps/router.lua +++ b/apps/router.lua @@ -5,7 +5,7 @@ -- some global variables DIR_SEP = "/" WWW_ROOT = "/opt/www/htdocs/apps" -HTTP_ROOT = "https://10.1.10.84:9195/apps" +HTTP_ROOT = "https://apps.lxsang.me" -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class @@ -21,7 +21,7 @@ POLICY.mimes["application/wasm"] = true -- registry object store global variables local REGISTRY = {} -- set logging level -REGISTRY.logger = Logger:new{ levels = {INFO = true, ERROR = true, DEBUG = true}} +REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = true, DEBUG = false}} REGISTRY.db = DBHelper:new{db="iosapps"} REGISTRY.layout = 'default' REGISTRY.fileaccess = true @@ -33,7 +33,7 @@ router:setPath(CONTROLLER_ROOT) --router:route('edit', 'post/edit', "ALL" ) -- example of depedencies to the current main route --- each layout may have different dependencies +--[[ -- each layout may have different dependencies local default_routes_dependencies = { edit = { url = "post/edit", @@ -48,8 +48,8 @@ local default_routes_dependencies = { -- url = "cat/index", -- visibility = "ALL" --} -} -router:route('default', default_routes_dependencies ) +} +router:route('default', default_routes_dependencies )]] router:delegate() if REGISTRY.db then REGISTRY.db:close() end diff --git a/blog/router.lua b/blog/router.lua index f457a4c..9e4bbd3 100644 --- a/blog/router.lua +++ b/blog/router.lua @@ -5,7 +5,7 @@ -- some global variables DIR_SEP = "/" WWW_ROOT = "/opt/www/htdocs/blog" -HTTP_ROOT = "https://blog.localhost:9195" +HTTP_ROOT = "https://blog.lxsang.me" -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class @@ -25,7 +25,7 @@ end -- registry object store global variables local REGISTRY = {} -- set logging level -REGISTRY.logger = Logger:new{ levels = {INFO = true, ERROR = true, DEBUG = true}} +REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = true, DEBUG = false}} REGISTRY.db = DBHelper:new{db="mrsang"} REGISTRY.layout = 'default' REGISTRY.fileaccess = true @@ -52,8 +52,8 @@ router:setPath(CONTROLLER_ROOT) } } } -} ]] -router:route('default', default_routes_dependencies ) +} +router:route('default', default_routes_dependencies )]] router:remap("index", "post") router:remap("r", "post") router:delegate() diff --git a/info/router.lua b/info/router.lua index 5096c94..a6ce24e 100644 --- a/info/router.lua +++ b/info/router.lua @@ -5,7 +5,7 @@ -- some global variables DIR_SEP = "/" WWW_ROOT = "/opt/www/htdocs/info" -HTTP_ROOT = "https://info.localhost:9195/" +HTTP_ROOT = "https://info.lxsang.me" -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class @@ -21,7 +21,7 @@ require(BASE_FRW.."silk.api") -- registry object store global variables local REGISTRY = {} -- set logging level -REGISTRY.logger = Logger:new{ levels = {INFO = true, ERROR = true, DEBUG = true}} +REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = true, DEBUG = false}} REGISTRY.db = DBHelper:new{db="mrsang"} REGISTRY.layout = 'default' REGISTRY.fileaccess = true diff --git a/mimes.json b/mimes.json index afabf6e..7cc007c 100644 --- a/mimes.json +++ b/mimes.json @@ -15,5 +15,9 @@ "apj": { "mime": "text/antos-project", "binary": false + }, + "wasm": { + "mime": "application/wasm", + "binary": true } } \ No newline at end of file diff --git a/os/router.lua b/os/router.lua index 77bbd9f..ac8105c 100644 --- a/os/router.lua +++ b/os/router.lua @@ -5,7 +5,7 @@ -- some global variables DIR_SEP = "/" WWW_ROOT = "/opt/www/htdocs/os" -HTTP_ROOT = "http://os.localhost:9192" +HTTP_ROOT = "https://os.lxsang.me" -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class @@ -26,7 +26,7 @@ require("common") -- registry object store global variables local REGISTRY = {} -- set logging level -REGISTRY.logger = Logger:new{ levels = {INFO = true, ERROR = true, DEBUG = true}} +REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = true, DEBUG = false}} --REGISTRY.db = DBHelper:new{db="sysdb"} REGISTRY.layout = 'default' REGISTRY.fileaccess = true