mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
Merge branch 'main' of github.com:wavetermdev/waveterm into red/aichat-sidebar
This commit is contained in:
@@ -104,15 +104,11 @@ class AIChat extends React.Component<{}, {}> {
|
||||
}
|
||||
|
||||
onTextAreaFocused(e: any) {
|
||||
mobx.action(() => {
|
||||
GlobalModel.inputModel.setAuxViewFocus(true);
|
||||
})();
|
||||
GlobalModel.inputModel.setAuxViewFocus(true);
|
||||
}
|
||||
|
||||
onTextAreaBlur(e: any) {
|
||||
mobx.action(() => {
|
||||
GlobalModel.inputModel.setAuxViewFocus(false);
|
||||
})();
|
||||
GlobalModel.inputModel.setAuxViewFocus(false);
|
||||
}
|
||||
|
||||
// Adjust the height of the textarea to fit the text
|
||||
|
||||
@@ -16,11 +16,12 @@ interface AuxiliaryCmdViewProps {
|
||||
titleBarContents?: React.ReactElement[];
|
||||
children?: React.ReactNode;
|
||||
onClose?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onScrollbarInitialized?: () => void;
|
||||
scrollable?: boolean;
|
||||
}
|
||||
|
||||
export const AuxiliaryCmdView: React.FC<AuxiliaryCmdViewProps> = observer((props) => {
|
||||
const { title, className, iconClass, titleBarContents, children, onClose } = props;
|
||||
const { title, className, iconClass, titleBarContents, children, onClose, onScrollbarInitialized } = props;
|
||||
|
||||
return (
|
||||
<div className={cn("auxview", className)}>
|
||||
@@ -50,6 +51,8 @@ export const AuxiliaryCmdView: React.FC<AuxiliaryCmdViewProps> = observer((props
|
||||
<OverlayScrollbarsComponent
|
||||
className="auxview-content"
|
||||
options={{ scrollbars: { autoHide: "leave" } }}
|
||||
defer={true}
|
||||
events={{ initialized: onScrollbarInitialized }}
|
||||
>
|
||||
{children}
|
||||
</OverlayScrollbarsComponent>
|
||||
|
||||
@@ -73,7 +73,6 @@ class CmdInput extends React.Component<{}, {}> {
|
||||
return;
|
||||
}
|
||||
GlobalModel.inputModel.setAuxViewFocus(false);
|
||||
GlobalModel.inputModel.giveFocus();
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
@@ -232,12 +231,7 @@ class CmdInput extends React.Component<{}, {}> {
|
||||
</Button>
|
||||
</div>
|
||||
</If>
|
||||
<div
|
||||
key="base-cmdinput"
|
||||
className="base-cmdinput"
|
||||
onClick={this.baseCmdInputClick}
|
||||
onSelect={this.baseCmdInputClick}
|
||||
>
|
||||
<div key="base-cmdinput" className="base-cmdinput" onClick={this.baseCmdInputClick}>
|
||||
<div className="cmdinput-actions">
|
||||
<If condition={numRunningLines > 0}>
|
||||
<div
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
.history-items {
|
||||
color: var(--app-text-color);
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
|
||||
.history-item {
|
||||
cursor: pointer;
|
||||
|
||||
@@ -154,7 +154,11 @@ class HistoryInfo extends React.Component<{}, {}> {
|
||||
lastClickTs: number = 0;
|
||||
containingText: mobx.IObservableValue<string> = mobx.observable.box("");
|
||||
|
||||
componentDidMount() {
|
||||
/**
|
||||
* Handles the OverlayScrollbars initialization event to set the scroll position without it being overridden.
|
||||
*/
|
||||
@boundMethod
|
||||
handleScrollbarInitialized() {
|
||||
const inputModel = GlobalModel.inputModel;
|
||||
let hitem = inputModel.getHistorySelectedItem();
|
||||
if (hitem == null) {
|
||||
@@ -225,7 +229,7 @@ class HistoryInfo extends React.Component<{}, {}> {
|
||||
render() {
|
||||
const inputModel = GlobalModel.inputModel;
|
||||
const selItem = inputModel.getHistorySelectedItem();
|
||||
const hitems = inputModel.getFilteredHistoryItems().slice().reverse();
|
||||
const hitems = inputModel.getFilteredHistoryItems();
|
||||
const opts = inputModel.historyQueryOpts.get();
|
||||
let hitem: HistoryItem = null;
|
||||
let snames: Record<string, string> = {};
|
||||
@@ -244,6 +248,7 @@ class HistoryInfo extends React.Component<{}, {}> {
|
||||
titleBarContents={this.getTitleBarContents()}
|
||||
iconClass="fa-sharp fa-solid fa-clock-rotate-left"
|
||||
scrollable={true}
|
||||
onScrollbarInitialized={this.handleScrollbarInitialized}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
|
||||
+1
-2
@@ -152,7 +152,7 @@ class InputModel {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "aichat":
|
||||
case appconst.InputAuxView_AIChat:
|
||||
this.setAIChatFocus();
|
||||
break;
|
||||
case null: {
|
||||
@@ -550,7 +550,6 @@ class InputModel {
|
||||
|
||||
if (info != null && timeoutMs) {
|
||||
this.infoTimeoutId = setTimeout(() => {
|
||||
console.log("clearing info msg");
|
||||
if (this.activeAuxView.get() != appconst.InputAuxView_Info) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1180,7 +1180,7 @@ func main() {
|
||||
gr.HandleFunc("/api/log-active-state", AuthKeyWrap(HandleLogActiveState))
|
||||
gr.HandleFunc("/api/read-file", AuthKeyWrapAllowHmac(HandleReadFile))
|
||||
gr.HandleFunc("/api/write-file", AuthKeyWrap(HandleWriteFile)).Methods("POST")
|
||||
configPath := filepath.Join(scbase.GetWaveHomeDir(), "config") + strconv.QuoteRune(filepath.Separator)
|
||||
configPath := filepath.Join(scbase.GetWaveHomeDir(), "config") + string(filepath.Separator)
|
||||
log.Printf("[wave] config path: %q\n", configPath)
|
||||
isFileHandler := http.StripPrefix("/config/", http.FileServer(http.Dir(configPath)))
|
||||
isDirHandler := http.HandlerFunc(configDirHandler)
|
||||
|
||||
@@ -2735,7 +2735,7 @@ func doOpenAICmdInfoCompletion(cmd *sstore.CmdType, clientId string, opts *sstor
|
||||
}
|
||||
writePacketToUpdateBus(ctx, cmd, asstMessagePk)
|
||||
packetTimeout := OpenAIPacketTimeout
|
||||
if opts.Timeout >= 0 {
|
||||
if opts.Timeout > 0 {
|
||||
packetTimeout = time.Duration(opts.Timeout) * time.Millisecond
|
||||
}
|
||||
doneWaitingForPackets := false
|
||||
@@ -2830,7 +2830,7 @@ func doOpenAIStreamCompletion(cmd *sstore.CmdType, clientId string, opts *sstore
|
||||
return
|
||||
}
|
||||
packetTimeout := OpenAIPacketTimeout
|
||||
if opts.Timeout >= 0 {
|
||||
if opts.Timeout > 0 {
|
||||
packetTimeout = time.Duration(opts.Timeout) * time.Millisecond
|
||||
}
|
||||
doneWaitingForPackets := false
|
||||
|
||||
Reference in New Issue
Block a user