|
@@ -132,7 +132,6 @@
|
|
|
})
|
|
|
var ipDOM = iplinks.join(" / ");
|
|
|
var macDOM = host.MacAddr.join(" / ");
|
|
|
- console.log(host.MacAddr);
|
|
|
if (host.MacAddr.length == 0){
|
|
|
//Old version of ArozOS, do not support MAC addr broadcast
|
|
|
macDOM = "Version Not Supported";
|
|
@@ -196,13 +195,17 @@
|
|
|
ipDOM = host.LastSeenIP.join(" / ");
|
|
|
}
|
|
|
let macDOM = "No Record";
|
|
|
+ let wakeOnLanButton = "";
|
|
|
if (host.MacAddr != null && host.MacAddr.length > 0){
|
|
|
macDOM = host.MacAddr.join(" / ");
|
|
|
+ wakeOnLanButton = `<button class="ui right floated basic button" mac="${encodeURIComponent(JSON.stringify(host.MacAddr))}" onclick="wakeonlan(this);"><i class="power icon"></i> Wake On LAN</button>`;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
$("#offlineList").append(`<div class="ui icon message">
|
|
|
- <i class="server icon"></i>
|
|
|
+ <i class="server icon"></i>
|
|
|
<div class="content">
|
|
|
- <button class="ui right floated basic button"><i class="power icon"></i> Wake On LAN</button>
|
|
|
+ ${wakeOnLanButton}
|
|
|
<div class="header">
|
|
|
<span>${host.Name}</a>
|
|
|
</div>
|
|
@@ -252,6 +255,30 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function wakeonlan(object){
|
|
|
+ $(object).addClass("disabled");
|
|
|
+ let macAddr = $(object).attr("mac");
|
|
|
+ macAddr = JSON.parse(decodeURIComponent(macAddr));
|
|
|
+ let counter = macAddr.length;
|
|
|
+ macAddr.forEach(function(thisMac){
|
|
|
+ $.get("../../system/cluster/wol?mac=" + thisMac, function(data){
|
|
|
+ console.log("Wake On Lan packet sent to " + thisMac + " with results: "+ data);
|
|
|
+ counter--;
|
|
|
+ if (counter == 0){
|
|
|
+ //All WOL packet has been sent
|
|
|
+ let currentButtonText = $(object).html();
|
|
|
+ $(object).addClass("green").addClass("icon");;
|
|
|
+ $(object).html(`<i class="green checkmark icon"></i>`);
|
|
|
+ setTimeout(function(){
|
|
|
+ $(object).removeClass("green").removeClass("remove");
|
|
|
+ $(object).html(currentButtonText);
|
|
|
+ $(object).removeClass("disabled");
|
|
|
+ }, 5000)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
</script>
|
|
|
</body>
|