-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
443fe61
commit 7d0884d
Showing
16 changed files
with
202 additions
and
61 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
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
8 changes: 8 additions & 0 deletions
8
src/Aguacongas.TheIdServer.BlazorApp/Components/ReferenceToken.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,8 @@ | ||
using Entity = Aguacongas.IdentityServer.Store.Entity; | ||
|
||
namespace Aguacongas.TheIdServer.BlazorApp.Components | ||
{ | ||
public class ReferenceToken: TokensGrid<Entity.ReferenceToken> | ||
{ | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Aguacongas.TheIdServer.BlazorApp/Components/RefreshToken.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,8 @@ | ||
using Entity = Aguacongas.IdentityServer.Store.Entity; | ||
|
||
namespace Aguacongas.TheIdServer.BlazorApp.Components | ||
{ | ||
public class RefreshToken: TokensGrid<Entity.RefreshToken> | ||
{ | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/Aguacongas.TheIdServer.BlazorApp/Components/TokensGrid.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,63 @@ | ||
@typeparam T | ||
@inherits UserEntitesGridModel<T> | ||
@inject IJSRuntime _jsRuntime | ||
@inject NavigationManager _navigationManager | ||
|
||
<EntitiesGrid Items="@Model" TableClass="table table-hover" Context="token"> | ||
<TableHeader> | ||
<th scope="col"> | ||
<SortableHeader Property="ClientId" | ||
Text="client id" | ||
GridState="GridState" /> | ||
</th> | ||
<th scope="col"> | ||
<SortableHeader Property="Data" | ||
Text="data" | ||
GridState="GridState" /> | ||
</th> | ||
<th> | ||
<SortableHeader Property="Expiration" | ||
Text="expire at" | ||
GridState="GridState" /> | ||
</th> | ||
<th></th> | ||
</TableHeader> | ||
<RowTemplate> | ||
<td> | ||
<a href="@(_navigationManager.BaseUri)/client/@(token.ClientId)">@token.ClientId</a> | ||
</td> | ||
<td> | ||
<button type="button" class="btn btn-secondary" @onclick="() => ShowData(token)"> | ||
<span class="oi oi-code"></span> | ||
</button> | ||
</td> | ||
<td> | ||
@token.Expiration | ||
</td> | ||
<td> | ||
<AuthorizeButton CssSubClass="btn-primary" Type="button" Clicked="() => OnDeleteEntityClicked(token)"> | ||
<span class="oi oi-trash"></span> | ||
</AuthorizeButton> | ||
</td> | ||
</RowTemplate> | ||
</EntitiesGrid> | ||
<div class="modal fade" id="token-data" tabindex="-1" role="dialog" aria-labelledby="delete-modal-header" aria-hidden="true" data-backdrop="false"> | ||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header bg-secondary text-white"> | ||
<h5 class="modal-title" id="delete-modal-header">Token</h5> | ||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="row"> | ||
<div class="col text-monospace text-body"> | ||
<small><code><pre>@_selectedData</pre></code></small> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
24 changes: 24 additions & 0 deletions
24
src/Aguacongas.TheIdServer.BlazorApp/Components/TokensGrid.razor.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,24 @@ | ||
using Aguacongas.IdentityServer.Store.Entity; | ||
using Microsoft.JSInterop; | ||
using Newtonsoft.Json.Linq; | ||
using Newtonsoft.Json; | ||
using System.Threading.Tasks; | ||
|
||
namespace Aguacongas.TheIdServer.BlazorApp.Components | ||
{ | ||
public partial class TokensGrid<T> where T: IGrant | ||
{ | ||
private readonly JsonSerializerSettings _serializerOptions = new JsonSerializerSettings | ||
{ | ||
Formatting = Formatting.Indented, | ||
}; | ||
private string _selectedData; | ||
|
||
private async Task ShowData(T row) | ||
{ | ||
var token = JsonConvert.DeserializeObject<JObject>(row.Data); | ||
_selectedData = JsonConvert.SerializeObject(token, _serializerOptions); | ||
await _jsRuntime.InvokeVoidAsync("bootstrapInteropt.showModal", "token-data"); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Aguacongas.TheIdServer.BlazorApp.Models | ||
{ | ||
public class TokenData | ||
{ | ||
public string Data { get; set; } | ||
} | ||
} |
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
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
32 changes: 0 additions & 32 deletions
32
src/Aguacongas.TheIdServer.BlazorApp/wwwroot/sample-data/weather.json
This file was deleted.
Oops, something went wrong.
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