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="">
|
||||
<div class="title-block">
|
||||
<div class="title">Vynte Connect</div>
|
||||
<div id="identity" class="identity">Vynte access</div>
|
||||
</div>
|
||||
<button id="refresh" class="icon-button" title="Refresh">↻</button>
|
||||
</header>
|
||||
@@ -41,18 +40,6 @@
|
||||
<span id="gateway-state" class="badge">Offline</span>
|
||||
</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">
|
||||
<button id="auto" class="chip">
|
||||
<span>⚡</span>
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "vynte-connect",
|
||||
"productName": "vynte-connect",
|
||||
"productName": "Vynte Connect",
|
||||
"version": "1.0.0",
|
||||
"description": "My Electron application description",
|
||||
"description": "VPN used to access internal Vynte services",
|
||||
"main": ".vite/build/main.js",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -6,9 +6,6 @@ export const DEFAULT_STATUS = {
|
||||
state: "checking",
|
||||
title: `Checking ${GATEWAY_HOST}`,
|
||||
message: "Preparing the Vynte access client.",
|
||||
ip: '',
|
||||
fqdn: '',
|
||||
peers: '0/0',
|
||||
connectedSince: null,
|
||||
gatewayHost: GATEWAY_HOST
|
||||
};
|
||||
+1
-15
@@ -48,13 +48,6 @@ body {
|
||||
.logo-small { width: 22px; height: 22px; border-radius: 4px; }
|
||||
.title-block { flex: 1; min-width: 0; }
|
||||
.title { font-size: 13px; font-weight: 650; }
|
||||
.identity {
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
button {
|
||||
font-family: inherit;
|
||||
@@ -172,7 +165,7 @@ button {
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.gateway, .stats {
|
||||
.gateway {
|
||||
margin: 0 14px 12px;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--line);
|
||||
@@ -216,13 +209,6 @@ button {
|
||||
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; }
|
||||
|
||||
.chip {
|
||||
|
||||
+1
-1
@@ -146,7 +146,7 @@ async function logout() {
|
||||
function createWindow() {
|
||||
window = new BrowserWindow({
|
||||
width: 384,
|
||||
height: 456,
|
||||
height: 430,
|
||||
show: false,
|
||||
resizable: false,
|
||||
frame: false,
|
||||
|
||||
+1
-10
@@ -34,11 +34,7 @@ const body = document.body;
|
||||
const orb = document.getElementById('orb') as HTMLElement;
|
||||
const statusTitle = document.getElementById('status-title') 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 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 auto = document.getElementById('auto') as HTMLElement;
|
||||
const logout = document.getElementById('logout') as HTMLElement;
|
||||
@@ -58,7 +54,6 @@ function setStatus(status: UIStatus): void {
|
||||
body.className = status.state ?? 'disconnected';
|
||||
statusTitle.textContent = status.title ?? 'Disconnected';
|
||||
statusMessage.textContent = status.message ?? '';
|
||||
identity.textContent = status.fqdn ?? 'Vynte access';
|
||||
|
||||
const gatewayHostElement = document.querySelector(
|
||||
'[data-gateway-host]'
|
||||
@@ -70,12 +65,8 @@ function setStatus(status: UIStatus): void {
|
||||
}
|
||||
|
||||
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');
|
||||
auto.classList.toggle('active', Boolean(status.autoConnect));
|
||||
}
|
||||
|
||||
+1
-17
@@ -4,17 +4,12 @@ export interface NetworkStatus {
|
||||
state?: string;
|
||||
title?: string;
|
||||
message?: string;
|
||||
ip: string;
|
||||
fqdn: string;
|
||||
peers: string;
|
||||
connectedSince: number | null;
|
||||
gatewayHost: string;
|
||||
}
|
||||
|
||||
interface NetBirdStatusResponse {
|
||||
daemonStatus?: string;
|
||||
netbirdIp?: string;
|
||||
fqdn?: string;
|
||||
management?: {
|
||||
connected?: boolean;
|
||||
};
|
||||
@@ -31,9 +26,6 @@ export function baseStatus(
|
||||
overrides: Partial<NetworkStatus> = {}
|
||||
): NetworkStatus {
|
||||
return {
|
||||
ip: '',
|
||||
fqdn: '',
|
||||
peers: '0/0',
|
||||
connectedSince: null,
|
||||
gatewayHost: GATEWAY_HOST,
|
||||
...overrides,
|
||||
@@ -62,22 +54,16 @@ export function normalizeStatus(
|
||||
|
||||
const managementConnected = parsed.management?.connected === true;
|
||||
const signalConnected = parsed.signal?.connected === true;
|
||||
const hasIdentity = Boolean(parsed.netbirdIp || parsed.fqdn);
|
||||
|
||||
const connected =
|
||||
daemonConnected &&
|
||||
(managementConnected || signalConnected || hasIdentity);
|
||||
|
||||
const peerCount = parsed.peers ?? {};
|
||||
(managementConnected || signalConnected);
|
||||
|
||||
if (connected) {
|
||||
return baseStatus({
|
||||
state: 'connected',
|
||||
title: 'Connected',
|
||||
message: "You're on the Vynte network.",
|
||||
ip: parsed.netbirdIp || 'Assigned',
|
||||
fqdn: parsed.fqdn || '',
|
||||
peers: `${peerCount.connected ?? 0}/${peerCount.total ?? 0}`,
|
||||
connectedSince:
|
||||
previousStatus.connectedSince ?? Date.now(),
|
||||
});
|
||||
@@ -87,7 +73,5 @@ export function normalizeStatus(
|
||||
state: 'disconnected',
|
||||
title: 'Disconnected',
|
||||
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