From b65bee0323ab27a0c7e1988e03a7e305214b86a9 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Mon, 22 May 2023 13:53:41 +0200 Subject: [PATCH] update: working version compatible with the latest version of silk and antd --- blog/router.lua | 7 +++---- doc/controllers/IndexController.lua | 1 - doc/router.lua | 6 ++---- doc/views/default/layout.ls | 2 +- info/router.lua | 13 +++++++------ info/views/default/layout.ls | 2 +- talk/controllers/CommentController.lua | 15 +++++++-------- talk/router.lua | 7 ++----- 8 files changed, 23 insertions(+), 30 deletions(-) diff --git a/blog/router.lua b/blog/router.lua index e03184f..0cb768a 100644 --- a/blog/router.lua +++ b/blog/router.lua @@ -7,8 +7,8 @@ require("silk.api") -- crypto lib enc = require("enc") WWW_ROOT = __ROOT__.."/blog" --- TODO: change me -DB_FILE = "/home/dany/databases/mrsang.db" +DB_LOC="/opt/www/databases" +DB_FILE = DB_LOC.."/mrsang.db" -- add aditional paths package.path = package.path..";"..WWW_ROOT .. '/?.lua' @@ -18,8 +18,7 @@ if HEADER.Host then else HTTP_ROOT = "https://blog.iohub.dev" end --- TODO remove me -HTTP_ROOT = HTTP_ROOT.."/next/blog" + CONTROLLER_ROOT = "blog.controllers" MODEL_ROOT = "blog.models" -- file path: path/to/file diff --git a/doc/controllers/IndexController.lua b/doc/controllers/IndexController.lua index 96f5ad3..3baeefd 100644 --- a/doc/controllers/IndexController.lua +++ b/doc/controllers/IndexController.lua @@ -1,7 +1,6 @@ BaseController:subclass("IndexController") function IndexController:index(...) - -- TODO: add description to router local file = io.open(DOC_COVER, "r") if file then local content = "" diff --git a/doc/router.lua b/doc/router.lua index bee1c0b..8170405 100644 --- a/doc/router.lua +++ b/doc/router.lua @@ -14,8 +14,7 @@ if HEADER.Host then else HTTP_ROOT = "https://doc.iohub.dev" end --- TODO remove me -HTTP_ROOT = HTTP_ROOT.."/next/doc" + -- class path: path.to.class CONTROLLER_ROOT = "doc.controllers" @@ -23,8 +22,7 @@ MODEL_ROOT = "doc.models" -- file path: path/to/file VIEW_ROOT = WWW_ROOT..DIR_SEP.."views" --- TODO change me -DOC_DIR = "/home/dany/doc" +DOC_DIR = "/opt/www/doc" DOC_COVER = DOC_DIR.."/library.md" package.path = package.path..";"..__ROOT__.."/os/libs/?.lua" diff --git a/doc/views/default/layout.ls b/doc/views/default/layout.ls index 69625f2..521b413 100644 --- a/doc/views/default/layout.ls +++ b/doc/views/default/layout.ls @@ -154,7 +154,7 @@ end
- Powered by antd server, (c) 2019 - Xuan Sang LE + Powered by antd server, (c) 2019 - Dany LE
+ diff --git a/talk/controllers/CommentController.lua b/talk/controllers/CommentController.lua index d41045a..faf727a 100644 --- a/talk/controllers/CommentController.lua +++ b/talk/controllers/CommentController.lua @@ -54,15 +54,14 @@ function CommentController:index(...) data.children = {} -- find all the replies to this thread local sub_comments, suborder = - self.comment:find( - { - where = { - pid = pid, - rid = data.id - }, - order = {"time$asc"} + self.comment:find({ + where = { + pid = pid, + rid = data.id + }, + order = {"time$asc"} - }) + }) if sub_comments and #suborder ~= 0 then for i, subc in pairs(suborder) do sub_comments[subc].content = diff --git a/talk/router.lua b/talk/router.lua index 28857e3..c7208e9 100644 --- a/talk/router.lua +++ b/talk/router.lua @@ -7,8 +7,8 @@ require("silk.api") -- crypto lib enc = require("enc") WWW_ROOT = __ROOT__.."/talk" --- TODO change me -DB_FILE = "/home/dany/databases/quicktalk.db" +DB_LOC="/opt/www/databases" +DB_FILE = DB_LOC.."/quicktalk.db" function fail(msg) std.json() std.t(JSON.encode({error = msg})) @@ -25,9 +25,6 @@ else HTTP_ROOT = "https://talk.iohub.dev" end --- TODO remove me -HTTP_ROOT = HTTP_ROOT.."/next/talk" - -- class path: path.to.class CONTROLLER_ROOT = "talk.controllers" MODEL_ROOT = "talk.models"