Merge pull request #317 from Moonlight-Panel/AddManualMalwareScan
Added manual malware scan
This commit is contained in:
commit
73a07761f8
1 changed files with 20 additions and 4 deletions
|
@ -1,20 +1,26 @@
|
|||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Interop
|
||||
|
||||
@inject ServerService ServerService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject MalwareScanService MalwareScanService
|
||||
@inject AlertService AlertService
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<TL>Reinstall</TL>
|
||||
<TL>Actions</TL>
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Reinstall"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Reinstalling"))"
|
||||
CssClasses="btn-warning"
|
||||
OnClick="Reinstall">
|
||||
WorkingText="@(SmartTranslateService.Translate("Reinstalling"))" CssClasses="btn-warning"
|
||||
OnClick="Reinstall">
|
||||
</WButton>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Scan for malware"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Scanning"))" CssClasses="btn-primary ms-3"
|
||||
OnClick="Scan">
|
||||
</WButton>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -28,4 +34,14 @@
|
|||
{
|
||||
await ServerService.Reinstall(Server!);
|
||||
}
|
||||
|
||||
private async Task Scan()
|
||||
{
|
||||
var result = await MalwareScanService.Perform(Server);
|
||||
|
||||
if (result == null)
|
||||
await AlertService.Success(SmartTranslateService.Translate("No malware found on this server"));
|
||||
else
|
||||
await AlertService.Warning(result.Title, result.Description);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue