refactoring

This commit is contained in:
Devaev Maxim
2020-07-21 15:02:57 +03:00
parent b5ba546481
commit 360ff00903
9 changed files with 91 additions and 98 deletions

View File

@@ -42,14 +42,17 @@ export function WakeOnLan() {
self.setState = function(state) {
if (state) {
tools.setFeatureEnabled($("wol"), state.enabled);
tools.featureSetEnabled($("wol"), state.enabled);
__target = state.target;
}
wm.switchEnabled($("wol-wakeup-button"), (state && state.enabled));
};
var __clickWakeupButton = function() {
let msg = `Are you sure to send Wake-on-LAN packet to the server?<br>Target: <b>${__target.mac}</b> (${__target.ip}:${__target.port})?`;
let msg = `
Are you sure to send Wake-on-LAN packet to the server?<br>
Target: <b>${__target.mac}</b> (${__target.ip}:${__target.port})?
`;
wm.confirm(msg).then(function(ok) {
if (ok) {
let http = tools.makeRequest("POST", "/api/wol/wakeup", function() {