1
|
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 Shared = require "site:/lib/Shared.luan"
|
|
7 local head = Shared.head or error()
|
|
8 local header = Shared.private_header or error()
|
|
9 local config = Shared.config or error()
|
|
10
|
|
11
|
|
12 return function()
|
|
13 Io.stdout = Http.response.text_writer()
|
|
14 %>
|
|
15 <!doctype html>
|
|
16 <html>
|
|
17 <head>
|
|
18 <% head() %>
|
|
19 <style>
|
50
|
20 [content] {
|
|
21 max-width: 90%;
|
|
22 width: 700px;
|
|
23 padding: 0;
|
|
24 }
|
1
|
25 textarea {
|
50
|
26 width: 100%;
|
1
|
27 height: 20em;
|
|
28 }
|
|
29 </style>
|
|
30 </head>
|
|
31 <body>
|
|
32 <% header() %>
|
|
33 <div content>
|
|
34 <h1>Configure</h1>
|
|
35 <form method=post action="save_config.txt">
|
|
36 <p>
|
69
|
37 <textarea name=config autofocus><%= stringify(config).."\n" %></textarea>
|
1
|
38 </p>
|
|
39 <p>
|
|
40 <input type=submit value="Update">
|
|
41 </p>
|
|
42 </form>
|
|
43 </div>
|
|
44 </body>
|
|
45 </html>
|
|
46 <%
|
|
47 end
|