mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-21 21:32:13 +01:00
update build instructions for new webpack configuration. merge origin/main into dev branch to pick up linux changes.
This commit is contained in:
commit
2b72cd18b8
22
BUILD.md
22
BUILD.md
@ -1,5 +1,8 @@
|
||||
# Build Instructions for Wave Terminal
|
||||
|
||||
These instructions are for setting up the build on MacOS.
|
||||
If you're developing on Linux please use the [Linux Build Instructions](./build-linux.md).
|
||||
|
||||
## Running the Development Version of Wave
|
||||
|
||||
If you install the production version of Wave, you'll see a semi-transparent sidebar, and the data for Wave is stored in the directory ~/prompt. The development version has a red/brown sidebar and stores its data in ~/prompt-dev. This allows the production and development versions to be run simultaneously with no conflicts. If the dev database is corrupted by development bugs, or the schema changes in development it will not affect the production copy.
|
||||
@ -17,6 +20,9 @@ brew tap scripthaus-dev/scripthaus
|
||||
brew install scripthaus
|
||||
```
|
||||
|
||||
You also need a relatively modern nodejs with npm and yarn installed.
|
||||
Node can be installed from [here](https://nodejs.org). npm can install yarn using `npm install -g yarn`.
|
||||
|
||||
## Clone the Repo
|
||||
|
||||
```
|
||||
@ -46,27 +52,23 @@ scripthaus run electron-rebuild
|
||||
|
||||
## Running WebPack
|
||||
|
||||
Two webpacks are required to run the client. One webpack will build the React code that runs inside of Electron. The other webpack builds the node.js code for the Electron App Wrapper.
|
||||
We use webpack to build both the React and Electron App Wrapper code. They are both run together using:
|
||||
|
||||
For the React code:
|
||||
```
|
||||
scripthaus run webpack-watch
|
||||
```
|
||||
|
||||
For the Electron App:
|
||||
```
|
||||
scripthaus run webpack-electron-watch
|
||||
```
|
||||
## Running the WaveTerm Dev Client
|
||||
|
||||
## Running the Prompt Dev Client
|
||||
|
||||
Now that webpack is running (and watching for file changes) we can finally run the Prompt Dev Client! To start the client run:
|
||||
Now that webpack is running (and watching for file changes) we can finally run the WaveTerm Dev Client! To start the client run:
|
||||
```
|
||||
scripthaus run electron
|
||||
```
|
||||
|
||||
To kill the client, either exit the Electron App normally or just Ctrl-C the ```scripthaus run electron``` command.
|
||||
|
||||
Because we're running webpack in watch mode, any changes you make to the typescript will be automatically picked up by the client after a refresh. Note that I've disabled hot-reloading in the webpack config, so to pick up new changes you'll have to manually refresh the Prompt Client window. To do that use "Command-Shift-R" (Command-R is used internally by Prompt and will not force a refresh).
|
||||
Because we're running webpack in watch mode, any changes you make to the typescript will be automatically picked up by the client after a refresh. Note that I've disabled hot-reloading in the webpack config, so to pick up new changes you'll have to manually refresh the WaveTerm Client window. To do that use "Command-Shift-R" (Command-R is used internally by WaveTerm and will not force a refresh).
|
||||
|
||||
## Debugging the Dev Client
|
||||
|
||||
You can use the regular Chrome DevTools to debug the frontend application. You can open the DevTools using the keyboard shortcut `Cmd-Option-I`.
|
||||
|
201
LICENSE
Normal file
201
LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
103
build-linux.md
Normal file
103
build-linux.md
Normal file
@ -0,0 +1,103 @@
|
||||
# Build Instructions for Wave Terminal on Linux
|
||||
|
||||
These instructions are for setting up the build on Linux (Ubuntu).
|
||||
If you're developing on MacOS please use the [MacOS Build Instructions](./BUILD.md).
|
||||
If you are working on a different Linux distribution, you may need to adapt some of these instructions to fit your environment.
|
||||
|
||||
## Running the Development Version of Wave
|
||||
|
||||
If you install the production version of Wave, you'll see a semi-transparent sidebar, and the data for Wave is stored in the directory ~/prompt. The development version has a red/brown sidebar and stores its data in ~/prompt-dev. This allows the production and development versions to be run simultaneously with no conflicts. If the dev database is corrupted by development bugs, or the schema changes in development it will not affect the production copy.
|
||||
|
||||
## Prereqs and Tools
|
||||
|
||||
Download and install Go (must be at least go 1.18). We also need gcc installed to run a CGO build (for Golang):
|
||||
```
|
||||
sudo snap install go --classic
|
||||
sudo apt-get install gcc
|
||||
```
|
||||
|
||||
Download and install [ScriptHaus](https://github.com/scripthaus-dev/scripthaus) (to run the build commands):
|
||||
|
||||
```
|
||||
git clone https://github.com/scripthaus-dev/scripthaus.git
|
||||
cd scripthaus
|
||||
CGO_ENABLED=1 go build -o scripthaus cmd/main.go
|
||||
```
|
||||
|
||||
You'll now have to move the built `scripthaus` binary to a directory in your path (e.g. /usr/local/bin):
|
||||
|
||||
```
|
||||
sudo cp scripthaus /usr/local/bin
|
||||
```
|
||||
|
||||
## Install nodejs, npm, and yarn
|
||||
|
||||
We use [nvm](https://github.com/nvm-sh/nvm) to install nodejs on Linux (you can use an alternate installer if you wish). You must have a relatively recent version of node in order to build the terminal. Different distributions and shells will require different setup instructions. These instructions work for Ubuntu 22 using bash (will install node v20.8.1):
|
||||
|
||||
```
|
||||
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
|
||||
source ~/.bashrc
|
||||
nvm install v20.8.1
|
||||
```
|
||||
|
||||
Now we can install yarn:
|
||||
|
||||
```
|
||||
npm install -g yarn
|
||||
```
|
||||
|
||||
|
||||
## Clone the Wave Repo
|
||||
|
||||
Move out of the `scripthaus` directory if you're still in it. Clone the wave repository into the directory that you'd like to use for development.
|
||||
|
||||
```
|
||||
git clone git@github.com:wavetermdev/waveterm.git
|
||||
```
|
||||
|
||||
## Building WaveShell / WaveSrv
|
||||
|
||||
cd into the waveterm directory (if you haven't already) and run the build-backend command using `scripthaus`.
|
||||
|
||||
```
|
||||
cd waveterm
|
||||
scripthaus run build-backend
|
||||
```
|
||||
|
||||
This builds the Golang backends for Wave. The binaries will put in waveshell/bin and wavesrv/bin respectively. If you're working on a new plugin or other pure frontend changes to Wave, you won't need to rebuild these unless you pull new code from the Wave Repository.
|
||||
|
||||
## One-Time Setup
|
||||
|
||||
Install Wave modules (we use yarn):
|
||||
```
|
||||
yarn
|
||||
```
|
||||
|
||||
Electron also requires specific builds of node_modules to work (because Electron embeds a specific node.js version that might not match your development node.js version). We use a special electron command to cross-compile those modules:
|
||||
|
||||
```
|
||||
scripthaus run electron-rebuild
|
||||
```
|
||||
|
||||
## Running WebPack
|
||||
|
||||
We use webpack to build both the React and Electron App Wrapper code. They are both run together using:
|
||||
|
||||
```
|
||||
scripthaus run webpack-watch
|
||||
```
|
||||
|
||||
## Running the WaveTerm Dev Client
|
||||
|
||||
Now that webpack is running (and watching for file changes) we can finally run the WaveTerm Dev Client! To start the client run:
|
||||
```
|
||||
scripthaus run electron
|
||||
```
|
||||
|
||||
To kill the client, either exit the Electron App normally or just Ctrl-C the ```scripthaus run electron``` command.
|
||||
|
||||
Because we're running webpack in watch mode, any changes you make to the typescript will be automatically picked up by the client after a refresh. Note that I've disabled hot-reloading in the webpack config, so to pick up new changes you'll have to manually refresh the WaveTerm Client window. To do that use "Command-Shift-R" (Command-R is used internally by Wave and will not force a refresh).
|
||||
|
||||
## Debugging the Dev Client
|
||||
|
||||
You can use the regular Chrome DevTools to debug the frontend application. You can open the DevTools using the keyboard shortcut `Cmd-Option-I`.
|
@ -74,21 +74,9 @@ module.exports = {
|
||||
},
|
||||
rebuildConfig: {},
|
||||
makers: [
|
||||
{
|
||||
name: "@electron-forge/maker-squirrel",
|
||||
config: {},
|
||||
},
|
||||
{
|
||||
name: "@electron-forge/maker-zip",
|
||||
platforms: ["darwin"],
|
||||
},
|
||||
{
|
||||
name: "@electron-forge/maker-deb",
|
||||
config: {},
|
||||
},
|
||||
{
|
||||
name: "@electron-forge/maker-rpm",
|
||||
config: {},
|
||||
platforms: ["darwin", "linux"],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
@ -47,6 +47,7 @@
|
||||
"@electron-forge/cli": "^6.0.0-beta.70",
|
||||
"@electron-forge/maker-deb": "^6.0.0-beta.70",
|
||||
"@electron-forge/maker-rpm": "^6.0.0-beta.70",
|
||||
"@electron-forge/maker-snap": "^6.4.2",
|
||||
"@electron-forge/maker-squirrel": "^6.0.0-beta.70",
|
||||
"@electron-forge/maker-zip": "^6.0.0-beta.70",
|
||||
"@svgr/webpack": "^8.1.0",
|
||||
@ -78,9 +79,5 @@
|
||||
"webpack-dev-server": "^4.9.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "electron-forge start",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make"
|
||||
}
|
||||
"scripts": {}
|
||||
}
|
||||
|
@ -44,16 +44,33 @@ rm -rf bin/
|
||||
rm -rf build/
|
||||
node_modules/.bin/webpack --env prod
|
||||
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
|
||||
(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 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
|
||||
node_modules/.bin/electron-forge make
|
||||
```
|
||||
|
||||
```bash
|
||||
# @scripthaus command build-package-linux
|
||||
# @scripthaus cd :playbook
|
||||
rm -rf dist/
|
||||
rm -rf bin/
|
||||
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 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; go build -ldflags="$GO_LDFLAGS" -o ../bin/wavesrv ./cmd)
|
||||
node_modules/.bin/electron-forge make
|
||||
```
|
||||
|
||||
```bash
|
||||
# @scripthaus command open-electron-package
|
||||
# @scripthaus cd :playbook
|
||||
|
@ -81,12 +81,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" />
|
||||
@ -106,7 +107,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 />
|
||||
|
@ -391,7 +391,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) => {
|
||||
@ -399,6 +399,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"),
|
||||
|
@ -169,6 +169,7 @@ type KeyModsType = {
|
||||
type ElectronApi = {
|
||||
getId: () => string;
|
||||
getIsDev: () => boolean;
|
||||
getPlatform: () => string;
|
||||
getAuthKey: () => string;
|
||||
getWaveSrvStatus: () => boolean;
|
||||
restartWaveSrv: () => boolean;
|
||||
@ -2654,6 +2655,7 @@ class Model {
|
||||
waveSrvRunning: OV<boolean>;
|
||||
authKey: string;
|
||||
isDev: boolean;
|
||||
platform: string;
|
||||
activeMainView: OV<"session" | "history" | "bookmarks" | "webshare"> = mobx.observable.box("session", {
|
||||
name: "activeMainView",
|
||||
});
|
||||
@ -2735,6 +2737,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) {
|
||||
|
51
yarn.lock
51
yarn.lock
@ -1217,6 +1217,16 @@
|
||||
optionalDependencies:
|
||||
electron-installer-redhat "^3.2.0"
|
||||
|
||||
"@electron-forge/maker-snap@^6.4.2":
|
||||
version "6.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@electron-forge/maker-snap/-/maker-snap-6.4.2.tgz#6a87e92ee07d460e91697064e0d8369c55114aba"
|
||||
integrity sha512-07ge28xLdcUpLQFu9POuNuaR8rWjU3c9r2PX8dMrvgAi00DooVaLuZFF7DIOPRDxFO5JfX1BwgzjO7KZhMA3og==
|
||||
dependencies:
|
||||
"@electron-forge/maker-base" "6.4.2"
|
||||
"@electron-forge/shared-types" "6.4.2"
|
||||
optionalDependencies:
|
||||
electron-installer-snap "^5.2.0"
|
||||
|
||||
"@electron-forge/maker-squirrel@^6.0.0-beta.70":
|
||||
version "6.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@electron-forge/maker-squirrel/-/maker-squirrel-6.4.2.tgz#92d44fc6cadf6ff23c65dc901c8044d7c8b53f95"
|
||||
@ -2264,6 +2274,13 @@ are-we-there-yet@^3.0.0:
|
||||
delegates "^1.0.0"
|
||||
readable-stream "^3.6.0"
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
||||
dependencies:
|
||||
sprintf-js "~1.0.2"
|
||||
|
||||
argparse@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
|
||||
@ -3277,6 +3294,22 @@ electron-installer-redhat@^3.2.0:
|
||||
word-wrap "^1.2.3"
|
||||
yargs "^16.0.2"
|
||||
|
||||
electron-installer-snap@^5.2.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-installer-snap/-/electron-installer-snap-5.2.0.tgz#8dd637dc94d4279d790d728b7bdb23fe9415377d"
|
||||
integrity sha512-SRm7pCpNHMXV545JjScV8fLC9NhFli5r8L8Ju4EHdXwRh76+mwrJoUEDLItixBudZ5Mcgz1SJcDPJfWpEQWX7Q==
|
||||
dependencies:
|
||||
"@malept/cross-spawn-promise" "^1.0.0"
|
||||
debug "^4.3.4"
|
||||
electron-installer-common "^0.10.2"
|
||||
fs-extra "^9.0.0"
|
||||
js-yaml "^3.10.0"
|
||||
lodash "^4.17.15"
|
||||
semver "^7.1.1"
|
||||
tmp-promise "^3.0.2"
|
||||
which "^2.0.1"
|
||||
yargs "^16.0.2"
|
||||
|
||||
electron-packager@^17.1.2:
|
||||
version "17.1.2"
|
||||
resolved "https://registry.yarnpkg.com/electron-packager/-/electron-packager-17.1.2.tgz#18030b28024d242b706d0a8a67ed4cd1a57311aa"
|
||||
@ -3478,6 +3511,11 @@ eslint-scope@5.1.1:
|
||||
esrecurse "^4.3.0"
|
||||
estraverse "^4.1.1"
|
||||
|
||||
esprima@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
|
||||
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||
|
||||
esrecurse@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
|
||||
@ -4609,6 +4647,14 @@ jest-worker@^27.4.5:
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
|
||||
|
||||
js-yaml@^3.10.0:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
|
||||
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
|
||||
dependencies:
|
||||
argparse "^1.0.7"
|
||||
esprima "^4.0.0"
|
||||
|
||||
js-yaml@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
|
||||
@ -7145,6 +7191,11 @@ sprintf-js@^1.1.2:
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a"
|
||||
integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==
|
||||
|
||||
ssri@^10.0.0:
|
||||
version "10.0.5"
|
||||
resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.5.tgz#e49efcd6e36385196cb515d3a2ad6c3f0265ef8c"
|
||||
|
Loading…
Reference in New Issue
Block a user