|
@@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Components;
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
-using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace CronAlarm.Pages
|
|
namespace CronAlarm.Pages
|
|
|
{
|
|
{
|
|
@@ -13,7 +12,7 @@ namespace CronAlarm.Pages
|
|
|
private Alerts Config { get; set; }
|
|
private Alerts Config { get; set; }
|
|
|
|
|
|
|
|
[Inject]
|
|
[Inject]
|
|
|
- private ICrontFragmentHandler CronFragmentHandler { get; set; }
|
|
|
|
|
|
|
+ private ICronSectionHandler CronFragmentHandler { get; set; }
|
|
|
|
|
|
|
|
private IDictionary<string, int> SelectedOptions { get; set; } = new Dictionary<string, int>();
|
|
private IDictionary<string, int> SelectedOptions { get; set; } = new Dictionary<string, int>();
|
|
|
|
|
|
|
@@ -59,12 +58,17 @@ namespace CronAlarm.Pages
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- CronFragmentHandler.Update(alerts);
|
|
|
|
|
|
|
+ ResetGroups(CronFragmentHandler.Update(alerts));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void Reset()
|
|
private void Reset()
|
|
|
{
|
|
{
|
|
|
- var current = CronFragmentHandler.GetExpressions().ToHashSet();
|
|
|
|
|
|
|
+ ResetGroups(CronFragmentHandler.GetExpressions());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void ResetGroups(IEnumerable<string> cronLines)
|
|
|
|
|
+ {
|
|
|
|
|
+ var current = cronLines.ToHashSet();
|
|
|
|
|
|
|
|
foreach (var group in Config.Groups)
|
|
foreach (var group in Config.Groups)
|
|
|
{
|
|
{
|