mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 18:14:42 +00:00
dashboard: openvpn clients: missing endpoint and minor cleanup
This commit is contained in:
parent
22fa1e33d4
commit
af6180d631
@ -289,6 +289,7 @@
|
||||
<filename>OpenVPNClients.js</filename>
|
||||
<endpoints>
|
||||
<endpoint>/api/openvpn/service/search_sessions</endpoint>
|
||||
<endpoint>/api/openvpn/service/kill_session</endpoint>
|
||||
</endpoints>
|
||||
<translations>
|
||||
<title>OpenVPN Client Connections</title>
|
||||
|
||||
@ -53,11 +53,11 @@ export default class OpenVPNClients extends BaseTableWidget {
|
||||
async _killClient(id, commonName) {
|
||||
let split = id.split('_');
|
||||
let params = {server_id: split[0], session_id: split[1]};
|
||||
await this.ajaxCall('/api/openvpn/service/kill_session/', JSON.stringify(params), 'POST').then(async (data) => {
|
||||
await this.ajaxCall('/api/openvpn/service/kill_session', JSON.stringify(params), 'POST').then(async (data) => {
|
||||
if (data && data.status === 'not_found') {
|
||||
// kill by common name
|
||||
params.session_id = commonName;
|
||||
await this.ajaxCall('/api/openvpn/service/kill_session/', JSON.stringify(params), 'POST');
|
||||
await this.ajaxCall('/api/openvpn/service/kill_session', JSON.stringify(params), 'POST');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user