summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2019-06-06 11:18:52 +0100
committerEmīls Piņķis <emils@mullvad.net>2019-06-06 12:12:45 +0100
commitbc5a62a085ad73964c1af46c02cdcb83aae111b7 (patch)
treea49dfc49a08512e78b63861ba3e7888ff83b6559 /gui/src/shared
parentee2ad5124f2773119c0665410cc65f544a02f0fc (diff)
downloadmullvadvpn-bc5a62a085ad73964c1af46c02cdcb83aae111b7.tar.xz
mullvadvpn-bc5a62a085ad73964c1af46c02cdcb83aae111b7.zip
Implement pretty printing for TunnelType and ProxyType
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/daemon-rpc-types.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts
index 108f6dc98f..891c06c8b9 100644
--- a/gui/src/shared/daemon-rpc-types.ts
+++ b/gui/src/shared/daemon-rpc-types.ts
@@ -33,10 +33,30 @@ export type AfterDisconnect = 'nothing' | 'block' | 'reconnect';
export type TunnelState = 'connecting' | 'connected' | 'disconnecting' | 'disconnected' | 'blocked';
export type TunnelType = 'wireguard' | 'openvpn';
+export function tunnelTypeToString(tunnel: TunnelType): string {
+ switch (tunnel) {
+ case 'wireguard':
+ return 'WireGuard';
+ case 'openvpn':
+ return 'OpenVPN';
+ default:
+ return '';
+ }
+}
export type RelayProtocol = 'tcp' | 'udp';
export type ProxyType = 'shadowsocks' | 'custom';
+export function proxyTypeToString(proxy: ProxyType): string {
+ switch (proxy) {
+ case 'shadowsocks':
+ return 'Shadowsocks';
+ case 'custom':
+ return 'Custom';
+ default:
+ return '';
+ }
+}
export interface ITunnelEndpoint {
address: string;