diff --git a/Seenginx.Models/Result.cs b/Seenginx.Models/Result.cs index 6c984c2..9aee4d2 100644 --- a/Seenginx.Models/Result.cs +++ b/Seenginx.Models/Result.cs @@ -27,4 +27,21 @@ namespace Seenginx.Models public void SetData(D data) => Data = data; } + + public class Result + { + public bool AllOk { get; private set; } = true; + public string ErrorMessage { get; private set; } + public Exception Exception { get; private set; } = null; + + public Result Invalidate(string errorMessage, Exception exception = null) + { + AllOk = false; + ErrorMessage = errorMessage; + if (exception != null) + Exception = exception; + + return this; + } + } } diff --git a/Seenginx/Components/FilesWithEditor.razor b/Seenginx/Components/FilesWithEditor.razor index b2597b8..aaa179d 100644 --- a/Seenginx/Components/FilesWithEditor.razor +++ b/Seenginx/Components/FilesWithEditor.razor @@ -7,7 +7,7 @@
@@ -17,33 +17,39 @@ @if (IsAnyFileSelected) {@file.Name
+@file.Name
Any template to quick setup the configuration
@@ -32,7 +32,7 @@Name it the same as the service which is going to run behind
diff --git a/Seenginx/Shared/RenameForm.razor b/Seenginx/Shared/RenameForm.razor new file mode 100644 index 0000000..f4a0de2 --- /dev/null +++ b/Seenginx/Shared/RenameForm.razor @@ -0,0 +1,65 @@ + + +@code { + [CascadingParameter] + BlazoredModalInstance BlazoredModal { get; set; } + + [Required, Parameter, MaxLength(251)] + public string Name { get; set; } + + void SubmitForm() => BlazoredModal.Close(ModalResult.Ok(Name)); + void Cancel() => BlazoredModal.Cancel(); +} diff --git a/Seenginx/Startup.cs b/Seenginx/Startup.cs index 0a3a327..c15a831 100644 --- a/Seenginx/Startup.cs +++ b/Seenginx/Startup.cs @@ -48,7 +48,6 @@ namespace Seenginx services.AddTransient