mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
change cursorAccent to cursor to match xtermjs. (#968)
also add more feedback for waveai -- tooltips + icon for local/cloud. also use 'ai:name' correctly
This commit is contained in:
parent
1bd2fe83cb
commit
b490113a87
@ -110,18 +110,47 @@ export class WaveAiModel implements ViewModel {
|
|||||||
set(this.updateLastMessageAtom, "", false);
|
set(this.updateLastMessageAtom, "", false);
|
||||||
});
|
});
|
||||||
this.viewText = atom((get) => {
|
this.viewText = atom((get) => {
|
||||||
|
const viewTextChildren: HeaderElem[] = [];
|
||||||
const settings = get(atoms.settingsAtom);
|
const settings = get(atoms.settingsAtom);
|
||||||
const isCloud = isBlank(settings?.["ai:apitoken"]) && isBlank(settings?.["ai:baseurl"]);
|
const isCloud = isBlank(settings?.["ai:apitoken"]) && isBlank(settings?.["ai:baseurl"]);
|
||||||
let modelText = "gpt-4o-mini";
|
let modelText = "gpt-4o-mini";
|
||||||
if (!isCloud && !isBlank(settings?.["ai:model"])) {
|
if (!isCloud && !isBlank(settings?.["ai:model"])) {
|
||||||
modelText = settings["ai:model"];
|
if (!isBlank(settings?.["ai:name"])) {
|
||||||
|
modelText = settings["ai:name"];
|
||||||
|
} else {
|
||||||
|
modelText = settings["ai:model"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const viewTextChildren: HeaderElem[] = [
|
if (isCloud) {
|
||||||
{
|
viewTextChildren.push({
|
||||||
elemtype: "text",
|
elemtype: "iconbutton",
|
||||||
text: modelText,
|
icon: "cloud",
|
||||||
},
|
title: "Using Wave's AI Proxy (gpt-4o-mini)",
|
||||||
];
|
disabled: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const baseUrl = settings["ai:baseurl"] ?? "OpenAI Default Endpoint";
|
||||||
|
const modelName = settings["ai:model"];
|
||||||
|
if (baseUrl.startsWith("http://localhost") || baseUrl.startsWith("http://127.0.0.1")) {
|
||||||
|
viewTextChildren.push({
|
||||||
|
elemtype: "iconbutton",
|
||||||
|
icon: "location-dot",
|
||||||
|
title: "Using Local Model @ " + baseUrl + " (" + modelName + ")",
|
||||||
|
disabled: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
viewTextChildren.push({
|
||||||
|
elemtype: "iconbutton",
|
||||||
|
icon: "globe",
|
||||||
|
title: "Using Remote Model @ " + baseUrl + " (" + modelName + ")",
|
||||||
|
disabled: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
viewTextChildren.push({
|
||||||
|
elemtype: "text",
|
||||||
|
text: modelText,
|
||||||
|
});
|
||||||
return viewTextChildren;
|
return viewTextChildren;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
2
frontend/types/gotypes.d.ts
vendored
2
frontend/types/gotypes.d.ts
vendored
@ -515,7 +515,7 @@ declare global {
|
|||||||
foreground: string;
|
foreground: string;
|
||||||
selectionBackground: string;
|
selectionBackground: string;
|
||||||
background: string;
|
background: string;
|
||||||
cursorAccent: string;
|
cursor: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
// wshrpc.TimeSeriesData
|
// wshrpc.TimeSeriesData
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"foreground": "#c1c1c1",
|
"foreground": "#c1c1c1",
|
||||||
"selectionBackground": "",
|
"selectionBackground": "",
|
||||||
"background": "#00000077",
|
"background": "#00000077",
|
||||||
"cursorAccent": ""
|
"cursor": ""
|
||||||
},
|
},
|
||||||
"dracula": {
|
"dracula": {
|
||||||
"display:name": "Dracula",
|
"display:name": "Dracula",
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"foreground": "#F8F8F2",
|
"foreground": "#F8F8F2",
|
||||||
"selectionBackground": "#44475a",
|
"selectionBackground": "#44475a",
|
||||||
"background": "#282a36",
|
"background": "#282a36",
|
||||||
"cursorAccent": "#f8f8f2"
|
"cursor": "#f8f8f2"
|
||||||
},
|
},
|
||||||
"monokai": {
|
"monokai": {
|
||||||
"display:name": "Monokai",
|
"display:name": "Monokai",
|
||||||
@ -75,7 +75,7 @@
|
|||||||
"foreground": "#F8F8F2",
|
"foreground": "#F8F8F2",
|
||||||
"selectionBackground": "#49483E",
|
"selectionBackground": "#49483E",
|
||||||
"background": "#272822",
|
"background": "#272822",
|
||||||
"cursorAccent": "#F8F8F2"
|
"cursor": "#F8F8F2"
|
||||||
},
|
},
|
||||||
"campbell": {
|
"campbell": {
|
||||||
"display:name": "Campbell",
|
"display:name": "Campbell",
|
||||||
@ -101,6 +101,6 @@
|
|||||||
"foreground": "#CCCCCC",
|
"foreground": "#CCCCCC",
|
||||||
"selectionBackground": "#3A96DD",
|
"selectionBackground": "#3A96DD",
|
||||||
"background": "#0C0C0C",
|
"background": "#0C0C0C",
|
||||||
"cursorAccent": "#CCCCCC"
|
"cursor": "#CCCCCC"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -392,5 +392,5 @@ type TermThemeType struct {
|
|||||||
Foreground string `json:"foreground"`
|
Foreground string `json:"foreground"`
|
||||||
SelectionBackground string `json:"selectionBackground"`
|
SelectionBackground string `json:"selectionBackground"`
|
||||||
Background string `json:"background"`
|
Background string `json:"background"`
|
||||||
CursorAccent string `json:"cursorAccent"`
|
Cursor string `json:"cursor"`
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user