diff --git a/webshare/static/js/script.js b/webshare/static/js/script.js new file mode 100644 index 0000000..916a62b --- /dev/null +++ b/webshare/static/js/script.js @@ -0,0 +1,17 @@ +function getStartUrl() { + const url = new URL(window.location.href); + const params = new URLSearchParams(url.search); + params.delete("delay"); + return url.pathname + "?" + params.toString(); +} + +async function refresh() { + const ping_url = document.body.dataset.pingurl; + if (ping_url) { + await fetch(ping_url, { + method: "GET", + mode: "no-cors", + }); + } + window.location.href = getStartUrl(); +} \ No newline at end of file diff --git a/webshare/templates/app_index.html b/webshare/templates/app_index.html index c1fb47c..7c40251 100644 --- a/webshare/templates/app_index.html +++ b/webshare/templates/app_index.html @@ -4,6 +4,7 @@ + -