diff --git a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/State.cs b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/State.cs
index 5a6e7936..9c3a6b36 100644
--- a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/State.cs
+++ b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/State.cs
@@ -30,4 +30,8 @@ public record TimelineState
/// Gets/sets a boolean value that indicates whether data is currently being gathered
///
public bool Loading { get; set; } = false;
+ ///
+ /// Gets/sets a boolean value that indicates whether to keep the previous chart's time frame or to redraw it with the new data boundaries
+ ///
+ public bool KeepTimeRange { get; set; } = false;
}
diff --git a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Store.cs b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Store.cs
index c14e1b1f..32a5d406 100644
--- a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Store.cs
+++ b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Store.cs
@@ -45,6 +45,11 @@ public class TimelineStore(ICloudStreamsCoreApiClient cloudStreamsApi)
///
public IObservable Loading => this.Select(state => state.Loading).DistinctUntilChanged();
+ ///
+ /// Gets an used to observe changes
+ ///
+ public IObservable KeepTimeRange => this.Select(state => state.KeepTimeRange).DistinctUntilChanged();
+
///
public override async Task InitializeAsync()
{
@@ -108,6 +113,16 @@ public void RemoveStreamsReadOption(int index)
});
}
+ ///
+ /// Toggles the state's
+ ///
+ public void ToggleKeepTimeRange()
+ {
+ this.Reduce(state => state with {
+ KeepTimeRange = !state.KeepTimeRange
+ });
+ }
+
///
/// Adds a for the provided if none already exists
///
diff --git a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor
index b8a22fa1..95cfb861 100644
--- a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor
+++ b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor
@@ -25,6 +25,12 @@
}
+