mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-17 20:51:55 +01:00
add platform class into main div
This commit is contained in:
parent
4e98db9745
commit
b01472a917
@ -81,10 +81,10 @@ rm -rf build/
|
||||
node_modules/.bin/webpack --config webpack.prod.js
|
||||
node_modules/.bin/webpack --config webpack.electron.prod.js
|
||||
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
|
||||
(cd ../apishell; GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../prompt-client/bin/mshell/mshell-v0.3-darwin.amd64 main-mshell.go)
|
||||
(cd ../apishell; GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../prompt-client/bin/mshell/mshell-v0.3-darwin.arm64 main-mshell.go)
|
||||
(cd ../apishell; GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../prompt-client/bin/mshell/mshell-v0.3-linux.amd64 main-mshell.go)
|
||||
(cd ../apishell; GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../prompt-client/bin/mshell/mshell-v0.3-linux.arm64 main-mshell.go)
|
||||
(cd waveshell; GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go)
|
||||
(cd waveshell; GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go)
|
||||
(cd waveshell; GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go)
|
||||
(cd waveshell; GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go)
|
||||
(cd wavesrv; GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../build/wavesrv.amd64 ./cmd)
|
||||
(cd wavesrv; GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../build/wavesrv.arm64 ./cmd)
|
||||
lipo -create -output bin/wavesrv build/wavesrv.amd64 build/wavesrv.arm64
|
||||
|
@ -78,12 +78,13 @@ class App extends React.Component<{}, {}> {
|
||||
let disconnected = !GlobalModel.ws.open.get() || !GlobalModel.waveSrvRunning.get();
|
||||
let hasClientStop = GlobalModel.getHasClientStop();
|
||||
let dcWait = this.dcWait.get();
|
||||
let platform = GlobalModel.getPlatform();
|
||||
if (disconnected || hasClientStop) {
|
||||
if (!dcWait) {
|
||||
setTimeout(() => this.updateDcWait(true), 1500);
|
||||
}
|
||||
return (
|
||||
<div id="main" onContextMenu={this.handleContextMenu}>
|
||||
<div id="main" className={"platform-" + platform} onContextMenu={this.handleContextMenu}>
|
||||
<div className="main-content">
|
||||
<MainSideBar />
|
||||
<div className="session-view" />
|
||||
@ -103,7 +104,7 @@ class App extends React.Component<{}, {}> {
|
||||
setTimeout(() => this.updateDcWait(false), 0);
|
||||
}
|
||||
return (
|
||||
<div id="main" onContextMenu={this.handleContextMenu}>
|
||||
<div id="main" className={"platform-" + platform} onContextMenu={this.handleContextMenu}>
|
||||
<div className="main-content">
|
||||
<MainSideBar />
|
||||
<WorkspaceView />
|
||||
|
@ -388,7 +388,7 @@ function calcBounds(clientData) {
|
||||
}
|
||||
|
||||
app.on("window-all-closed", () => {
|
||||
if (process.platform !== "darwin") app.quit();
|
||||
if (unamePlatform !== "darwin") app.quit();
|
||||
});
|
||||
|
||||
electron.ipcMain.on("get-id", (event) => {
|
||||
@ -396,6 +396,11 @@ electron.ipcMain.on("get-id", (event) => {
|
||||
return;
|
||||
});
|
||||
|
||||
electron.ipcMain.on("get-platform", (event) => {
|
||||
event.returnValue = unamePlatform;
|
||||
return;
|
||||
});
|
||||
|
||||
electron.ipcMain.on("get-isdev", (event) => {
|
||||
event.returnValue = isDev;
|
||||
return;
|
||||
|
@ -2,6 +2,7 @@ let { contextBridge, ipcRenderer } = require("electron");
|
||||
|
||||
contextBridge.exposeInMainWorld("api", {
|
||||
getId: () => ipcRenderer.sendSync("get-id"),
|
||||
getPlatform: () => ipcRenderer.sendSync("get-platform"),
|
||||
getIsDev: () => ipcRenderer.sendSync("get-isdev"),
|
||||
getAuthKey: () => ipcRenderer.sendSync("get-authkey"),
|
||||
getWaveSrvStatus: () => ipcRenderer.sendSync("wavesrv-status"),
|
||||
|
@ -165,6 +165,7 @@ type KeyModsType = {
|
||||
type ElectronApi = {
|
||||
getId: () => string;
|
||||
getIsDev: () => boolean;
|
||||
getPlatform: () => string;
|
||||
getAuthKey: () => string;
|
||||
getWaveSrvStatus: () => boolean;
|
||||
restartWaveSrv: () => boolean;
|
||||
@ -2640,6 +2641,7 @@ class Model {
|
||||
waveSrvRunning: OV<boolean>;
|
||||
authKey: string;
|
||||
isDev: boolean;
|
||||
platform: string;
|
||||
activeMainView: OV<"session" | "history" | "bookmarks" | "webshare"> = mobx.observable.box("session", {
|
||||
name: "activeMainView",
|
||||
});
|
||||
@ -2721,6 +2723,14 @@ class Model {
|
||||
setTimeout(() => this.getClientDataLoop(1), 10);
|
||||
}
|
||||
|
||||
getPlatform(): string {
|
||||
if (this.platform != null) {
|
||||
return this.platform;
|
||||
}
|
||||
this.platform = getApi().getPlatform();
|
||||
return this.platform;
|
||||
}
|
||||
|
||||
needsTos(): boolean {
|
||||
let cdata = this.clientData.get();
|
||||
if (cdata == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user