diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/private/tools/config.html.luan	Wed Oct 23 21:18:04 2024 -0600
@@ -0,0 +1,43 @@
+local Luan = require "luan:Luan.luan"
+local error = Luan.error
+local stringify = Luan.stringify or error()
+local Io = require "luan:Io.luan"
+local Http = require "luan:http/Http.luan"
+local Shared = require "site:/lib/Shared.luan"
+local head = Shared.head or error()
+local header = Shared.private_header or error()
+local config = Shared.config or error()
+
+
+return function()
+	Io.stdout = Http.response.text_writer()
+%>
+<!doctype html>
+<html>
+	<head>
+<%		head() %>
+		<title>Chat Private Tools</title>
+		<style>
+			textarea {
+				width: 90%;
+				height: 20em;
+			}
+		</style>
+	</head>
+	<body>
+<%		header() %>
+		<div content>
+			<h1>Configure</h1>
+			<form method=post action="save_config.txt">
+				<p>
+					<textarea name=config autofocus><%= stringify(config) %></textarea>
+				</p>
+				<p>
+					<input type=submit value="Update">
+				</p>
+			</form>
+		</div>
+	</body>
+</html>
+<%
+end