The first letter of the guiconfig attribute must be capitalized.
This commit is contained in:
@@ -40,7 +40,7 @@ namespace ServiceLib.ViewModels
|
||||
|
||||
var canEditRemove = this.WhenAnyValue(
|
||||
x => x.SelectedSource,
|
||||
selectedSource => selectedSource != null && !selectedSource.outboundTag.IsNullOrEmpty());
|
||||
selectedSource => selectedSource != null && !selectedSource.OutboundTag.IsNullOrEmpty());
|
||||
|
||||
RuleAddCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
@@ -105,14 +105,14 @@ namespace ServiceLib.ViewModels
|
||||
{
|
||||
var it = new RulesItemModel()
|
||||
{
|
||||
id = item.id,
|
||||
outboundTag = item.outboundTag,
|
||||
port = item.port,
|
||||
network = item.network,
|
||||
Protocols = Utils.List2String(item.protocol),
|
||||
InboundTags = Utils.List2String(item.inboundTag),
|
||||
Domains = Utils.List2String(item.domain),
|
||||
Ips = Utils.List2String(item.ip),
|
||||
Id = item.Id,
|
||||
OutboundTag = item.OutboundTag,
|
||||
Port = item.Port,
|
||||
Network = item.Network,
|
||||
Protocols = Utils.List2String(item.Protocol),
|
||||
InboundTags = Utils.List2String(item.InboundTag),
|
||||
Domains = Utils.List2String(item.Domain),
|
||||
Ips = Utils.List2String(item.Ip),
|
||||
Enabled = item.Enabled,
|
||||
Remarks = item.Remarks,
|
||||
};
|
||||
@@ -129,7 +129,7 @@ namespace ServiceLib.ViewModels
|
||||
}
|
||||
else
|
||||
{
|
||||
item = _rules.FirstOrDefault(t => t.id == SelectedSource?.id);
|
||||
item = _rules.FirstOrDefault(t => t.Id == SelectedSource?.Id);
|
||||
if (item is null)
|
||||
{
|
||||
return;
|
||||
@@ -147,7 +147,7 @@ namespace ServiceLib.ViewModels
|
||||
|
||||
public async Task RuleRemoveAsync()
|
||||
{
|
||||
if (SelectedSource is null || SelectedSource.outboundTag.IsNullOrEmpty())
|
||||
if (SelectedSource is null || SelectedSource.OutboundTag.IsNullOrEmpty())
|
||||
{
|
||||
NoticeHandler.Instance.Enqueue(ResUI.PleaseSelectRules);
|
||||
return;
|
||||
@@ -158,7 +158,7 @@ namespace ServiceLib.ViewModels
|
||||
}
|
||||
foreach (var it in SelectedSources ?? [SelectedSource])
|
||||
{
|
||||
var item = _rules.FirstOrDefault(t => t.id == it?.id);
|
||||
var item = _rules.FirstOrDefault(t => t.Id == it?.Id);
|
||||
if (item != null)
|
||||
{
|
||||
_rules.Remove(item);
|
||||
@@ -170,7 +170,7 @@ namespace ServiceLib.ViewModels
|
||||
|
||||
public async Task RuleExportSelectedAsync()
|
||||
{
|
||||
if (SelectedSource is null || SelectedSource.outboundTag.IsNullOrEmpty())
|
||||
if (SelectedSource is null || SelectedSource.OutboundTag.IsNullOrEmpty())
|
||||
{
|
||||
NoticeHandler.Instance.Enqueue(ResUI.PleaseSelectRules);
|
||||
return;
|
||||
@@ -179,7 +179,7 @@ namespace ServiceLib.ViewModels
|
||||
var lst = new List<RulesItem4Ray>();
|
||||
foreach (var it in SelectedSources ?? [SelectedSource])
|
||||
{
|
||||
var item = _rules.FirstOrDefault(t => t.id == it?.id);
|
||||
var item = _rules.FirstOrDefault(t => t.Id == it?.Id);
|
||||
if (item != null)
|
||||
{
|
||||
var item2 = JsonUtils.Deserialize<RulesItem4Ray>(JsonUtils.Serialize(item));
|
||||
@@ -194,13 +194,13 @@ namespace ServiceLib.ViewModels
|
||||
|
||||
public async Task MoveRule(EMove eMove)
|
||||
{
|
||||
if (SelectedSource is null || SelectedSource.outboundTag.IsNullOrEmpty())
|
||||
if (SelectedSource is null || SelectedSource.OutboundTag.IsNullOrEmpty())
|
||||
{
|
||||
NoticeHandler.Instance.Enqueue(ResUI.PleaseSelectRules);
|
||||
return;
|
||||
}
|
||||
|
||||
var item = _rules.FirstOrDefault(t => t.id == SelectedSource?.id);
|
||||
var item = _rules.FirstOrDefault(t => t.Id == SelectedSource?.Id);
|
||||
if (item == null)
|
||||
{
|
||||
return;
|
||||
@@ -223,7 +223,7 @@ namespace ServiceLib.ViewModels
|
||||
var item = SelectedRouting;
|
||||
foreach (var it in _rules)
|
||||
{
|
||||
it.id = Utils.GetGuid(false);
|
||||
it.Id = Utils.GetGuid(false);
|
||||
}
|
||||
item.RuleNum = _rules.Count;
|
||||
item.RuleSet = JsonUtils.Serialize(_rules, false);
|
||||
@@ -313,7 +313,7 @@ namespace ServiceLib.ViewModels
|
||||
}
|
||||
foreach (var rule in lstRules)
|
||||
{
|
||||
rule.id = Utils.GetGuid(false);
|
||||
rule.Id = Utils.GetGuid(false);
|
||||
}
|
||||
|
||||
if (blReplace)
|
||||
|
||||
Reference in New Issue
Block a user