From 9ab90040d4cf87a89f23a92b73ce95cbe8ac983c Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 23 Feb 2017 13:04:00 +0100 Subject: [feat] add VPN API to bitmask.js - Resolves: #8779 --- ui/app/lib/bitmask.js | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'ui') diff --git a/ui/app/lib/bitmask.js b/ui/app/lib/bitmask.js index 79f4b916..88a66447 100644 --- a/ui/app/lib/bitmask.js +++ b/ui/app/lib/bitmask.js @@ -204,6 +204,65 @@ var bitmask = function(){ } }, + /** + * For now the VPN setup is not really streamlined + * + * src/leap/bitmask/vpn/README.rst for more info + */ + vpn: { + enable: function() { + return call(['vpn', 'enable']) + }, + + disable: function() { + return call(['vpn', 'disable']) + }, + + status: function() { + return call(['vpn', 'status']) + }, + + start: function(provider) { + return call(['vpn', 'start', provider]) + }, + + stop: function() { + return call(['vpn', 'stop']) + }, + + /** + * Check if the VPN is ready to start and has the cert downloaded + * + * @return {Promise} User readable status + */ + check: function(provider) { + return call(['vpn', 'check', provider]) + }, + + /** + * Download VPN cert + * + * @param {string} userid the userid to be used + */ + get_cert: function(userid) { + return call(['vpn', 'get_cert', userid]) + }, + + /** + * Install helpers in the system + */ + install: function() { + return call(['vpn', 'install']) + }, + + /** + * Uninstall helpers in the system + */ + uninstall: function() { + return call(['vpn', 'uninstall']) + } + }, + mail: { /** * Check the status of the email service -- cgit v1.2.3