Started at
- @(WorkflowInstance.Status?.StartedAt?.DateTime.FromNow() ?? "-")
+ @(workflowInstance.Status?.StartedAt?.DateTime.FromNow() ?? "-")
Ended at
- @(WorkflowInstance.Status?.EndedAt?.DateTime.FromNow() ?? "-")
+ @(workflowInstance.Status?.EndedAt?.DateTime.FromNow() ?? "-")
Duration
- @if (WorkflowInstance.Status?.StartedAt.HasValue == true && WorkflowInstance.Status?.EndedAt.HasValue == true)
+ @if (workflowInstance.Status?.StartedAt.HasValue == true && workflowInstance.Status?.EndedAt.HasValue == true)
{
- @WorkflowInstance.Status.EndedAt.Value.Subtract(WorkflowInstance.Status.StartedAt.Value).ToString("hh\\:mm\\:ss\\.fff")
+ @workflowInstance.Status.EndedAt.Value.Subtract(workflowInstance.Status.StartedAt.Value).ToString("hh\\:mm\\:ss\\.fff")
}
else
{
@@ -42,27 +56,20 @@
}
-
-
-
-
-
-
-
- @if (WorkflowInstance.Status?.Error != null)
+
+
+
+ @if (workflowInstance.Status?.Error != null)
{
-
+
}
else
{
-
+
}
-
-
Executed Tasks
- @if (WorkflowInstance.Status?.Tasks == null || WorkflowInstance.Status.Tasks.Count == 0)
+
Executed Tasks
+ @if (workflowInstance.Status?.Tasks == null || workflowInstance.Status.Tasks.Count == 0)
{
@("-")
}
@@ -79,15 +86,15 @@
- @foreach (var task in WorkflowInstance.Status.Tasks)
+ @foreach (var task in workflowInstance.Status.Tasks)
{
}
}
-
Runs
- @if (WorkflowInstance.Status?.Runs == null || WorkflowInstance.Status.Runs.Count == 0)
+
Runs
+ @if (workflowInstance.Status?.Runs == null || workflowInstance.Status.Runs.Count == 0)
{
@("-")
}
@@ -102,7 +109,7 @@
- @foreach (var run in WorkflowInstance.Status.Runs)
+ @foreach (var run in workflowInstance.Status.Runs)
{
@run.StartedAt.DateTime.FromNow() |
@@ -113,15 +120,15 @@
}
-
Correlation
- @if (WorkflowInstance.Status?.Correlation == null)
+
Correlation
+ @if (workflowInstance.Status?.Correlation == null)
{
@("-")
}
else
{
Keys
- @if (WorkflowInstance.Status?.Correlation?.Keys == null || WorkflowInstance.Status.Correlation.Keys.Count == 0)
+ @if (workflowInstance.Status?.Correlation?.Keys == null || workflowInstance.Status.Correlation.Keys.Count == 0)
{
@("-")
}
@@ -135,7 +142,7 @@
- @foreach (var keyValuePair in WorkflowInstance.Status.Correlation.Keys)
+ @foreach (var keyValuePair in workflowInstance.Status.Correlation.Keys)
{
@keyValuePair.Key |
@@ -146,7 +153,7 @@
}
Contexts
- @if (WorkflowInstance.Status?.Correlation?.Contexts == null || WorkflowInstance.Status.Correlation.Contexts.Count == 0)
+ @if (workflowInstance.Status?.Correlation?.Contexts == null || workflowInstance.Status.Correlation.Contexts.Count == 0)
{
@("-")
}
@@ -161,7 +168,7 @@
- @foreach (var keyValuePair in WorkflowInstance.Status.Correlation.Contexts)
+ @foreach (var keyValuePair in workflowInstance.Status.Correlation.Contexts)
{
}
@@ -169,231 +176,41 @@
}
}
- Logs
+ Logs
-
-
- Raw
-
-
-
-
+ Raw
+
}
@code {
+ private WorkflowInstance? workflowInstance;
[Parameter] public WorkflowInstance? WorkflowInstance { get; set; }
+
+ protected override void OnParametersSet()
+ {
+ base.OnParametersSet();
+ if (WorkflowInstance != workflowInstance)
+ {
+ workflowInstance = WorkflowInstance;
+ }
+ }
+
+ ///
+ /// Gets the css class for the provided 's status
+ ///
+ /// The instance to get the status of
+ ///
+ string GetStatusClass(WorkflowInstance instance)
+ {
+ return instance.Status?.Phase switch
+ {
+ WorkflowInstanceStatusPhase.Running => "border-accent text-accent",
+ WorkflowInstanceStatusPhase.Faulted => "border-danger text-danger",
+ WorkflowInstanceStatusPhase.Cancelled => "border-warning text-warning",
+ WorkflowInstanceStatusPhase.Completed => "border-success text-success",
+ WorkflowInstanceStatusPhase.Waiting => "border-cinereous text-cinereous",
+ _ => ""
+ };
+ }
}
diff --git a/src/dashboard/Synapse.Dashboard/Components/WorkflowInstancesList/WorkflowInstancesList.razor b/src/dashboard/Synapse.Dashboard/Components/WorkflowInstancesList/WorkflowInstancesList.razor
index bf3220d9a..50edabc1d 100644
--- a/src/dashboard/Synapse.Dashboard/Components/WorkflowInstancesList/WorkflowInstancesList.razor
+++ b/src/dashboard/Synapse.Dashboard/Components/WorkflowInstancesList/WorkflowInstancesList.razor
@@ -62,7 +62,7 @@
@if (WorkflowInstances != null && WorkflowInstances.Any())
{
- await OnShowClickedAsync(instance)" class="cursor-pointer">
+
await OnShowClickedAsync(instance)" class="cursor-pointer @(ActiveRow == instance.GetName() ? "table-active" : "")">
@foreach (var column in columns)
{
if (Columns.Count() == 0 || Columns.Contains(column))
@@ -133,6 +133,7 @@
[Parameter] public IEnumerable? WorkflowInstances { get; set; }
[Parameter] public IEnumerable? Workflows { get; set; }
[Parameter] public IEnumerable? Namespaces { get; set; }
+ [Parameter] public string? ActiveRow { get; set; }
[Parameter] public EventCallback OnWorkflowChanged { get; set; }
[Parameter] public EventCallback OnNamespaceChanged { get; set; }
diff --git a/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/Store.cs b/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/Store.cs
index 640746998..c740c64b3 100644
--- a/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/Store.cs
+++ b/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/Store.cs
@@ -112,9 +112,9 @@ IYamlSerializer yamlSerializer
}
return null;
}
- return workflow.Spec.Versions.Get(version);
+ return workflow.Spec.Versions.Get(version)?.Clone();
}
- );
+ ).DistinctUntilChanged();
///
/// Gets an used to observe changes
@@ -137,9 +137,9 @@ IYamlSerializer yamlSerializer
{
return null;
}
- return instances.FirstOrDefault(instance => instance.Metadata.Name == name);
+ return instances.FirstOrDefault(instance => instance.Metadata.Name == name)?.Clone();
}
- );
+ ).DistinctUntilChanged();
#endregion
#region Setters
@@ -290,7 +290,7 @@ public override async Task InitializeAsync()
this.WorkflowDefinition.Where(definition => definition != null).SubscribeAsync(async (definition) =>
{
await Task.Delay(1);
- var document = this.JsonSerializer.SerializeToText(definition);
+ var document = this.JsonSerializer.SerializeToText(definition.Clone());
this.Reduce(state => state with
{
WorkflowDefinitionJson = document
diff --git a/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor b/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor
index 32412150d..63861f16f 100644
--- a/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor
+++ b/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor
@@ -30,10 +30,11 @@