From 696884ab2878749b55c49c2ff1a213c2156282da Mon Sep 17 00:00:00 2001 From: Denis Lemeshko Date: Fri, 25 Jun 2021 20:45:09 +0300 Subject: [PATCH] Kill user session button added --- frontend/src/main.js | 17 +++++++++++++++++ frontend/static/index.html | 16 +++++++++++++++- main.go | 17 +++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/frontend/src/main.js b/frontend/src/main.js index 4335468..7f7466b 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -91,6 +91,14 @@ new Vue({ ], rows: [], actions: [ + { + name: 'u-kill', + label: 'Kill', + class: 'btn-warning', + showWhenStatus: 'Connected', + showForServerRole: ['master', 'slave'], + showForModule: ["core"], + }, { name: 'u-change-password', label: 'Change password', @@ -186,6 +194,15 @@ new Vue({ created() { var _this = this; + _this.$root.$on('u-kill', function (msg) { + var data = new URLSearchParams(); + data.append('username', _this.username); + axios.request(axios_cfg('api/user/kill', data, 'form')) + .then(function(response) { + _this.getUserData(); + _this.$notify({title: 'User ' + _this.username + ' session killed!', type: 'warn'}) + }); + }) _this.$root.$on('u-revoke', function (msg) { var data = new URLSearchParams(); data.append('username', _this.username); diff --git a/frontend/static/index.html b/frontend/static/index.html index 3926847..d9ff221 100644 --- a/frontend/static/index.html +++ b/frontend/static/index.html @@ -2,7 +2,8 @@ - ovpn-admin + OpenVPN Admin Panel + @@ -25,6 +26,19 @@