lede/package/lean/luci-app-baidupcs-web/luasrc/view/baidupcs-web/baidupcs-web_status.htm
Beginner 6ca9a1b1a8
treewide: fix http/https protocol on some packages (#8350)
Not tested, but this shouldn't affect anything.

Co-authored-by: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
2021-11-30 01:22:04 +08:00

39 lines
1.2 KiB
HTML

<!--
Copyright (C) 2020 KFERMercer <KFER.Mercer@gmail.com>
THIS IS FREE SOFTWARE, LICENSED UNDER GPLv3.
-->
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[nas]], [[baidupcs-web]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('baidupcs-web_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>BaiduPCS-Web <%:RUNNING%></font></b></em><input class="cbi-button mar-10" type="button" value="<%:打开管理页面%>" onclick="openClient();" />';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>BaiduPCS-Web <%:NOT RUNNING%></font></b></em>';
}
}
}
);
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.baidupcs-web.config.port").value
var url = localhostPath + ":" + clientPort;
window.open(url)
};
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="baidupcs-web_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>