From 4ad289d02d893010a270eb9028bcbf0fa1c0da68 Mon Sep 17 00:00:00 2001 From: david-ajax Date: Thu, 14 Aug 2025 11:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E9=83=A8=E7=BD=B2=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webshare/static/js/script.js | 17 +++++++++++++++++ webshare/templates/app_index.html | 21 ++------------------- 2 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 webshare/static/js/script.js 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 @@ + -
@@ -145,4 +128,4 @@ data-font-size="{{ font_size }}" >
- + \ No newline at end of file