diff --git a/apps/Makefile b/apps/Makefile index 01cb653..6aa4b87 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -5,7 +5,6 @@ coffees = assets/coffee/bootstrap.coffee \ assets/coffee/BaseObject.coffee \ assets/coffee/APIManager.coffee \ assets/coffee/MarkOn.coffee \ - assets/coffee/WVNC.coffee \ assets/coffee/WebVNC.coffee SED=sed @@ -17,7 +16,7 @@ endif main: js - mkdir -p $(BUILDDIR)/assets cp -rf $(copyfiles) $(BUILDDIR) - cp -r assets/css assets/scripts assets/shs $(BUILDDIR)/assets + cp -r assets/css assets/scripts $(BUILDDIR)/assets - cd $(BUILDDIR) && ln -s ../grs ./rst js: diff --git a/apps/assets/coffee/WebVNC.coffee b/apps/assets/coffee/WebVNC.coffee index 3f1aaf4..a7cb2bb 100644 --- a/apps/assets/coffee/WebVNC.coffee +++ b/apps/assets/coffee/WebVNC.coffee @@ -14,6 +14,7 @@ class WebVNC extends window.classes.BaseObject args = { element: 'canvas', + #ws: 'wss://localhost:9192/wvnc', ws: 'wss://lxsang.me/wvnc', worker: '/assets/scripts/decoder.js' } @@ -34,9 +35,9 @@ class WebVNC extends window.classes.BaseObject me.client.connect "/opt/www/vnc.conf", { bbp: 32, flag: 3, - quality: 40 + quality: 30 } - $("#tbstatus").html "32bbp, compress JPEG & ZLib, JPEG quality 10%" + $("#tbstatus").html "32bbp, compression JPEG & ZLib, JPEG quality 30%" $("#stop").click (e) -> me.client.disconnect() $("#selscale").on 'change', (e) -> diff --git a/apps/assets/scripts/main.js b/apps/assets/scripts/main.js index f4eb07f..0137e8a 100644 --- a/apps/assets/scripts/main.js +++ b/apps/assets/scripts/main.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.12.7 +// Generated by CoffeeScript 1.9.3 (function() { var APIManager, BaseObject, MarkOn, WebVNC, require, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, @@ -181,7 +181,7 @@ var args, me; args = { element: 'canvas', - ws: 'wss://localhost:9192/wvnc', + ws: 'wss://lxsang.me/wvnc', worker: '/assets/scripts/decoder.js' }; this.client = new WVNC(args); @@ -197,17 +197,17 @@ }); }; this.client.oncopy = function(text) { - return ($("#clipboard"))[0].value = text; + return cosole.log(text); }; return this.client.init().then(function() { $("#connect").click(function(e) { - return me.client.connect("/Users/mrsang/Documents/build/www/vnc.conf", { + return me.client.connect("/opt/www/vnc.conf", { bbp: 32, flag: 3, - quality: 10 + quality: 30 }); }); - $("#tbstatus").html("32bbp, compress JPEG & ZLib, JPEG quality 10%"); + $("#tbstatus").html("32bbp, compression JPEG & ZLib, JPEG quality 30%"); $("#stop").click(function(e) { return me.client.disconnect(); }); diff --git a/get/Makefile b/get/Makefile new file mode 100644 index 0000000..623ac9c --- /dev/null +++ b/get/Makefile @@ -0,0 +1,10 @@ +BUILDDIR = ../build/get + +copyfiles = router.lua shs +main: + - mkdir -p $(BUILDDIR) + cp -rf $(copyfiles) $(BUILDDIR) + - cd $(BUILDDIR) && ln -s ../grs ./rst + +clean: + rm -rf $(BUILDDIR)/* \ No newline at end of file diff --git a/get/router.lua b/get/router.lua new file mode 100644 index 0000000..b76591c --- /dev/null +++ b/get/router.lua @@ -0,0 +1,55 @@ + +-- the rewrite rule for the framework +-- should be something like this +-- ^\/apps\/+(.*)$ = /apps/router.lua?r=<1>& +-- some global variables +DIR_SEP = "/" +WWW_ROOT = "/opt/www/htdocs/get" +HTTP_ROOT = "https://get.makeand.run" +-- class path: path.to.class +BASE_FRW = "" +-- class path: path.to.class +CONTROLLER_ROOT = BASE_FRW.."apps.controllers" +MODEL_ROOT = BASE_FRW.."apps.models" +-- file path: path/to/file +VIEW_ROOT = WWW_ROOT..DIR_SEP.."views" +LOG_ROOT = WWW_ROOT..DIR_SEP.."logs" + +-- require needed library +require(BASE_FRW.."silk.api") + +function NotfoundController:index(...) + local args = {...} + local name = args[1] or nil + if not name then + return self:error("Unknown script") + end + name = name:gsub("Controller",""):lower() + local path = WWW_ROOT..DIR_SEP.."shs"..DIR_SEP..name..".sh" + + if ulib.exists(path) then + std.header("text/plain") + std.f(path) + else + self:error("No script found: "..path) + end + return false +end + + +-- registry object store global variables +local REGISTRY = {} +-- set logging level +REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = false, DEBUG = false}} + +REGISTRY.layout = 'default' +REGISTRY.fileaccess = false + +local router = Router:new{registry = REGISTRY} +REGISTRY.router = router +router:setPath(CONTROLLER_ROOT) +--router:route('edit', 'post/edit', "ALL" ) + +router:route('default', default_routes_dependencies ) +router:delegate() + diff --git a/apps/assets/shs/antd.sh b/get/shs/antd.sh similarity index 100% rename from apps/assets/shs/antd.sh rename to get/shs/antd.sh diff --git a/os/router.lua b/os/router.lua index 1a24738..87d9b99 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 = "https://wos.localhost:9195" +HTTP_ROOT = "https://wos.localhost:9192" -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class