add Refresh option for Job Logs
This commit is contained in:
parent
d7a290c595
commit
0c80e28754
|
@ -10,9 +10,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
<ActionLink Action="Log" Class="btn btn-secondary" Text="View Logs" ResourceKey="ViewJobs" />
|
||||
<button type="button" class="btn btn-secondary" @onclick="(async () => await Refresh())">@Localizer["Refresh.Text"]</button>
|
||||
<br />
|
||||
<button type="button" class="btn btn-secondary" @onclick="Refresh">@Localizer["Refresh.Text"]</button>
|
||||
<br />
|
||||
|
||||
<Pager Items="@_jobs" SearchProperties="Name">
|
||||
|
@ -44,6 +42,9 @@ else
|
|||
</td>
|
||||
</Row>
|
||||
</Pager>
|
||||
|
||||
<br />
|
||||
<ActionLink Action="Log" Class="btn btn-secondary" Text="View All Logs" ResourceKey="ViewLogs" />
|
||||
}
|
||||
|
||||
@code {
|
||||
|
@ -53,13 +54,18 @@ else
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_jobs = await JobService.GetJobsAsync();
|
||||
await GetJobs();
|
||||
if (_jobs.Count == 0)
|
||||
{
|
||||
AddModuleMessage(string.Format(Localizer["Message.NoJobs"], NavigateUrl("admin/system")), MessageType.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task GetJobs()
|
||||
{
|
||||
_jobs = await JobService.GetJobsAsync();
|
||||
}
|
||||
|
||||
private string DisplayStatus(bool isEnabled, bool isExecuting)
|
||||
{
|
||||
var status = string.Empty;
|
||||
|
@ -146,7 +152,7 @@ else
|
|||
|
||||
private async Task Refresh()
|
||||
{
|
||||
_jobs = await JobService.GetJobsAsync();
|
||||
await GetJobs();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-secondary" @onclick="Refresh">@Localizer["Refresh"]</button>
|
||||
<br /><br />
|
||||
|
||||
<Pager Items="@_jobLogs">
|
||||
<Header>
|
||||
<th>@SharedLocalizer["Name"]</th>
|
||||
|
@ -35,6 +38,11 @@ else
|
|||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await GetJobLogs();
|
||||
}
|
||||
|
||||
private async Task GetJobLogs()
|
||||
{
|
||||
_jobLogs = await JobLogService.GetJobLogsAsync();
|
||||
|
||||
|
@ -67,4 +75,10 @@ else
|
|||
|
||||
return status;
|
||||
}
|
||||
|
||||
private async Task Refresh()
|
||||
{
|
||||
await GetJobLogs();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,8 +144,8 @@
|
|||
<data name="Month" xml:space="preserve">
|
||||
<value>Month(s)</value>
|
||||
</data>
|
||||
<data name="ViewJobs.Text" xml:space="preserve">
|
||||
<value>View Logs</value>
|
||||
<data name="ViewLogs.Text" xml:space="preserve">
|
||||
<value>View All Logs</value>
|
||||
</data>
|
||||
<data name="Frequency" xml:space="preserve">
|
||||
<value>Frequency</value>
|
||||
|
|
|
@ -132,4 +132,7 @@
|
|||
<data name="Failed" xml:space="preserve">
|
||||
<value>Failed</value>
|
||||
</data>
|
||||
<data name="Refresh" xml:space="preserve">
|
||||
<value>Refresh</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user