mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
remove fe migration status updates
This commit is contained in:
+1
-14
@@ -8,7 +8,7 @@ import cn from "classnames";
|
||||
import {debounce, throttle} from "throttle-debounce";
|
||||
import {v4 as uuidv4} from "uuid";
|
||||
import dayjs from "dayjs";
|
||||
import type {SessionDataType, LineType, CmdDataType, RemoteType, RemoteStateType, RemoteInstanceType, RemotePtrType, HistoryItem, HistoryQueryOpts, RemoteEditType, ContextMenuOpts, BookmarkType, RenderModeType, ClientMigrationInfo, LineFactoryProps} from "./types";
|
||||
import type {SessionDataType, LineType, CmdDataType, RemoteType, RemoteStateType, RemoteInstanceType, RemotePtrType, HistoryItem, HistoryQueryOpts, RemoteEditType, ContextMenuOpts, BookmarkType, RenderModeType, LineFactoryProps} from "./types";
|
||||
import type * as T from "./types";
|
||||
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
||||
import {GlobalModel, GlobalCommandRunner, Session, Cmd, ScreenLines, Screen, riToRPtr, TabColors, RemoteColors} from "./model";
|
||||
@@ -1711,11 +1711,7 @@ class ClientStopModal extends React.Component<{}, {}> {
|
||||
render() {
|
||||
let model = GlobalModel;
|
||||
let cdata = model.clientData.get();
|
||||
let mdata : ClientMigrationInfo = (cdata != null ? cdata.migration : null);
|
||||
let title = "Client Not Ready";
|
||||
if (mdata != null) {
|
||||
title = "Migrating Data";
|
||||
}
|
||||
return (
|
||||
<div className="prompt-modal client-stop-modal modal is-active">
|
||||
<div className="modal-background"></div>
|
||||
@@ -1727,15 +1723,6 @@ class ClientStopModal extends React.Component<{}, {}> {
|
||||
<If condition={cdata == null}>
|
||||
<div>Cannot get client data.</div>
|
||||
</If>
|
||||
<If condition={cdata != null && cdata.cmdstoretype == "session"}>
|
||||
<div>Client database is being migrated to the latest version, please wait.</div>
|
||||
<If condition={mdata != null}>
|
||||
<div className="progress-container">
|
||||
<progress className="progress is-primary" value={mdata.migrationpos} max={mdata.migrationtotal}>{mdata.migrationpos}</progress>
|
||||
</div>
|
||||
<div className="progress-text">{mdata.migrationpos}/{mdata.migrationtotal}</div>
|
||||
</If>
|
||||
</If>
|
||||
</div>
|
||||
<footer>
|
||||
<button onClick={this.refreshClient} className="button">
|
||||
|
||||
+2
-4
@@ -5,7 +5,7 @@ import {debounce} from "throttle-debounce";
|
||||
import {handleJsonFetchResponse, base64ToArray, genMergeData, genMergeDataMap, genMergeSimpleData, boundInt, isModKeyPress} from "./util";
|
||||
import {TermWrap} from "./term";
|
||||
import {v4 as uuidv4} from "uuid";
|
||||
import type {SessionDataType, LineType, RemoteType, HistoryItem, RemoteInstanceType, RemotePtrType, CmdDataType, FeCmdPacketType, TermOptsType, RemoteStateType, ScreenDataType, ScreenOptsType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, UIContextType, HistoryInfoType, HistoryQueryOpts, FeInputPacketType, TermWinSize, RemoteInputPacketType, ContextMenuOpts, RendererContext, RendererModel, PtyDataType, BookmarkType, ClientDataType, HistoryViewDataType, AlertMessageType, HistorySearchParams, FocusTypeStrs, ScreenLinesType, HistoryTypeStrs, RendererPluginType, WindowSize, ClientMigrationInfo, WebShareOpts, TermContextUnion, RemoteEditType, RemoteViewType, CommandRtnType, WebCmd, WebRemote} from "./types";
|
||||
import type {SessionDataType, LineType, RemoteType, HistoryItem, RemoteInstanceType, RemotePtrType, CmdDataType, FeCmdPacketType, TermOptsType, RemoteStateType, ScreenDataType, ScreenOptsType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, UIContextType, HistoryInfoType, HistoryQueryOpts, FeInputPacketType, TermWinSize, RemoteInputPacketType, ContextMenuOpts, RendererContext, RendererModel, PtyDataType, BookmarkType, ClientDataType, HistoryViewDataType, AlertMessageType, HistorySearchParams, FocusTypeStrs, ScreenLinesType, HistoryTypeStrs, RendererPluginType, WindowSize, WebShareOpts, TermContextUnion, RemoteEditType, RemoteViewType, CommandRtnType, WebCmd, WebRemote} from "./types";
|
||||
import {WSControl} from "./ws";
|
||||
import {measureText, getMonoFontSize, windowWidthToCols, windowHeightToRows, termWidthFromCols, termHeightFromRows} from "./textmeasure";
|
||||
import dayjs from "dayjs";
|
||||
@@ -2457,7 +2457,6 @@ class Model {
|
||||
bookmarksModel : BookmarksModel;
|
||||
historyViewModel : HistoryViewModel;
|
||||
clientData : OV<ClientDataType> = mobx.observable.box(null, {name: "clientData"});
|
||||
clientMigrationInfo : OV<ClientMigrationInfo> = mobx.observable.box(null, {name: "clientMigrationInfo"});
|
||||
showLinks : OV<boolean> = mobx.observable.box(true, {name: "model-showLinks"});
|
||||
|
||||
constructor() {
|
||||
@@ -3154,9 +3153,8 @@ class Model {
|
||||
let fetchHeaders = this.getFetchHeaders();
|
||||
fetch(url, {method: "post", body: null, headers: fetchHeaders}).then((resp) => handleJsonFetchResponse(url, resp)).then((data) => {
|
||||
mobx.action(() => {
|
||||
let clientData = data.data;
|
||||
let clientData : ClientDataType = data.data;
|
||||
this.clientData.set(clientData);
|
||||
this.clientMigrationInfo.set(clientData.migration);
|
||||
})();
|
||||
}).catch((err) => {
|
||||
this.errorHandler("calling get-client-data", err, true);
|
||||
|
||||
+1
-9
@@ -449,7 +449,6 @@ type ClientDataType = {
|
||||
clientopts : ClientOptsType,
|
||||
cmdstoretype : "session" | "screen";
|
||||
dbversion : number,
|
||||
migration? : ClientMigrationInfo;
|
||||
openaiopts? : OpenAIOptsType,
|
||||
};
|
||||
|
||||
@@ -460,13 +459,6 @@ type OpenAIOptsType = {
|
||||
maxchoices? : number,
|
||||
};
|
||||
|
||||
type ClientMigrationInfo = {
|
||||
migrationtype : string,
|
||||
migrationpos : number,
|
||||
migrationtotal : number,
|
||||
migrationdone : boolean,
|
||||
};
|
||||
|
||||
type PlaybookType = {
|
||||
playbookid : string,
|
||||
playbookname : string,
|
||||
@@ -614,4 +606,4 @@ type OpenAIPacketType = {
|
||||
error : string,
|
||||
};
|
||||
|
||||
export type {SessionDataType, LineType, RemoteType, RemoteStateType, RemoteInstanceType, HistoryItem, CmdRemoteStateType, FeCmdPacketType, TermOptsType, CmdStartPacketType, CmdDataType, ScreenDataType, ScreenOptsType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, RemotePtrType, UIContextType, HistoryInfoType, HistoryQueryOpts, WatchScreenPacketType, TermWinSize, FeInputPacketType, RemoteInputPacketType, RemoteEditType, ContextMenuOpts, RendererContext, WindowSize, RendererModel, PtyDataType, BookmarkType, ClientDataType, PlaybookType, PlaybookEntryType, HistoryViewDataType, RenderModeType, AlertMessageType, HistorySearchParams, ScreenLinesType, FocusTypeStrs, HistoryTypeStrs, RendererOpts, RendererPluginType, SimpleBlobRendererComponent, RendererModelContainerApi, RendererModelInitializeParams, RendererOptsUpdate, ClientMigrationInfo, WebShareOpts, RemoteStatusTypeStrs, WebFullScreen, WebScreen, WebLine, WebCmd, RemoteTermContext, TermContextUnion, WebRemote, PtyDataUpdate, WebShareWSMessage, LineHeightChangeCallbackType, LineFactoryProps, LineInterface, RendererContainerType, RemoteViewType, CommandRtnType, OpenAIPacketType};
|
||||
export type {SessionDataType, LineType, RemoteType, RemoteStateType, RemoteInstanceType, HistoryItem, CmdRemoteStateType, FeCmdPacketType, TermOptsType, CmdStartPacketType, CmdDataType, ScreenDataType, ScreenOptsType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, RemotePtrType, UIContextType, HistoryInfoType, HistoryQueryOpts, WatchScreenPacketType, TermWinSize, FeInputPacketType, RemoteInputPacketType, RemoteEditType, ContextMenuOpts, RendererContext, WindowSize, RendererModel, PtyDataType, BookmarkType, ClientDataType, PlaybookType, PlaybookEntryType, HistoryViewDataType, RenderModeType, AlertMessageType, HistorySearchParams, ScreenLinesType, FocusTypeStrs, HistoryTypeStrs, RendererOpts, RendererPluginType, SimpleBlobRendererComponent, RendererModelContainerApi, RendererModelInitializeParams, RendererOptsUpdate, WebShareOpts, RemoteStatusTypeStrs, WebFullScreen, WebScreen, WebLine, WebCmd, RemoteTermContext, TermContextUnion, WebRemote, PtyDataUpdate, WebShareWSMessage, LineHeightChangeCallbackType, LineFactoryProps, LineInterface, RendererContainerType, RemoteViewType, CommandRtnType, OpenAIPacketType};
|
||||
|
||||
Reference in New Issue
Block a user