mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-23 19:36:55 +00:00
Allow upload empty vmesses to github.
This commit is contained in:
parent
0d02b4c345
commit
fc5862c91d
5 changed files with 22 additions and 2 deletions
|
@ -1687,8 +1687,9 @@ namespace v2rayN.Forms
|
|||
}
|
||||
try {
|
||||
await GithubRemoteStorageHelper.Fetch(config.vmess, githubRemoteStorageConfig);
|
||||
RefreshServers();
|
||||
UI.Show(UIRes.I18N("GithubRemoteStoreFetchSucceed"));
|
||||
RefreshServers();
|
||||
ConfigHandler.SaveConfig(ref config);
|
||||
}
|
||||
catch (Octokit.AuthorizationException githubAuthException) {
|
||||
AppendText(githubAuthException.Message);
|
||||
|
|
9
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
9
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
|
@ -258,6 +258,15 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 There is no data in the local Vmess list. After uploading, the remote configuration file (if have) will be cleared. Are you sure you want to do this? 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string GithubRemoteStorageLocalVmessIsEmpty {
|
||||
get {
|
||||
return ResourceManager.GetString("GithubRemoteStorageLocalVmessIsEmpty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Github authentication failed, please check the settings 的本地化字符串。
|
||||
/// </summary>
|
||||
|
|
|
@ -183,6 +183,9 @@
|
|||
<data name="GithubRemoteStorageConfigNotFound" xml:space="preserve">
|
||||
<value>Failed to download the configuration file from Github, the configuration file was not found on Github, please check the settings.If it is the first time, you can upload to Github first.</value>
|
||||
</data>
|
||||
<data name="GithubRemoteStorageLocalVmessIsEmpty" xml:space="preserve">
|
||||
<value>There is no data in the local Vmess list. After uploading, the remote configuration file (if have) will be cleared. Are you sure you want to do this?</value>
|
||||
</data>
|
||||
<data name="GithubRemoteStoreAuthorizationFailed" xml:space="preserve">
|
||||
<value>Github authentication failed, please check the settings</value>
|
||||
</data>
|
||||
|
|
|
@ -183,6 +183,9 @@
|
|||
<data name="GithubRemoteStorageConfigNotFound" xml:space="preserve">
|
||||
<value>从Github下载配置文件失败,没有在Github找到配置文件,请检查设置。如果是第一次可以先上传到Github</value>
|
||||
</data>
|
||||
<data name="GithubRemoteStorageLocalVmessIsEmpty" xml:space="preserve">
|
||||
<value>本地Vmess列表没有数据,上传后会清空远端配置文件(如有),确定要这么做吗</value>
|
||||
</data>
|
||||
<data name="GithubRemoteStoreAuthorizationFailed" xml:space="preserve">
|
||||
<value>Github认证失败,请检查设置</value>
|
||||
</data>
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Text;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using v2rayN.Mode;
|
||||
using v2rayN.Protos.Statistics;
|
||||
|
||||
|
@ -46,7 +48,9 @@ namespace v2rayN.Tool {
|
|||
/// <returns></returns>
|
||||
public static async Task Upload(IList<VmessItem> localVmessItems, GithubRemoteStorageConfig config) {
|
||||
if (localVmessItems?.Any() != true) {
|
||||
return;
|
||||
if (DialogResult.No == UI.ShowYesNo(UIRes.I18N("GithubRemoteStorageLocalVmessIsEmpty"))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
var vmessesJson = Newtonsoft.Json.JsonConvert.SerializeObject(localVmessItems);
|
||||
var client = GetClient(config);
|
||||
|
|
Loading…
Reference in a new issue