Trying to fix getting services status in index.html

This commit is contained in:
Iam54r1n4
2025-02-07 22:00:21 +00:00
parent a8be39e2e7
commit 5aa3c6df5b

View File

@ -90,7 +90,7 @@
</div> </div>
</div> </div>
<div class="col-lg-3 col-6"> <div class="col-lg-3 col-6">
<div class="small-box" id="singbox-status-box"> <div class="small-box" id="singbox-status-box">
<div class="inner"> <div class="inner">
<h3 id="singbox-status">--</h3> <h3 id="singbox-status">--</h3>
<p>Singbox</p> <p>Singbox</p>
@ -100,7 +100,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-lg-3 col-6"> <div class="col-lg-3 col-6">
<div class="small-box" id="normalsub-status-box"> <div class="small-box" id="normalsub-status-box">
<div class="inner"> <div class="inner">
<h3 id="normalsub-status">--</h3> <h3 id="normalsub-status">--</h3>
@ -133,13 +133,13 @@
function updateServiceStatuses() { function updateServiceStatuses() {
// Add services api in fetch // Add services api in fetch
fetch('') fetch('{{ url_for("server_services_status_api") }}')
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
updateServiceBox('hysteria2', data.hysteria2); updateServiceBox('hysteria2', data.hysteria_server);
updateServiceBox('telegrambot', data.telegrambot); updateServiceBox('telegrambot', data.hysteria_telegram);
updateServiceBox('singbox', data.singbox); updateServiceBox('singbox', data.hysteria_singbox);
updateServiceBox('normalsub', data.normalsub); updateServiceBox('normalsub', data.hysetria_normal_sub);
}) })
.catch(error => console.error('Error fetching service statuses:', error)); .catch(error => console.error('Error fetching service statuses:', error));
} }
@ -167,4 +167,4 @@
setInterval(updateServerInfo, 5000); setInterval(updateServerInfo, 5000);
</script> </script>
{% endblock %} {% endblock %}