mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-09-11 19:04:21 +08:00
29 lines
1.0 KiB
HTML
29 lines
1.0 KiB
HTML
<script type="text/javascript">//<![CDATA[
|
|
XHR.poll(5, '<%=url("admin/services/kaiplus_status")%>', null, function(x, st) {
|
|
var el = document.getElementById('kaiplus_status');
|
|
if (st && el) {
|
|
if (!st.running) {
|
|
el.innerHTML = '<br/><em style=\"color:red\"><%:The KaiPlus service is not running.%></em>';
|
|
}
|
|
if (st.running) {
|
|
var basePath = st.base_path || "/apps/kaiplus/";
|
|
if (basePath.charAt(0) !== "/") {
|
|
basePath = "/" + basePath;
|
|
}
|
|
if (basePath.charAt(basePath.length - 1) !== "/") {
|
|
basePath = basePath + "/";
|
|
}
|
|
el.innerHTML = '<br/><em style=\"color:green\"><%:The KaiPlus service is running.%></em>'
|
|
+ "<br/><br/><input class=\"btn cbi-button cbi-button-apply\" type=\"button\" value=\" <%:Click to open KaiPlus%> \" onclick=\"window.open('http://' + window.location.hostname + ':' + st.port + basePath)\"/>";
|
|
}
|
|
}
|
|
});
|
|
//]]></script>
|
|
|
|
<fieldset class="cbi-section">
|
|
<legend><%:Status%></legend>
|
|
<p id="kaiplus_status">
|
|
<em><%:Collecting data...%></em>
|
|
</p>
|
|
</fieldset>
|