-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Dashboard): enabled custom functions and service accounts edition
Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,140 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
src/dashboard/Synapse.Dashboard/Components/CustomFunctionDetails/CustomFunctionDetails.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
@* | ||
Copyright © 2024-Present The Synapse Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*@ | ||
|
||
@namespace Synapse.Dashboard.Components | ||
|
||
@if (resource != null) | ||
{ | ||
|
||
<div class="container-fluid"> | ||
<div class="row"> | ||
<table class="table mb-3"> | ||
<tbody> | ||
<tr> | ||
<td>API Version</td> | ||
<td>@resource.ApiVersion</td> | ||
</tr> | ||
<tr> | ||
<td>Kind</td> | ||
<td>@resource.Kind</td> | ||
</tr> | ||
<tr> | ||
<td>Name</td> | ||
<td>@resource.GetName()</td> | ||
</tr> | ||
@if (resource.IsNamespaced() == true) | ||
{ | ||
<tr> | ||
<td>Namespace</td> | ||
<td>@resource.GetNamespace()</td> | ||
</tr> | ||
} | ||
<tr> | ||
<td>Creation Time</td> | ||
<td>@resource.Metadata.CreationTimestamp?.ToString("R")</td> | ||
</tr> | ||
<tr> | ||
<td>Generation</td> | ||
<td>@resource.Metadata.Generation</td> | ||
</tr> | ||
@if (resource.Metadata.Labels?.Any() == true) | ||
{ | ||
<tr> | ||
<td>Labels</td> | ||
<td> | ||
@foreach (var label in resource.Metadata.Labels) | ||
{ | ||
<span class="badge bg-primary text-dark m-1">@label.Key: @label.Value</span> | ||
} | ||
</td> | ||
</tr> | ||
} | ||
<tr> | ||
<td>Latest version</td> | ||
<td>@resource.Spec.Versions.GetLatestVersion()</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2"> | ||
Latest definition | ||
<br /> | ||
<MonacoEditor Document="resource.Spec.Versions.GetLatest()" IsReadOnly="true" /> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
} | ||
|
||
@code { | ||
|
||
CustomFunction? resource; | ||
/// <summary> | ||
/// Gets/sets the resource to display details about | ||
/// </summary> | ||
[Parameter] public CustomFunction? Resource { get; set; } | ||
|
||
/// <inheritdoc/> | ||
protected override Task OnParametersSetAsync() | ||
{ | ||
if(this.resource != this.Resource) | ||
{ | ||
this.resource = this.Resource; | ||
} | ||
return base.OnParametersSetAsync(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
src/dashboard/Synapse.Dashboard/Pages/Functions/Create/State.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// Copyright © 2024-Present The Synapse Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"), | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using Semver; | ||
using ServerlessWorkflow.Sdk.Models; | ||
using Synapse.Resources; | ||
|
||
namespace Synapse.Dashboard.Pages.Functions.Create; | ||
|
||
/// <summary> | ||
/// The <see cref="State{TState}"/> of the workflow editor | ||
/// </summary> | ||
[Feature] | ||
public record CreateFunctionViewState | ||
{ | ||
/// <summary> | ||
/// Gets a <see cref="EquatableList{T}"/> that contains all <see cref="Neuroglia.Data.Infrastructure.ResourceOriented.Namespace"/>s | ||
/// </summary> | ||
public EquatableList<Namespace>? Namespaces { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="CustomFunction"/>'s namespace | ||
/// </summary> | ||
public string? Namespace { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="CustomFunction"/>'s name | ||
/// </summary> | ||
public string? Name { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="CustomFunction"/>'s namespace, when the user is creating one | ||
/// </summary> | ||
public string? ChosenNamespace { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="CustomFunction"/>'s name, when the user is creating one | ||
/// </summary> | ||
public string? ChosenName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the function text representation | ||
/// </summary> | ||
public SemVersion Version { get; set; } = new SemVersion(1, 0, 0); | ||
|
||
/// <summary> | ||
/// Gets/sets the definition of the workflow to create | ||
/// </summary> | ||
public TaskDefinition? Function { get; set; } = null; | ||
|
||
/// <summary> | ||
/// Gets/sets the function text representation | ||
/// </summary> | ||
public string? FunctionText { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets a boolean indicating whether or not the state is being loaded | ||
/// </summary> | ||
public bool Loading { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Defines if the function is being updated | ||
/// </summary> | ||
public bool Updating { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Defines if the function is being saved | ||
/// </summary> | ||
public bool Saving { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="ProblemDetails"/> type that occurred when trying to save the resource, if any | ||
/// </summary> | ||
public Uri? ProblemType { get; set; } = null; | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="ProblemDetails"/> title that occurred when trying to save the resource, if any | ||
/// </summary> | ||
public string ProblemTitle { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="ProblemDetails"/> details that occurred when trying to save the resource, if any | ||
/// </summary> | ||
public string ProblemDetail { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// Gets/sets the <see cref="ProblemDetails"/> status that occurred when trying to save the resource, if any | ||
/// </summary> | ||
public int ProblemStatus { get; set; } = 0; | ||
|
||
/// <summary> | ||
/// Gets/sets the list of <see cref="ProblemDetails"/> errors that occurred when trying to save the resource, if any | ||
/// </summary> | ||
public IDictionary<string, string[]> ProblemErrors { get; set; } = new Dictionary<string, string[]>(); | ||
|
||
} |
Oops, something went wrong.