diff src/private/tools/config.html.luan @ 3:43814e9f5802

add config
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 21 Oct 2023 22:52:41 -0600
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/private/tools/config.html.luan	Sat Oct 21 22:52:41 2023 -0600
@@ -0,0 +1,36 @@
+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 Config = require "site:/lib/Config.luan"
+
+
+return function()
+	local config = Config.get_for_config()
+	config = stringify(config)
+	Io.stdout = Http.response.text_writer()
+%>
+<!doctype html>
+<html>
+	<head>
+		<meta name="viewport" content="width=device-width, initial-scale=1">
+		<style>
+			@import "/tools/tools.css";
+
+			textarea {
+				width: 100%;
+				height: 200px;
+			}
+		</style>
+	</head>
+	<body>
+		<h1>Config</h1>
+		<form method=post action="config_save.txt">
+			<p><textarea name=config><%=config%></textarea></p>
+			<p><input type=submit></p>
+		</form>
+	</body>
+</html>
+<%
+end