From c5e3761811476cf53a33235a1883d412acccca75 Mon Sep 17 00:00:00 2001 From: Xendarboh <1435589+xendarboh@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:39:59 -0800 Subject: [PATCH 1/4] chore: remove version from tauri.conf.json If removed the version from `Cargo.toml` is used. --- src-tauri/tauri.conf.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index bc95281..fcc64c7 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,6 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "ZKNetwork", - "version": "0.1.0", "identifier": "com.zkn-client.app", "build": { "beforeDevCommand": "npm run dev", From eb4173c4753ea5ee89213d94c15c4d7e1f93341a Mon Sep 17 00:00:00 2001 From: Xendarboh <1435589+xendarboh@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:42:39 -0800 Subject: [PATCH 2/4] feat: log app version on startup --- src/App.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index f0795e3..c6c78b0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from "react"; +import * as app from "@tauri-apps/api/app"; import * as log from "@tauri-apps/plugin-log"; import * as path from "@tauri-apps/api/path"; import { arch, platform } from "@tauri-apps/plugin-os"; @@ -42,6 +43,7 @@ function App() { const [networkId, setNetworkId] = useState(""); const [dlProgress, setDlProgress] = useState(0); const [clientPid, setClientPid] = useState(0); + const [appVersion, setAppVersion] = useState(""); const [platformArch, setPlatformArch] = useState(""); const [platformSupported, setPlatformSupported] = useState(false); const [networks, setNetworks] = useState([]); @@ -50,11 +52,14 @@ function App() { // run once on startup (twice in dev mode) useEffect(() => { try { - log.info(`Platform: ${platform()}-${arch()}`); - setPlatformArch(getPlatformArch()); - setPlatformSupported(true); - (async () => { + const name = await app.getName(); + const v = "v" + (await app.getVersion()); + log.info(`Starting ${name} ${v} on ${platform()}-${arch()}`); + + setAppVersion(v); + setPlatformArch(getPlatformArch()); + setPlatformSupported(true); setNetworks(await getNetworks()); })(); } catch (error: any) { From 179b34e8554778e2240b589f5fbc3e7da740ab03 Mon Sep 17 00:00:00 2001 From: Xendarboh <1435589+xendarboh@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:44:12 -0800 Subject: [PATCH 3/4] refactor: extract main layout to component --- src/App.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c6c78b0..77cc790 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -211,8 +211,8 @@ function App() { return child.pid; } - return ( -
+ const Main = () => ( +

Zero Knowledge Network

); + + return ( +
+
+
+ ); } export default App; From d4e0640e09459857f0b0fd08b948843086e71f11 Mon Sep 17 00:00:00 2001 From: Xendarboh <1435589+xendarboh@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:45:44 -0800 Subject: [PATCH 4/4] feat: add footer with app name, version, and platform --- src/App.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 77cc790..c2cc777 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -274,9 +274,22 @@ function App() {
); + const Footer = () => ( +
+
+ ZKNetwork Client + | + Version: {appVersion} + | + Platform: {platformArch} +
+
+ ); + return (
+
); }