aboutsummaryrefslogtreecommitdiff
path: root/status.js
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2020-10-07 10:55:25 -0500
committerMark Powers <markppowers0@gmail.com>2020-10-07 10:55:25 -0500
commit2c2718ed12d07b7cdb5dfee60e146e214a8d6842 (patch)
treee03670981ac9b8b12772461d5f273066c098d2ef /status.js
parent1f1f48db76b5b99092b44d52f1ed7af327034d71 (diff)
Add status check
Diffstat (limited to 'status.js')
-rw-r--r--status.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/status.js b/status.js
new file mode 100644
index 0000000..262a1b5
--- /dev/null
+++ b/status.js
@@ -0,0 +1,24 @@
+let urls = [
+ WIKI_URL, RSS_URL, RSS_VIDEO_URL, GITEA_URL, FILES_URL, FILE_FEED_URL, CALENDAR_URL, BUDGET_URL
+]
+let ids = [
+ "wiki", "rss", "rssvideo", "gitea", "files", "filefeed", "calendar", "budget"
+]
+let status_url = `http://localhost:8080?${urls.join("&")}`
+fetch(status_url)
+ .then( response => response.text())
+ .then( response => {
+ response.split("\n").forEach((el, i)=> {
+ if(el == "") { return }
+ console.log(urls[i], ids[i], el)
+ let htmlEl = document.getElementById(ids[i])
+ let newEl = document.createElement("span")
+ if(el == "up"){
+ newEl.className = "status-up"
+ } else {
+ newEl.className = "status-down"
+ }
+ htmlEl.insertBefore(newEl, htmlEl.lastChild);
+ })
+ })
+