Ver código fonte

auto update script executed

Toby Chui 1 ano atrás
pai
commit
fbfb7141f0
1 arquivos alterados com 19 adições e 1 exclusões
  1. 19 1
      web/tools/mdns.html

+ 19 - 1
web/tools/mdns.html

@@ -18,7 +18,7 @@
         <div id="mdns-hosts">
 
         </div>
-        <div class="ui divider"></div>
+        <br>
         <div class="ui container">
             <h4>Scan with custom domain filter</h4>
             <div class="ui form">
@@ -27,6 +27,7 @@
                     <input type="text" id="domain" name="domain" placeholder="domain.example.com"/>
                 </div>
                 <button id="discover" class="ui basic button">Discover</button>
+                <small><span id="countdownTimer"></span></small>
             </div>
             <br>
         </div>
@@ -47,6 +48,7 @@
             $("#discover").on("click", function() {
                 var domain = $("#domain").val();
                 $("#discover").addClass("loading").addClass('disabled');
+                setCountdown();
                 $.ajax({
                     type: "POST",
                     url: "/api/mdns/discover",
@@ -62,6 +64,22 @@
                 });
             });
 
+            function setCountdown() {
+                var timeLeft = 29;
+                var countdownTimer = document.getElementById("countdownTimer");
+
+                // Update the timer every second
+                var countdownInterval = setInterval(function() {
+                    if (timeLeft <= 0) {
+                    clearInterval(countdownInterval);
+                    countdownTimer.innerHTML = "Scan Completed";
+                    } else {
+                    countdownTimer.innerHTML = "Estimated Remaining Time: " + timeLeft + " seconds";
+                    timeLeft--;
+                    }
+                }, 1000);
+            }
+
             function renderMDNSHosts(data) {
                 // Create table header
                 var tableHeader = $('<thead>').append(