+
{WorkflowMenuSection({
onDelete: handleDeleteClick,
onRun: handleRunClick,
@@ -404,177 +401,31 @@ function WorkflowTile({ workflow }: { workflow: Workflow }) {
workflow,
})}
-
-
-
- {workflow.description}
-
-
-
-
-
- Created By
- {workflow.created_by}
-
-
- Created At
-
- {workflow.creation_time
- ? new Date(workflow.creation_time + "Z").toLocaleString()
- : "N/A"}
-
-
-
- Last Updated
-
- {workflow.last_updated
- ? new Date(workflow.last_updated + "Z").toLocaleString()
- : "N/A"}
-
-
-
- Last Execution
-
- {workflow.last_execution_time
- ? new Date(workflow.last_execution_time + "Z").toLocaleString()
- : "N/A"}
-
-
-
- Last Status
-
- {workflow.last_execution_status
- ? workflow.last_execution_status
- : "N/A"}
-
-
-
-
-
-
- Triggers:
- {triggerTypes.map((t) => {
- if (t === "alert") {
- const handleImageError = (event: any) => {
- event.target.href.baseVal = "/icons/keep-icon.png";
- };
- const alertSource = workflow.triggers
- .find((w) => w.type === "alert")
- ?.filters?.find((f) => f.key === "source")?.value;
- const DynamicIcon = (props: any) => (
-
- );
- return (
-
- {t}
-
- );
+
+
+
+
{workflow?.name || 'Unknown'}{'testing the flow with large text'}
+
+
+
+
+
+ {workflow?.last_execution_started ? (
+
+ ) : null
+ // (
+ //
+ // )
}
- return (
-
- {t}
-
- );
- })}
-
-
- {workflow.triggers.length > 0 ? (
-
- {workflow.triggers.map((trigger, index) => (
-
- ))}
-
- ) : (
-
- This workflow does not have any triggers.
-
- )}
-
-
-
-
- Providers:
-
- {uniqueProviders.map((provider) => (
-
- ))}
-
-
-
- {selectedProvider && (
-
- )}
-
- */}
- {/*
*/}
- {/* */}
- {/*
-
- {WorkflowMenuSection({
- onDelete: handleDeleteClick,
- onRun: handleRunClick,
- onDownload: handleDownloadClick,
- onView: handleViewClick,
- onBuilder: handleBuilderClick,
- workflow,
- })}
-
-
-
-
{'My amzing worflow example' || workflow?.name}
-
-
-
- 4h 2mins ago
+
- */}
-
+ */}
+
{WorkflowMenuSection({
onDelete: handleDeleteClick,
@@ -585,24 +436,27 @@ function WorkflowTile({ workflow }: { workflow: Workflow }) {
workflow,
})}
-
-
-
{workflow?.name || 'Unknown'}
-
-
-
-
+
+
+
+
{workflow?.name || 'Unknown'}
+
+
+
+
+
+ {workflow?.last_execution_started ? (
+
+ ) : null
+ }
- {workflow?.last_execution_started ?
: null}
-
- {/*
4h 2mins ago */}
-
+
{
- const chartData = {
- labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
- datasets: [
- {
- label: 'Execution Time (mins)',
- data: [1, 3, 5, 2, 10],
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
- borderColor: 'rgba(255, 99, 132, 1)',
- borderWidth: 1,
- },
- ],
- };
-
- const chartOptions = {
- scales: {
- x: {
- beginAtZero: true,
- },
- y: {
- beginAtZero: true,
- },
- },
- };
-
- return (
-
-
-
{workflow?.name}
-
-
-
-
-
- );
-};
-
const show_real_data = true
const demoLabels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
@@ -750,34 +565,30 @@ const getBorderColors = (lastExecutions: { status: string, execution_time: numbe
})
}
-
const WorkflowGraph = ({ workflow }) => {
-
const lastExecutions = useMemo(() => {
- // Reverse the array only once when it's fetched
const reversedExecutions = workflow?.last_executions?.slice(0, 15) || [];
return reversedExecutions.reverse();
- }, [workflow?.last_executions]); // Depend on workflow?.last_executions for change detection
+ }, [workflow?.last_executions]);
- // Memoize the padded executions to prevent unnecessary recomputation
const hasNoData = !lastExecutions || lastExecutions.length === 0;
const chartData = {
labels: getLabels(lastExecutions),
datasets: [
{
- label: 'Execution Time (mins)',
+ label: "Execution Time (mins)",
data: getDataValues(lastExecutions),
backgroundColor: getBackgroundColors(lastExecutions),
borderColor: getBorderColors(lastExecutions),
borderWidth: {
- top: 2, // Thicker top border
- right: 0,
- bottom: 0,
- left: 0,
- },
- borderSkipped: 'bottom', // Skips border on the bottom
- categoryPercentage: 0.4,
+ top: 2,
+ right: 0,
+ bottom: 0,
+ left: 0,
+ },
+ barPercentage: 0.6, // Adjust this value to control bar width
+ // categoryPercentage: 0.8, // Adjust this value to control space between bars
},
],
};
@@ -787,35 +598,37 @@ const WorkflowGraph = ({ workflow }) => {
x: {
beginAtZero: true,
ticks: {
- display: false, // Hide x-axis labels
+ display: false,
},
grid: {
- display: false, // Hide x-axis grid lines
+ display: false,
},
border: {
- display: false, // Hide x-axis border line
+ display: false,
},
},
y: {
beginAtZero: true,
ticks: {
- display: false, // Hide y-axis labels
+ display: false,
},
grid: {
- display: false, // Hide y-axis grid lines
+ display: false,
},
border: {
- display: false, // Hide y-axis border line
+ display: false,
},
},
},
plugins: {
legend: {
- display: false, // Hide the legend
+ display: false,
},
},
responsive: true,
maintainAspectRatio: false,
+ barPercentage: 0.7, // Adjust this value to control bar width
+ categoryPercentage: 0.8, // Adjust this value to control space between bars
};
const status = workflow?.last_execution_status?.toLowerCase() || null;
@@ -830,12 +643,12 @@ const WorkflowGraph = ({ workflow }) => {
/>
);
switch (status) {
- case 'success':
+ case "success":
icon = ;
break;
- case 'failed':
- case 'fail':
- case 'failure':
+ case "failed":
+ case "fail":
+ case "failure":
icon = ;
break;
default:
@@ -843,15 +656,17 @@ const WorkflowGraph = ({ workflow }) => {
}
return (
-
- {!hasNoData || !show_real_data &&
{icon}
}
-
- {hasNoData && show_real_data ? (
+
+
{!hasNoData && icon}
+
+ {hasNoData ? (
No data available
) : (
-
+
+
+
)}
diff --git a/keep-ui/app/workflows/workflows.client.tsx b/keep-ui/app/workflows/workflows.client.tsx
index be8602a6b..6a1da53ab 100644
--- a/keep-ui/app/workflows/workflows.client.tsx
+++ b/keep-ui/app/workflows/workflows.client.tsx
@@ -255,7 +255,7 @@ export default function WorkflowsPage() {
{data.length === 0 ? (
) : (
-
+
{data.map((workflow) => (
))}