From 6f28e83f5d8924354a66b69241cb61a7b3162721 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 11 Nov 2023 16:55:59 -0500 Subject: dmt: Add main page layout Signed-off-by: Malfurious --- dmt/config.sh | 3 +++ dmt/dmt | 8 +++++++- dmt/html/jobs.html | 26 ++++++++++++++++++++++++++ dmt/html/master.html | 22 ++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 dmt/html/jobs.html create mode 100644 dmt/html/master.html diff --git a/dmt/config.sh b/dmt/config.sh index a19e14f..aa8a9c4 100644 --- a/dmt/config.sh +++ b/dmt/config.sh @@ -1,2 +1,5 @@ +# Title/heading to use for the web interface +CYCHE_SITE_NAME="cychedelic" + # Number of lines of text to show per job on the main page CYCHE_LOG_TAIL_LENGTH=25 diff --git a/dmt/dmt b/dmt/dmt index ca44b78..771ef88 100755 --- a/dmt/dmt +++ b/dmt/dmt @@ -18,6 +18,11 @@ escape() { | awk '{printf "%s\\n", $0}' } +template() { + [ -n "$2" ] && printf 'Content-type: %s\n\n' "$2" + template.awk "$1" | bash +} + newest_job() { ls -A "$CYCHE_LOG_DIR" | sort -rn | head -n1 } @@ -75,4 +80,5 @@ api_log() { fi } -api_log +page_template="html/jobs.html" +template html/master.html text/html diff --git a/dmt/html/jobs.html b/dmt/html/jobs.html new file mode 100644 index 0000000..72269f6 --- /dev/null +++ b/dmt/html/jobs.html @@ -0,0 +1,26 @@ +

Latest Jobs

+ + + +
+
+ Please wait... + +
+
+ Gathering job logs... +
+
+ +
+ +

Older Jobs

+
diff --git a/dmt/html/master.html b/dmt/html/master.html new file mode 100644 index 0000000..14c7c6f --- /dev/null +++ b/dmt/html/master.html @@ -0,0 +1,22 @@ + + + + + %($CYCHE_SITE_NAME%) + + + + + + + %{ template "$page_template" %} + + -- cgit v1.2.3