From 804b492b23aa0a34f3fa09a428c0abbc69ddc5c5 Mon Sep 17 00:00:00 2001 From: Iam54r1n4 Date: Fri, 7 Feb 2025 23:07:15 +0000 Subject: [PATCH] Fix fetching services status bug in index.html --- core/scripts/webpanel/templates/index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/scripts/webpanel/templates/index.html b/core/scripts/webpanel/templates/index.html index 21065aa..5c05618 100644 --- a/core/scripts/webpanel/templates/index.html +++ b/core/scripts/webpanel/templates/index.html @@ -136,10 +136,11 @@ fetch('{{ url_for("server_services_status_api") }}') .then(response => response.json()) .then(data => { + updateServiceBox('hysteria2', data.hysteria_server); - updateServiceBox('telegrambot', data.hysteria_telegram); + updateServiceBox('telegrambot', data.hysteria_telegram_bot); updateServiceBox('singbox', data.hysteria_singbox); - updateServiceBox('normalsub', data.hysetria_normal_sub); + updateServiceBox('normalsub', data.hysteria_normal_sub); }) .catch(error => console.error('Error fetching service statuses:', error)); } @@ -148,7 +149,7 @@ const statusElement = document.getElementById(serviceName + '-status'); const statusBox = document.getElementById(serviceName + '-status-box'); - if (status === 'active') { + if (status === true) { statusElement.textContent = 'Active'; statusBox.classList.remove('bg-danger'); statusBox.classList.add('bg-success'); // Add green