|
@@ -0,0 +1,48 @@
|
|
|
|
|
+using CronAlarm.Config;
|
|
|
|
|
+using Microsoft.AspNetCore.Components;
|
|
|
|
|
+using System;
|
|
|
|
|
+using System.Collections.Generic;
|
|
|
|
|
+using System.Linq;
|
|
|
|
|
+using System.Threading.Tasks;
|
|
|
|
|
+
|
|
|
|
|
+namespace CronAlarm.Pages
|
|
|
|
|
+{
|
|
|
|
|
+ public partial class AlertSelection : IComponent
|
|
|
|
|
+ {
|
|
|
|
|
+ [Inject]
|
|
|
|
|
+ private AlertConfig Config { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ private IDictionary<string, int> SelectedOptions { get; set; } = new Dictionary<string, int>();
|
|
|
|
|
+
|
|
|
|
|
+ public AlertSelection()
|
|
|
|
|
+ {
|
|
|
|
|
+ SelectedOptions["Weekdays"] = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void ToggleOption(string group, int index)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (SelectedOptions.ContainsKey(group) && SelectedOptions[group] == index)
|
|
|
|
|
+ {
|
|
|
|
|
+ // set to "unselected"
|
|
|
|
|
+ index = -1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ SelectedOptions[group] = index;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private string ActiveClass(string group, int index)
|
|
|
|
|
+ {
|
|
|
|
|
+ return SelectedOptions.ContainsKey(group) && SelectedOptions[group] == index ? "active" : string.Empty;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void Save()
|
|
|
|
|
+ {
|
|
|
|
|
+ //this.
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void Reset()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|