From 00bcec4624a8e261b954564ee88add2bf1190ea0 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 11 Feb 2020 19:59:09 +0800 Subject: [PATCH] luci-app-verysync: fix button Revert "luci-app-verysync: fix button" This reverts commit c0e574c69b438a82576cf8de989758812f52ce5a. --- .../luasrc/model/cbi/verysync.lua | 15 ++++----------- .../luasrc/view/verysync/verysync_status.htm | 14 +++++--------- 2 files changed, 9 insertions(+), 20 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 bd99c6c4ff..f8bfd26bb2 100644 --- a/package/zxlhhyccc/luci-app-verysync/luasrc/model/cbi/verysync.lua +++ b/package/zxlhhyccc/luci-app-verysync/luasrc/model/cbi/verysync.lua @@ -1,17 +1,10 @@ -- Copyright 2008 Yanira -- Copyright 2020 KFERMercer --- Copyright 2020 [CTCGFW]Project-OpenWrt --- Licensed to the public under the GPL v3.0. +-- Licensed to the public under the Apache License 2.0. -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 = 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.") 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 3ab27a9b96..65d8cbee65 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,7 +5,8 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null, if (data && tb) { if (data.running) { - tb.innerHTML = 'Verysync <%:RUNNING%>'; + var links = 'Verysync <%:RUNNING%>'; + tb.innerHTML = links; } else { tb.innerHTML = 'Verysync <%:NOT RUNNING%>'; } @@ -13,14 +14,9 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null, } ); -function openClient() { - var curWwwPath = window.document.location.href; - var pathName = window.document.location.pathname; - var pos = curWwwPath.indexOf(pathName); - var localhostPath = curWwwPath.substring(0, pos); - var clientPort = window.document.getElementById("cbid.verysync.config.port").value - var url = "http:" + localhostPath.substring(window.location.protocol.length) + ":" + clientPort; - window.open(url) +function openwebui(){ + var url = window.location.host+":<%=luci.sys.exec("uci -q get verysync.config.port"):gsub("^%s*(.-)%s*$", "%1")%>"; + window.open('http://'+url,'target',''); }; //]]>