mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2026-07-11 13:39:41 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4948946f84 | |||
| 3a1c7376c1 | |||
| c93093c0ea | |||
| cc14d4ee04 | |||
| f3cf177409 | |||
| 226eb6ccb3 |
@@ -11,7 +11,7 @@
|
|||||||
<AvaloniaXamlIlDebuggerLaunch>False</AvaloniaXamlIlDebuggerLaunch>
|
<AvaloniaXamlIlDebuggerLaunch>False</AvaloniaXamlIlDebuggerLaunch>
|
||||||
<ApplicationIcon>app.ico</ApplicationIcon>
|
<ApplicationIcon>app.ico</ApplicationIcon>
|
||||||
<AssemblyName>NeedleworkDotNet</AssemblyName>
|
<AssemblyName>NeedleworkDotNet</AssemblyName>
|
||||||
<AssemblyVersion>0.14.1.0</AssemblyVersion>
|
<AssemblyVersion>0.14.3.0</AssemblyVersion>
|
||||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||||
<AvaloniaXamlVerboseExceptions>False</AvaloniaXamlVerboseExceptions>
|
<AvaloniaXamlVerboseExceptions>False</AvaloniaXamlVerboseExceptions>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ namespace Needlework.Net.Services
|
|||||||
foreach (var element in elements)
|
foreach (var element in elements)
|
||||||
{
|
{
|
||||||
var path = element.QuerySelector("a.post-card-content-link")!.GetAttribute("href")!;
|
var path = element.QuerySelector("a.post-card-content-link")!.GetAttribute("href")!;
|
||||||
var title = element.QuerySelector(".post-card-title")!.TextContent;
|
var title = element.QuerySelector(".post-card-title")!.TextContent.Trim();
|
||||||
var excerpt = element.QuerySelector(".post-card-excerpt > p")!.TextContent;
|
var excerpt = element.QuerySelector(".post-card-excerpt")!.TextContent;
|
||||||
var post = new HextechDocsPost()
|
var post = new HextechDocsPost()
|
||||||
{
|
{
|
||||||
Path = path,
|
Path = path,
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
using Needlework.Net.Extensions;
|
||||||
using Needlework.Net.Models;
|
using Needlework.Net.Models;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Needlework.Net.ViewModels.MainWindow
|
namespace Needlework.Net.ViewModels.MainWindow
|
||||||
{
|
{
|
||||||
public partial class NotificationViewModel : ObservableObject
|
public partial class NotificationViewModel : ObservableObject, IEnableLogger
|
||||||
{
|
{
|
||||||
public NotificationViewModel(Notification notification)
|
public NotificationViewModel(Notification notification)
|
||||||
{
|
{
|
||||||
@@ -20,8 +21,17 @@ namespace Needlework.Net.ViewModels.MainWindow
|
|||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
public void OpenUrl()
|
public void OpenUrl()
|
||||||
{
|
{
|
||||||
var process = new Process() { StartInfo = new() { UseShellExecute = true } };
|
try
|
||||||
process.Start();
|
{
|
||||||
|
var url = Notification?.Url ?? "https://github.com/BlossomiShymae/Needlework.Net/releases/latest";
|
||||||
|
var process = new Process() { StartInfo = new(url) { UseShellExecute = true } };
|
||||||
|
process.Start();
|
||||||
|
}
|
||||||
|
catch (System.Exception exception)
|
||||||
|
{
|
||||||
|
this.Log()
|
||||||
|
.Error("Failed to open URL for notification: {@exception}", exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user