Update radial progress & fix build trigger log handling

- The radial progress now displays the percentage value correctly.
- In the build trigger, we now properly handle the end of a stream event and fixed an issue with the RadialProgressComponent when isBuilding is true.
This commit is contained in:
Cristhian Zanforlin Lousa 2023-06-21 14:04:35 -03:00
commit 7a46794f1d
2 changed files with 3 additions and 2 deletions

View file

@ -6,7 +6,7 @@ export default function RadialProgressComponent({
color, color,
}: RadialProgressType) { }: RadialProgressType) {
const style = { const style = {
"--value": value, "--value": value * 100,
"--size": "1.5rem", "--size": "1.5rem",
"--thickness": "2px", "--thickness": "2px",
} as React.CSSProperties; } as React.CSSProperties;

View file

@ -83,6 +83,7 @@ export default function BuildTrigger({
// if the event is the end of the stream, close the connection // if the event is the end of the stream, close the connection
if (parsedData.end_of_stream) { if (parsedData.end_of_stream) {
eventSource.close(); eventSource.close();
return; return;
} else if (parsedData.log) { } else if (parsedData.log) {
// If the event is a log, log it // If the event is a log, log it
@ -162,7 +163,7 @@ export default function BuildTrigger({
> >
<button> <button>
<div className="flex gap-3 items-center"> <div className="flex gap-3 items-center">
{isBuilding && myValue * 100 < 100 ? ( {isBuilding && myValue < 1 ? (
// Render your loading animation here when isBuilding is true // Render your loading animation here when isBuilding is true
<RadialProgressComponent <RadialProgressComponent
color={"text-orange-400"} color={"text-orange-400"}