1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
openmptcprouter-feeds/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm

46 lines
1.5 KiB
HTML
Raw Normal View History

2018-01-22 10:20:49 +00:00
<div class="cbi-section-create cbi-tblsection-create">
<br />
2018-05-31 13:44:12 +00:00
<div class="table cbi-section-table">
<div class="tr cbi-section-table-row">
<div class="td cbi-section-table-cell" style="width:140px">
2018-01-22 10:20:49 +00:00
<select class="cbi-input-select" id="_newinst.type" name="_newinst.type">
<option value="_dummy">-- instance type --</option>
<option value="ss_local">ss-local</option>
<option value="ss_tunnel">ss-tunnel</option>
<option value="ss_redir">ss-redir</option>
<option value="ss_server">ss-server</option>
</select>
2018-05-31 13:44:12 +00:00
</div>
<div class="td cbi-section-table-cell" style="width:110px">
2018-01-22 10:20:49 +00:00
<input type="text" class="cbi-input-text" id="_newinst.name" name="_newinst.name" placeholder="<%:Name%>"/>
2018-05-31 13:44:12 +00:00
</div>
<div class="td cbi-section-table-cell left">
2018-01-22 10:20:49 +00:00
<input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>" value="<%:Add%>" />
2018-05-31 13:44:12 +00:00
</div>
</div>
</div>
2018-01-22 10:20:49 +00:00
</div>
<script type="text/javascript">//<![CDATA[
XHR.poll(5, '<%=url('admin/services/shadowsocks-libev/status')%>', null,
function(x, st)
{
var names = [
<%-
for _, name in ipairs(self:cfgsections()) do
write("%q," % name)
end
-%>
];
var instances = st["instances"] || {};
for (var i = 0, len = names.length; i < len; i++) {
var name = names[i];
var el = document.getElementById('cbi-table-' + name + '-running');
if (el) {
var running = instances.hasOwnProperty(name)? instances[name].running : false;
el.innerText = running ? 'yes' : 'no';
}
}
}
);
//]]></script>