mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 01:44:16 +08:00
28 lines
951 B
HTML
28 lines
951 B
HTML
<script type="text/javascript">//<![CDATA[
|
|
XHR.poll(3, '<%=url([[admin]], [[nas]], [[cloudreve]], [[status]])%>', null,
|
|
function(x, data) {
|
|
var tb = document.getElementById('cloudreve_status');
|
|
if (data && tb) {
|
|
if (data.running) {
|
|
var links = '<em><b><font color=green>Cloudreve <%:RUNNING%></font></b></em><input class="cbi-button mar-10" type="button" value="<%:Open Web Interface%>" onclick="openwebui();" />';
|
|
tb.innerHTML = links;
|
|
} else {
|
|
tb.innerHTML = '<em><b><font color=red>Cloudreve <%:NOT RUNNING%></font></b></em>';
|
|
}
|
|
}
|
|
}
|
|
);
|
|
|
|
function openwebui(){
|
|
var url = window.location.host+":<%=luci.sys.exec("uci -q get cloudreve.@cloudreve[0].port"):gsub("^%s*(.-)%s*$", "%1")%>";
|
|
window.open('http://'+url,'target','');
|
|
};
|
|
//]]>
|
|
</script>
|
|
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
|
<fieldset class="cbi-section">
|
|
<p id="cloudreve_status">
|
|
<em><%:Collecting data...%></em>
|
|
</p>
|
|
</fieldset>
|