fix conflicts

This commit is contained in:
Red Adaya 2024-02-08 14:48:29 +08:00
commit a9b9ff3362
2 changed files with 17 additions and 21 deletions

View File

@ -10,7 +10,7 @@
# Wave Terminal # Wave Terminal
A open-source, cross-platform, modern terminal for seamless workflows. A open-source, cross-platform, AI-integrated, modern terminal for seamless workflows.
Wave isn't just another terminal emulator; it's a rethink on how terminals are built. Wave combines command line with the power of the open web to help veteran CLI users and new developers alike. Wave isn't just another terminal emulator; it's a rethink on how terminals are built. Wave combines command line with the power of the open web to help veteran CLI users and new developers alike.
@ -18,6 +18,7 @@ Wave isn't just another terminal emulator; it's a rethink on how terminals are b
* Persistent sessions that can restore state across network disconnections and reboots * Persistent sessions that can restore state across network disconnections and reboots
* Searchable contextual command history across all remote sessions (saved locally) * Searchable contextual command history across all remote sessions (saved locally)
* Workspaces, tabs, and command blocks to keep you organized * Workspaces, tabs, and command blocks to keep you organized
* AI Integration with ChatGPT (or ChatGPT compatible APIs) to help write commands and get answers inline
## Installation ## Installation
@ -35,6 +36,7 @@ brew install --cask wave
* Homepage — https://www.waveterm.dev * Homepage — https://www.waveterm.dev
* Download Page — https://www.waveterm.dev/download * Download Page — https://www.waveterm.dev/download
* Documentation — https://docs.waveterm.dev/ * Documentation — https://docs.waveterm.dev/
* Blog — https://blog.waveterm.dev/
* Quick Start Guide — https://docs.waveterm.dev/quickstart/ * Quick Start Guide — https://docs.waveterm.dev/quickstart/
* Discord Community — https://discord.gg/XfvZ334gwU * Discord Community — https://discord.gg/XfvZ334gwU

View File

@ -8,7 +8,7 @@ import { boundMethod } from "autobind-decorator";
import { If, For } from "tsx-control-statements/components"; import { If, For } from "tsx-control-statements/components";
import cn from "classnames"; import cn from "classnames";
import type { BookmarkType } from "../../types/types"; import type { BookmarkType } from "../../types/types";
import { Model } from "../../models"; import { GlobalModel } from "../../models";
import { CmdStrCode, Markdown } from "../common/elements"; import { CmdStrCode, Markdown } from "../common/elements";
import { ReactComponent as XmarkIcon } from "../assets/icons/line/xmark.svg"; import { ReactComponent as XmarkIcon } from "../assets/icons/line/xmark.svg";
@ -25,44 +25,41 @@ type BookmarkProps = {
@mobxReact.observer @mobxReact.observer
class Bookmark extends React.Component<BookmarkProps, {}> { class Bookmark extends React.Component<BookmarkProps, {}> {
globalModel: Model;
constructor(props: BookmarkProps) { constructor(props: BookmarkProps) {
super(props); super(props);
this.globalModel = Model.getInstance();
} }
@boundMethod @boundMethod
handleDeleteClick(): void { handleDeleteClick(): void {
let { bookmark } = this.props; let { bookmark } = this.props;
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
model.handleDeleteBookmark(bookmark.bookmarkid); model.handleDeleteBookmark(bookmark.bookmarkid);
} }
@boundMethod @boundMethod
handleEditClick(): void { handleEditClick(): void {
let { bookmark } = this.props; let { bookmark } = this.props;
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
model.handleEditBookmark(bookmark.bookmarkid); model.handleEditBookmark(bookmark.bookmarkid);
} }
@boundMethod @boundMethod
handleEditCancel(): void { handleEditCancel(): void {
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
model.cancelEdit(); model.cancelEdit();
return; return;
} }
@boundMethod @boundMethod
handleEditUpdate(): void { handleEditUpdate(): void {
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
model.confirmEdit(); model.confirmEdit();
return; return;
} }
@boundMethod @boundMethod
handleDescChange(e: any): void { handleDescChange(e: any): void {
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
mobx.action(() => { mobx.action(() => {
model.tempDesc.set(e.target.value); model.tempDesc.set(e.target.value);
})(); })();
@ -70,7 +67,7 @@ class Bookmark extends React.Component<BookmarkProps, {}> {
@boundMethod @boundMethod
handleCmdChange(e: any): void { handleCmdChange(e: any): void {
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
mobx.action(() => { mobx.action(() => {
model.tempCmd.set(e.target.value); model.tempCmd.set(e.target.value);
})(); })();
@ -79,27 +76,27 @@ class Bookmark extends React.Component<BookmarkProps, {}> {
@boundMethod @boundMethod
handleClick(): void { handleClick(): void {
let { bookmark } = this.props; let { bookmark } = this.props;
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
model.selectBookmark(bookmark.bookmarkid); model.selectBookmark(bookmark.bookmarkid);
} }
@boundMethod @boundMethod
handleUse(): void { handleUse(): void {
let { bookmark } = this.props; let { bookmark } = this.props;
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
model.useBookmark(bookmark.bookmarkid); model.useBookmark(bookmark.bookmarkid);
} }
@boundMethod @boundMethod
clickCopy(): void { clickCopy(): void {
let bm = this.props.bookmark; let bm = this.props.bookmark;
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
model.handleCopyBookmark(bm.bookmarkid); model.handleCopyBookmark(bm.bookmarkid);
} }
render() { render() {
let bm = this.props.bookmark; let bm = this.props.bookmark;
let model = this.globalModel.bookmarksModel; let model = GlobalModel.bookmarksModel;
let isSelected = model.activeBookmark.get() == bm.bookmarkid; let isSelected = model.activeBookmark.get() == bm.bookmarkid;
let markdown = bm.description ?? ""; let markdown = bm.description ?? "";
let hasDesc = markdown != ""; let hasDesc = markdown != "";
@ -190,24 +187,21 @@ class Bookmark extends React.Component<BookmarkProps, {}> {
@mobxReact.observer @mobxReact.observer
class BookmarksView extends React.Component<{}, {}> { class BookmarksView extends React.Component<{}, {}> {
globalModel: Model;
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.globalModel = Model.getInstance();
} }
@boundMethod @boundMethod
closeView(): void { closeView(): void {
this.globalModel.bookmarksModel.closeView(); GlobalModel.bookmarksModel.closeView();
} }
render() { render() {
let isHidden = this.globalModel.activeMainView.get() != "bookmarks"; let isHidden = GlobalModel.activeMainView.get() != "bookmarks";
if (isHidden) { if (isHidden) {
return null; return null;
} }
let bookmarks = this.globalModel.bookmarksModel.bookmarks; let bookmarks = GlobalModel.bookmarksModel.bookmarks;
let idx: number = 0; let idx: number = 0;
let bookmark: BookmarkType = null; let bookmark: BookmarkType = null;
return ( return (