Update Data Directories and Environment Variables (#59)

* phase 1 of wave runtime migration.  update waveterm_dev, build vars, waveterm_app_path.  fix errors with plugins readmes and screenshot directories.  use asset loaders in webpack.  fix window-empty styles.  wave-migrate script.  remove unused scripthaus commands.  other fixes

* waveterm_home directory.  lots of internal scbase prompt names to wave

* update waveterm.lock file

* change wave data directories.  remove welcome modal code

* update waveterm.db name

* fix Wave menu (add back default items).  Update TOS modal words

* fix typescript errors
This commit is contained in:
sawka
2023-11-01 01:26:19 -07:00
committed by GitHub
parent 15a4719b17
commit afc5bbd212
33 changed files with 256 additions and 701 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
if [ ! -d ~/prompt ]; then
echo "~/prompt directory does not exist, will not migrate"
exit 1;
fi
if [ -d ~/.wave ]; then
echo "~/.wave directory already exists, will not migrate"
exit 1;
fi
mv ~/prompt ~/.wave
cd ~/.wave
mv prompt.db wave.db
mv prompt.db-wal wave.db-wal
mv prompt.db-shm wave.db-shm
mv prompt.authkey wave.authkey
+2 -19
View File
@@ -27,7 +27,7 @@ node_modules/.bin/electron-rebuild
```bash
# @scripthaus command electron
# @scripthaus cd :playbook
PROMPT_DEV=1 PCLOUD_ENDPOINT="https://ot2e112zx5.execute-api.us-west-2.amazonaws.com/dev" node_modules/.bin/electron dist-dev/emain.js
WAVETERM_DEV=1 PCLOUD_ENDPOINT="https://ot2e112zx5.execute-api.us-west-2.amazonaws.com/dev" node_modules/.bin/electron dist-dev/emain.js
```
```bash
@@ -60,8 +60,7 @@ node_modules/.bin/electron-forge make
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
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)
@@ -113,22 +112,6 @@ rm *.dmg
"out/Wave-darwin-arm64/Wave.app"
```
```bash
# @scripthaus command sync-webshare-dev
# @scripthaus cd :playbook
# no-cache for dev
aws --profile prompt-s3 s3 sync webshare/static s3://prompt-devshare-static/static --cache-control 'no-cache'
aws --profile prompt-s3 s3 sync webshare/dist-dev s3://prompt-devshare-static/dist-dev --cache-control 'no-cache'
```
```bash
# @scripthaus command sync-webshare
# @scripthaus cd :playbook
# no-cache for dev
aws --profile prompt-s3 s3 sync webshare/static s3://prompt-share-static/static --cache-control 'no-cache'
aws --profile prompt-s3 s3 sync webshare/dist s3://prompt-share-static/dist --cache-control 'no-cache'
```
```bash
# @scripthaus command build-wavesrv
cd wavesrv
+1 -4
View File
@@ -24,7 +24,7 @@ import {
import { RemotesModal } from "./connections/connections";
import { TosModal } from "./common/modals/modals";
import { MainSideBar } from "./sidebar/MainSideBar";
import { DisconnectedModal, ClientStopModal, AlertModal, WelcomeModal, AboutModal } from "./common/modals/modals";
import { DisconnectedModal, ClientStopModal, AlertModal, AboutModal } from "./common/modals/modals";
import { ErrorBoundary } from "./common/error/errorboundary";
import "./app.less";
@@ -124,9 +124,6 @@ class App extends React.Component<{}, {}> {
<If condition={GlobalModel.needsTos()}>
<TosModal />
</If>
<If condition={GlobalModel.welcomeModalOpen.get()}>
<WelcomeModal />
</If>
<If condition={GlobalModel.aboutModalOpen.get()}>
<AboutModal />
</If>
-367
View File
@@ -1,367 +0,0 @@
// Copyright 2023, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import * as React from "react";
import * as mobxReact from "mobx-react";
import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator";
import { If, For } from "tsx-control-statements/components";
import cn from "classnames";
import dayjs from "dayjs";
import localizedFormat from "dayjs/plugin/localizedFormat";
import { GlobalModel, GlobalCommandRunner } from "../../../model/model";
import { Markdown } from "../common";
import * as util from "../../../util/util";
import { ReactComponent as XmarkIcon } from "../../assets/icons/line/xmark.svg";
import { ReactComponent as WarningIcon } from "../../assets/icons/line/triangle-exclamation.svg";
import { ReactComponent as ShieldCheck } from "../../assets/icons/line/shield_check.svg";
import { ReactComponent as Help } from "../../assets/icons/line/help_filled.svg";
import { ReactComponent as Github } from "../../assets/icons/line/github.svg";
dayjs.extend(localizedFormat);
type OV<V> = mobx.IObservableValue<V>;
@mobxReact.observer
class DisconnectedModal extends React.Component<{}, {}> {
logRef: any = React.createRef();
showLog: mobx.IObservableValue<boolean> = mobx.observable.box(false);
@boundMethod
restartServer() {
GlobalModel.restartWaveSrv();
}
@boundMethod
tryReconnect() {
GlobalModel.ws.connectNow("manual");
}
componentDidMount() {
if (this.logRef.current != null) {
this.logRef.current.scrollTop = this.logRef.current.scrollHeight;
}
}
componentDidUpdate() {
if (this.logRef.current != null) {
this.logRef.current.scrollTop = this.logRef.current.scrollHeight;
}
}
@boundMethod
handleShowLog(): void {
mobx.action(() => {
this.showLog.set(!this.showLog.get());
})();
}
render() {
let model = GlobalModel;
let logLine: string = null;
let idx: number = 0;
return (
<div className="prompt-modal disconnected-modal modal is-active">
<div className="modal-background"></div>
<div className="modal-content">
<div className="message-header">
<div className="modal-title">Prompt Client Disconnected</div>
</div>
<If condition={this.showLog.get()}>
<div className="inner-content">
<div className="ws-log" ref={this.logRef}>
<For each="logLine" index="idx" of={GlobalModel.ws.wsLog}>
<div key={idx} className="ws-logline">
{logLine}
</div>
</For>
</div>
</div>
</If>
<footer>
<div className="footer-text-link" style={{ marginLeft: 10 }} onClick={this.handleShowLog}>
<If condition={!this.showLog.get()}>
<i className="fa-sharp fa-solid fa-plus" /> Show Log
</If>
<If condition={this.showLog.get()}>
<i className="fa-sharp fa-solid fa-minus" /> Hide Log
</If>
</div>
<div className="flex-spacer" />
<button onClick={this.tryReconnect} className="button">
<span className="icon">
<i className="fa-sharp fa-solid fa-rotate" />
</span>
<span>Try Reconnect</span>
</button>
<button onClick={this.restartServer} className="button is-danger" style={{ marginLeft: 10 }}>
<WarningIcon className="icon" />
<span>Restart Server</span>
</button>
</footer>
</div>
</div>
);
}
}
@mobxReact.observer
class ClientStopModal extends React.Component<{}, {}> {
@boundMethod
refreshClient() {
GlobalModel.refreshClient();
}
render() {
let model = GlobalModel;
let cdata = model.clientData.get();
let title = "Client Not Ready";
return (
<div className="prompt-modal client-stop-modal modal is-active">
<div className="modal-background"></div>
<div className="modal-content">
<div className="message-header">
<div className="modal-title">[prompt] {title}</div>
</div>
<div className="inner-content">
<If condition={cdata == null}>
<div>Cannot get client data.</div>
</If>
</div>
<footer>
<button onClick={this.refreshClient} className="button">
<span className="icon">
<i className="fa-sharp fa-solid fa-rotate" />
</span>
<span>Hard Refresh Client</span>
</button>
</footer>
</div>
</div>
);
}
}
@mobxReact.observer
class LoadingSpinner extends React.Component<{}, {}> {
render() {
return (
<div className="loading-spinner">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
);
}
}
@mobxReact.observer
class AlertModal extends React.Component<{}, {}> {
@boundMethod
closeModal(): void {
GlobalModel.cancelAlert();
}
@boundMethod
handleOK(): void {
GlobalModel.confirmAlert();
}
render() {
let message = GlobalModel.alertMessage.get();
if (message == null) {
return null;
}
let title = message.title ?? (message.confirm ? "Confirm" : "Alert");
let isConfirm = message.confirm;
return (
<div className="modal prompt-modal wave-modal is-active alert-modal">
<div className="modal-background" />
<div className="modal-content">
<header>
<p className="modal-title">
<WarningIcon className="icon" />
{title}
</p>
<div className="close-icon hoverEffect" title="Close (Escape)" onClick={this.closeModal}>
<XmarkIcon />
</div>
</header>
<If condition={message.markdown}>
<Markdown text={message.message} extraClassName="inner-content" />
</If>
<If condition={!message.markdown}>
<div className="inner-content content">
<p>{message.message}</p>
</div>
</If>
<footer>
<If condition={isConfirm}>
<div onClick={this.closeModal} className="button is-prompt-cancel is-outlined is-small">
Cancel
</div>
<div onClick={this.handleOK} className="button is-prompt-green is-outlined is-small">
OK
</div>
</If>
<If condition={!isConfirm}>
<div onClick={this.handleOK} className="button is-prompt-green is-small">
OK
</div>
</If>
</footer>
</div>
</div>
);
}
}
@mobxReact.observer
class WelcomeModal extends React.Component<{}, {}> {
totalPages: number = 3;
pageNum: OV<number> = mobx.observable.box(1, { name: "welcome-pagenum" });
@boundMethod
closeModal(): void {
mobx.action(() => {
GlobalModel.welcomeModalOpen.set(false);
})();
}
@boundMethod
goNext(): void {
mobx.action(() => {
this.pageNum.set(this.pageNum.get() + 1);
})();
}
@boundMethod
goPrev(): void {
mobx.action(() => {
this.pageNum.set(this.pageNum.get() - 1);
})();
}
renderDot(num: number): any {
if (num == this.pageNum.get()) {
return <i key={String(num)} className="fa-sharp fa-solid fa-circle" />;
}
return <i key={String(num)} className="fa-sharp fa-regular fa-circle" />;
}
renderDots(): any {
let elems: any = [];
for (let i = 1; i <= this.totalPages; i++) {
let elem = this.renderDot(i);
elems.push(elem);
}
return elems;
}
render() {
let pageNum = this.pageNum.get();
return (
<div className={cn("modal welcome-modal prompt-modal is-active")}>
<div className="modal-background" onClick={this.closeModal} />
<div className="modal-content">
<header>
<div className="modal-title">welcome to [prompt]</div>
<div className="close-icon hoverEffect" title="Close (Escape)" onClick={this.closeModal}>
<XmarkIcon />
</div>
</header>
<div className={cn("inner-content content", { "is-hidden": pageNum != 1 })}>
<p>
Prompt is a new terminal to help save you time and keep your command-line life organized.
Here's a couple quick tips to get your started!
</p>
</div>
<footer>
<If condition={pageNum > 1}>
<button className={cn("button is-dark prev-button is-small")} onClick={this.goPrev}>
<span className="icon is-small">
<i className="fa-sharp fa-regular fa-angle-left" />
</span>
<span>Prev</span>
</button>
</If>
<If condition={pageNum == 1}>
<div className="prev-spacer" />
</If>
<div className="flex-spacer" />
<div className="dots">{this.renderDots()}</div>
<div className="flex-spacer" />
<If condition={pageNum < this.totalPages}>
<button className="button is-dark next-button is-small" onClick={this.goNext}>
<span>Next</span>
<span className="icon is-small">
<i className="fa-sharp fa-regular fa-angle-right" />
</span>
</button>
</If>
<If condition={pageNum == this.totalPages}>
<button className="button is-dark next-button is-small" onClick={this.closeModal}>
<span>Done</span>
</button>
</If>
</footer>
</div>
</div>
);
}
}
@mobxReact.observer
class TosModal extends React.Component<{}, {}> {
@boundMethod
acceptTos(): void {
GlobalCommandRunner.clientAcceptTos();
}
render() {
return (
<div className={cn("modal tos-modal wave-modal is-active")}>
<div className="modal-background" />
<div className="modal-content">
<div className="modal-content-wrapper">
<header>
<div className="modal-title">Welcome to Wave Terminal!</div>
<div className="modal-subtitle">Lets set everything for you</div>
</header>
<div className="content">
<div className="item">
<ShieldCheck />
<div className="item-inner">
<div className="item-title">Telemetry</div>
</div>
</div>
<div className="item">
<Help />
<div className="item-inner"></div>
</div>
<div className="item">
<Github />
<div className="item-inner"></div>
</div>
{/* <p>
<a target="_blank" href={util.makeExternLink("https://www.commandline.dev/tos")}>
Full Terms of Service
</a>
</p> */}
</div>
<footer>
<div className="flex-spacer" />
<div onClick={this.acceptTos} className="button is-prompt-green is-outlined is-small">
Accept Terms of Service
</div>
</footer>
</div>
</div>
</div>
);
}
}
export { WelcomeModal, LoadingSpinner, ClientStopModal, AlertModal, DisconnectedModal, TosModal };
+29 -117
View File
@@ -17,6 +17,7 @@ import { ClientDataType } from "../../../types/types";
import close from "../../assets/icons/close.svg";
import { ReactComponent as WarningIcon } from "../../assets/icons/line/triangle-exclamation.svg";
import { ReactComponent as XmarkIcon } from "../../assets/icons/line/xmark.svg";
import shield from "../../assets/icons/shield_check.svg";
import help from "../../assets/icons/help_filled.svg";
import github from "../../assets/icons/github.svg";
@@ -25,7 +26,7 @@ import logo from "../../assets/waveterm-logo-with-bg.svg";
dayjs.extend(localizedFormat);
// @ts-ignore
const VERSION = __PROMPT_VERSION__;
const VERSION = __WAVETERM_VERSION__;
type OV<V> = mobx.IObservableValue<V>;
@@ -72,7 +73,7 @@ class DisconnectedModal extends React.Component<{}, {}> {
<div className="modal-background"></div>
<div className="modal-content">
<div className="message-header">
<div className="modal-title">Prompt Client Disconnected</div>
<div className="modal-title">Wave Client Disconnected</div>
</div>
<If condition={this.showLog.get()}>
<div className="inner-content">
@@ -128,7 +129,7 @@ class ClientStopModal extends React.Component<{}, {}> {
<div className="modal-background"></div>
<div className="modal-content">
<div className="message-header">
<div className="modal-title">[prompt] {title}</div>
<div className="modal-title">{title}</div>
</div>
<div className="inner-content">
<If condition={cdata == null}>
@@ -224,101 +225,6 @@ class AlertModal extends React.Component<{}, {}> {
}
}
@mobxReact.observer
class WelcomeModal extends React.Component<{}, {}> {
totalPages: number = 3;
pageNum: OV<number> = mobx.observable.box(1, { name: "welcome-pagenum" });
@boundMethod
closeModal(): void {
mobx.action(() => {
GlobalModel.welcomeModalOpen.set(false);
})();
}
@boundMethod
goNext(): void {
mobx.action(() => {
this.pageNum.set(this.pageNum.get() + 1);
})();
}
@boundMethod
goPrev(): void {
mobx.action(() => {
this.pageNum.set(this.pageNum.get() - 1);
})();
}
renderDot(num: number): any {
if (num == this.pageNum.get()) {
return <i key={String(num)} className="fa-sharp fa-solid fa-circle" />;
}
return <i key={String(num)} className="fa-sharp fa-regular fa-circle" />;
}
renderDots(): any {
let elems: any = [];
for (let i = 1; i <= this.totalPages; i++) {
let elem = this.renderDot(i);
elems.push(elem);
}
return elems;
}
render() {
let pageNum = this.pageNum.get();
return (
<div className={cn("modal welcome-modal prompt-modal is-active")}>
<div className="modal-background" onClick={this.closeModal} />
<div className="modal-content">
<header>
<div className="modal-title">About</div>
<div className="close-icon hoverEffect" title="Close (Escape)" onClick={this.closeModal}>
<XmarkIcon />
</div>
</header>
<div className={cn("inner-content content", { "is-hidden": pageNum != 1 })}>
<p>
Prompt is a new terminal to help save you time and keep your command-line life organized.
Here's a couple quick tips to get your started!
</p>
</div>
<footer>
<If condition={pageNum > 1}>
<button className={cn("button is-dark prev-button is-small")} onClick={this.goPrev}>
<span className="icon is-small">
<i className="fa-sharp fa-regular fa-angle-left" />
</span>
<span>Prev</span>
</button>
</If>
<If condition={pageNum == 1}>
<div className="prev-spacer" />
</If>
<div className="flex-spacer" />
<div className="dots">{this.renderDots()}</div>
<div className="flex-spacer" />
<If condition={pageNum < this.totalPages}>
<button className="button is-dark next-button is-small" onClick={this.goNext}>
<span>Next</span>
<span className="icon is-small">
<i className="fa-sharp fa-regular fa-angle-right" />
</span>
</button>
</If>
<If condition={pageNum == this.totalPages}>
<button className="button is-dark next-button is-small" onClick={this.closeModal}>
<span>Done</span>
</button>
</If>
</footer>
</div>
</div>
);
}
}
@mobxReact.observer
class TosModal extends React.Component<{}, {}> {
state = {
@@ -352,60 +258,66 @@ class TosModal extends React.Component<{}, {}> {
<div className="modal-background" />
<div className="modal-content tos-modal-content">
<div className="modal-content-wrapper">
<header className="tos-header">
<header className="tos-header unselectable">
<div className="modal-title">Welcome to Wave Terminal!</div>
<div className="modal-subtitle">Lets set everything for you</div>
</header>
<div className="content tos-content">
<div className="content tos-content unselectable">
<div className="item">
<img src={shield} alt="Privacy" />
<div className="item-inner">
<div className="item-title">Telemetry</div>
<div className="item-text">
We dont collect any personal info, only crash logs and IP address to make Wave
better. If you like, you can disable telemetry now or late.
We only collect minimal <i>anonymous</i> telemetry data to help us
understand how many people are using Wave.
</div>
<div className="item-field">
<div className="item-field" style={{marginTop: 2}}>
<Toggle
checked={!cdata.clientopts.notelemetry}
onChange={this.handleChangeTelemetry}
/>
<div className="item-label">Basic Telemetry</div>
<div className="item-label">Telemetry {cdata.clientopts.notelemetry ? "Disabled" : "Enabled"}</div>
</div>
</div>
</div>
<div className="item">
<img src={help} alt="Help" />
<a target="_blank" href={util.makeExternLink("https://discord.gg/XfvZ334gwU")}>
<img src={help} alt="Help" />
</a>
<div className="item-inner">
<div className="item-title">Help</div>
<div className="item-title">Join our Community</div>
<div className="item-text">
If you need any help or you have feature request, you can join{" "}
Get help, submit feature requests, report bugs,
or just chat with fellow terminal enthusiasts.<br/>
<a target="_blank" href={util.makeExternLink("https://discord.gg/XfvZ334gwU")}>
our Discord
Join the Wave&nbsp;Discord&nbsp;Channel
</a>
.
</div>
</div>
</div>
<div className="item">
<img src={github} alt="Github" />
<a
target="_blank"
href={util.makeExternLink("https://github.com/wavetermdev/waveterm")}
>
<img src={github} alt="Github" />
</a>
<div className="item-inner">
<div className="item-title">Like Wave? Give us a star</div>
<div className="item-title">Support us on GitHub</div>
<div className="item-text">
Rankings are very important for small startups like us, it helps other people to
know about us. If you like Wave, please consider giving us a star on our{" "}
We're <i>open source</i> and committed to providing a free terminal for individual
users. Please show your support us by giving us a star on{" "}
<a
target="_blank"
href={util.makeExternLink("https://github.com/wavetermdev/waveterm")}
>
Github Repository
Github&nbsp;(wavetermdev/waveterm)
</a>
.
</div>
</div>
</div>
</div>
<footer>
<footer className="unselectable">
<div>
<Checkbox
checked={this.state.isChecked}
@@ -541,4 +453,4 @@ class AboutModal extends React.Component<{}, {}> {
}
}
export { WelcomeModal, LoadingSpinner, ClientStopModal, AlertModal, DisconnectedModal, TosModal, AboutModal };
export { LoadingSpinner, ClientStopModal, AlertModal, DisconnectedModal, TosModal, AboutModal };
+2 -2
View File
@@ -23,9 +23,9 @@ import "./modals.less";
type OV<V> = mobx.IObservableValue<V>;
// @ts-ignore
const VERSION = __PROMPT_VERSION__;
const VERSION = __WAVETERM_VERSION__;
// @ts-ignore
const BUILD = __PROMPT_BUILD__;
const BUILD = __WAVETERM_BUILD__;
const ScreenDeleteMessage = `
Are you sure you want to delete this screen/tab?
+6 -6
View File
@@ -408,13 +408,13 @@ class CreateRemote extends React.Component<{ model: RemotesModalModel; remoteEdi
<InfoMessage width={350}>
<ul>
<li>
<b>startup</b> - connect when [prompt] starts.
<b>startup</b> - Connect when Wave Terminal starts.
</li>
<li>
<b>auto</b> - connect when you first run a command using this connection.
<b>auto</b> - Connect when you first run a command using this connection.
</li>
<li>
<b>manual</b> - connect manually. Note, if your connection requires manual input,
<b>manual</b> - Connect manually. Note, if your connection requires manual input,
like an OPT code, you must use this setting.
</li>
</ul>
@@ -703,13 +703,13 @@ class EditRemoteSettings extends React.Component<
<InfoMessage width={350}>
<ul>
<li>
<b>startup</b> - connect when [prompt] starts.
<b>startup</b> - Connect when Wave Terminal starts.
</li>
<li>
<b>auto</b> - connect when you first run a command using this connection.
<b>auto</b> - Connect when you first run a command using this connection.
</li>
<li>
<b>manual</b> - connect manually. Note, if your connection requires manual input,
<b>manual</b> - Connect manually. Note, if your connection requires manual input,
like an OPT code, you must use this setting.
</li>
</ul>
-7
View File
@@ -118,13 +118,6 @@ class MainSideBar extends React.Component<{}, {}> {
GlobalModel.showWebShareView();
}
@boundMethod
handleWelcomeClick(): void {
mobx.action(() => {
GlobalModel.welcomeModalOpen.set(true);
})();
}
@boundMethod
handleSettingsClick(): void {
mobx.action(() => {
+20
View File
@@ -41,6 +41,26 @@
}
}
.window-empty {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 10px;
height: 100%;
color: #ccc;
code {
background-color: transparent;
color: #4e9a06;
}
&.should-fade {
opacity: 1;
animation: fade-in 2.5s;
}
}
.share-tag {
color: @term-white;
position: absolute;
+18 -8
View File
@@ -16,7 +16,7 @@ import * as T from "../../../types/types";
import localizedFormat from "dayjs/plugin/localizedFormat";
import { InlineSettingsTextEdit, RemoteStatusLight } from "../../common/common";
import { getRemoteStr } from "../../common/prompt/prompt";
import { GlobalModel, ScreenLines, Screen } from "../../../model/model";
import { GlobalModel, ScreenLines, Screen, Session } from "../../../model/model";
import { Line } from "../../line/linecomps";
import { LinesView } from "../../line/linesview";
import * as util from "../../../util/util";
@@ -36,16 +36,16 @@ dayjs.extend(localizedFormat);
type OV<V> = mobx.IObservableValue<V>;
@mobxReact.observer
class ScreenView extends React.Component<{ screen: Screen }, {}> {
class ScreenView extends React.Component<{ session: Session, screen: Screen }, {}> {
render() {
let { screen } = this.props;
let { session, screen } = this.props;
if (screen == null) {
return <div className="screen-view">(no screen found)</div>;
}
let fontSize = GlobalModel.termFontSize.get();
return (
<div className="screen-view" data-screenid={screen.screenId}>
<ScreenWindowView key={screen.screenId + ":" + fontSize} screen={screen} />
<ScreenWindowView key={screen.screenId + ":" + fontSize} session={session} screen={screen} />
</div>
);
}
@@ -219,7 +219,7 @@ class NewTabSettings extends React.Component<{ screen: Screen }, {}> {
// screen is not null
@mobxReact.observer
class ScreenWindowView extends React.Component<{ screen: Screen }, {}> {
class ScreenWindowView extends React.Component<{ session: Session, screen: Screen }, {}> {
rszObs: any;
windowViewRef: React.RefObject<any>;
@@ -303,7 +303,7 @@ class ScreenWindowView extends React.Component<{ screen: Screen }, {}> {
<div className="window-view" ref={this.windowViewRef} data-screenid={screen.screenId}>
<div key="lines" className="lines"></div>
<div key="window-empty" className={cn("window-empty", { "should-fade": fade })}>
<div>{message}</div>
<div className="text-standard">{message}</div>
</div>
</div>
);
@@ -344,7 +344,7 @@ class ScreenWindowView extends React.Component<{ screen: Screen }, {}> {
}
render() {
let { screen } = this.props;
let { session, screen } = this.props;
let win = this.getScreenLines();
if (win == null || !win.loaded.get()) {
return this.renderError("...", true);
@@ -379,7 +379,17 @@ class ScreenWindowView extends React.Component<{ screen: Screen }, {}> {
</div>
</div>
<If condition={lines.length == 0}>
<NewTabSettings screen={screen}/>
<If condition={true}>
<NewTabSettings screen={screen}/>
</If>
<If condition={false}>
<div className="window-view" ref={this.windowViewRef} data-screenid={screen.screenId}>
<div key="lines" className="lines"></div>
<div key="window-empty" className={cn("window-empty")}>
<div><code className="text-standard">[workspace="{session.name.get()}" screen="{screen.name.get()}"]</code></div>
</div>
</div>
</If>
</If>
<If condition={screen.isWebShared()}>
<div key="share-tag" className="share-tag">
+1 -1
View File
@@ -39,7 +39,7 @@ class WorkspaceView extends React.Component<{}, {}> {
<div className={cn("session-view", { "is-hidden": isHidden })} data-sessionid={session.sessionId}>
<ScreenTabs session={session} />
<ErrorBoundary>
<ScreenView screen={activeScreen} />
<ScreenView session={session} screen={activeScreen} />
<div className="cmdinput-height-placeholder" style={{ height: cmdInputHeight }}></div>
<CmdInput />
</ErrorBoundary>
+33 -26
View File
@@ -13,15 +13,15 @@ import * as util from "util";
import { sprintf } from "sprintf-js";
import { v4 as uuidv4 } from "uuid";
const PromptAppPathVarName = "PROMPT_APP_PATH";
const PromptDevVarName = "PROMPT_DEV";
const AuthKeyFile = "prompt.authkey";
const WaveAppPathVarName = "WAVETERM_APP_PATH";
const WaveDevVarName = "WAVETERM_DEV";
const AuthKeyFile = "waveterm.authkey";
const DevServerEndpoint = "http://127.0.0.1:8090";
const ProdServerEndpoint = "http://127.0.0.1:1619";
let isDev = process.env[PromptDevVarName] != null;
let scHome = getPromptHomeDir();
ensureDir(scHome);
let isDev = process.env[WaveDevVarName] != null;
let waveHome = getWaveHomeDir();
ensureDir(waveHome);
let DistDir = isDev ? "dist-dev" : "dist";
let GlobalAuthKey = "";
let instanceId = uuidv4();
@@ -43,7 +43,7 @@ let loggerConfig = {
winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
winston.format.printf((info) => `${info.timestamp} ${info.message}`)
),
transports: [new winston.transports.File({ filename: path.join(scHome, "waveterm-app.log"), level: "info" })],
transports: [new winston.transports.File({ filename: path.join(waveHome, "waveterm-app.log"), level: "info" })],
};
if (isDev) {
loggerConfig.transports.push(new winston.transports.Console());
@@ -59,15 +59,15 @@ function log(...msg) {
console.log = log;
console.log(
sprintf(
"waveterm-app starting, PROMPT_HOME=%s, apppath=%s arch=%s/%s",
scHome,
"waveterm-app starting, WAVETERM_HOME=%s, apppath=%s arch=%s/%s",
waveHome,
getAppBasePath(),
unamePlatform,
unameArch
)
);
if (isDev) {
console.log("prompt-app PROMPT_DEV set");
console.log("waveterm-app WAVETERM_DEV set");
}
let app = electron.app;
app.setName(isDev ? "Wave (Dev)" : "Wave");
@@ -79,20 +79,20 @@ electron.dialog.showErrorBox = (title, content) => {
};
// must match golang
function getPromptHomeDir() {
let scHome = process.env.PROMPT_HOME;
if (scHome == null) {
function getWaveHomeDir() {
let waveHome = process.env.WAVETERM_HOME;
if (waveHome == null) {
let homeDir = process.env.HOME;
if (homeDir == null) {
homeDir = "/";
}
scHome = path.join(homeDir, isDev ? "prompt-dev" : "prompt");
waveHome = path.join(homeDir, isDev ? ".waveterm-dev" : ".waveterm");
}
return scHome;
return waveHome;
}
// for dev, this is just the github.com/commandlinedev/prompt-client directory
// for prod, this is .../Prompt.app/Contents/Resources/app
// for dev, this is just the waveterm directory
// for prod, this is .../Wave.app/Contents/Resources/app
function getAppBasePath() {
return path.dirname(__dirname);
}
@@ -113,14 +113,14 @@ function getWaveSrvPath() {
function getWaveSrvCmd() {
let waveSrvPath = getWaveSrvPath();
let scHome = getPromptHomeDir();
let logFile = path.join(scHome, "wavesrv.log");
let waveHome = getWaveHomeDir();
let logFile = path.join(waveHome, "wavesrv.log");
return `${waveSrvPath} >> "${logFile}" 2>&1`;
}
function getWaveSrvCwd() {
let scHome = getPromptHomeDir();
return scHome;
let waveHome = getWaveHomeDir();
return waveHome;
}
function ensureDir(dir) {
@@ -128,7 +128,7 @@ function ensureDir(dir) {
}
function readAuthKey() {
let homeDir = getPromptHomeDir();
let homeDir = getWaveHomeDir();
let authKeyFileName = path.join(homeDir, AuthKeyFile);
if (!fs.existsSync(authKeyFileName)) {
let authKeyStr = String(uuidv4());
@@ -152,11 +152,18 @@ let menuTemplate = [
click: () => {
MainWindow?.webContents.send('menu-item-about');
}
}
},
{ type: "separator" },
{ role: "services" },
{ type: "separator" },
{ role: "hide" },
{ role: "hideOthers" },
{ type: "separator" },
{ role: "quit" },
],
},
{
label: "File",
label: "Filemenu",
submenu: [{ role: "close" }, { role: "forceReload" }],
},
{
@@ -509,9 +516,9 @@ function runWaveSrv() {
pReject = argReject;
});
let envCopy = Object.assign({}, process.env);
envCopy[PromptAppPathVarName] = getAppBasePath();
envCopy[WaveAppPathVarName] = getAppBasePath();
if (isDev) {
envCopy[PromptDevVarName] = "1";
envCopy[WaveDevVarName] = "1";
}
console.log("trying to run local server", getWaveSrvPath());
let proc = child_process.spawn("/bin/bash", ["-c", getWaveSrvCmd()], {
+3 -3
View File
@@ -10,9 +10,9 @@ import * as DOMPurify from "dompurify";
import { loadFonts } from "./util/util";
// @ts-ignore
let VERSION = __PROMPT_VERSION__;
let VERSION = __WAVETERM_VERSION__;
// @ts-ignore
let BUILD = __PROMPT_BUILD__;
let BUILD = __WAVETERM_BUILD__;
loadFonts();
@@ -34,4 +34,4 @@ document.addEventListener("DOMContentLoaded", () => {
(window as any).sprintf = sprintf;
(window as any).DOMPurify = DOMPurify;
console.log("PROMPT", VERSION, BUILD);
console.log("WaveTerm", VERSION, BUILD);
+2 -13
View File
@@ -97,9 +97,9 @@ const RemoteColors = ["red", "green", "yellow", "blue", "magenta", "cyan", "whit
const TabColors = ["green", "blue", "yellow", "pink", "magenta", "cyan", "violet", "orange", "red", "white"];
// @ts-ignore
const VERSION = __PROMPT_VERSION__;
const VERSION = __WAVETERM_VERSION__;
// @ts-ignore
const BUILD = __PROMPT_BUILD__;
const BUILD = __WAVETERM_BUILD__;
type LineContainerModel = {
loadTerminalRenderer: (elem: Element, line: LineType, cmd: Cmd, width: number) => void;
@@ -2697,9 +2697,6 @@ class Model {
name: "alertMessage",
});
alertPromiseResolver: (result: boolean) => void;
welcomeModalOpen: OV<boolean> = mobx.observable.box(false, {
name: "welcomeModalOpen",
});
aboutModalOpen: OV<boolean> = mobx.observable.box(false, {
name: "aboutModalOpen",
});
@@ -2978,14 +2975,6 @@ class Model {
GlobalModel.lineSettingsModal.set(null);
didSomething = true;
}
if (GlobalModel.welcomeModalOpen.get()) {
GlobalModel.welcomeModalOpen.set(false);
didSomething = true;
}
if (GlobalModel.welcomeModalOpen.get()) {
GlobalModel.welcomeModalOpen.set(false);
didSomething = true;
}
})();
return didSomething;
}
+1
View File
@@ -0,0 +1 @@
+1
View File
@@ -0,0 +1 @@
+1
View File
@@ -0,0 +1 @@
@@ -0,0 +1 @@
# placeholder
+1
View File
@@ -0,0 +1 @@
@@ -0,0 +1 @@
# placeholder

Some files were not shown because too many files have changed in this diff Show More