Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/go go gadgets #54

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@using System.IO
@model EPiServer.DeveloperTools.Features.AppSettings.AppSettingsModel

<div class="epi-contentArea">
<h1 class="EP-prefix">Final AppSettings Values</h1>
<p>
Displays the transformed appSettings values after the appSettings.{environment}.config has been applied
</p>
</div>
<div class="epi-formArea">

<h2 class="EP-prefix">AppSettings.json</h2>

@if (!string.IsNullOrEmpty(Model.FinalValues))
{
<pre>
@Html.Raw(Model.FinalValues)
</pre>
}

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@using System.Collections
@model EPiServer.DeveloperTools.Features.ClaimsRoles.ClaimsRolesModel

<div class="epi-contentArea">
<h1 class="EP-prefix">Claims/Roles</h1>
<p>
Displays all claims/roles for the current user
</p>
</div>
<div class="epi-formArea">

<h2 class="EP-prefix">Roles</h2>
<table cellpadding="5" cellspacing="0" border="0" class="display">
<thead>
<tr>
<th align="left">Claim</th>
<th align="left">Value</th>
</tr>
</thead>
<tbody>
@foreach (var claim in Model.Roles)
{
<tr>
<td>@claim.Type</td>
<td>@claim.Value </td>
</tr>
}
</tbody>
</table>

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using EPiServer.DeveloperTools.Features.Common;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;


namespace EPiServer.DeveloperTools.Features.AppSettings
{
public class AppSettingsController : DeveloperToolsController
{
private readonly IConfiguration _configuration;

public AppSettingsController(IConfiguration configuration)
{
_configuration = configuration;
}
public IActionResult Index()
{

var root = (IConfigurationRoot)_configuration;
var model = new AppSettingsModel { FinalValues = root.GetDebugView() };

return View(model);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace EPiServer.DeveloperTools.Features.AppSettings
{
public class AppSettingsModel
{
public string FinalValues { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using EPiServer.DeveloperTools.Features.Common;
using Microsoft.AspNetCore.Mvc;
using System.Linq;


namespace EPiServer.DeveloperTools.Features.ClaimsRoles
{
public class ClaimsRolesController : DeveloperToolsController
{
public IActionResult Index()
{
var user = base.User;
var claims = user.Identities.First().Claims.ToList();

var model = new ClaimsRolesModel { Roles = claims };

return View(model);
}
}
}
11 changes: 11 additions & 0 deletions EPiServer.DeveloperTools/Features/ClaimsRoles/ClaimsRolesModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;
using System.Security.Claims;

namespace EPiServer.DeveloperTools.Features.ClaimsRoles
{
public class ClaimsRolesModel
{
public List<Claim> Roles { get; set; }

}
}
4 changes: 3 additions & 1 deletion EPiServer.DeveloperTools/MenuProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public IEnumerable<MenuItem> GetMenuItems()
CreateUrlMenuItem("Routes", "Routes", 110),
CreateUrlMenuItem("View Locations", "ViewLocations", 120),
CreateUrlMenuItem("Module Dependencies", "ModuleDependencies", 130),
CreateUrlMenuItem("Local Object Cache", "LocalObjectCache", 140)
CreateUrlMenuItem("Local Object Cache", "LocalObjectCache", 140),
CreateUrlMenuItem("Claims And Roles", "ClaimsRoles", 150),
CreateUrlMenuItem("AppSettings", "AppSettings", 160)
};
}

Expand Down