mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
merge branch 'main' into sylvie/plot-variety
This commit is contained in:
commit
07675787c8
@ -219,10 +219,6 @@ func main() {
|
|||||||
log.Printf("error initializing wstore: %v\n", err)
|
log.Printf("error initializing wstore: %v\n", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
migrateErr := wstore.TryMigrateOldHistory()
|
|
||||||
if migrateErr != nil {
|
|
||||||
log.Printf("error migrating old history: %v\n", migrateErr)
|
|
||||||
}
|
|
||||||
go func() {
|
go func() {
|
||||||
err := shellutil.InitCustomShellStartupFiles()
|
err := shellutil.InitCustomShellStartupFiles()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -234,6 +230,12 @@ func main() {
|
|||||||
log.Printf("error ensuring initial data: %v\n", err)
|
log.Printf("error ensuring initial data: %v\n", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if firstRun {
|
||||||
|
migrateErr := wstore.TryMigrateOldHistory()
|
||||||
|
if migrateErr != nil {
|
||||||
|
log.Printf("error migrating old history: %v\n", migrateErr)
|
||||||
|
}
|
||||||
|
}
|
||||||
if window != nil {
|
if window != nil {
|
||||||
ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second)
|
ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second)
|
||||||
defer cancelFn()
|
defer cancelFn()
|
||||||
|
@ -12,7 +12,7 @@ export function getLaunchSettings(): SettingsType {
|
|||||||
try {
|
try {
|
||||||
const settingsContents = fs.readFileSync(settingsPath, "utf8");
|
const settingsContents = fs.readFileSync(settingsPath, "utf8");
|
||||||
return JSON.parse(settingsContents);
|
return JSON.parse(settingsContents);
|
||||||
} catch (e) {
|
} catch (_) {
|
||||||
console.error("Unable to load settings.json to get initial launch settings", e);
|
// fail silently
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import path from "path";
|
|||||||
import { WaveDevVarName, WaveDevViteVarName } from "../frontend/util/isdev";
|
import { WaveDevVarName, WaveDevViteVarName } from "../frontend/util/isdev";
|
||||||
import * as keyutil from "../frontend/util/keyutil";
|
import * as keyutil from "../frontend/util/keyutil";
|
||||||
|
|
||||||
|
const WaveHomeVarName = "WAVETERM_HOME";
|
||||||
|
|
||||||
const isDev = !app.isPackaged;
|
const isDev = !app.isPackaged;
|
||||||
const isDevVite = isDev && process.env.ELECTRON_RENDERER_URL;
|
const isDevVite = isDev && process.env.ELECTRON_RENDERER_URL;
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
@ -37,6 +39,10 @@ ipcMain.on("get-host-name", (event) => {
|
|||||||
|
|
||||||
// must match golang
|
// must match golang
|
||||||
function getWaveHomeDir() {
|
function getWaveHomeDir() {
|
||||||
|
const override = process.env[WaveHomeVarName];
|
||||||
|
if (override) {
|
||||||
|
return override;
|
||||||
|
}
|
||||||
return path.join(os.homedir(), isDev ? ".waveterm-dev" : ".waveterm");
|
return path.join(os.homedir(), isDev ? ".waveterm-dev" : ".waveterm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,6 +233,10 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button:not(:first-child) {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
button.disabled-button {
|
button.disabled-button {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import { useEffect, useRef, useState } from "react";
|
|||||||
import { FlexiModal } from "./modal";
|
import { FlexiModal } from "./modal";
|
||||||
|
|
||||||
import { QuickTips } from "@/app/element/quicktips";
|
import { QuickTips } from "@/app/element/quicktips";
|
||||||
import { atoms } from "@/app/store/global";
|
import { atoms, getApi } from "@/app/store/global";
|
||||||
import { modalsModel } from "@/app/store/modalmodel";
|
import { modalsModel } from "@/app/store/modalmodel";
|
||||||
import { atom, PrimitiveAtom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
import { atom, PrimitiveAtom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||||
import "./tos.less";
|
import "./tos.less";
|
||||||
@ -153,6 +153,58 @@ const ModalPage2 = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ModalPageLegacy = () => {
|
||||||
|
const setPageNum = useSetAtom(pageNumAtom);
|
||||||
|
const handleContinue = () => {
|
||||||
|
setPageNum(1);
|
||||||
|
};
|
||||||
|
const handleDownloadLegacy = () => {
|
||||||
|
getApi().openExternal("https://waveterm.dev/download-legacy?ref=v7upgrade");
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<header className="modal-header tos-header unselectable">
|
||||||
|
<div className="logo">
|
||||||
|
<Logo />
|
||||||
|
</div>
|
||||||
|
<div className="modal-title">Welcome to Wave v0.8</div>
|
||||||
|
</header>
|
||||||
|
<div className="modal-content tos-content unselectable">
|
||||||
|
<div className="item">
|
||||||
|
We’re excited to announce the release of Wave Terminal v0.8. This update introduces a brand-new
|
||||||
|
layout engine, featuring drag-and-drop screen splitting with flexible block sizing and positioning.
|
||||||
|
We've also integrated powerful tools like file previews, an editor, web integration, and AI, all
|
||||||
|
designed to keep you focused and minimize context switching. And for the first time, Wave Terminal
|
||||||
|
runs <b>natively on Windows</b>!
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Wave v0.8 is less opinionated, giving you the freedom to use your standard terminal prompt and
|
||||||
|
command completions, while supporting all shells (not just bash/zsh). We've also improved
|
||||||
|
compatibility with ohmyzsh packages, removing some of the friction users experienced. It’s faster,
|
||||||
|
more performant, and provides a stronger foundation for you to build your own blocks and widgets in
|
||||||
|
the future.
|
||||||
|
</div>
|
||||||
|
<div className="item">
|
||||||
|
The new build is a fresh start, and a clean break from the current version. As such, your history,
|
||||||
|
settings, and configuration will <i>not</i> be carried over. If you'd like to continue to run the
|
||||||
|
legacy version, you will need to download it separately.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer className="unselectable">
|
||||||
|
<div className="button-wrapper">
|
||||||
|
<Button className="outlined grey" onClick={handleDownloadLegacy}>
|
||||||
|
Download WaveLegacy
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button className="font-weight-600" onClick={handleContinue}>
|
||||||
|
Continue
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const TosModal = () => {
|
const TosModal = () => {
|
||||||
const modalRef = useRef<HTMLDivElement | null>(null);
|
const modalRef = useRef<HTMLDivElement | null>(null);
|
||||||
const [pageNum, setPageNum] = useAtom(pageNumAtom);
|
const [pageNum, setPageNum] = useAtom(pageNumAtom);
|
||||||
@ -173,7 +225,9 @@ const TosModal = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// on unmount, always reset pagenum
|
// on unmount, always reset pagenum
|
||||||
if (clientData.tosagreed) {
|
if (!clientData.tosagreed && clientData.hasoldhistory) {
|
||||||
|
setPageNum(0);
|
||||||
|
} else if (clientData.tosagreed) {
|
||||||
setPageNum(2);
|
setPageNum(2);
|
||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
@ -189,11 +243,25 @@ const TosModal = () => {
|
|||||||
window.removeEventListener("resize", updateModalHeight);
|
window.removeEventListener("resize", updateModalHeight);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
let pageComp: React.JSX.Element = null;
|
||||||
|
switch (pageNum) {
|
||||||
|
case 0:
|
||||||
|
pageComp = <ModalPageLegacy />;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
pageComp = <ModalPage1 />;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
pageComp = <ModalPage2 />;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (pageComp == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<FlexiModal className="tos-modal" ref={modalRef}>
|
<FlexiModal className="tos-modal" ref={modalRef}>
|
||||||
<OverlayScrollbarsComponent className="modal-inner" options={{ scrollbars: { autoHide: "leave" } }}>
|
<OverlayScrollbarsComponent className="modal-inner" options={{ scrollbars: { autoHide: "leave" } }}>
|
||||||
{pageNum === 1 ? <ModalPage1 /> : <ModalPage2 />}
|
{pageComp}
|
||||||
</OverlayScrollbarsComponent>
|
</OverlayScrollbarsComponent>
|
||||||
</FlexiModal>
|
</FlexiModal>
|
||||||
);
|
);
|
||||||
|
2
frontend/types/gotypes.d.ts
vendored
2
frontend/types/gotypes.d.ts
vendored
@ -44,7 +44,7 @@ declare global {
|
|||||||
type Client = WaveObj & {
|
type Client = WaveObj & {
|
||||||
windowids: string[];
|
windowids: string[];
|
||||||
tosagreed?: number;
|
tosagreed?: number;
|
||||||
historymigrated?: boolean;
|
hasoldhistory?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
// wshrpc.CommandAppendIJsonData
|
// wshrpc.CommandAppendIJsonData
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"productName": "Wave",
|
"productName": "Wave",
|
||||||
"description": "Open-Source AI-Native Terminal Built for Seamless Workflows",
|
"description": "Open-Source AI-Native Terminal Built for Seamless Workflows",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"version": "0.8.4-beta.4",
|
"version": "0.8.4",
|
||||||
"homepage": "https://waveterm.dev",
|
"homepage": "https://waveterm.dev",
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "dev.commandline.waveterm"
|
"appId": "dev.commandline.waveterm"
|
||||||
|
@ -112,12 +112,12 @@ func (update *WaveObjUpdate) UnmarshalJSON(data []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
OID string `json:"oid"`
|
OID string `json:"oid"`
|
||||||
Version int `json:"version"`
|
Version int `json:"version"`
|
||||||
WindowIds []string `json:"windowids"`
|
WindowIds []string `json:"windowids"`
|
||||||
Meta MetaMapType `json:"meta"`
|
Meta MetaMapType `json:"meta"`
|
||||||
TosAgreed int64 `json:"tosagreed,omitempty"`
|
TosAgreed int64 `json:"tosagreed,omitempty"`
|
||||||
HistoryMigrated bool `json:"historymigrated,omitempty"`
|
HasOldHistory bool `json:"hasoldhistory,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Client) GetOType() string {
|
func (*Client) GetOType() string {
|
||||||
|
@ -83,19 +83,6 @@ func ReplaceOldHistory(ctx context.Context, hist []*OldHistoryType) error {
|
|||||||
func TryMigrateOldHistory() error {
|
func TryMigrateOldHistory() error {
|
||||||
ctx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancelFn()
|
defer cancelFn()
|
||||||
client, err := DBGetSingleton[*waveobj.Client](ctx)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if client.HistoryMigrated {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
log.Printf("trying to migrate old wave history\n")
|
|
||||||
client.HistoryMigrated = true
|
|
||||||
err = DBUpdate(ctx, client)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
hist, err := GetAllOldHistory()
|
hist, err := GetAllOldHistory()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -108,5 +95,14 @@ func TryMigrateOldHistory() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Printf("migrated %d old wave history records\n", len(hist))
|
log.Printf("migrated %d old wave history records\n", len(hist))
|
||||||
|
client, err := DBGetSingleton[*waveobj.Client](ctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
client.HasOldHistory = true
|
||||||
|
err = DBUpdate(ctx, client)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user