diff options
-rw-r--r-- | dmt/config.sh | 3 | ||||
-rwxr-xr-x | dmt/dmt | 8 | ||||
-rw-r--r-- | dmt/html/jobs.html | 26 | ||||
-rw-r--r-- | dmt/html/master.html | 22 |
4 files changed, 58 insertions, 1 deletions
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 @@ -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 @@ +<h1>Latest Jobs</h1> + +<div class="box hidden" id="no_server"> + <div class="box-title"> + Please wait... + <span class="right progress"></span> + </div> + <div class="box-text"> + Fetch failure - Attempting to contact server... + </div> +</div> + +<div class="box" id="no_jobs"> + <div class="box-title"> + Please wait... + <span class="right progress"></span> + </div> + <div class="box-text"> + Gathering job logs... + </div> +</div> + +<div id="latest_jobs"></div> + +<h1>Older Jobs</h1> +<div id="older_jobs"></div> 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 @@ +<!DOCTYPE HTML> + +<html> + <head> + <title>%($CYCHE_SITE_NAME%)</title> + <link rel="stylesheet" type="text/css" href="/style.css" /> + <script defer type="text/javascript" src="/script.js"></script> + </head> + + <body> + <nav class="links"> + <a href="/">jobs</a> + | etc... + + <span class="right"> + %($CYCHE_SITE_NAME%) + <span id="nav_progress"></span> + </span> + </nav> + %{ template "$page_template" %} + </body> +</html> |