luci-app-verysync: fix button

This commit is contained in:
CN_SZTL 2020-02-10 13:33:16 +08:00
parent abc0efe0a8
commit c0e574c69b
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 12 additions and 6 deletions

View File

@ -1,10 +1,17 @@
-- Copyright 2008 Yanira <forum-2008@email.de>
-- Copyright 2020 KFERMercer <KFER.Mercer@gmail.com>
-- Licensed to the public under the Apache License 2.0.
-- Copyright 2020 [CTCGFW]Project-OpenWrt
-- Licensed to the public under the GPL v3.0.
m = Map("verysync")
m.title = translate("Verysync")
m.description = translate("Simple and easy-to-use multi-platform file synchronization software, astonishing transmission speed is different from the greatest advantage of other products. Micro-force synchronization of intelligent P2P technology to accelerate synchronization, will split the file into several KB-only data synchronization, and the file will be AES encryption processing.")
local uci = require "luci.model.uci".cursor()
local running=(luci.sys.call("pgrep verysync >/dev/null") == 0)
local button = ""
local trport = uci:get("verysync", "config", "port")
if running then
button = "<br/><br/><input type=\"button\" value=\" " .. translate("Open Verysync page") .. " \" onclick=\"window.open('http://'+window.location.hostname+':" .. trport .. "')\"/>"
end
m = Map("verysync", translate("Verysync"), translate("Simple and easy-to-use multi-platform file synchronization software, astonishing transmission speed is different from the greatest advantage of other products. Micro-force synchronization of intelligent P2P technology to accelerate synchronization, will split the file into several KB-only data synchronization, and the file will be AES encryption processing.") .. button)
m:section(SimpleSection).template = "verysync/verysync_status"

View File

@ -5,8 +5,7 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null,
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>Verysync <%:RUNNING%></font></b></em><input class="cbi-button mar-10" type="button" value="<%:Open Verysync page%>" onclick="openClient();" />';
tb.innerHTML = links;
tb.innerHTML = '<em><b><font color=green>Verysync <%:RUNNING%></font></b></em>';
} else {
tb.innerHTML = '<em><b><font color=red>Verysync <%:NOT RUNNING%></font></b></em>';
}