From e0a497b3f2b85c049026e57820421e0c52bf704d Mon Sep 17 00:00:00 2001 From: 4cuck <40539855+4cuck@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:04:54 +0200 Subject: [PATCH] allow sorting --- server/static/sortable.min.js | 3 +++ server/static/sorting.css | 43 ++++++++++++++++++++++++++++++ server/templates/instances.html.j2 | 25 ++++++++++++----- 3 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 server/static/sortable.min.js create mode 100644 server/static/sorting.css diff --git a/server/static/sortable.min.js b/server/static/sortable.min.js new file mode 100644 index 0000000..fc6e133 --- /dev/null +++ b/server/static/sortable.min.js @@ -0,0 +1,3 @@ +document.addEventListener("click",function(c){try{function h(a,b){return a.nodeName===b?a:h(a.parentNode,b)}var y=c.shiftKey||c.altKey,d=h(c.target,"TH"),m=d.parentNode,n=m.parentNode,f=n.parentNode;function p(a,b){a.classList.remove("dir-d");a.classList.remove("dir-u");b&&a.classList.add(b)}function q(a){return y&&a.dataset.sortAlt||a.dataset.sort||a.textContent}if("THEAD"===n.nodeName&&f.classList.contains("sortable")&&!d.classList.contains("no-sort")){var r,e=m.cells,t=parseInt(d.dataset.sortTbr); +for(c=0;cAbout

Last Updated {{last_updated}} UTC.

- +
@@ -84,7 +84,18 @@ - @@ -110,5 +121,7 @@ + + \ No newline at end of file
Instance {{host.ping_avg}} {% if host.rss -%} ✅ {%- else -%} ❌ {%- endif -%} + {%- if host.healthy and not host.version -%} + {%- set version = "Dmissing" -%} + {%- elif host.version and not host.is_upstream -%} + {%- set version = "Aforeign" -%} + {%- elif host.is_latest_version -%} + {%- set version = "Blatest" -%} + {%- elif host.version and not host.is_latest_version -%} + {%- set version = "Coutdated" -%} + {%- else -%} + {%- set version = "Eunknown" -%} + {%- endif -%} + {%- if host.version_url -%} {{host.version | default(value="missing version")}} @@ -92,13 +103,13 @@ {%- else -%} missing version {%- endif -%} - {%- if host.healthy and not host.version -%} + {%- if version == "Dmissing" -%} missing - {%- elif host.version and not host.is_upstream -%} + {%- elif version == "Aforeign" -%} foreign repo - {%- elif host.is_latest_version -%} + {%- elif version == "Blatest" -%} latest - {%- elif host.version and not host.is_latest_version -%} + {%- elif version == "Coutdated" -%} outdated {%- endif -%}