Skip to content

Commit

Permalink
fix: ui not loading full execution output (#1641)
Browse files Browse the repository at this point in the history
* fix: ui not loading full execution output
  • Loading branch information
vcastellm authored Jan 4, 2025
1 parent 0637194 commit 07e2181
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 50 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dkron/ui-dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
window.DKRON_FAILED_JOBS = {{.DKRON_FAILED_JOBS}};
window.DKRON_UNTRIGGERED_JOBS = {{.DKRON_UNTRIGGERED_JOBS}};
window.DKRON_ACL_ENABLED = {{.DKRON_ACL_ENABLED}};</script>
<script type="module" crossorigin src="./assets/index-6dc28a61.js"></script>
<script type="module" crossorigin src="./assets/index-a0a8ac74.js"></script>
<link rel="stylesheet" href="./assets/index-73a69410.css">
</head>

Expand Down
3 changes: 2 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"prettier": "^2.8.8",
"typescript": "^5.1.6",
"vite": "^4.3.9"
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
7 changes: 3 additions & 4 deletions ui/src/TagsField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Chip } from '@mui/material';
import { useRecordContext } from 'react-admin';

export const TagsField = ({ record }: any) => {
export const TagsField = () => {
const record = useRecordContext();
if (record === undefined) {
return null
} else {
Expand All @@ -11,6 +13,3 @@ export const TagsField = ({ record }: any) => {
</ul>
}
};
TagsField.defaultProps = {
addLabel: true
};
2 changes: 1 addition & 1 deletion ui/src/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Dashboard = () => (
<TextField source="Addr" sortable={false} />
<TextField source="Port" sortable={false} />
<TextField label="Status" source="statusText" sortable={false} />
<TagsField source="Tags" sortable={false} />
<TagsField source="Tags" />
</Datagrid>
</List>
</CardContent>
Expand Down
13 changes: 8 additions & 5 deletions ui/src/jobs/JobShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ const FullButton = ({record}: any) => {
setLoading(true);
httpClient(`${apiUrl}/jobs/${record.job_name}/executions/${record.id}`)
.then((response) => {
if (response.ok) {
if (response.status === 200) {
notify('Success loading full output');
return response.json()
return response.json
}
throw response
})
.then((data) => {
record.output_truncated = false
record.output = data.output
record.output_truncated = false;
record.output = data.output;
})
.catch((e) => {
notify('Error on loading full output', { type: 'warning' })
Expand All @@ -64,6 +64,9 @@ const FullButton = ({record}: any) => {
setLoading(false);
});
};

if (record.output_truncated === false) return record.output;

return (
<Button
label="Load full output"
Expand All @@ -72,7 +75,7 @@ const FullButton = ({record}: any) => {
>
<FullIcon/>
</Button>
);
)
};

const SpecialOutputPanel = () => {
Expand Down

0 comments on commit 07e2181

Please sign in to comment.