Skip to content

Commit 71867d1

Browse files
authored
cleanup connection messages (#80)
1 parent f25ae7d commit 71867d1

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/renderer/pages/ConnectionView.tsx

+8-16
Original file line numberDiff line numberDiff line change
@@ -116,37 +116,29 @@ const ConnectionView = (): JSX.Element => {
116116
link.click();
117117
};
118118

119-
const formatLog = (
120-
msg: ConnectionStatusUpdate,
121-
remoteAddr: string
122-
): SimplifiedLog => {
119+
const formatLog = (msg: ConnectionStatusUpdate): SimplifiedLog => {
123120
const date = msg.ts?.toLocaleTimeString() || '';
124121
const status = msg.lastError ? 'error' : 'info';
125122
let message = '';
126123

127124
switch (msg.status) {
128125
case 1:
129-
message = msg.peerAddr + ' opening connection to ' + remoteAddr;
126+
message = 'Connecting to Pomerium...';
130127
break;
131128
case 2:
132-
message =
133-
msg.peerAddr +
134-
' authentication with ' +
135-
msg.authUrl +
136-
' required for ' +
137-
remoteAddr;
129+
message = `Authentication required, web browser was open`;
138130
break;
139131
case 3:
140-
message = msg.peerAddr + ' connected to ' + remoteAddr;
132+
message = 'Connected to Pomerium';
141133
break;
142134
case 4:
143-
message = msg.peerAddr + ' disconnected from ' + remoteAddr;
135+
message = 'Disconnected from Pomerium';
144136
break;
145137
case 5:
146-
message = 'Listener opened';
138+
message = 'Listening for new connections';
147139
break;
148140
case 6:
149-
message = 'Listener closed connection to ' + remoteAddr;
141+
message = 'Stop listening for new connections';
150142
break;
151143
default:
152144
break;
@@ -179,7 +171,7 @@ const ConnectionView = (): JSX.Element => {
179171
}
180172
});
181173
ipcRenderer.on(LISTENER_LOG, (_, args) => {
182-
setLogs((oldLogs) => [formatLog(args.msg, args.remoteAddr), ...oldLogs]);
174+
setLogs((oldLogs) => [formatLog(args.msg), ...oldLogs]);
183175
});
184176
ipcRenderer.on(EXPORT, (_, args) => {
185177
if (args.err) {

0 commit comments

Comments
 (0)