diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-08-31 10:58:59 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-08-31 19:21:42 +0200 |
commit | 808f9d3542e21c819beb8fe72224f000ae2e019c (patch) | |
tree | 661e9e098103658a49d4e9170128c8592464249e /ui | |
parent | f721c5ef0cdd9952d014a1dc9e3a944afc0f7f45 (diff) |
[feat] expose an API to set/get/list gateway preferences
- Related: #9010
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/lib/bitmask.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ui/app/lib/bitmask.js b/ui/app/lib/bitmask.js index bfdf050..7a97319 100644 --- a/ui/app/lib/bitmask.js +++ b/ui/app/lib/bitmask.js @@ -289,6 +289,46 @@ var bitmask = function(){ uninstall: function() { return call(['vpn', 'uninstall']) } + + /** + * List VPN gateways + * + * They will be sorted in the order that they will be used + * + * @return {Promise<{provider_name: [{'name': string, + * 'country_code': string, + * 'location': string, + * ...}]}> + */ + list: function() { + return call(['vpn', 'list']) + } + + /** + * Get/set the location preference for the gateways + * + * @param {list<strings>} Order of preference of locations. + * If it's missing it will return the existing location list + */ + locations: function(locations) { + if (typeof locations !== 'list') { + locations = []; + } + return call(['vpn', 'locations'].concat(locations)) + } + + /** + * Get/set the country preference for the gateways + * + * @param {list<strings>} Order of preference of countries. + * If it's missing it will return the existing country list + */ + countries: function(countries) { + if (typeof countries !== 'list') { + countries = []; + } + return call(['vpn', 'countries'].concat(countries)) + } }, mail: { |