改进部署组件
This commit is contained in:
17
webshare/static/js/script.js
Normal file
17
webshare/static/js/script.js
Normal file
@@ -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();
|
||||
}
|
@@ -4,6 +4,7 @@
|
||||
<link rel="stylesheet" href="{{ config.static.url }}css/xterm.css" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto%20Mono"/>
|
||||
<script src="{{ config.static.url }}js/textual.js"></script>
|
||||
<script src="{{ config.static.url }}js/script.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background: #000000;
|
||||
@@ -99,24 +100,6 @@
|
||||
z-index: 5;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
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();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body data-pingurl="{{ ping_url }}">
|
||||
<div class="dialog-container intro-dialog">
|
||||
@@ -145,4 +128,4 @@
|
||||
data-font-size="{{ font_size }}"
|
||||
></div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
Reference in New Issue
Block a user