mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-03-01 03:51:59 +01:00
Frontend S3 Improvements (#2018)
This adds the following changes: - S3 icons have been changed to the database icon - S3 icons always show up in green - frontend crash errors are now wrapped within their block - fileinfo errors have a special case view and display the error in the modal
This commit is contained in:
parent
b5a7288330
commit
1a90474830
@ -72,11 +72,12 @@ a.plain-link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.error-boundary {
|
.error-boundary {
|
||||||
|
white-space: pre-wrap;
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-color {
|
.error-color {
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* OverlayScrollbars styling */
|
/* OverlayScrollbars styling */
|
||||||
|
@ -127,12 +127,10 @@ function createS3SuggestionItems(
|
|||||||
// behavior
|
// behavior
|
||||||
return s3Profiles.map((profileName) => {
|
return s3Profiles.map((profileName) => {
|
||||||
const connStatus = connStatusMap.get(profileName);
|
const connStatus = connStatusMap.get(profileName);
|
||||||
const connColorNum = computeConnColorNum(connStatus);
|
|
||||||
const item: SuggestionConnectionItem = {
|
const item: SuggestionConnectionItem = {
|
||||||
status: "connected",
|
status: "connected",
|
||||||
icon: "arrow-right-arrow-left",
|
icon: "database",
|
||||||
iconColor:
|
iconColor: "var(--accent-color)",
|
||||||
connStatus?.status == "connected" ? `var(--conn-icon-color-${connColorNum})` : "var(--grey-text-color)",
|
|
||||||
value: profileName,
|
value: profileName,
|
||||||
label: profileName,
|
label: profileName,
|
||||||
current: profileName == connection,
|
current: profileName == connection,
|
||||||
|
@ -485,7 +485,11 @@ export class PreviewModel implements ViewModel {
|
|||||||
const fileName = fileInfo?.name;
|
const fileName = fileInfo?.name;
|
||||||
const connErr = getFn(this.connectionError);
|
const connErr = getFn(this.connectionError);
|
||||||
const editMode = getFn(this.editMode);
|
const editMode = getFn(this.editMode);
|
||||||
|
const genErr = getFn(this.errorMsgAtom);
|
||||||
|
|
||||||
|
if (!fileInfo) {
|
||||||
|
return { errorStr: `Load Error: ${genErr?.text}` };
|
||||||
|
}
|
||||||
if (connErr != "") {
|
if (connErr != "") {
|
||||||
return { errorStr: `Connection Error: ${connErr}` };
|
return { errorStr: `Connection Error: ${connErr}` };
|
||||||
}
|
}
|
||||||
@ -1072,10 +1076,14 @@ function PreviewView({
|
|||||||
const filePath = useAtomValue(model.metaFilePath);
|
const filePath = useAtomValue(model.metaFilePath);
|
||||||
const [errorMsg, setErrorMsg] = useAtom(model.errorMsgAtom);
|
const [errorMsg, setErrorMsg] = useAtom(model.errorMsgAtom);
|
||||||
const connection = useAtomValue(model.connectionImmediate);
|
const connection = useAtomValue(model.connectionImmediate);
|
||||||
|
const fileInfo = useAtomValue(model.statFile);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!fileInfo) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
setErrorMsg(null);
|
setErrorMsg(null);
|
||||||
}, [connection, filePath]);
|
}, [connection, filePath, fileInfo]);
|
||||||
|
|
||||||
if (connStatus?.status != "connected") {
|
if (connStatus?.status != "connected") {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user