fix: More various fixes
Removes the internal IP, peers, and FQDN due to it not being useful Changes the productName in the package.json to be the actual "Vynte Connect" name
This commit is contained in:
-13
@@ -12,7 +12,6 @@
|
|||||||
<img class="logo-small" src="resources/VynteIcon.png" alt="">
|
<img class="logo-small" src="resources/VynteIcon.png" alt="">
|
||||||
<div class="title-block">
|
<div class="title-block">
|
||||||
<div class="title">Vynte Connect</div>
|
<div class="title">Vynte Connect</div>
|
||||||
<div id="identity" class="identity">Vynte access</div>
|
|
||||||
</div>
|
</div>
|
||||||
<button id="refresh" class="icon-button" title="Refresh">↻</button>
|
<button id="refresh" class="icon-button" title="Refresh">↻</button>
|
||||||
</header>
|
</header>
|
||||||
@@ -41,18 +40,6 @@
|
|||||||
<span id="gateway-state" class="badge">Offline</span>
|
<span id="gateway-state" class="badge">Offline</span>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="stats" class="stats hidden">
|
|
||||||
<div class="stat">
|
|
||||||
<div class="label">Internal IP</div>
|
|
||||||
<div id="ip" class="mono">Assigned</div>
|
|
||||||
</div>
|
|
||||||
<div class="divider"></div>
|
|
||||||
<div class="stat">
|
|
||||||
<div class="label">Peers</div>
|
|
||||||
<div id="peers" class="mono">0/0</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<button id="auto" class="chip">
|
<button id="auto" class="chip">
|
||||||
<span>⚡</span>
|
<span>⚡</span>
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "vynte-connect",
|
"name": "vynte-connect",
|
||||||
"productName": "vynte-connect",
|
"productName": "Vynte Connect",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "My Electron application description",
|
"description": "VPN used to access internal Vynte services",
|
||||||
"main": ".vite/build/main.js",
|
"main": ".vite/build/main.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ export const DEFAULT_STATUS = {
|
|||||||
state: "checking",
|
state: "checking",
|
||||||
title: `Checking ${GATEWAY_HOST}`,
|
title: `Checking ${GATEWAY_HOST}`,
|
||||||
message: "Preparing the Vynte access client.",
|
message: "Preparing the Vynte access client.",
|
||||||
ip: '',
|
|
||||||
fqdn: '',
|
|
||||||
peers: '0/0',
|
|
||||||
connectedSince: null,
|
connectedSince: null,
|
||||||
gatewayHost: GATEWAY_HOST
|
gatewayHost: GATEWAY_HOST
|
||||||
};
|
};
|
||||||
+1
-15
@@ -48,13 +48,6 @@ body {
|
|||||||
.logo-small { width: 22px; height: 22px; border-radius: 4px; }
|
.logo-small { width: 22px; height: 22px; border-radius: 4px; }
|
||||||
.title-block { flex: 1; min-width: 0; }
|
.title-block { flex: 1; min-width: 0; }
|
||||||
.title { font-size: 13px; font-weight: 650; }
|
.title { font-size: 13px; font-weight: 650; }
|
||||||
.identity {
|
|
||||||
color: var(--muted);
|
|
||||||
font-size: 11px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
@@ -172,7 +165,7 @@ button {
|
|||||||
min-height: 32px;
|
min-height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gateway, .stats {
|
.gateway {
|
||||||
margin: 0 14px 12px;
|
margin: 0 14px 12px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
@@ -216,13 +209,6 @@ button {
|
|||||||
background: rgba(255,122,26,.14);
|
background: rgba(255,122,26,.14);
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats { padding: 0; gap: 0; overflow: hidden; }
|
|
||||||
.stat {
|
|
||||||
flex: 1;
|
|
||||||
padding: 9px 12px;
|
|
||||||
background: rgba(0,0,0,.16);
|
|
||||||
}
|
|
||||||
.divider { width: 1px; align-self: stretch; background: var(--line); }
|
|
||||||
.hidden { display: none !important; }
|
.hidden { display: none !important; }
|
||||||
|
|
||||||
.chip {
|
.chip {
|
||||||
|
|||||||
+1
-1
@@ -146,7 +146,7 @@ async function logout() {
|
|||||||
function createWindow() {
|
function createWindow() {
|
||||||
window = new BrowserWindow({
|
window = new BrowserWindow({
|
||||||
width: 384,
|
width: 384,
|
||||||
height: 456,
|
height: 430,
|
||||||
show: false,
|
show: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
frame: false,
|
frame: false,
|
||||||
|
|||||||
+1
-10
@@ -34,11 +34,7 @@ const body = document.body;
|
|||||||
const orb = document.getElementById('orb') as HTMLElement;
|
const orb = document.getElementById('orb') as HTMLElement;
|
||||||
const statusTitle = document.getElementById('status-title') as HTMLElement;
|
const statusTitle = document.getElementById('status-title') as HTMLElement;
|
||||||
const statusMessage = document.getElementById('status-message') as HTMLElement;
|
const statusMessage = document.getElementById('status-message') as HTMLElement;
|
||||||
const identity = document.getElementById('identity') as HTMLElement;
|
|
||||||
const gatewayState = document.getElementById('gateway-state') as HTMLElement;
|
const gatewayState = document.getElementById('gateway-state') as HTMLElement;
|
||||||
const stats = document.getElementById('stats') as HTMLElement;
|
|
||||||
const ip = document.getElementById('ip') as HTMLElement;
|
|
||||||
const peers = document.getElementById('peers') as HTMLElement;
|
|
||||||
const refresh = document.getElementById('refresh') as HTMLElement;
|
const refresh = document.getElementById('refresh') as HTMLElement;
|
||||||
const auto = document.getElementById('auto') as HTMLElement;
|
const auto = document.getElementById('auto') as HTMLElement;
|
||||||
const logout = document.getElementById('logout') as HTMLElement;
|
const logout = document.getElementById('logout') as HTMLElement;
|
||||||
@@ -58,7 +54,6 @@ function setStatus(status: UIStatus): void {
|
|||||||
body.className = status.state ?? 'disconnected';
|
body.className = status.state ?? 'disconnected';
|
||||||
statusTitle.textContent = status.title ?? 'Disconnected';
|
statusTitle.textContent = status.title ?? 'Disconnected';
|
||||||
statusMessage.textContent = status.message ?? '';
|
statusMessage.textContent = status.message ?? '';
|
||||||
identity.textContent = status.fqdn ?? 'Vynte access';
|
|
||||||
|
|
||||||
const gatewayHostElement = document.querySelector(
|
const gatewayHostElement = document.querySelector(
|
||||||
'[data-gateway-host]'
|
'[data-gateway-host]'
|
||||||
@@ -70,12 +65,8 @@ function setStatus(status: UIStatus): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gatewayState.textContent =
|
gatewayState.textContent =
|
||||||
status.state === 'connected' ? 'Live' : 'Offline';
|
status.state === 'connected' ? 'Online' : 'Offline';
|
||||||
|
|
||||||
ip.textContent = status.ip ?? 'Assigned';
|
|
||||||
peers.textContent = status.peers ?? '0/0';
|
|
||||||
|
|
||||||
stats.classList.toggle('hidden', status.state !== 'connected');
|
|
||||||
logout.classList.toggle('hidden', status.state !== 'connected');
|
logout.classList.toggle('hidden', status.state !== 'connected');
|
||||||
auto.classList.toggle('active', Boolean(status.autoConnect));
|
auto.classList.toggle('active', Boolean(status.autoConnect));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-17
@@ -4,17 +4,12 @@ export interface NetworkStatus {
|
|||||||
state?: string;
|
state?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
message?: string;
|
message?: string;
|
||||||
ip: string;
|
|
||||||
fqdn: string;
|
|
||||||
peers: string;
|
|
||||||
connectedSince: number | null;
|
connectedSince: number | null;
|
||||||
gatewayHost: string;
|
gatewayHost: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NetBirdStatusResponse {
|
interface NetBirdStatusResponse {
|
||||||
daemonStatus?: string;
|
daemonStatus?: string;
|
||||||
netbirdIp?: string;
|
|
||||||
fqdn?: string;
|
|
||||||
management?: {
|
management?: {
|
||||||
connected?: boolean;
|
connected?: boolean;
|
||||||
};
|
};
|
||||||
@@ -31,9 +26,6 @@ export function baseStatus(
|
|||||||
overrides: Partial<NetworkStatus> = {}
|
overrides: Partial<NetworkStatus> = {}
|
||||||
): NetworkStatus {
|
): NetworkStatus {
|
||||||
return {
|
return {
|
||||||
ip: '',
|
|
||||||
fqdn: '',
|
|
||||||
peers: '0/0',
|
|
||||||
connectedSince: null,
|
connectedSince: null,
|
||||||
gatewayHost: GATEWAY_HOST,
|
gatewayHost: GATEWAY_HOST,
|
||||||
...overrides,
|
...overrides,
|
||||||
@@ -62,22 +54,16 @@ export function normalizeStatus(
|
|||||||
|
|
||||||
const managementConnected = parsed.management?.connected === true;
|
const managementConnected = parsed.management?.connected === true;
|
||||||
const signalConnected = parsed.signal?.connected === true;
|
const signalConnected = parsed.signal?.connected === true;
|
||||||
const hasIdentity = Boolean(parsed.netbirdIp || parsed.fqdn);
|
|
||||||
|
|
||||||
const connected =
|
const connected =
|
||||||
daemonConnected &&
|
daemonConnected &&
|
||||||
(managementConnected || signalConnected || hasIdentity);
|
(managementConnected || signalConnected);
|
||||||
|
|
||||||
const peerCount = parsed.peers ?? {};
|
|
||||||
|
|
||||||
if (connected) {
|
if (connected) {
|
||||||
return baseStatus({
|
return baseStatus({
|
||||||
state: 'connected',
|
state: 'connected',
|
||||||
title: 'Connected',
|
title: 'Connected',
|
||||||
message: "You're on the Vynte network.",
|
message: "You're on the Vynte network.",
|
||||||
ip: parsed.netbirdIp || 'Assigned',
|
|
||||||
fqdn: parsed.fqdn || '',
|
|
||||||
peers: `${peerCount.connected ?? 0}/${peerCount.total ?? 0}`,
|
|
||||||
connectedSince:
|
connectedSince:
|
||||||
previousStatus.connectedSince ?? Date.now(),
|
previousStatus.connectedSince ?? Date.now(),
|
||||||
});
|
});
|
||||||
@@ -87,7 +73,5 @@ export function normalizeStatus(
|
|||||||
state: 'disconnected',
|
state: 'disconnected',
|
||||||
title: 'Disconnected',
|
title: 'Disconnected',
|
||||||
message: 'Click the flame to connect with NetBird.',
|
message: 'Click the flame to connect with NetBird.',
|
||||||
fqdn: parsed.fqdn || '',
|
|
||||||
peers: `${peerCount.connected ?? 0}/${peerCount.total ?? 0}`,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user