File tree Expand file tree Collapse file tree
Areas/IdentityManager/Pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
22using System . Threading . Tasks ;
3- using IdentityManager2 . Assets ;
3+ using IdentityManager2 . Api . Models ;
44using IdentityManager2 . Configuration ;
55using Microsoft . AspNetCore . Authentication ;
66using Microsoft . AspNetCore . Authorization ;
77using Microsoft . AspNetCore . Mvc ;
8+ using Newtonsoft . Json ;
89
910namespace IdentityManager2 . Api . Controllers
1011{
@@ -23,10 +24,20 @@ public PageController(IdentityManagerOptions config)
2324 [ Route ( "" , Name = IdentityManagerConstants . RouteNames . Home ) ]
2425 public IActionResult Index ( )
2526 {
26- return new EmbeddedHtmlResult (
27- Request . PathBase ,
28- "IdentityManager2.Assets.Templates.index.html" ,
29- config . SecurityConfiguration ) ;
27+ return View ( "/Areas/IdentityManager/Pages/Index.cshtml" , new PageModel
28+ {
29+ PathBase = Request . PathBase ,
30+ Model = JsonConvert . SerializeObject ( new
31+ {
32+ PathBase = Request . PathBase ,
33+ ShowLoginButton = config . SecurityConfiguration . ShowLoginButton ,
34+ oauthSettings = new
35+ {
36+ authorization_endpoint = Request . PathBase + Constants . AuthorizePath ,
37+ client_id = Constants . IdMgrClientId
38+ }
39+ } )
40+ } ) ;
3041 }
3142
3243 [ HttpGet ]
Original file line number Diff line number Diff line change 1+ namespace IdentityManager2 . Api . Models
2+ {
3+ public class PageModel
4+ {
5+ public string PathBase { get ; set ; }
6+ public string Model { get ; set ; }
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ @model IdentityManager2 .Api .Models .PageModel
2+
3+ <!DOCTYPE html>
4+ <html >
5+ <head >
6+ <meta http-equiv =" X-UA-Compatible" content =" IE=edge" />
7+ <meta charset =" utf-8" />
8+ <title >IdentityManager 2</title >
9+ <link href =" @Model.PathBase/assets/Content.bootstrap.min.css" rel =" stylesheet" />
10+ <link href =" @Model.PathBase/assets/Content.Style.min.css" rel =" stylesheet" />
11+ <link rel =" icon" type =" image/x-icon" href =" @Model.PathBase/assets/Content.favicon.ico" />
12+ <link rel =" shortcut icon" type =" image/x-icon" href =" @Model.PathBase/assets/Content.favicon.ico" />
13+ </head >
14+ <body lang =" en" ng-app =" ttIdmApp" ng-csp ng-controller =" LayoutCtrl" ng-cloak >
15+
16+ <div ng-include =" '@Model.PathBase/assets/Templates.navbar.html'" ></div >
17+
18+ <div class =" container" ng-cloak >
19+ <ng-view tt-focus ></ng-view >
20+ </div >
21+
22+ <div ng-include =" '@Model.PathBase/assets/Templates.footer.html'" ></div >
23+
24+ <script id =" model" type =" application/json" >
25+ @Html .Raw (Model .Model )
26+ </script >
27+ <script src =" @Model.PathBase/assets/Scripts.Bundle.js" ></script >
28+ </body >
29+ </html >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- <Project Sdk =" Microsoft.NET.Sdk" >
1+ <Project Sdk =" Microsoft.NET.Sdk.Razor " >
22
33 <PropertyGroup >
44 <TargetFramework >netstandard2.0</TargetFramework >
2323
2424 <EmbeddedResource Include =" Assets\Scripts\Bundle.js" />
2525
26- <EmbeddedResource Include =" Assets\Templates\index.html" />
2726 <EmbeddedResource Include =" Assets\Templates\home.html" />
2827 <EmbeddedResource Include =" Assets\Templates\users\edit.html" />
2928 <EmbeddedResource Include =" Assets\Templates\users\list.html" />
You can’t perform that action at this time.
0 commit comments