Skip to content

Commit

Permalink
update tab title, inject variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Oct 21, 2023
1 parent 6657c6b commit 5d773fb
Show file tree
Hide file tree
Showing 33 changed files with 80 additions and 128 deletions.
4 changes: 2 additions & 2 deletions OryAdmin/Components/App.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@inject ICustomTranslator Translator
@inject ICustomTranslator translator

<!DOCTYPE html>
<html lang="@Translator.GetTranslation("en")">
<html lang="@translator.GetTranslation("en")">

<head>
<meta charset="utf-8"/>
Expand Down
4 changes: 2 additions & 2 deletions OryAdmin/Components/Elements/RefreshPageButton.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject NavigationManager Navigation
@inject NavigationManager nav

<button class="button is-info" @onclick="@RefreshPage">
Refresh Page
Expand All @@ -8,7 +8,7 @@

private void RefreshPage()
{
Navigation.Refresh(true);
nav.Refresh(true);
}

}
2 changes: 1 addition & 1 deletion OryAdmin/Components/Layout/NavbarMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject EnvService EnvService
@inject EnvService env
<nav class="navbar is-fixed-top has-shadow is-info" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="">
Expand Down
16 changes: 8 additions & 8 deletions OryAdmin/Components/Layout/SideMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject EnvService EnvService
@inject EnvService env

<aside class="is-narrow-mobile is-fullheight">
<p class="menu-label">Home</p>
Expand All @@ -14,14 +14,14 @@
<p class="menu-label">Identities</p>
<ul class="menu-list">
<li>
<a href="identities/users" class="@(EnvService.EnabledKratos ? "" : "is-disabled")">
<a href="identities/users" class="@(env.EnabledKratos ? "" : "is-disabled")">
<span class="icon" style="height: 16px; width: 16px">
<i class="fa-solid fa-users"></i>
</span> Users
</a>
</li>
<li>
<a href="identities/schemas" class="@(EnvService.EnabledKratos ? "" : "is-disabled")">
<a href="identities/schemas" class="@(env.EnabledKratos ? "" : "is-disabled")">
<span class="icon-text">
<span class="icon">
<i class="fas fa-receipt"></i>
Expand All @@ -31,7 +31,7 @@
</a>
</li>
<li>
<a href="identities/messages" class="@(EnvService.EnabledKratos ? "" : "is-disabled")">
<a href="identities/messages" class="@(env.EnabledKratos ? "" : "is-disabled")">
<span class="icon" style="height: 16px; width: 16px">
<i class="fa-solid fa-envelope"></i>
</span> Message Log
Expand All @@ -41,21 +41,21 @@
<p class="menu-label">OAuth2</p>
<ul class="menu-list">
<li>
<a href="oauth2" class="@(EnvService.EnabledHydra ? "" : "is-disabled")">
<a href="oauth2" class="@(env.EnabledHydra ? "" : "is-disabled")">
<span class="icon">
<i class="fa-solid fa-circle-info"></i>
</span> Information
</a>
</li>
<li>
<a href="oauth2/clients" class="@(EnvService.EnabledHydra ? "" : "is-disabled")">
<a href="oauth2/clients" class="@(env.EnabledHydra ? "" : "is-disabled")">
<span class="icon" style="height: 16px; width: 16px">
<i class="fa-solid fa-window-restore"></i>
</span> Clients
</a>
</li>
<li>
<a href="oauth2/issuers" class="@(EnvService.EnabledHydra ? "" : "is-disabled")">
<a href="oauth2/issuers" class="@(env.EnabledHydra ? "" : "is-disabled")">
<span class="icon" style="height: 16px; width: 16px">
<i class="fa-solid fa-address-card"></i>
</span> Grant Issuers
Expand All @@ -65,7 +65,7 @@
<p class="menu-label">Permissions</p>
<ul class="menu-list">
<li>
<a href="permissions" class="@(EnvService.EnabledKeto ? "" : "is-disabled")">
<a href="permissions" class="@(env.EnabledKeto ? "" : "is-disabled")">
<span class="icon" style="height: 16px; width: 16px">
<i class="fa-solid fa-rectangle-list"></i>
</span> Permissions
Expand Down
28 changes: 13 additions & 15 deletions OryAdmin/Components/Pages/Home.razor
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
@page "/"
@inject EnvService EnvService
@inject EnvService env
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger

