2025-05-29 15:07:58 +08:00

28 lines
962 B
HTML

<script type="text/javascript">//<![CDATA[
XHR.poll(1, '<%=url([[admin]], [[nas]], [[gowebdav]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('gowebdav_status');
if (data && tb) {
if (data.running) {
var links = '<em style=\"color:green\"><b>GoWebDav <%:RUNNING%></b></em><input class="cbi-button cbi-button-reload mar-10" type="button" value="<%:Open Web Interface%>" onclick="openwebui();" />';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em style=\"color:red\"><b>GoWebDav <%:NOT RUNNING%></b></em>';
}
}
}
);
function openwebui() {
var url = window.location.hostname+":<%=luci.sys.exec("uci -q get gowebdav.config.listen_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="gowebdav_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>