comparison src/private/tools/config.html.luan @ 101:0fc454beff08 default tip

use Config.luan
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 30 Jun 2025 23:49:10 -0600
parents 0e3b22ece2fc
children
comparison
equal deleted inserted replaced
100:0e3b22ece2fc 101:0fc454beff08
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 lang="en">
17 <head>
18 <% head() %>
19 <style>
20 [content] {
21 max-width: 90%;
22 width: 700px;
23 padding: 0;
24 }
25 textarea {
26 width: 100%;
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>
37 <textarea name=config autofocus><%= stringify(config).."\n" %></textarea>
38 </p>
39 <p>
40 <input type=submit value="Update">
41 </p>
42 </form>
43 </div>
44 </body>
45 </html>
46 <%
47 end