From 2e18921a2713d17005e6a79e4c227e806a97cccc Mon Sep 17 00:00:00 2001 From: Joren Date: Mon, 30 Dec 2024 16:45:56 +0100 Subject: [PATCH] Show limit --- config.toml | 2 +- src/templates/index | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config.toml b/config.toml index 04a2c04..808531f 100644 --- a/config.toml +++ b/config.toml @@ -7,7 +7,7 @@ EnableConsole = true [WatchFolder] Path = "/home/joren/dev/DRMDTool/folder" PollingInterval = 10 -UsePolling = true +UsePolling = false UseInotify = false [N_m3u8DLRE] diff --git a/src/templates/index b/src/templates/index index 1e6d92a..8e2135d 100644 --- a/src/templates/index +++ b/src/templates/index @@ -293,12 +293,15 @@ document.addEventListener('DOMContentLoaded', function() { const currentSpeedLimit = "{{if .GlobalSpeedLimit}}{{.GlobalSpeedLimit}}{{else}}0{{end}}"; const speedLimitValueInput = document.getElementById('speedLimitValue'); - - // Extract numeric value and unit + const speedLimitUnitSelect = document.getElementById('speedLimitUnit'); + const match = currentSpeedLimit.match(/(\d+(\.\d+)?)([A-Za-z]+)/); if (match) { - speedLimitValueInput.value = match[1]; // Set the numeric value - document.getElementById('speedLimitUnit').value = match[3]; // Set the unit + speedLimitValueInput.value = match[1]; + speedLimitUnitSelect.value = match[3]; + } else { + speedLimitValueInput.value = "0"; + speedLimitUnitSelect.value = "MBps"; } });