2020-07-02 19:39:14 +02:00
|
|
|
<div class="modal-content neomorph">
|
|
|
|
|
|
|
|
<div class="modal-card-head">
|
|
|
|
<h4 class="modal-card-title has-text-centered">
|
|
|
|
Add a new configuration for a service
|
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-card-body">
|
|
|
|
|
|
|
|
<div class="field">
|
|
|
|
<label class="label">Template</label>
|
|
|
|
<div class="control has-icons-left">
|
|
|
|
<div class="select is-small is-rounded neoSelect fullwidth">
|
|
|
|
<select class="fullwidth" @bind="SelectedTemplate">
|
|
|
|
<option value="0">No template</option>
|
|
|
|
@foreach (var template in Templates)
|
|
|
|
{
|
|
|
|
<option value="@template.Name">@($"{template.Name.First().ToString().ToUpper()}{template.Name.Substring(1)}")</option>
|
|
|
|
}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<span class="icon is-small is-left has-text-dark">
|
2020-07-06 18:01:01 +02:00
|
|
|
<i class="mdi mdi-puzzle"></i>
|
2020-07-02 19:39:14 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<p class="help">Any template to quick setup the configuration</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="field">
|
|
|
|
<label class="label">Configuration file name</label>
|
|
|
|
<div class="control has-icons-left">
|
|
|
|
<input class="input is-rounded is-small neoInput" type="text" placeholder="Name" @bind="TemplateName">
|
|
|
|
<span class="icon is-small is-left has-text-dark">
|
2020-07-06 18:01:01 +02:00
|
|
|
<i class="mdi mdi-file-code"></i>
|
2020-07-02 19:39:14 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<p class="help">Name it the same as the service which is going to run behind</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-card-foot">
|
|
|
|
|
|
|
|
<div class="level fullwidth">
|
|
|
|
<div class="level-left">
|
|
|
|
<div class="level-item">
|
|
|
|
<button type="button" class="button is-rounded neoBtnSmall is-small has-text-dark" @onclick="Cancel">
|
|
|
|
<span class="icon is-small">
|
|
|
|
<i class="mdi mdi-close"></i>
|
|
|
|
</span>
|
|
|
|
<span>Close</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="level-right">
|
|
|
|
<div class="level-item">
|
|
|
|
<button type="submit" class="button is-primary is-rounded neoBtnSmall is-small has-text-dark" @onclick="SubmitForm">
|
|
|
|
<span class="icon is-small has-text-success">
|
|
|
|
<i class="mdi mdi-plus"></i>
|
|
|
|
</span>
|
|
|
|
<span>Add</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@code {
|
|
|
|
[CascadingParameter]
|
|
|
|
BlazoredModalInstance BlazoredModal { get; set; }
|
|
|
|
|
|
|
|
string SelectedTemplate { get; set; } = "0";
|
|
|
|
[Required]
|
|
|
|
string TemplateName { get; set; }
|
|
|
|
[Parameter]
|
|
|
|
public List<Template> Templates { get; set; } = new List<Template>();
|
|
|
|
|
|
|
|
void SubmitForm() => BlazoredModal.Close(ModalResult.Ok(new NewFileForm { Name = TemplateName, SelectedTemplate = SelectedTemplate }));
|
|
|
|
void Cancel() => BlazoredModal.Cancel();
|
|
|
|
}
|