From 667da2627491e7655c6807b2e024f844fe689bad Mon Sep 17 00:00:00 2001
From: ReturnFI <151555003+ReturnFI@users.noreply.github.com>
Date: Thu, 18 Sep 2025 20:41:10 +0000
Subject: [PATCH] feat(frontend): display current telegram backup interval in
UI
---
core/scripts/webpanel/templates/settings.html | 26 ++++++++++++++++---
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/core/scripts/webpanel/templates/settings.html b/core/scripts/webpanel/templates/settings.html
index f4396cb..ed88cb2 100644
--- a/core/scripts/webpanel/templates/settings.html
+++ b/core/scripts/webpanel/templates/settings.html
@@ -970,12 +970,14 @@
if ($form.find(".alert-info").length === 0) {
$form.prepend(`
Service is running. You can stop it or change the backup interval.
`);
}
+ fetchTelegramBackupInterval();
} else {
$form.find('[data-group="start-only"]').show();
$("#telegram_start").show();
$("#telegram_stop").hide();
$("#telegram_save_interval").hide();
$form.find(".alert-info").remove();
+ $("#telegram_backup_interval").val("");
}
} else if (serviceKey === "hysteria_normal_sub") {
@@ -1062,6 +1064,25 @@
}
});
}
+
+ function fetchTelegramBackupInterval() {
+ $.ajax({
+ url: "{{ url_for('telegram_get_interval_api') }}",
+ type: "GET",
+ success: function (data) {
+ if (data.backup_interval) {
+ $("#telegram_backup_interval").val(data.backup_interval);
+ } else {
+ $("#telegram_backup_interval").val("");
+ }
+ },
+ error: function (xhr, status, error) {
+ console.error("Failed to fetch Telegram backup interval:", error, xhr.responseText);
+ $("#telegram_backup_interval").val("");
+ }
+ });
+ }
+
function fetchIpLimitConfig() {
$.ajax({
@@ -1291,10 +1312,7 @@
"Backup interval updated successfully!",
"#telegram_save_interval",
false,
- function() {
- $("#telegram_backup_interval").val("");
- $("#telegram_backup_interval").removeClass("is-invalid");
- }
+ fetchTelegramBackupInterval
);
});
}