comparison src/private/tools/config.html.luan @ 1:b116b6ef07bf

add config
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 23 Oct 2024 21:18:04 -0600
parents
children 2c63b10781e1
comparison
equal deleted inserted replaced
0:fddd11ae516c 1:b116b6ef07bf
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 <title>Chat Private Tools</title>
20 <style>
21 textarea {
22 width: 90%;
23 height: 20em;
24 }
25 </style>
26 </head>
27 <body>
28 <% header() %>
29 <div content>
30 <h1>Configure</h1>
31 <form method=post action="save_config.txt">
32 <p>
33 <textarea name=config autofocus><%= stringify(config) %></textarea>
34 </p>
35 <p>
36 <input type=submit value="Update">
37 </p>
38 </form>
39 </div>
40 </body>
41 </html>
42 <%
43 end