better repeat error parsing
This commit is contained in:
1 parent
f8f6d74d6a
commit
9184d1f7bd
8 files changed
+65
-31
No files matched your search
@@ -25,6 +25,11 @@
|
||||
|
||||
.automation-manager--metadatabox .metadatabox--title {
|
||||
flex: 1;
|
||||
max-width: calc(80% - 5em);
|
||||
}
|
||||
|
||||
.automation-manager--metadatabox .metadatabox--switch {
|
||||
width: 5em;
|
||||
}
|
||||
|
||||
.automation-manager--metadatabox .metadatabox--title .title {
|
||||
@@ -94,4 +99,5 @@
|
||||
.automation-manager--metadatabox .metadatabox--title--source .MuiChip-root {
|
||||
font-size: 0.85em;
|
||||
height: 2em;
|
||||
max-width: 60%;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import { AutomationManagerAuto } from "../types";
|
||||
import { Tags } from "./Tags";
|
||||
import { TagDB } from "../TagDB";
|
||||
import { Chip } from "@mui/material";
|
||||
import { Chip, Tooltip } from "@mui/material";
|
||||
|
||||
export type MetadataBoxProps = AutomationManagerAuto & {
|
||||
onDelete: () => void;
|
||||
@@ -55,7 +55,14 @@ export const MetadataBox: FC<MetadataBoxProps> = (props) => {
|
||||
title={`ID=${props.id}, EntityID=${props.entityId}`}
|
||||
>
|
||||
<span className="metadatabox--title--source">
|
||||
<Chip label={`@${props.source_file} (${props.source_file_type})`} />
|
||||
<Tooltip
|
||||
title={`This automation is located in the file ${props.source_file} and is set up in your configuration.yaml file under the key ${props.configuration_key}.`}
|
||||
>
|
||||
<Chip
|
||||
label={`@${props.source_file} (${props.source_file_type})`}
|
||||
className="text-ellipsis"
|
||||
/>
|
||||
</Tooltip>
|
||||
</span>
|
||||
<InputTextView
|
||||
className="title"
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.automation-manager.error>code {
|
||||
padding: 1.5em;
|
||||
}
|
||||
|
||||
.automation-manager.loading .automation-manager--sidebar.loading {
|
||||
width: 25vh;
|
||||
height: 100%;
|
||||
|
||||
@@ -195,13 +195,20 @@ export const AutomationManager: FC<AutomationManagerProps> = ({
|
||||
}
|
||||
|
||||
if (!api.state.automations.ok) {
|
||||
let error = api.state.automations.error;
|
||||
try {
|
||||
const errorObj = JSON.parse(api.state.automations.error);
|
||||
if ("detail" in errorObj) {
|
||||
error = errorObj["detail"];
|
||||
}
|
||||
} catch (_: any) {}
|
||||
return (
|
||||
<div className="automation-manager error">
|
||||
<Alert color="error">
|
||||
Failed to load automations from <code>/config</code>
|
||||
</Alert>{" "}
|
||||
<br />
|
||||
<code>{api.state.automations.error}</code>
|
||||
<code>{error}</code>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user