3
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
|
3 local stringify = Luan.stringify or error()
|
|
4 local Io = require "luan:Io.luan"
|
|
5 local Http = require "luan:http/Http.luan"
|
|
6 local Config = require "site:/lib/Config.luan"
|
|
7
|
|
8
|
|
9 return function()
|
|
10 local config = Config.get_for_config()
|
|
11 config = stringify(config)
|
|
12 Io.stdout = Http.response.text_writer()
|
|
13 %>
|
|
14 <!doctype html>
|
|
15 <html>
|
|
16 <head>
|
|
17 <meta name="viewport" content="width=device-width, initial-scale=1">
|
|
18 <style>
|
|
19 @import "/tools/tools.css";
|
|
20
|
|
21 textarea {
|
|
22 width: 100%;
|
|
23 height: 200px;
|
|
24 }
|
|
25 </style>
|
|
26 </head>
|
|
27 <body>
|
|
28 <h1>Config</h1>
|
|
29 <form method=post action="config_save.txt">
|
|
30 <p><textarea name=config><%=config%></textarea></p>
|
|
31 <p><input type=submit></p>
|
|
32 </form>
|
|
33 </body>
|
|
34 </html>
|
|
35 <%
|
|
36 end
|