add lots of stuff
This commit is contained in:
parent
f9c3921768
commit
4d02f7d0b7
BIN
data/dk.db
BIN
data/dk.db
Binary file not shown.
11
libs/install.lua
Normal file
11
libs/install.lua
Normal file
@ -0,0 +1,11 @@
|
||||
local m = {}
|
||||
|
||||
function m.is_installed()
|
||||
if fs.exists(".installed") then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return m
|
16
routes/install/first/get.lua
Normal file
16
routes/install/first/get.lua
Normal file
@ -0,0 +1,16 @@
|
||||
local i = require("install")
|
||||
if i.is_installed() then http.redirect("/") end
|
||||
|
||||
return send.html([[
|
||||
<html>
|
||||
<head>
|
||||
<title>Dragon Knight Installation</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Dragon Knight Installation</h1>
|
||||
<p>Installation for Dragon Knight is a simple two-step process: set up the database tables, then create the admin user. After that, you're done.</p>
|
||||
<a href="/install/second"><button>Install</button></a>
|
||||
</body>
|
||||
</html>
|
||||
]])
|
@ -1,14 +1,2 @@
|
||||
http.set_content_type("text/html")
|
||||
return [[
|
||||
<html>
|
||||
<head>
|
||||
<title>Dragon Knight Installation</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Dragon Knight Installation</h1>
|
||||
<p>Installation for Dragon Knight is a simple two-step process: set up the database tables, then create the admin user. After that, you're done.</p>
|
||||
<a href="/install/second"><button>Install</button></a>
|
||||
</body>
|
||||
</html>
|
||||
]]
|
||||
local i = require("install")
|
||||
if i.is_installed() then http.redirect("/") else http.redirect("/install/first") end
|
@ -1,3 +1,6 @@
|
||||
local i = require("install")
|
||||
if i.is_installed() then http.redirect("/") end
|
||||
|
||||
local start = microtime(true)
|
||||
local db = sqlite("dk")
|
||||
|
||||
@ -429,16 +432,15 @@ db:commit()
|
||||
|
||||
local time = math.roundto(microtime(true) - start, 4)
|
||||
|
||||
http.set_content_type("text/html")
|
||||
return [[
|
||||
return send.html(iparse([[
|
||||
<html>
|
||||
<head>
|
||||
<title>Dragon Knight Installation</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Dragon Knight Installation</h1>
|
||||
<p>Database setup complete in ]]..time..[[ seconds.</p>
|
||||
<p>Database setup complete in <!> seconds.</p>
|
||||
<a href="/install/third"><button>Continue</button></a>
|
||||
</body>
|
||||
</html>
|
||||
]]
|
||||
]], {time}))
|
||||
|
2
routes/install/third/get.lua
Normal file
2
routes/install/third/get.lua
Normal file
@ -0,0 +1,2 @@
|
||||
local i = require("install")
|
||||
if i.is_installed() then http.redirect("/") end
|
Loading…
x
Reference in New Issue
Block a user