missing IStringLocalizer<Index> causing compilation error

This commit is contained in:
Shaun Walker 2020-11-20 10:30:07 -05:00
parent 6d913c842c
commit 710aab9b93

View File

@ -1,6 +1,7 @@
@namespace Oqtane.Modules.Admin.Jobs @namespace Oqtane.Modules.Admin.Jobs
@inherits ModuleBase @inherits ModuleBase
@inject IJobService JobService @inject IJobService JobService
@inject IStringLocalizer<Index> Localizer
@if (_jobs == null) @if (_jobs == null)
{ {
@ -11,7 +12,8 @@ else
<ActionLink Action="Add" Text="Add Job" ResourceKey="AddJob" /> <ActionLink Action="Add" Text="Add Job" ResourceKey="AddJob" />
<ActionLink Action="Log" Class="btn btn-secondary" Text="View Logs" ResourceKey="ViewJobs" /> <ActionLink Action="Log" Class="btn btn-secondary" Text="View Logs" ResourceKey="ViewJobs" />
<button type="button" class="btn btn-secondary" @onclick="(async () => await Refresh())">Refresh</button> <button type="button" class="btn btn-secondary" @onclick="(async () => await Refresh())">Refresh</button>
<br /><br /> <br />
<br />
<Pager Items="@_jobs"> <Pager Items="@_jobs">
<Header> <Header>
@ -34,13 +36,13 @@ else
<td>@context.NextExecution</td> <td>@context.NextExecution</td>
<td> <td>
@if (context.IsStarted) @if (context.IsStarted)
{ {
<button type="button" class="btn btn-danger" @onclick="(async () => await StopJob(context.JobId))">@Localizer["Stop"]</button> <button type="button" class="btn btn-danger" @onclick="(async () => await StopJob(context.JobId))">@Localizer["Stop"]</button>
} }
else else
{ {
<button type="button" class="btn btn-success" @onclick="(async () => await StartJob(context.JobId))">@Localizer["Start"]</button> <button type="button" class="btn btn-success" @onclick="(async () => await StartJob(context.JobId))">@Localizer["Start"]</button>
} }
</td> </td>
</Row> </Row>
</Pager> </Pager>
@ -48,7 +50,7 @@ else
@code { @code {
private List<Job> _jobs; private List<Job> _jobs;
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Host; } } public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Host; } }
protected override async Task OnParametersSetAsync() protected override async Task OnParametersSetAsync()
@ -81,7 +83,7 @@ else
private string DisplayFrequency(int interval, string frequency) private string DisplayFrequency(int interval, string frequency)
{ {
var result = "Every " + interval.ToString() + " "; var result = "Every " + interval.ToString() + " ";
switch (frequency) switch (frequency)
{ {
case "m": case "m":
@ -97,12 +99,12 @@ else
result += "Month"; result += "Month";
break; break;
} }
if (interval > 1) if (interval > 1)
{ {
result += "s"; result += "s";
} }
return result; return result;
} }