diff --git a/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua b/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua index f764ff79db..0dd662a788 100644 --- a/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua +++ b/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua @@ -1,13 +1,3 @@ -local e=require"luci.model.uci".cursor() -local o=e:get_first("qbittorrent","qbittorrent","port") or 8080 - -local a=(luci.sys.call("pidof qbittorrent-nox > /dev/null")==0) - -local t="" -if a then - t="

" -end - m = Map("qbittorrent", translate("qBittorrent"), translate("qBittorrent is a cross-platform free and open-source BitTorrent client.").."
"..translate("Default login username: admin, password: adminadmin.")..t) m:section(SimpleSection).template="qbittorrent/qbittorrent_status" diff --git a/package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbittorrent_status.htm b/package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbittorrent_status.htm index 13ebe1c978..0d4666e627 100644 --- a/package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbittorrent_status.htm +++ b/package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbittorrent_status.htm @@ -4,7 +4,7 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[qBittorrent]], [[status]])%>', null, var tb = document.getElementById('qBittorrent_status'); if (data && tb) { if (data.running) { - var links = 'qBittorrent <%:RUNNING%>'; + var links = 'qBittorrent <%:RUNNING%>'; tb.innerHTML = links; } else { tb.innerHTML = 'qBittorrent <%:NOT RUNNING%>'; @@ -12,6 +12,16 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[qBittorrent]], [[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.qbittorrent.config.port").value + var url = "http:" + localhostPath.substring(window.location.protocol.length) + ":" + clientPort; + window.open(url) +}; //]]> @@ -19,4 +29,4 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[qBittorrent]], [[status]])%>', null,

<%:Collecting data...%>

- \ No newline at end of file +