mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-31 23:01:21 +08:00
34 lines
1.1 KiB
HTML
34 lines
1.1 KiB
HTML
<script type="text/javascript">//<![CDATA[
|
|
XHR.poll(3, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null,
|
|
function(x, data) {
|
|
var tb = document.getElementById('verysync_status');
|
|
|
|
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;
|
|
} else {
|
|
tb.innerHTML = '<em><b><font color=red>Verysync <%: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.verysync.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="verysync_status">
|
|
<em><%:Collecting data...%></em>
|
|
</p>
|
|
</fieldset>
|