181 lines
11 KiB
Plaintext
181 lines
11 KiB
Plaintext
@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;
|
|
|
|
<PageTitle>Profilschritt</PageTitle>
|
|
|
|
@if (profile == null)
|
|
{
|
|
<h3>Job</h3>
|
|
|
|
<ul class="list-group">
|
|
<li class="list-group-item">Loading Job..</li>
|
|
</ul>
|
|
}
|
|
else
|
|
{
|
|
@if (step != null)
|
|
{
|
|
<h3>
|
|
@if (profile.Active)
|
|
{
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-bar-chart-steps text-success" viewBox="0 0 16 16">
|
|
<path d="M.5 0a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-1 0V.5A.5.5 0 0 1 .5 0zM2 1.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-6a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1z" />
|
|
</svg>
|
|
}
|
|
else
|
|
{
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-bar-chart-steps text-danger" viewBox="0 0 16 16">
|
|
<path d="M.5 0a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-1 0V.5A.5.5 0 0 1 .5 0zM2 1.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-6a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1z" />
|
|
</svg>
|
|
}
|
|
Schritt
|
|
</h3>
|
|
|
|
<ul class="list-group mb-3">
|
|
<li class="list-group-item d-flex justify-content-between align-items-start">
|
|
<div class="ms-2 me-auto">
|
|
<div class="fw-bold">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-braces" viewBox="0 0 16 16">
|
|
<path d="M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6zM13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6z" />
|
|
</svg> Index
|
|
</div>
|
|
@step.IndexName
|
|
</div>
|
|
</li>
|
|
<li class="list-group-item d-flex justify-content-between align-items-start">
|
|
<div class="ms-2 me-auto">
|
|
<div class="fw-bold">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-gear" viewBox="0 0 16 16">
|
|
<path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z" />
|
|
<path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z" />
|
|
</svg> Methode
|
|
</div>
|
|
@step.Method
|
|
</div>
|
|
</li>
|
|
<li class="list-group-item d-flex justify-content-between align-items-start">
|
|
<div class="ms-2 me-auto">
|
|
<div class="fw-bold">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
|
|
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
|
|
</svg> Scope
|
|
</div>
|
|
@step.Scope
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
|
|
<ul class="list-group mb-3">
|
|
@if (!String.IsNullOrEmpty(step.Argument1))
|
|
{
|
|
<li class="list-group-item d-flex justify-content-between align-items-start">
|
|
<div class="ms-2 me-auto">
|
|
<div class="fw-bold">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
|
|
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
|
|
</svg> Argument1
|
|
</div>
|
|
@step.Argument1
|
|
</div>
|
|
</li>
|
|
}
|
|
@if (!String.IsNullOrEmpty(step.Argument2))
|
|
{
|
|
<li class="list-group-item d-flex justify-content-between align-items-start">
|
|
<div class="ms-2 me-auto">
|
|
<div class="fw-bold">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
|
|
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
|
|
</svg> Argument2
|
|
</div>
|
|
@step.Argument2
|
|
</div>
|
|
</li>
|
|
}
|
|
@if (!String.IsNullOrEmpty(step.Argument3))
|
|
{
|
|
<li class="list-group-item d-flex justify-content-between align-items-start">
|
|
<div class="ms-2 me-auto">
|
|
<div class="fw-bold">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
|
|
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
|
|
</svg> Argument3
|
|
</div>
|
|
@step.Argument3
|
|
</div>
|
|
</li>
|
|
}
|
|
</ul>
|
|
|
|
<div class="btn-group mt-3" role="group" aria-label="Basic example">
|
|
<a class="btn btn-secondary" href="profiles/import/@profile.Id/steps">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
|
|
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
|
|
</svg> Back
|
|
</a>
|
|
<a class="btn btn-primary" href="profiles/import/@profile.Id/steps/@step.Id/edit">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
|
|
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
|
|
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z" />
|
|
</svg> Edit
|
|
</a>
|
|
<a class="btn btn-danger" @onclick="DeleteStep">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash3" viewBox="0 0 16 16">
|
|
<path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z" />
|
|
</svg> Delete
|
|
</a>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
@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<bool>("confirm", "Are you sure?");
|
|
if (confirmed)
|
|
{
|
|
var steps = profile.Steps.
|
|
ToList().
|
|
Where<ImportProfileStep>(s => s.Id != StepId).
|
|
ToArray();
|
|
profile.Steps = steps;
|
|
|
|
if (await Import.UpdateProfile(profile) == true)
|
|
{
|
|
Navigation.NavigateTo($"/profiles/import/{ProfileId}/steps");
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
} |