mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-24 10:49:51 +08:00
ASF
This commit is contained in:
Submodule references/ArchiSteamFarm updated: cb26758121...3e2946db05
+1
-1
Submodule references/AvaloniaGif updated: 1f71087129...b8f500eb89
@@ -27,13 +27,14 @@ namespace System.Application.Converters
|
||||
protected static Bitmap? DownloadImage(string? url, int width = 0)
|
||||
{
|
||||
if (url == null) return null;
|
||||
using var web = new WebClient();
|
||||
var ua = DI.Get<IHttpPlatformHelperService>().UserAgent;
|
||||
web.Headers.Add("User-Agent", ua);
|
||||
var bt = web.DownloadData(url);
|
||||
var stream = new MemoryStream(bt);
|
||||
//var task = IHttpService.Instance.GetAsync<Stream>(url, MediaTypeNames.All);
|
||||
//if (stream == null) return null;
|
||||
//using var web = new WebClient();
|
||||
//var ua = DI.Get<IHttpPlatformHelperService>().UserAgent;
|
||||
//web.Headers.Add("User-Agent", ua);
|
||||
//var bt = web.DownloadData(url);
|
||||
//var stream = new MemoryStream(bt);
|
||||
var task = IHttpService.Instance.GetAsync<Stream>(url, MediaTypeNames.All);
|
||||
var stream = task.GetAwaiter().GetResult();
|
||||
if (stream == null) return null;
|
||||
return GetDecodeBitmap(stream, width);
|
||||
}
|
||||
|
||||
|
||||
+23
-9
@@ -51,16 +51,15 @@
|
||||
<ia:InvokeCommandAction Command="{ReflectionBinding #u.DataContext.OpenUserProfileUrl}" CommandParameter="{Binding}"/>
|
||||
</ia:EventTriggerBehavior>
|
||||
</i:Interaction.Behaviors>
|
||||
<!--<gif:Image2
|
||||
<gif:Image2
|
||||
Width="184"
|
||||
AutoStart="true"
|
||||
Stretch="Uniform"
|
||||
Source="{Binding AvatarUrl}">
|
||||
</gif:Image2>-->
|
||||
<Image Width="184"
|
||||
</gif:Image2>
|
||||
<!--<Image Width="184"
|
||||
Stretch="Uniform"
|
||||
Source="{Binding AvatarUrl,Converter={StaticResource BitmapAssetValueConverter}}">
|
||||
</Image>
|
||||
</Image>-->
|
||||
<!--<Image Width="184" Stretch="Uniform" IsVisible="{Binding AvatarStream^,Converter={StaticResource IsNullConverter}}"
|
||||
Source="avares://System.Application.SteamTools.Client.Avalonia/Application/UI/Assets/AppResources/avatar.jpg">
|
||||
</Image>-->
|
||||
@@ -125,7 +124,7 @@
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right">
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Text="{Binding WalletBalance,StringFormat={}{0:C}}"/>
|
||||
Text="{Binding WalletBalanceM,StringFormat={}{0:C}}"/>
|
||||
</WrapPanel>
|
||||
</DockPanel>
|
||||
|
||||
@@ -167,7 +166,16 @@
|
||||
<Button ToolTip.Tip="Bot配置" >
|
||||
<PathIcon Data="{StaticResource SettingsDrawing}" />
|
||||
</Button>
|
||||
<Button ToolTip.Tip="禁用Bot" >
|
||||
<Button ToolTip.Tip="启用"
|
||||
IsVisible="{Binding !KeepRunning}"
|
||||
Command="{ReflectionBinding #u.DataContext.EnableOrDisableBot}"
|
||||
CommandParameter="{Binding}">
|
||||
<PathIcon Data="{StaticResource BlockDrawing}" />
|
||||
</Button>
|
||||
<Button ToolTip.Tip="禁用"
|
||||
IsVisible="{Binding KeepRunning}"
|
||||
Command="{ReflectionBinding #u.DataContext.EnableOrDisableBot}"
|
||||
CommandParameter="{Binding}">
|
||||
<PathIcon Data="{StaticResource BlockDrawing}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
@@ -184,9 +192,15 @@
|
||||
<Border Classes="paper"
|
||||
ClipToBounds="True">
|
||||
<Panel>
|
||||
<Image Source="{Binding ImageUrl,Converter={StaticResource BitmapAssetValueConverter}}"
|
||||
<gif:Image2
|
||||
MaxWidth="184"
|
||||
MaxHeight="86"
|
||||
Stretch="Uniform"
|
||||
Source="{Binding ImageUrl}">
|
||||
</gif:Image2>
|
||||
<!--<Image Source="{Binding ImageUrl,Converter={StaticResource BitmapAssetValueConverter}}"
|
||||
Width="184"
|
||||
Stretch="Uniform"/>
|
||||
Stretch="Uniform"/>-->
|
||||
<Border VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource ThemeColorKey}">
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace System.Application.Services.Implementation
|
||||
ReadLineTask = new(TaskCreationOptions.AttachedToParent);
|
||||
IsReadPasswordLine = isPassword;
|
||||
#if NET6_0_OR_GREATER
|
||||
var result = await ReadLineTask.Task.WaitAsync(TimeSpan.FromSeconds(20));
|
||||
var result = await ReadLineTask.Task.WaitAsync(TimeSpan.FromSeconds(60));
|
||||
#else
|
||||
var result = await ReadLineTask.Task;
|
||||
#endif
|
||||
|
||||
+8
-4
@@ -89,7 +89,7 @@ namespace System.Application.UI.ViewModels
|
||||
{
|
||||
(bool success, string message) result;
|
||||
|
||||
if (bot.CardsFarmer.Paused)
|
||||
if (bot.KeepRunning)
|
||||
{
|
||||
result = bot.Actions.Stop();
|
||||
}
|
||||
@@ -109,7 +109,12 @@ namespace System.Application.UI.ViewModels
|
||||
|
||||
public void GoToBotSettings(Bot bot)
|
||||
{
|
||||
OpenBrowser("WebBotConfig", bot.BotName);
|
||||
if (!ASFService.Current.IsASFRuning)
|
||||
{
|
||||
Toast.Show("请先运行ASF功能");
|
||||
return;
|
||||
}
|
||||
Browser2.Open(IPCUrl + "/bot/" + bot.BotName);
|
||||
}
|
||||
|
||||
public void OpenFolder(string tag)
|
||||
@@ -133,7 +138,7 @@ namespace System.Application.UI.ViewModels
|
||||
IPlatformService.Instance.OpenFolder(path);
|
||||
}
|
||||
|
||||
public void OpenBrowser(string? tag, string? botName = null)
|
||||
public void OpenBrowser(string? tag)
|
||||
{
|
||||
var url = tag switch
|
||||
{
|
||||
@@ -142,7 +147,6 @@ namespace System.Application.UI.ViewModels
|
||||
"ConfigGenerator" => "https://justarchinet.github.io/ASF-WebConfigGenerator/",
|
||||
"WebConfig" => IPCUrl + "/asf-config",
|
||||
"WebAddBot" => IPCUrl + "/bot/new",
|
||||
"WebBotConfig" => IPCUrl + "/bot/" + botName,
|
||||
_ => IPCUrl,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user