0
0
mirror of https://github.com/openwrt/luci.git synced 2025-04-18 06:06:12 +00:00
Files
Mustafa Can Elmacı ae8bbb814f treewide: HTML Cleanup
* HTML Cleanup: Meta tags.
* Converted charset to shorthand.
* Removed meta tags with `Content-Script-Type` attribute. (Invalid in HTML5 spec.)

* HTML Cleanup: CSS tags.
* Removed `type` attribute with CSS files from link tags. (HTML5 spec recommends omitting it.)
* Removed `type` attribute from style tags. (Deprecated in HTML5 spec.)
https://html.spec.whatwg.org/#attr-link-type
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style

* HTML Cleanup: Convert from XHTML to HTML5
* Removed XML declaration.
* Removed XML namespace.
* Changed doctype to HTML5.

* HTML Cleanup: CDATA tags.
* CDATA sections should not be used within HTML they are considered as comments and not displayed.
https://developer.mozilla.org/en-US/docs/Web/API/CDATASection

* HTML Cleanup: Script tags.
* Removed `language` attribute from script tags. (No longer valid in HTML5)
* Removed `type` attribute with JavaScript MIME type from script tags. (HTML5 spec recommends omitting it.)
https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
https://mimesniff.spec.whatwg.org/#javascript-mime-type

Signed-off-by: Mustafa Can Elmacı <mustafacan@elmaci.net>
2024-11-22 22:39:46 +01:00

67 lines
1.6 KiB
HTML

<script>
function ocserv_disconnect(idx) {
(new XHR()).post('<%=url('admin/vpn/ocserv/disconnect')%>/' + idx, { token: '<%=token%>' },
function(x)
{
var tb = document.getElementById('ocserv_status_table');
if (tb && (idx + 1 < tb.childNodes.length))
tb.removeChild(tb.childNodes[idx + 1]);
}
);
}
XHR.poll(-1, '<%=url('admin/vpn/ocserv/status')%>', null,
function(x, st)
{
var tb = document.getElementById('ocserv_status_table');
if (st && tb)
{
var rows = [];
for (var i = 0; i < st.length; i++)
{
rows.push([
st[i].user,
st[i].group,
st[i].vpn_ip,
st[i].ip,
st[i].device,
st[i].time,
st[i].cipher,
st[i].status,
E('input', {
type: 'button',
class: 'cbi-button cbi-button-remove',
onclick: 'ocserv_disconnect(%d)'.format(st[i].id)
})
]);
}
cbi_update_table(tb, rows, '<em><%:There are no active users.%></em>');
}
}
);
</script>
<fieldset class="cbi-section">
<legend><%:Active OpenConnect Users%></legend>
<div class="table" id="ocserv_status_table">
<div class="tr table-titles">
<div class="th"><%:User%></div>
<div class="th"><%:Group%></div>
<div class="th"><%:IP Address%></div>
<div class="th"><%:VPN IP Address%></div>
<div class="th"><%:Device%></div>
<div class="th"><%:Time%></div>
<div class="th"><%:Cipher%></div>
<div class="th"><%:Status%></div>
<div class="th">&#160;</div>
</div>
<div class="tr placeholder">
<div class="td"><em><%:Collecting data...%></em></div>
</div>
</div>
</fieldset>