mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-02 19:42:08 +03:00
Inner uri (#9245)
* Inner uri import and export * Add tests * Fix * Compress export length
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user