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>
|
|
20 textarea {
|
|
21 width: 90%;
|
|
22 height: 20em;
|
|
23 }
|
|
24 </style>
|
|
25 </head>
|
|
26 <body>
|
|
27 <% header() %>
|
|
28 <div content>
|
|
29 <h1>Configure</h1>
|
|
30 <form method=post action="save_config.txt">
|
|
31 <p>
|
|
32 <textarea name=config autofocus><%= stringify(config) %></textarea>
|
|
33 </p>
|
|
34 <p>
|
|
35 <input type=submit value="Update">
|
|
36 </p>
|
|
37 </form>
|
|
38 </div>
|
|
39 </body>
|
|
40 </html>
|
|
41 <%
|
|
42 end
|