Update On Mon Oct 21 20:36:26 CEST 2024

This commit is contained in:
github-action[bot]
2024-10-21 20:36:27 +02:00
parent a2e7d7f51b
commit db0940aedb
355 changed files with 12956 additions and 6642 deletions
@@ -36,26 +36,11 @@ namespace ServiceLib.ViewModels
public RoutingRuleSettingViewModel(RoutingItem routingItem, Func<EViewAction, object?, Task<bool>>? updateView)
{
_config = AppHandler.Instance.Config;
_updateView = updateView;
SelectedSource = new();
if (routingItem.id.IsNullOrEmpty())
{
SelectedRouting = routingItem;
_rules = new();
}
else
{
SelectedRouting = routingItem;
_rules = JsonUtils.Deserialize<List<RulesItem>>(SelectedRouting.ruleSet);
}
RefreshRulesItems();
var canEditRemove = this.WhenAnyValue(
x => x.SelectedSource,
selectedSource => selectedSource != null && !selectedSource.outboundTag.IsNullOrEmpty());
x => x.SelectedSource,
selectedSource => selectedSource != null && !selectedSource.outboundTag.IsNullOrEmpty());
RuleAddCmd = ReactiveCommand.CreateFromTask(async () =>
{
@@ -104,6 +89,12 @@ namespace ServiceLib.ViewModels
{
await SaveRoutingAsync();
});
SelectedSource = new();
SelectedRouting = routingItem;
_rules = routingItem.id.IsNullOrEmpty() ? new() : JsonUtils.Deserialize<List<RulesItem>>(SelectedRouting.ruleSet);
RefreshRulesItems();
}
public void RefreshRulesItems()