1.5.1 progress

fixed new 407 error caused by parsing {id} as password part
This commit is contained in:
Давид Чернопятов
2024-07-08 12:58:26 +03:00
parent 9a277d07db
commit 6a1b03163c
7 changed files with 104 additions and 26 deletions
+1
View File
@@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "changelog", "changelog", "{
changelog\1.4.8.html = changelog\1.4.8.html
changelog\1.4.9.html = changelog\1.4.9.html
changelog\1.5.0.html = changelog\1.5.0.html
changelog\1.5.1.html = changelog\1.5.1.html
EndProjectSection
EndProject
Global
+1 -1
View File
@@ -22,7 +22,7 @@ public partial class App : Application
}
catch (Exception ex)
{
var msg = ex.Message;
var msg = ex.ToString();
if (ex is CantAlignTimeException)
{
msg = Loc.Tr(LocManager.GetCodeBehind("CantAlignTimeError"));
+10 -14
View File
@@ -11,6 +11,7 @@ namespace NebulaAuth.Model;
public static class ProxyStorage
{
public const string FORMAT = ADDRESS_FORMAT + ":{USER}:{PASS}";
public const string ADDRESS_FORMAT = "{IP}:{PORT}";
@@ -32,7 +33,7 @@ public static class ProxyStorage
try
{
var json = File.ReadAllText("proxies.json");
var proxies = JsonConvert.DeserializeObject<Proxies>(json) ?? throw new NullReferenceException();
var proxies = JsonConvert.DeserializeObject<ProxiesSchema>(json) ?? throw new NullReferenceException();
Proxies = proxies.ProxiesData;
Proxies = new ObservableDictionary<int, ProxyData>(
Proxies.OrderBy(p => p.Key)
@@ -48,16 +49,13 @@ public static class ProxyStorage
SnackbarController.SendSnackbar("Ошибка при загрузке прокси");
SnackbarController.SendSnackbar(ex.Message);
}
}
public static void SetProxy(int? id, ProxyData proxyData)
{
if (id == null)
{
if (Proxies.Any() == false)
if (Proxies.Count == 0)
{
id = 0;
}
@@ -94,7 +92,7 @@ public static class ProxyStorage
return proxyData.AuthEnabled ? proxyData.ToString(FORMAT) : proxyData.ToString(ADDRESS_FORMAT);
}
private static Proxies Create()
private static ProxiesSchema Create()
{
int? def = null;
if (MaClient.DefaultProxy != null)
@@ -106,18 +104,16 @@ public static class ProxyStorage
}
}
return new Proxies
return new ProxiesSchema
{
ProxiesData = Proxies,
DefaultProxy = def
};
}
}
public class Proxies
{
public ObservableDictionary<int, ProxyData> ProxiesData { get; set; }
public int? DefaultProxy { get; set; }
private class ProxiesSchema
{
public ObservableDictionary<int, ProxyData> ProxiesData = new();
public int? DefaultProxy;
}
}
+1 -1
View File
@@ -10,7 +10,7 @@
<SatelliteResourceLanguages>en;ru;ua</SatelliteResourceLanguages>
<ApplicationIcon>Theme\lock.ico</ApplicationIcon>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
<AssemblyVersion>1.5.0</AssemblyVersion>
<AssemblyVersion>1.5.1</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
+10 -7
View File
@@ -1,7 +1,5 @@
using AchiesUtilities.Collections;
using AchiesUtilities.Web.Proxy;
using AutoUpdaterDotNET;
using CodingSeb.Localization.WPF;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using NebulaAuth.Core;
@@ -42,14 +40,19 @@ public partial class ProxyManagerVM : ObservableObject
var idPresent = (bool?)null;
var proxies = new List<KeyValuePair<int?, ProxyData>>();
var i = 0;
foreach (var str in split.Where(s => string.IsNullOrWhiteSpace(s) == false))
foreach (var s in split.Where(s => string.IsNullOrWhiteSpace(s) == false))
{
i++;
var str = s;
int? id = null;
var match = IdRegex.Match(str);
if (match.Success) id = int.Parse(match.Groups[1].Value);
idPresent ??= match.Success;
if (match.Success)
{
id = int.Parse(match.Groups[1].Value);
str = IdRegex.Replace(str, "");
}
idPresent ??= match.Success;
if (idPresent.Value != match.Success)
{
SnackbarController.SendSnackbar(GetLocalizationOrDefault("WrongFormatSomeIdsMissing"));
@@ -132,7 +135,7 @@ public partial class ProxyManagerVM : ObservableObject
break;
}
}
ProxyStorage.RemoveProxy(s.Key);
SelectedProxy = nextNeighbor ?? prevNeighbor;
CheckIfDefaultProxyStay();
@@ -167,7 +170,7 @@ public partial class ProxyManagerVM : ObservableObject
{
Shell.Logger.Error(ex);
}
}
[RelayCommand]
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.5.0.0</version>
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.0/NebulaAuth.1.5.0.zip</url>
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.0.html</changelog>
<version>1.5.1.0</version>
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.1/NebulaAuth.1.5.1.zip</url>
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.1.html</changelog>
<mandatory>false</mandatory>
</item>
+78
View File
@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Changelog</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #eeeeee;
color: #333;
line-height: 1.6;
}
.changelog-container {
background-color: #fff;
border-radius: 10px;
padding: 25px;
margin: 25px auto;
max-width: 800px;
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.change {
margin-bottom: 20px;
padding: 0;
border-left: 4px solid #a50ec7;
background-color: #f9f9f9;
}
.version {
font-weight: 600;
font-size: 1.5em;
color: #a50ec7;
margin-left: 10px;
}
.date {
font-style: italic;
color: #888;
margin-bottom: 10px;
margin-left: 15px;
}
.description {
font-size: 1em;
padding: 0 15px;
}
.description ul {
list-style: inside square;
padding: 0;
}
@media only screen and (max-width: 600px) {
.changelog-container {
width: 90%;
margin: 25px auto;
padding: 25px;
}
}
</style>
</head>
<body>
<div class="changelog-container">
<!-- Changelog entry -->
<div class="change">
<div class="version">Version 1.5.1</div>
<div class="date">DATE</div>
<div class="description">
- FIX: Fixed proxy problem when {id} was parsed as a part of password when using 'ip:port:username:password{id}' proxy format
</div>
</div>
</div>
</body>
</html>