luci-app-travelmate: "final" fixes
during intense testing with different browsers (Chrome/Firefox/partly IE
in a VM) I found & fixed some more minor things:
* re-add accidently removed "apply_on_parse" attribute in overview cbi
* fixed a corner case where the "Restart" button not works correctly
* Removed leftovers from last commit
Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit af25cf4879
)
This commit is contained in:
parent
e290fe917d
commit
cc4310817e
3 changed files with 7 additions and 7 deletions
|
@ -39,7 +39,7 @@ function trm_action(name)
|
||||||
if name == "do_restart" then
|
if name == "do_restart" then
|
||||||
luci.sys.call("/etc/init.d/travelmate restart >/dev/null 2>&1")
|
luci.sys.call("/etc/init.d/travelmate restart >/dev/null 2>&1")
|
||||||
end
|
end
|
||||||
luci.http.prepare_content("text/plain")
|
luci.http.prepare_content("text/plain")
|
||||||
luci.http.write("0")
|
luci.http.write("0")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,10 @@ m = Map("travelmate", translate("Travelmate"),
|
||||||
.. "see online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md"))
|
.. "see online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md"))
|
||||||
m:chain("network")
|
m:chain("network")
|
||||||
m:chain("firewall")
|
m:chain("firewall")
|
||||||
|
m.apply_on_parse = true
|
||||||
|
|
||||||
function m.on_apply(self)
|
function m.on_apply(self)
|
||||||
luci.sys.call("env -i /etc/init.d/travelmate restart >/dev/null 2>&1")
|
luci.sys.call("/etc/init.d/travelmate restart >/dev/null 2>&1")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Interface Wizard
|
-- Interface Wizard
|
||||||
|
|
|
@ -7,7 +7,6 @@ This is free software, licensed under the Apache License, Version 2.0
|
||||||
.runtime
|
.runtime
|
||||||
{
|
{
|
||||||
color: #37c;
|
color: #37c;
|
||||||
//#0069d6;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -22,7 +21,7 @@ This is free software, licensed under the Apache License, Version 2.0
|
||||||
var btn1 = document.getElementById("btn1");
|
var btn1 = document.getElementById("btn1");
|
||||||
var view = document.getElementById("value_1");
|
var view = document.getElementById("value_1");
|
||||||
var input = json.data.travelmate_status;
|
var input = json.data.travelmate_status;
|
||||||
|
|
||||||
btn1.value = "<%:Restart%>";
|
btn1.value = "<%:Restart%>";
|
||||||
btn1.name = "do_restart";
|
btn1.name = "do_restart";
|
||||||
view.innerHTML = input || "-";
|
view.innerHTML = input || "-";
|
||||||
|
@ -41,8 +40,6 @@ This is free software, licensed under the Apache License, Version 2.0
|
||||||
view = document.getElementById("value_6");
|
view = document.getElementById("value_6");
|
||||||
input = json.data.last_rundate;
|
input = json.data.last_rundate;
|
||||||
view.innerHTML = input || "-";
|
view.innerHTML = input || "-";
|
||||||
btn1.disabled = false;
|
|
||||||
running(btn1_running, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function btn_action(action)
|
function btn_action(action)
|
||||||
|
@ -60,6 +57,8 @@ This is free software, licensed under the Apache License, Version 2.0
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
btn1.disabled = false;
|
||||||
|
running(btn1_running, 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +138,7 @@ This is free software, licensed under the Apache License, Version 2.0
|
||||||
<div class="cbi-value" id="button_1">
|
<div class="cbi-value" id="button_1">
|
||||||
<label class="cbi-value-title" for="button_1"><%:Restart Travelmate%></label>
|
<label class="cbi-value-title" for="button_1"><%:Restart Travelmate%></label>
|
||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input class="cbi-button cbi-button-reset" id="btn1" type="button" value="" onclick="btn_action(this)" />
|
<input class="cbi-button cbi-button-reset" id="btn1" type="button" name="do_restart" value="<%:Restart%>" onclick="btn_action(this)" />
|
||||||
<span id="btn1_running" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>
|
<span id="btn1_running" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue