diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-06-06 11:18:52 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-06-06 12:12:45 +0100 |
| commit | bc5a62a085ad73964c1af46c02cdcb83aae111b7 (patch) | |
| tree | a49dfc49a08512e78b63861ba3e7888ff83b6559 | |
| parent | ee2ad5124f2773119c0665410cc65f544a02f0fc (diff) | |
| download | mullvadvpn-bc5a62a085ad73964c1af46c02cdcb83aae111b7.tar.xz mullvadvpn-bc5a62a085ad73964c1af46c02cdcb83aae111b7.zip | |
Implement pretty printing for TunnelType and ProxyType
| -rw-r--r-- | gui/src/shared/daemon-rpc-types.ts | 20 |
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; |
