@page "/profiles/import/{profileId:int}/steps/{stepId:int}"
@using ECM.JobRunner.Common.JobRunnerReference;
@using ECM.JobRunner.Web.Data;
@inject NavigationManager Navigation;
@inject IJSRuntime JsRuntime;
@inject JobService Jobs;
@inject ImportService Import;
Profilschritt
@if (profile == null)
{
Job
}
else
{
@if (step != null)
{
@if (profile.Active)
{
}
else
{
}
Schritt
@if (!String.IsNullOrEmpty(step.Argument1))
{
-
}
@if (!String.IsNullOrEmpty(step.Argument2))
{
-
}
@if (!String.IsNullOrEmpty(step.Argument3))
{
-
}
}
}
@code {
[Parameter]
public int ProfileId { get; set; }
[Parameter]
public int StepId { get; set; }
private ImportProfile? profile;
private ImportProfileStep? step;
private DateTime nextExecution;
protected async override void OnInitialized()
{
profile = await Import.GetProfile(ProfileId);
if (profile != null)
{
step = profile.Steps.Where(s => s.Id == StepId).SingleOrDefault();
StateHasChanged();
}
}
protected async void DeleteStep()
{
if (profile != null)
{
bool confirmed = await JsRuntime.InvokeAsync("confirm", "Are you sure?");
if (confirmed)
{
var steps = profile.Steps.
ToList().
Where(s => s.Id != StepId).
ToArray();
profile.Steps = steps;
if (await Import.UpdateProfile(profile) == true)
{
Navigation.NavigateTo($"/profiles/import/{ProfileId}/steps");
};
}
}
}
}