mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01: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
@ -200,10 +200,6 @@ function runWaveSrv(): Promise<boolean> {
|
||||
process.env[WebServerEndpointVarName] = startParams[2];
|
||||
WaveVersion = startParams[3];
|
||||
WaveBuildTime = parseInt(startParams[4]);
|
||||
electron.app.setAboutPanelOptions({
|
||||
applicationVersion: "v" + WaveVersion,
|
||||
version: (isDev ? "dev-" : "") + String(WaveBuildTime),
|
||||
});
|
||||
waveSrvReadyResolve(true);
|
||||
return;
|
||||
}
|
||||
@ -599,6 +595,10 @@ electron.ipcMain.on("get-env", (event, varName) => {
|
||||
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>();
|
||||
|
||||
electron.ipcMain.on("webview-focus", (event: Electron.IpcMainEvent, focusedId: number) => {
|
||||
|
@ -9,6 +9,7 @@ contextBridge.exposeInMainWorld("api", {
|
||||
getPlatform: () => ipcRenderer.sendSync("get-platform"),
|
||||
getCursorPoint: () => ipcRenderer.sendSync("get-cursor-point"),
|
||||
getUserName: () => ipcRenderer.sendSync("get-user-name"),
|
||||
getAboutModalDetails: () => ipcRenderer.sendSync("get-about-modal-details"),
|
||||
openNewWindow: () => ipcRenderer.send("open-new-window"),
|
||||
showContextMenu: (menu, position) => ipcRenderer.send("contextmenu-show", menu, position),
|
||||
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 { Modal } from "./modal";
|
||||
|
||||
import { isDev } from "@/util/isdev";
|
||||
import { useState } from "react";
|
||||
import { getApi } from "../store/global";
|
||||
import "./about.less";
|
||||
|
||||
interface AboutModalProps {}
|
||||
|
||||
const AboutModal = ({}: AboutModalProps) => {
|
||||
const currentDate = new Date();
|
||||
const [details] = useState(() => getApi().getAboutModalDetails());
|
||||
|
||||
return (
|
||||
<Modal className="about-modal" onClose={() => modalsModel.popModal()}>
|
||||
@ -25,7 +29,10 @@ const AboutModal = ({}: AboutModalProps) => {
|
||||
Built for Seamless Workflows
|
||||
</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">
|
||||
<LinkButton
|
||||
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;
|
||||
getEnv: (varName: string) => string;
|
||||
getUserName: () => string;
|
||||
getAboutModalDetails: () => AboutModalDetails;
|
||||
showContextMenu: (menu?: ElectronContextMenuItem[]) => void;
|
||||
onContextMenuClick: (callback: (id: string) => void) => void;
|
||||
onNavigate: (callback: (url: string) => void) => void;
|
||||
@ -234,6 +235,11 @@ declare global {
|
||||
}
|
||||
|
||||
type TypeAheadModalType = { [key: string]: boolean };
|
||||
|
||||
interface AboutModalDetails {
|
||||
version: string;
|
||||
buildTime: number;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
|
Loading…
Reference in New Issue
Block a user