From c0e574c69b438a82576cf8de989758812f52ce5a Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Mon, 10 Feb 2020 13:33:16 +0800 Subject: [PATCH] luci-app-verysync: fix button --- .../luasrc/model/cbi/verysync.lua | 15 +++++++++++---- .../luasrc/view/verysync/verysync_status.htm | 3 +-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package/zxlhhyccc/luci-app-verysync/luasrc/model/cbi/verysync.lua b/package/zxlhhyccc/luci-app-verysync/luasrc/model/cbi/verysync.lua index f8bfd26bb2..bd99c6c4ff 100644 --- a/package/zxlhhyccc/luci-app-verysync/luasrc/model/cbi/verysync.lua +++ b/package/zxlhhyccc/luci-app-verysync/luasrc/model/cbi/verysync.lua @@ -1,10 +1,17 @@ -- Copyright 2008 Yanira -- Copyright 2020 KFERMercer --- 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 = "

" +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" diff --git a/package/zxlhhyccc/luci-app-verysync/luasrc/view/verysync/verysync_status.htm b/package/zxlhhyccc/luci-app-verysync/luasrc/view/verysync/verysync_status.htm index a0386ec312..3ab27a9b96 100644 --- a/package/zxlhhyccc/luci-app-verysync/luasrc/view/verysync/verysync_status.htm +++ b/package/zxlhhyccc/luci-app-verysync/luasrc/view/verysync/verysync_status.htm @@ -5,8 +5,7 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null, if (data && tb) { if (data.running) { - var links = 'Verysync <%:RUNNING%>'; - tb.innerHTML = links; + tb.innerHTML = 'Verysync <%:RUNNING%>'; } else { tb.innerHTML = 'Verysync <%:NOT RUNNING%>'; }