<PageTitle>Services</PageTitle>
<PageTitle>Services | OryAdmin</PageTitle>

<h1 class="title">Services</h1>
<section class="columns is-multiline">
@if (EnvService.EnabledKratos)
@if (env.EnabledKratos)
{
<div class="column is-half">
<div class="box">
Expand All @@ -18,11 +16,11 @@
<tbody>
<tr>
<td>Admin URL</td>
<td>@EnvService.KratosAdminUrl</td>
<td>@env.KratosAdminUrl</td>
</tr>
<tr>
<td>Public URL</td>
<td>@EnvService.KratosPublicUrl</td>
<td>@env.KratosPublicUrl</td>
</tr>
<tr>
<td>Alive</td>
Expand All @@ -47,7 +45,7 @@
</div>
</div>
}
@if (EnvService.EnabledHydra)
@if (env.EnabledHydra)
{
<div class="column is-half">
<div class="box">
Expand All @@ -56,11 +54,11 @@
<tbody>
<tr>
<td>Admin URL</td>
<td>@EnvService.HydraAdminUrl</td>
<td>@env.HydraAdminUrl</td>
</tr>
<tr>
<td>Public URL</td>
<td>@EnvService.HydraAdminUrl</td>
<td>@env.HydraAdminUrl</td>
</tr>
<tr>
<td>Alive</td>
Expand All @@ -85,7 +83,7 @@
</div>
</div>
}
@if (EnvService.EnabledOathkeeper)
@if (env.EnabledOathkeeper)
{
<div class="column is-half">
<div class="box">
Expand All @@ -94,7 +92,7 @@
<tbody>
<tr>
<td>API URL</td>
<td>@EnvService.OathKeeperApiUrl</td>
<td>@env.OathKeeperApiUrl</td>
</tr>
<tr>
<td>Alive</td>
Expand All @@ -120,7 +118,7 @@
</div>
</div>
}
@if (EnvService.EnabledKeto)
@if (env.EnabledKeto)
{
<div class="column is-half">
<div class="box">
Expand All @@ -129,11 +127,11 @@
<tbody>
<tr>
<td>Read URL</td>
<td>@EnvService.KetoReadUrl</td>
<td>@env.KetoReadUrl</td>
</tr>
<tr>
<td>Write URL</td>
<td>@EnvService.KetoWriteUrl</td>
<td>@env.KetoWriteUrl</td>
</tr>
<tr>
<td>Alive</td>
Expand Down
8 changes: 4 additions & 4 deletions OryAdmin/Components/Pages/Home.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override async Task OnInitializedAsync()
var tasks = new List<Task>();

// kratos
if (EnvService.EnabledKratos)
if (env.EnabledKratos)
tasks.AddRange(new[]
{
Task.Run(async () =>
Expand Down Expand Up @@ -72,7 +72,7 @@ protected override async Task OnInitializedAsync()
});

// hydra
if (EnvService.EnabledHydra)
if (env.EnabledHydra)
tasks.AddRange(new[]
{
Task.Run(async () =>
Expand Down Expand Up @@ -114,7 +114,7 @@ protected override async Task OnInitializedAsync()
});

// oathkeeper
if (EnvService.EnabledOathkeeper)
if (env.EnabledOathkeeper)
tasks.AddRange(new[]
{
Task.Run(async () =>
Expand Down Expand Up @@ -156,7 +156,7 @@ protected override async Task OnInitializedAsync()
});

// keto
if (EnvService.EnabledKeto)
if (env.EnabledKeto)
tasks.AddRange(new[]
{
Task.Run(async () =>
Expand Down
6 changes: 2 additions & 4 deletions OryAdmin/Components/Pages/Identities/Messages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
@page "/identities/messages"
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger
@inject NavigationManager Navigation
@inject NavigationManager nav

<PageTitle>Message Log</PageTitle>
<PageTitle>Message Log | OryAdmin</PageTitle>

<h1 class="title">Message Log</h1>
@if (_isLoading)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ protected override async Task OnInitializedAsync()

private void RefreshPage(MouseEventArgs arg)
{
Navigation.Refresh(true);
nav.Refresh(true);
}
}
5 changes: 1 addition & 4 deletions OryAdmin/Components/Pages/Identities/Messages/View.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
@using Ory.Kratos.Client.Model
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger
@inject NavigationManager Navigation

<PageTitle>View Message</PageTitle>
<PageTitle>View Message | OryAdmin</PageTitle>

<h1 class="title">View Message</h1>
@if (_isLoading)
Expand Down
5 changes: 1 addition & 4 deletions OryAdmin/Components/Pages/Identities/Schemas/Index.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
@page "/identities/schemas"
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger
@inject NavigationManager Navigation

<PageTitle>Identity Schemas</PageTitle>
<PageTitle>Identity Schemas | OryAdmin</PageTitle>

<h1 class="title">Identity Schemas</h1>
@if (_isLoading)
Expand Down
6 changes: 2 additions & 4 deletions OryAdmin/Components/Pages/Identities/Users/Create.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
@page "/identities/users/create"
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger
@inject NavigationManager Navigation
@inject NavigationManager nav

<PageTitle>Create Identity</PageTitle>
<PageTitle>Create Identity | OryAdmin</PageTitle>

<h1 class="title">Create Identity</h1>
@if (_isLoading)
Expand Down
7 changes: 5 additions & 2 deletions OryAdmin/Components/Pages/Identities/Users/Create.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ public partial class Create
private bool _isLoading = true;

private List<string>? _schemaIds;
[SupplyParameterFromQuery(Name = "schema")] private string? SchemaId { get; set; }
private string? _selectedSchema;
private List<TraitsSchemaData>? _traitsSchemas;

[SupplyParameterFromQuery(Name = "schema")]
private string? SchemaId { get; set; }

[Inject] private ApiService ApiService { get; set; } = default!;
[Inject] private IdentitySchemaService SchemaService { get; set; } = default!;

Expand Down Expand Up @@ -48,7 +51,7 @@ private async Task SubmitForm()
return;
}

Navigation.NavigateTo("identities/users");
nav.NavigateTo("identities/users");
}

private void UpdateValue(TraitsSchemaData schema, ChangeEventArgs args)
Expand Down
6 changes: 2 additions & 4 deletions OryAdmin/Components/Pages/Identities/Users/Edit.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
@page "/identities/users/{UserId}/edit"
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger
@inject NavigationManager Navigation
@inject NavigationManager nav

<PageTitle>Edit Identity</PageTitle>
<PageTitle>Edit Identity | OryAdmin</PageTitle>

<h1 class="title">Edit Identity</h1>

Expand Down
4 changes: 2 additions & 2 deletions OryAdmin/Components/Pages/Identities/Users/Edit.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected override async Task OnInitializedAsync()

private void Cancel()
{
Navigation.NavigateTo($"identities/users/{UserId}");
nav.NavigateTo($"identities/users/{UserId}");
}

private async Task SubmitForm()
Expand All @@ -45,7 +45,7 @@ private async Task SubmitForm()
return;
}

Navigation.NavigateTo($"identities/users/{UserId}");
nav.NavigateTo($"identities/users/{UserId}");
}

private void UpdateValue(TraitsSchemaData schema, ChangeEventArgs args)
Expand Down
5 changes: 1 addition & 4 deletions OryAdmin/Components/Pages/Identities/Users/Index.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
@page "/identities/users"
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger
@inject NavigationManager Navigation

<PageTitle>Identities</PageTitle>
<PageTitle>Identities | OryAdmin</PageTitle>

<h1 class="title">Identities</h1>
<div class="buttons">
Expand Down
6 changes: 2 additions & 4 deletions OryAdmin/Components/Pages/Identities/Users/View.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
@page "/identities/users/{UserId}"
@attribute [StreamRendering]
@attribute [RenderModeInteractiveServer]
@inject ICustomTranslator Translator
@inject ILogger<Home> Logger
@inject NavigationManager Navigation
@inject NavigationManager nav

<PageTitle>View Identity</PageTitle>
<PageTitle>View Identity | OryAdmin</PageTitle>

<h1 class="title">View Identity</h1>
@if (_isLoading)
Expand Down
Loading

0 comments on commit 5d773fb

Please sign in to comment.