mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-24 09:18:27 +00:00
Fix the client version in the about modal (#315)
The client version in the about modal was hard-coded. Now, it will use the same values that powered the Electron about modal.
This commit is contained in:
parent
f252531197
commit
0de41fab08
4 changed files with 19 additions and 5 deletions
|
|
@ -200,10 +200,6 @@ function runWaveSrv(): Promise<boolean> {
|
||||||
process.env[WebServerEndpointVarName] = startParams[2];
|
process.env[WebServerEndpointVarName] = startParams[2];
|
||||||
WaveVersion = startParams[3];
|
WaveVersion = startParams[3];
|
||||||
WaveBuildTime = parseInt(startParams[4]);
|
WaveBuildTime = parseInt(startParams[4]);
|
||||||
electron.app.setAboutPanelOptions({
|
|
||||||
applicationVersion: "v" + WaveVersion,
|
|
||||||
version: (isDev ? "dev-" : "") + String(WaveBuildTime),
|
|
||||||
});
|
|
||||||
waveSrvReadyResolve(true);
|
waveSrvReadyResolve(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -599,6 +595,10 @@ electron.ipcMain.on("get-env", (event, varName) => {
|
||||||
event.returnValue = process.env[varName] ?? null;
|
event.returnValue = process.env[varName] ?? null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
electron.ipcMain.on("get-about-modal-details", (event) => {
|
||||||
|
event.returnValue = { version: WaveVersion, buildTime: WaveBuildTime } as AboutModalDetails;
|
||||||
|
});
|
||||||
|
|
||||||
const hasBeforeInputRegisteredMap = new Map<number, boolean>();
|
const hasBeforeInputRegisteredMap = new Map<number, boolean>();
|
||||||
|
|
||||||
electron.ipcMain.on("webview-focus", (event: Electron.IpcMainEvent, focusedId: number) => {
|
electron.ipcMain.on("webview-focus", (event: Electron.IpcMainEvent, focusedId: number) => {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ contextBridge.exposeInMainWorld("api", {
|
||||||
getPlatform: () => ipcRenderer.sendSync("get-platform"),
|
getPlatform: () => ipcRenderer.sendSync("get-platform"),
|
||||||
getCursorPoint: () => ipcRenderer.sendSync("get-cursor-point"),
|
getCursorPoint: () => ipcRenderer.sendSync("get-cursor-point"),
|
||||||
getUserName: () => ipcRenderer.sendSync("get-user-name"),
|
getUserName: () => ipcRenderer.sendSync("get-user-name"),
|
||||||
|
getAboutModalDetails: () => ipcRenderer.sendSync("get-about-modal-details"),
|
||||||
openNewWindow: () => ipcRenderer.send("open-new-window"),
|
openNewWindow: () => ipcRenderer.send("open-new-window"),
|
||||||
showContextMenu: (menu, position) => ipcRenderer.send("contextmenu-show", menu, position),
|
showContextMenu: (menu, position) => ipcRenderer.send("contextmenu-show", menu, position),
|
||||||
onContextMenuClick: (callback) => ipcRenderer.on("contextmenu-click", (_event, id) => callback(id)),
|
onContextMenuClick: (callback) => ipcRenderer.on("contextmenu-click", (_event, id) => callback(id)),
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,16 @@ import { LinkButton } from "@/app/element/linkbutton";
|
||||||
import { modalsModel } from "@/app/store/modalmodel";
|
import { modalsModel } from "@/app/store/modalmodel";
|
||||||
import { Modal } from "./modal";
|
import { Modal } from "./modal";
|
||||||
|
|
||||||
|
import { isDev } from "@/util/isdev";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { getApi } from "../store/global";
|
||||||
import "./about.less";
|
import "./about.less";
|
||||||
|
|
||||||
interface AboutModalProps {}
|
interface AboutModalProps {}
|
||||||
|
|
||||||
const AboutModal = ({}: AboutModalProps) => {
|
const AboutModal = ({}: AboutModalProps) => {
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
|
const [details] = useState(() => getApi().getAboutModalDetails());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal className="about-modal" onClose={() => modalsModel.popModal()}>
|
<Modal className="about-modal" onClose={() => modalsModel.popModal()}>
|
||||||
|
|
@ -25,7 +29,10 @@ const AboutModal = ({}: AboutModalProps) => {
|
||||||
Built for Seamless Workflows
|
Built for Seamless Workflows
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="section text-standard">Client Version 0.1.8 (20240615-002636)</div>
|
<div className="section text-standard">
|
||||||
|
Client Version {details.version} ({isDev() ? "dev-" : ""}
|
||||||
|
{details.buildTime})
|
||||||
|
</div>
|
||||||
<div className="section">
|
<div className="section">
|
||||||
<LinkButton
|
<LinkButton
|
||||||
className="secondary solid"
|
className="secondary solid"
|
||||||
|
|
|
||||||
6
frontend/types/custom.d.ts
vendored
6
frontend/types/custom.d.ts
vendored
|
|
@ -54,6 +54,7 @@ declare global {
|
||||||
getPlatform: () => NodeJS.Platform;
|
getPlatform: () => NodeJS.Platform;
|
||||||
getEnv: (varName: string) => string;
|
getEnv: (varName: string) => string;
|
||||||
getUserName: () => string;
|
getUserName: () => string;
|
||||||
|
getAboutModalDetails: () => AboutModalDetails;
|
||||||
showContextMenu: (menu?: ElectronContextMenuItem[]) => void;
|
showContextMenu: (menu?: ElectronContextMenuItem[]) => void;
|
||||||
onContextMenuClick: (callback: (id: string) => void) => void;
|
onContextMenuClick: (callback: (id: string) => void) => void;
|
||||||
onNavigate: (callback: (url: string) => void) => void;
|
onNavigate: (callback: (url: string) => void) => void;
|
||||||
|
|
@ -234,6 +235,11 @@ declare global {
|
||||||
}
|
}
|
||||||
|
|
||||||
type TypeAheadModalType = { [key: string]: boolean };
|
type TypeAheadModalType = { [key: string]: boolean };
|
||||||
|
|
||||||
|
interface AboutModalDetails {
|
||||||
|
version: string;
|
||||||
|
buildTime: number;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue