Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe8abb589f | ||
|
|
ae787373dc | ||
|
|
4f2fe7b292 | ||
|
|
635a489cc1 | ||
|
|
5b82edb9ee |
@@ -1,5 +1,4 @@
|
|||||||
name: .NET Core Desktop
|
name: .NET Core Desktop
|
||||||
permissions: write-all
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -44,7 +43,7 @@ jobs:
|
|||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
tag_name: ${{ github.ref }}
|
||||||
release_name: ${{ github.ref }}
|
release_name: ${{ github.ref }}
|
||||||
@@ -55,7 +54,7 @@ jobs:
|
|||||||
id: upload-release-asset
|
id: upload-release-asset
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||||
asset_path: /app/MonsterMonitor.zip
|
asset_path: /app/MonsterMonitor.zip
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1.0.5
|
1.0.10
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<RootNamespace>MonsterMonitor</RootNamespace>
|
<RootNamespace>MonsterMonitor</RootNamespace>
|
||||||
<AssemblyName>MonsterMonitor</AssemblyName>
|
<AssemblyName>MonsterMonitor</AssemblyName>
|
||||||
<AssemblyVersion>1.0.5</AssemblyVersion>
|
<AssemblyVersion>1.0.10</AssemblyVersion>
|
||||||
<Version>1.0.5</Version>
|
<Version>1.0.10</Version>
|
||||||
<FileVersion>1.0.5</FileVersion>
|
<FileVersion>1.0.10</FileVersion>
|
||||||
<InformationalVersion>1.0.5</InformationalVersion>
|
<InformationalVersion>1.0.10</InformationalVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Costura.Fody" Version="6.0.0">
|
<PackageReference Include="Costura.Fody" Version="6.0.0">
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace MonsterMonitor.Services
|
|||||||
|
|
||||||
var config = "users admin:CL:" + password + "\r\n" +
|
var config = "users admin:CL:" + password + "\r\n" +
|
||||||
"auth strong\r\n" +
|
"auth strong\r\n" +
|
||||||
|
"maxconn 2000\r\n" +
|
||||||
$"socks -i127.0.0.1 -p{port}";
|
$"socks -i127.0.0.1 -p{port}";
|
||||||
|
|
||||||
var configPath = GetConfigPath();
|
var configPath = GetConfigPath();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace MonsterMonitor.UI
|
|||||||
private readonly Button _btnSettings = new Button();
|
private readonly Button _btnSettings = new Button();
|
||||||
private readonly Button _btnExit = new Button();
|
private readonly Button _btnExit = new Button();
|
||||||
private readonly NotifyIcon _notifyIcon = new NotifyIcon();
|
private readonly NotifyIcon _notifyIcon = new NotifyIcon();
|
||||||
|
private readonly Timer _updateTimer = new Timer();
|
||||||
private readonly Icon _trayIcon;
|
private readonly Icon _trayIcon;
|
||||||
private readonly LogService _log = new LogService();
|
private readonly LogService _log = new LogService();
|
||||||
private readonly PowerManagementService _power = new PowerManagementService();
|
private readonly PowerManagementService _power = new PowerManagementService();
|
||||||
@@ -20,6 +21,7 @@ namespace MonsterMonitor.UI
|
|||||||
private AppController _controller;
|
private AppController _controller;
|
||||||
private AppSettings _settings;
|
private AppSettings _settings;
|
||||||
private bool _allowClose;
|
private bool _allowClose;
|
||||||
|
private bool _isUpdateCheckRunning;
|
||||||
|
|
||||||
public MainForm()
|
public MainForm()
|
||||||
{
|
{
|
||||||
@@ -43,7 +45,8 @@ namespace MonsterMonitor.UI
|
|||||||
_controller = new AppController(_log, _power);
|
_controller = new AppController(_log, _power);
|
||||||
_updateService = new GitHubUpdateService(_log);
|
_updateService = new GitHubUpdateService(_log);
|
||||||
RestartServices();
|
RestartServices();
|
||||||
_ = RunUpdateCheckAsync();
|
ConfigureUpdateTimer();
|
||||||
|
_ = RunUpdateCheckAsync(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BuildUi()
|
private void BuildUi()
|
||||||
@@ -148,6 +151,8 @@ namespace MonsterMonitor.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
_notifyIcon.Visible = false;
|
_notifyIcon.Visible = false;
|
||||||
|
_updateTimer.Stop();
|
||||||
|
_updateTimer.Dispose();
|
||||||
_controller?.Dispose();
|
_controller?.Dispose();
|
||||||
_trayIcon?.Dispose();
|
_trayIcon?.Dispose();
|
||||||
}
|
}
|
||||||
@@ -168,11 +173,40 @@ namespace MonsterMonitor.UI
|
|||||||
_console.ScrollToCaret();
|
_console.ScrollToCaret();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RunUpdateCheckAsync()
|
private void ConfigureUpdateTimer()
|
||||||
{
|
{
|
||||||
// Небольшая задержка, чтобы окно и лог уже успели инициализироваться.
|
_updateTimer.Interval = (int)TimeSpan.FromHours(1).TotalMilliseconds;
|
||||||
await Task.Delay(1000);
|
_updateTimer.Tick += async (_, __) => await RunUpdateCheckAsync(false);
|
||||||
await _updateService.CheckAndPrepareUpdateAsync();
|
_updateTimer.Start();
|
||||||
|
_log.Info("Автопроверка обновлений включена (раз в 1 час).");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task RunUpdateCheckAsync(bool isInitialCheck)
|
||||||
|
{
|
||||||
|
if (_isUpdateCheckRunning)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_isUpdateCheckRunning = true;
|
||||||
|
if (isInitialCheck)
|
||||||
|
{
|
||||||
|
// Небольшая задержка, чтобы окно и лог уже успели инициализироваться.
|
||||||
|
await Task.Delay(1000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_log.Info("Плановая проверка обновлений...");
|
||||||
|
}
|
||||||
|
|
||||||
|
await _updateService.CheckAndPrepareUpdateAsync();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_isUpdateCheckRunning = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Color GetColor(LogLevel level)
|
private static Color GetColor(LogLevel level)
|
||||||
|
|||||||
Reference in New Issue
Block a user