@page "/profiles/import/{profileId:int}"
@using ECM.JobRunner.Common.JobRunnerReference;
@using ECM.JobRunner.Web.Data;
@inject NavigationManager Navigation;
@inject IJSRuntime JsRuntime;
@inject JobService Jobs;
@inject ImportService Import;
Profile
@if (profile == null)
{
Job
}
else
{
@if (profile.Active)
{
}
else
{
}
@profile.Job.Name
Verarbeitungsschritte
}
@code {
[Parameter]
public int ProfileId { get; set; }
private ImportProfile? profile;
private DateTime nextExecution;
protected async override void OnInitialized()
{
profile = await Import.GetProfile(ProfileId);
if (profile != null)
{
nextExecution = Jobs.GetNextExecutionTime(profile.Job.CronSchedule);
StateHasChanged();
}
}
protected async void DeleteJob()
{
if (profile != null)
{
bool confirmed = await JsRuntime.InvokeAsync("confirm", "Are you sure?");
if (confirmed)
{
//if (await Jobs.DeleteJob(profile) == true)
//{
// Navigation.NavigateTo($"/jobs");
//};
}
}
}
}