1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +01:00

update: working version compatible with the latest version of silk and antd
All checks were successful
gitea-sync/antd-web-apps/pipeline/head This commit looks good

This commit is contained in:
DanyLE 2023-05-22 13:53:41 +02:00
parent a05507123c
commit b65bee0323
8 changed files with 23 additions and 30 deletions

View File

@ -7,8 +7,8 @@ require("silk.api")
-- crypto lib -- crypto lib
enc = require("enc") enc = require("enc")
WWW_ROOT = __ROOT__.."/blog" WWW_ROOT = __ROOT__.."/blog"
-- TODO: change me DB_LOC="/opt/www/databases"
DB_FILE = "/home/dany/databases/mrsang.db" DB_FILE = DB_LOC.."/mrsang.db"
-- add aditional paths -- add aditional paths
package.path = package.path..";"..WWW_ROOT .. '/?.lua' package.path = package.path..";"..WWW_ROOT .. '/?.lua'
@ -18,8 +18,7 @@ if HEADER.Host then
else else
HTTP_ROOT = "https://blog.iohub.dev" HTTP_ROOT = "https://blog.iohub.dev"
end end
-- TODO remove me
HTTP_ROOT = HTTP_ROOT.."/next/blog"
CONTROLLER_ROOT = "blog.controllers" CONTROLLER_ROOT = "blog.controllers"
MODEL_ROOT = "blog.models" MODEL_ROOT = "blog.models"
-- file path: path/to/file -- file path: path/to/file

View File

@ -1,7 +1,6 @@
BaseController:subclass("IndexController") BaseController:subclass("IndexController")
function IndexController:index(...) function IndexController:index(...)
-- TODO: add description to router
local file = io.open(DOC_COVER, "r") local file = io.open(DOC_COVER, "r")
if file then if file then
local content = "" local content = ""

View File

@ -14,8 +14,7 @@ if HEADER.Host then
else else
HTTP_ROOT = "https://doc.iohub.dev" HTTP_ROOT = "https://doc.iohub.dev"
end end
-- TODO remove me
HTTP_ROOT = HTTP_ROOT.."/next/doc"
-- class path: path.to.class -- class path: path.to.class
CONTROLLER_ROOT = "doc.controllers" CONTROLLER_ROOT = "doc.controllers"
@ -23,8 +22,7 @@ MODEL_ROOT = "doc.models"
-- file path: path/to/file -- file path: path/to/file
VIEW_ROOT = WWW_ROOT..DIR_SEP.."views" VIEW_ROOT = WWW_ROOT..DIR_SEP.."views"
-- TODO change me DOC_DIR = "/opt/www/doc"
DOC_DIR = "/home/dany/doc"
DOC_COVER = DOC_DIR.."/library.md" DOC_COVER = DOC_DIR.."/library.md"
package.path = package.path..";"..__ROOT__.."/os/libs/?.lua" package.path = package.path..";"..__ROOT__.."/os/libs/?.lua"

View File

@ -154,7 +154,7 @@ end
</div> </div>
<div id = "bottom"> <div id = "bottom">
Powered by antd server, (c) 2019 - <?=os.date("*t").year?> Xuan Sang LE Powered by antd server, (c) 2019 - <?=os.date("*t").year?> Dany LE
</div> </div>
<script> <script>
const toc_class_toggle = () => { const toc_class_toggle = () => {

View File

@ -11,8 +11,8 @@ if HEADER.Host then
else else
HTTP_ROOT = "https://info.iohub.dev" HTTP_ROOT = "https://info.iohub.dev"
end end
-- TODO remove me
HTTP_ROOT = HTTP_ROOT.."/next/info" DB_LOC="/opt/www/databases"
CONTROLLER_ROOT = "info.controllers" CONTROLLER_ROOT = "info.controllers"
MODEL_ROOT = "info.models" MODEL_ROOT = "info.models"
@ -25,9 +25,10 @@ local REGISTRY = {}
-- set logging level -- set logging level
REGISTRY.logger = Logger:new{ level = Logger.INFO} REGISTRY.logger = Logger:new{ level = Logger.INFO}
REGISTRY.users_allowed = { phuong = true, mrsang = true, dany = true } REGISTRY.users_allowed = { phuong = true, mrsang = true, dany = true }
-- TODO change me
REGISTRY.user = "dany" REGISTRY.user = "mrsang"
REGISTRY.dbfile = "/home/"..REGISTRY.user.."/databases/"..REGISTRY.user..".db"
REGISTRY.dbfile = DB_LOC.."/"..REGISTRY.user..".db"
REGISTRY.db = DBModel:new{db=REGISTRY.dbfile} REGISTRY.db = DBModel:new{db=REGISTRY.dbfile}
REGISTRY.layout = 'default' REGISTRY.layout = 'default'
@ -72,7 +73,7 @@ function NotfoundController:index(...)
REQUEST.r = ulib.trim(REQUEST.r:gsub(user, ""), "/") REQUEST.r = ulib.trim(REQUEST.r:gsub(user, ""), "/")
if REGISTRY.db then REGISTRY.db:close() end if REGISTRY.db then REGISTRY.db:close() end
REGISTRY.user = user REGISTRY.user = user
REGISTRY.dbfile = "/home/"..REGISTRY.user.."/databases/"..REGISTRY.user..".db" REGISTRY.dbfile = DB_LOC.."/"..REGISTRY.user..".db"
REGISTRY.db = DBModel:new{db=REGISTRY.dbfile} REGISTRY.db = DBModel:new{db=REGISTRY.dbfile}
REGISTRY.db:open() REGISTRY.db:open()
router:delegate() router:delegate()

View File

@ -1,7 +1,7 @@
<html> <html>
<head> <head>
<script type="text/javascript" src="<?=HTTP_ROOT?>/rst/gscripts/showdown.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/showdown/2.1.0/showdown.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?=HTTP_ROOT?>/style.css" /> <link rel="stylesheet" type="text/css" href="<?=HTTP_ROOT?>/style.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" /> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" />

View File

@ -54,8 +54,7 @@ function CommentController:index(...)
data.children = {} data.children = {}
-- find all the replies to this thread -- find all the replies to this thread
local sub_comments, suborder = local sub_comments, suborder =
self.comment:find( self.comment:find({
{
where = { where = {
pid = pid, pid = pid,
rid = data.id rid = data.id

View File

@ -7,8 +7,8 @@ require("silk.api")
-- crypto lib -- crypto lib
enc = require("enc") enc = require("enc")
WWW_ROOT = __ROOT__.."/talk" WWW_ROOT = __ROOT__.."/talk"
-- TODO change me DB_LOC="/opt/www/databases"
DB_FILE = "/home/dany/databases/quicktalk.db" DB_FILE = DB_LOC.."/quicktalk.db"
function fail(msg) function fail(msg)
std.json() std.json()
std.t(JSON.encode({error = msg})) std.t(JSON.encode({error = msg}))
@ -25,9 +25,6 @@ else
HTTP_ROOT = "https://talk.iohub.dev" HTTP_ROOT = "https://talk.iohub.dev"
end end
-- TODO remove me
HTTP_ROOT = HTTP_ROOT.."/next/talk"
-- class path: path.to.class -- class path: path.to.class
CONTROLLER_ROOT = "talk.controllers" CONTROLLER_ROOT = "talk.controllers"
MODEL_ROOT = "talk.models" MODEL_ROOT = "talk.models"