* Inner uri import and export

* Add tests

* Fix

* Compress export length
This commit is contained in:
DHR60
2026-05-06 12:33:35 +00:00
committed by GitHub
parent d13f7a4db6
commit 75ea81dd69
17 changed files with 468 additions and 0 deletions
@@ -72,6 +72,7 @@ public class ProfilesViewModel : MyReactiveObject
public ReactiveCommand<Unit, Unit> Export2ClientConfigClipboardCmd { get; }
public ReactiveCommand<Unit, Unit> Export2ShareUrlCmd { get; }
public ReactiveCommand<Unit, Unit> Export2ShareUrlBase64Cmd { get; }
public ReactiveCommand<Unit, Unit> Export2InnerUriCmd { get; }
public ReactiveCommand<Unit, Unit> AddSubCmd { get; }
public ReactiveCommand<Unit, Unit> EditSubCmd { get; }
@@ -212,6 +213,10 @@ public class ProfilesViewModel : MyReactiveObject
{
await Export2ShareUrlAsync(true);
}, canEditRemove);
Export2InnerUriCmd = ReactiveCommand.CreateFromTask(async () =>
{
await Export2InnerUrlAsync();
}, canEditRemove);
//Subscription
AddSubCmd = ReactiveCommand.CreateFromTask(async () =>
@@ -840,6 +845,32 @@ public class ProfilesViewModel : MyReactiveObject
}
}
public async Task Export2InnerUrlAsync()
{
var lstSelected = await GetProfileItems(true);
if (lstSelected == null)
{
return;
}
var result = string.Empty;
await Task.Run(() =>
{
result = InnerFmt.ToUri(lstSelected);
});
if (!result.IsNullOrEmpty())
{
await _updateView?.Invoke(EViewAction.SetClipboardData, result);
NoticeManager.Instance.SendMessage(ResUI.BatchExportURLSuccessfully);
}
else
{
NoticeManager.Instance.Enqueue(ResUI.OperationFailed);
}
}
#endregion Add Servers
#region Subscription