Initial migration
This commit is contained in:
parent
9b0404082a
commit
d1faa0ee5f
|
@ -7,7 +7,7 @@
|
||||||
@using Oqtane.Shared
|
@using Oqtane.Shared
|
||||||
@namespace Oqtane.Modules.Admin.Login
|
@namespace Oqtane.Modules.Admin.Login
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IJSRuntime jsRuntime
|
@inject IJSRuntime jsRuntime
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
@inject IServiceProvider ServiceProvider
|
@inject IServiceProvider ServiceProvider
|
||||||
|
@ -36,8 +36,8 @@
|
||||||
<input type="checkbox" class="form-check-input" name="Remember" @bind="@Remember" />
|
<input type="checkbox" class="form-check-input" name="Remember" @bind="@Remember" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@Login">Login</button>
|
<button type="button" class="btn btn-primary" @onclick="Login">Login</button>
|
||||||
<button type="button" class="btn btn-secondary" @onclick="@Cancel">Cancel</button>
|
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</NotAuthorized>
|
</NotAuthorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
{
|
{
|
||||||
authstateprovider.NotifyAuthenticationChanged();
|
authstateprovider.NotifyAuthenticationChanged();
|
||||||
PageState.Reload = Constants.ReloadSite;
|
PageState.Reload = Constants.ReloadSite;
|
||||||
UriHelper.NavigateTo(NavigateUrl(ReturnUrl));
|
NavigationManager.NavigateTo(NavigateUrl(ReturnUrl));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -100,6 +100,6 @@
|
||||||
private void Cancel()
|
private void Cancel()
|
||||||
{
|
{
|
||||||
string ReturnUrl = PageState.QueryString["returnurl"];
|
string ReturnUrl = PageState.QueryString["returnurl"];
|
||||||
UriHelper.NavigateTo(ReturnUrl);
|
NavigationManager.NavigateTo(ReturnUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@using Oqtane.Shared
|
@using Oqtane.Shared
|
||||||
@namespace Oqtane.Modules.Admin.ModuleDefinitions
|
@namespace Oqtane.Modules.Admin.ModuleDefinitions
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IFileService FileService
|
@inject IFileService FileService
|
||||||
@inject IModuleDefinitionService ModuleDefinitionService
|
@inject IModuleDefinitionService ModuleDefinitionService
|
||||||
|
|
||||||
|
@ -45,6 +45,6 @@ else
|
||||||
{
|
{
|
||||||
await ModuleDefinitionService.InstallModulesAsync();
|
await ModuleDefinitionService.InstallModulesAsync();
|
||||||
PageState.Reload = Constants.ReloadApplication;
|
PageState.Reload = Constants.ReloadApplication;
|
||||||
UriHelper.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
@using Oqtane.Modules.Controls
|
@using Oqtane.Modules.Controls
|
||||||
@namespace Oqtane.Modules.Admin.ModuleSettings
|
@namespace Oqtane.Modules.Admin.ModuleSettings
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IThemeService ThemeService
|
@inject IThemeService ThemeService
|
||||||
@inject IModuleService ModuleService
|
@inject IModuleService ModuleService
|
||||||
@inject IPageModuleService PageModuleService
|
@inject IPageModuleService PageModuleService
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
|
|
||||||
@DynamicComponent
|
@DynamicComponent
|
||||||
|
|
||||||
<button type="button" class="btn btn-success" @onclick="@SaveModule">Save</button>
|
<button type="button" class="btn btn-success" @onclick="SaveModule">Save</button>
|
||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
PageState.Reload = Constants.ReloadPage;
|
PageState.Reload = Constants.ReloadPage;
|
||||||
UriHelper.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
@using Oqtane.Security
|
@using Oqtane.Security
|
||||||
@namespace Oqtane.Modules.Admin.Pages
|
@namespace Oqtane.Modules.Admin.Pages
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IPageService PageService
|
@inject IPageService PageService
|
||||||
@inject IThemeService ThemeService
|
@inject IThemeService ThemeService
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<label for="Name" class="control-label">Parent: </label>
|
<label for="Name" class="control-label">Parent: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select class="form-control" @onchange="@(e => ParentChanged(e))">
|
<select class="form-control" @onchange="(e => ParentChanged(e))">
|
||||||
<option value=""><Site Root></option>
|
<option value=""><Site Root></option>
|
||||||
@foreach (Page page in pages)
|
@foreach (Page page in pages)
|
||||||
{
|
{
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button type="button" class="btn btn-success" @onclick="@SavePage">Save</button>
|
<button type="button" class="btn btn-success" @onclick="SavePage">Save</button>
|
||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParentChanged(UIChangeEventArgs e)
|
private void ParentChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -254,7 +254,7 @@
|
||||||
await PageService.UpdatePageOrderAsync(page.SiteId, page.ParentId);
|
await PageService.UpdatePageOrderAsync(page.SiteId, page.ParentId);
|
||||||
|
|
||||||
PageState.Reload = Constants.ReloadSite;
|
PageState.Reload = Constants.ReloadSite;
|
||||||
UriHelper.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
@using Oqtane.Security
|
@using Oqtane.Security
|
||||||
@namespace Oqtane.Modules.Admin.Pages
|
@namespace Oqtane.Modules.Admin.Pages
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IPageService PageService
|
@inject IPageService PageService
|
||||||
@inject IThemeService ThemeService
|
@inject IThemeService ThemeService
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button type="button" class="btn btn-danger" @onclick="@DeletePage">Delete</button>
|
<button type="button" class="btn btn-danger" @onclick="DeletePage">Delete</button>
|
||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
@ -181,11 +181,11 @@
|
||||||
PageState.Reload = Constants.ReloadSite;
|
PageState.Reload = Constants.ReloadSite;
|
||||||
if (PageState.Page.Name == "Page Management")
|
if (PageState.Page.Name == "Page Management")
|
||||||
{
|
{
|
||||||
UriHelper.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UriHelper.NavigateTo(NavigateUrl(""));
|
NavigationManager.NavigateTo(NavigateUrl(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
@using Oqtane.Security
|
@using Oqtane.Security
|
||||||
@namespace Oqtane.Modules.Admin.Pages
|
@namespace Oqtane.Modules.Admin.Pages
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IPageService PageService
|
@inject IPageService PageService
|
||||||
@inject IThemeService ThemeService
|
@inject IThemeService ThemeService
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
<label for="Name" class="control-label">Parent: </label>
|
<label for="Name" class="control-label">Parent: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select class="form-control" @onchange="@(e => ParentChanged(e))">
|
<select class="form-control" @onchange="(e => ParentChanged(e))">
|
||||||
<option value=""><Site Root></option>
|
<option value=""><Site Root></option>
|
||||||
@foreach (Page page in pages)
|
@foreach (Page page in pages)
|
||||||
{
|
{
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button type="button" class="btn btn-success" @onclick="@SavePage">Save</button>
|
<button type="button" class="btn btn-success" @onclick="SavePage">Save</button>
|
||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
@ -215,7 +215,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParentChanged(UIChangeEventArgs e)
|
private void ParentChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -298,7 +298,7 @@
|
||||||
await PageService.UpdatePageOrderAsync(page.SiteId, currentparentid);
|
await PageService.UpdatePageOrderAsync(page.SiteId, currentparentid);
|
||||||
|
|
||||||
PageState.Reload = Constants.ReloadSite;
|
PageState.Reload = Constants.ReloadSite;
|
||||||
UriHelper.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@using Oqtane.Services
|
@using Oqtane.Services
|
||||||
@namespace Oqtane.Modules.Admin.Profile
|
@namespace Oqtane.Modules.Admin.Profile
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
@inject IProfileService ProfileService
|
@inject IProfileService ProfileService
|
||||||
@inject ISettingService SettingService
|
@inject ISettingService SettingService
|
||||||
|
@ -49,13 +49,13 @@
|
||||||
<label for="@p.Name" class="control-label">@p.Title: </label>
|
<label for="@p.Name" class="control-label">@p.Title: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" placeholder="@p.Description" @onchange="@(e => ProfileChanged(e, p.Name))" />
|
<input class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" placeholder="@p.Description" @onchange="(e => ProfileChanged(e, p.Name))" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@SaveUser">Save</button>
|
<button type="button" class="btn btn-primary" @onclick="SaveUser">Save</button>
|
||||||
<button type="button" class="btn btn-secondary" @onclick="@Cancel">Cancel</button>
|
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
await UserService.UpdateUserAsync(user);
|
await UserService.UpdateUserAsync(user);
|
||||||
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
|
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
|
||||||
|
|
||||||
UriHelper.NavigateTo("");
|
NavigationManager.NavigateTo("");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -117,10 +117,10 @@
|
||||||
|
|
||||||
private void Cancel()
|
private void Cancel()
|
||||||
{
|
{
|
||||||
UriHelper.NavigateTo(NavigateUrl(""));
|
NavigationManager.NavigateTo(NavigateUrl(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProfileChanged(UIChangeEventArgs e, string SettingName)
|
private void ProfileChanged(ChangeEventArgs e, string SettingName)
|
||||||
{
|
{
|
||||||
string value = (string)e.Value;
|
string value = (string)e.Value;
|
||||||
settings = SettingService.SetSetting(settings, SettingName, value);
|
settings = SettingService.SetSetting(settings, SettingName, value);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
@using Oqtane.Services
|
@using Oqtane.Services
|
||||||
@namespace Oqtane.Modules.Admin.Register
|
@namespace Oqtane.Modules.Admin.Register
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -16,8 +16,8 @@
|
||||||
<label for="Password" class="control-label">Password: </label>
|
<label for="Password" class="control-label">Password: </label>
|
||||||
<input type="password" name="Password" class="form-control" placeholder="Password" @bind="@Password" />
|
<input type="password" name="Password" class="form-control" placeholder="Password" @bind="@Password" />
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@RegisterUser">Register</button>
|
<button type="button" class="btn btn-primary" @onclick="RegisterUser">Register</button>
|
||||||
<button type="button" class="btn btn-secondary" @onclick="@Cancel">Cancel</button>
|
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
@ -36,11 +36,11 @@
|
||||||
user.IsHost = false;
|
user.IsHost = false;
|
||||||
user.Password = Password;
|
user.Password = Password;
|
||||||
await UserService.AddUserAsync(user);
|
await UserService.AddUserAsync(user);
|
||||||
UriHelper.NavigateTo("");
|
NavigationManager.NavigateTo("");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Cancel()
|
private void Cancel()
|
||||||
{
|
{
|
||||||
UriHelper.NavigateTo(NavigateUrl("")); // navigate to home
|
NavigationManager.NavigateTo(NavigateUrl("")); // navigate to home
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
@using Oqtane.Security
|
@using Oqtane.Security
|
||||||
@namespace Oqtane.Modules.Admin.Sites
|
@namespace Oqtane.Modules.Admin.Sites
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject ITenantService TenantService
|
@inject ITenantService TenantService
|
||||||
@inject IAliasService AliasService
|
@inject IAliasService AliasService
|
||||||
@inject ISiteService SiteService
|
@inject ISiteService SiteService
|
||||||
|
@ -58,7 +58,7 @@ else
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button type="button" class="btn btn-success" @onclick="@SaveSite">Save</button>
|
<button type="button" class="btn btn-success" @onclick="SaveSite">Save</button>
|
||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +113,6 @@ else
|
||||||
|
|
||||||
await PageService.AddPageAsync(p);
|
await PageService.AddPageAsync(p);
|
||||||
|
|
||||||
UriHelper.NavigateTo(url, true);
|
NavigationManager.NavigateTo(url, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: right;"><label for="Username" class="control-label">User: </label></td>
|
<td style="text-align: right;"><label for="Username" class="control-label">User: </label></td>
|
||||||
<td><input type="text" name="Username" class="form-control" placeholder="Enter Username" @bind="@username" /></td>
|
<td><input type="text" name="Username" class="form-control" placeholder="Enter Username" @bind="@username" /></td>
|
||||||
<td style="text-align: left;"><button type="button" class="btn btn-primary" @onclick="@AddUser">Add</button></td>
|
<td style="text-align: left;"><button type="button" class="btn btn-primary" @onclick="AddUser">Add</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
Current count: @currentCount
|
Current count: @currentCount
|
||||||
<br />
|
<br />
|
||||||
<button type="button" class="btn btn-primary" @onclick="@IncrementCount">Click me</button>
|
<button type="button" class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
@using Oqtane.Shared;
|
@using Oqtane.Shared;
|
||||||
@namespace Oqtane.Modules.HtmlText
|
@namespace Oqtane.Modules.HtmlText
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject HttpClient http
|
@inject HttpClient http
|
||||||
@inject SiteState sitestate
|
@inject SiteState sitestate
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button type="button" class="btn btn-success" @onclick="@SaveContent">Save</button>
|
<button type="button" class="btn btn-success" @onclick="SaveContent">Save</button>
|
||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||||
if (htmltext != null)
|
if (htmltext != null)
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||||
if (htmltext != null)
|
if (htmltext != null)
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
await htmltextservice.AddHtmlTextAsync(htmltext);
|
await htmltextservice.AddHtmlTextAsync(htmltext);
|
||||||
}
|
}
|
||||||
PageState.Reload = Constants.ReloadPage;
|
PageState.Reload = Constants.ReloadPage;
|
||||||
UriHelper.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
@using Oqtane.Shared;
|
@using Oqtane.Shared;
|
||||||
@namespace Oqtane.Modules.HtmlText
|
@namespace Oqtane.Modules.HtmlText
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject HttpClient http
|
@inject HttpClient http
|
||||||
@inject SiteState sitestate
|
@inject SiteState sitestate
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||||
if (htmltext != null)
|
if (htmltext != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,18 +13,18 @@ namespace Oqtane.Modules.HtmlText.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public HtmlTextService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public HtmlTextService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "HtmlText"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "HtmlText"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<HtmlTextInfo> GetHtmlTextAsync(int ModuleId)
|
public async Task<HtmlTextInfo> GetHtmlTextAsync(int ModuleId)
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<!--<RestoreAdditionalProjectSources>
|
||||||
<RestoreAdditionalProjectSources>
|
|
||||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
||||||
</RestoreAdditionalProjectSources>
|
</RestoreAdditionalProjectSources>-->
|
||||||
<LangVersion>7.3</LangVersion>
|
|
||||||
<RazorLangVersion>3.0</RazorLangVersion>
|
<RazorLangVersion>3.0</RazorLangVersion>
|
||||||
<Configurations>Debug;Release;Wasm</Configurations>
|
<Configurations>Debug;Release;Wasm</Configurations>
|
||||||
<Version>0.0.1</Version>
|
<Version>0.0.1</Version>
|
||||||
|
@ -27,13 +26,17 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview8.19405.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19424.4" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19424.4" PrivateAssets="all" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview8.19405.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview9.19424.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Oqtane.Shared\Oqtane.Shared.csproj" />
|
<ProjectReference Include="..\Oqtane.Shared\Oqtane.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- there may be other elements here -->
|
||||||
|
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Net.Http;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using Oqtane.Services;
|
using Oqtane.Services;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
@ -11,20 +12,20 @@ namespace Oqtane.Providers
|
||||||
{
|
{
|
||||||
public class IdentityAuthenticationStateProvider : AuthenticationStateProvider
|
public class IdentityAuthenticationStateProvider : AuthenticationStateProvider
|
||||||
{
|
{
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
|
|
||||||
public IdentityAuthenticationStateProvider(IUriHelper urihelper, SiteState sitestate)
|
public IdentityAuthenticationStateProvider(NavigationManager NavigationManager, SiteState sitestate)
|
||||||
{
|
{
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
|
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
|
||||||
{
|
{
|
||||||
// hack: create a new HttpClient rather than relying on the registered service as the AuthenticationStateProvider is initialized prior to IUriHelper ( https://github.com/aspnet/AspNetCore/issues/11867 )
|
// hack: create a new HttpClient rather than relying on the registered service as the AuthenticationStateProvider is initialized prior to NavigationManager ( https://github.com/aspnet/AspNetCore/issues/11867 )
|
||||||
HttpClient http = new HttpClient();
|
HttpClient http = new HttpClient();
|
||||||
string apiurl = ServiceBase.CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "User") + "/authenticate";
|
string apiurl = ServiceBase.CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "User") + "/authenticate";
|
||||||
User user = await http.GetJsonAsync<User>(apiurl);
|
User user = await http.GetJsonAsync<User>(apiurl);
|
||||||
|
|
||||||
ClaimsIdentity identity = new ClaimsIdentity();
|
ClaimsIdentity identity = new ClaimsIdentity();
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public AliasService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public AliasService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Alias"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Alias"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Alias>> GetAliasesAsync()
|
public async Task<List<Alias>> GetAliasesAsync()
|
||||||
|
|
|
@ -8,19 +8,19 @@ namespace Oqtane.Services
|
||||||
public class FileService : ServiceBase, IFileService
|
public class FileService : ServiceBase, IFileService
|
||||||
{
|
{
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
private readonly IJSRuntime jsRuntime;
|
private readonly IJSRuntime jsRuntime;
|
||||||
|
|
||||||
public FileService(SiteState sitestate, IUriHelper urihelper, IJSRuntime jsRuntime)
|
public FileService(SiteState sitestate, NavigationManager NavigationManager, IJSRuntime jsRuntime)
|
||||||
{
|
{
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
this.jsRuntime = jsRuntime;
|
this.jsRuntime = jsRuntime;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "File"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "File"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UploadFilesAsync(string Folder)
|
public async Task UploadFilesAsync(string Folder)
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public InstallationService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public InstallationService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Installation"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Installation"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GenericResponse> IsInstalled()
|
public async Task<GenericResponse> IsInstalled()
|
||||||
|
|
|
@ -14,18 +14,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public ModuleDefinitionService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public ModuleDefinitionService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "ModuleDefinition"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "ModuleDefinition"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<ModuleDefinition>> GetModuleDefinitionsAsync()
|
public async Task<List<ModuleDefinition>> GetModuleDefinitionsAsync()
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public ModuleService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public ModuleService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Module"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Module"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Module>> GetModulesAsync(int PageId)
|
public async Task<List<Module>> GetModulesAsync(int PageId)
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public PageModuleService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public PageModuleService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "PageModule"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "PageModule"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<PageModule>> GetPageModulesAsync()
|
public async Task<List<PageModule>> GetPageModulesAsync()
|
||||||
|
|
|
@ -13,18 +13,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public PageService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public PageService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Page"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Page"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Page>> GetPagesAsync(int SiteId)
|
public async Task<List<Page>> GetPagesAsync(int SiteId)
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public ProfileService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public ProfileService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Profile"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Profile"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Profile>> GetProfilesAsync()
|
public async Task<List<Profile>> GetProfilesAsync()
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public RoleService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public RoleService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Role"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Role"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Role>> GetRolesAsync()
|
public async Task<List<Role>> GetRolesAsync()
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public SettingService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public SettingService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Setting"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Setting"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Dictionary<string, string>> GetHostSettingsAsync()
|
public async Task<Dictionary<string, string>> GetHostSettingsAsync()
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public SiteService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public SiteService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Site"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Site"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Site>> GetSitesAsync()
|
public async Task<List<Site>> GetSitesAsync()
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public TenantService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public TenantService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Tenant"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Tenant"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Tenant>> GetTenantsAsync()
|
public async Task<List<Tenant>> GetTenantsAsync()
|
||||||
|
|
|
@ -14,18 +14,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public ThemeService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public ThemeService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Theme"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Theme"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Theme>> GetThemesAsync()
|
public async Task<List<Theme>> GetThemesAsync()
|
||||||
|
|
|
@ -12,18 +12,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public UserRoleService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public UserRoleService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "UserRole"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "UserRole"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<UserRole>> GetUserRolesAsync()
|
public async Task<List<UserRole>> GetUserRolesAsync()
|
||||||
|
|
|
@ -13,18 +13,18 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly SiteState sitestate;
|
private readonly SiteState sitestate;
|
||||||
private readonly IUriHelper urihelper;
|
private readonly NavigationManager NavigationManager;
|
||||||
|
|
||||||
public UserService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
public UserService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.sitestate = sitestate;
|
this.sitestate = sitestate;
|
||||||
this.urihelper = urihelper;
|
this.NavigationManager = NavigationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string apiurl
|
private string apiurl
|
||||||
{
|
{
|
||||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "User"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "User"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<User>> GetUsersAsync(int SiteId)
|
public async Task<List<User>> GetUsersAsync(int SiteId)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
@using Oqtane.Models
|
@using Oqtane.Models
|
||||||
@using Oqtane.Shared
|
@using Oqtane.Shared
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.Shared
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IInstallationService InstallationService
|
@inject IInstallationService InstallationService
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
<label for="Title" class="control-label" style="font-weight: bold">Integrated Security: </label>
|
<label for="Title" class="control-label" style="font-weight: bold">Integrated Security: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select class="custom-select" @onchange="@SetIntegratedSecurity">
|
<select class="custom-select" @onchange="SetIntegratedSecurity">
|
||||||
<option value="true" selected>True</option>
|
<option value="true" selected>True</option>
|
||||||
<option value="false">False</option>
|
<option value="false">False</option>
|
||||||
</select>
|
</select>
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="mx-auto text-center">
|
<div class="mx-auto text-center">
|
||||||
<button type="button" class="btn btn-success" @onclick="@Install">Install Now</button><br /><br />
|
<button type="button" class="btn btn-success" @onclick="Install">Install Now</button><br /><br />
|
||||||
@((MarkupString)@Message)
|
@((MarkupString)@Message)
|
||||||
</div>
|
</div>
|
||||||
<div class="loading" style="@LoadingDisplay"></div>
|
<div class="loading" style="@LoadingDisplay"></div>
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
private string IntegratedSecurityDisplay = "display:none;";
|
private string IntegratedSecurityDisplay = "display:none;";
|
||||||
private string LoadingDisplay = "display:none;";
|
private string LoadingDisplay = "display:none;";
|
||||||
|
|
||||||
private void SetIntegratedSecurity(UIChangeEventArgs e)
|
private void SetIntegratedSecurity(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
if (Convert.ToBoolean(e.Value))
|
if (Convert.ToBoolean(e.Value))
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
user.Password = HostPassword;
|
user.Password = HostPassword;
|
||||||
user = await UserService.AddUserAsync(user);
|
user = await UserService.AddUserAsync(user);
|
||||||
|
|
||||||
UriHelper.NavigateTo("", true);
|
NavigationManager.NavigateTo("", true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Oqtane.Shared
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<string> GetCookie(string name)
|
public ValueTask<string> GetCookie(string name)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ namespace Oqtane.Shared
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
return Task.FromResult(string.Empty);
|
return new ValueTask<string>(Task.FromResult(string.Empty));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace Oqtane.Shared
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<string> GetElementByName(string name)
|
public ValueTask<string> GetElementByName(string name)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -67,7 +67,7 @@ namespace Oqtane.Shared
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
return Task.FromResult(string.Empty);
|
return new ValueTask<string>(Task.FromResult(string.Empty));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
@using System.Collections.Generic
|
@using System.Collections.Generic
|
||||||
@using Oqtane.Shared
|
@using Oqtane.Shared
|
||||||
@using Oqtane.Security
|
@using Oqtane.Security
|
||||||
|
@using Microsoft.AspNetCore.Components.Authorization
|
||||||
@using Microsoft.AspNetCore.Components.Routing
|
@using Microsoft.AspNetCore.Components.Routing
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.Shared
|
||||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||||
@inject SiteState SiteState
|
@inject SiteState SiteState
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject INavigationInterception NavigationInterception
|
@inject INavigationInterception NavigationInterception
|
||||||
@inject IComponentContext ComponentContext
|
|
||||||
@inject IAliasService AliasService
|
@inject IAliasService AliasService
|
||||||
@inject ITenantService TenantService
|
@inject ITenantService TenantService
|
||||||
@inject ISiteService SiteService
|
@inject ISiteService SiteService
|
||||||
|
@ -41,8 +41,8 @@
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
_absoluteUri = UriHelper.GetAbsoluteUri();
|
_absoluteUri = NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri;
|
||||||
UriHelper.OnLocationChanged += OnLocationChanged;
|
NavigationManager.LocationChanged += LocationChanged;
|
||||||
|
|
||||||
DynamicComponent = builder =>
|
DynamicComponent = builder =>
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
UriHelper.OnLocationChanged -= OnLocationChanged;
|
NavigationManager.LocationChanged -= LocationChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
|
@ -268,7 +268,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnLocationChanged(object sender, LocationChangedEventArgs args)
|
private async void LocationChanged(object sender, LocationChangedEventArgs args)
|
||||||
{
|
{
|
||||||
_absoluteUri = args.Location;
|
_absoluteUri = args.Location;
|
||||||
await Refresh();
|
await Refresh();
|
||||||
|
@ -276,7 +276,7 @@
|
||||||
|
|
||||||
Task IHandleAfterRender.OnAfterRenderAsync()
|
Task IHandleAfterRender.OnAfterRenderAsync()
|
||||||
{
|
{
|
||||||
if (!_navigationInterceptionEnabled && ComponentContext.IsConnected)
|
if (!_navigationInterceptionEnabled)
|
||||||
{
|
{
|
||||||
_navigationInterceptionEnabled = true;
|
_navigationInterceptionEnabled = true;
|
||||||
return NavigationInterception.EnableNavigationInterceptionAsync();
|
return NavigationInterception.EnableNavigationInterceptionAsync();
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
@using Oqtane.Security
|
@using Oqtane.Security
|
||||||
@namespace Oqtane.Themes.Controls
|
@namespace Oqtane.Themes.Controls
|
||||||
@inherits ThemeObjectBase
|
@inherits ThemeObjectBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
@inject IModuleDefinitionService ModuleDefinitionService
|
@inject IModuleDefinitionService ModuleDefinitionService
|
||||||
@inject IThemeService ThemeService
|
@inject IThemeService ThemeService
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@AddModule">Add Module To Page</button>
|
<button type="button" class="btn btn-primary" @onclick="AddModule">Add Module To Page</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane);
|
await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane);
|
||||||
|
|
||||||
PageState.Reload = Constants.ReloadPage;
|
PageState.Reload = Constants.ReloadPage;
|
||||||
UriHelper.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@
|
||||||
PageState.DesignMode = true;
|
PageState.DesignMode = true;
|
||||||
}
|
}
|
||||||
PageState.Reload = Constants.ReloadPage;
|
PageState.Reload = Constants.ReloadPage;
|
||||||
UriHelper.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + PageState.EditMode.ToString().ToLower()));
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + PageState.EditMode.ToString().ToLower()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@namespace Oqtane.Themes.Controls
|
@namespace Oqtane.Themes.Controls
|
||||||
@inherits ThemeObjectBase
|
@inherits ThemeObjectBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
@inject IJSRuntime jsRuntime
|
@inject IJSRuntime jsRuntime
|
||||||
@inject IServiceProvider ServiceProvider
|
@inject IServiceProvider ServiceProvider
|
||||||
|
@ -15,10 +15,10 @@
|
||||||
<text>...</text>
|
<text>...</text>
|
||||||
</Authorizing>
|
</Authorizing>
|
||||||
<Authorized>
|
<Authorized>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@LogoutUser">Logout</button>
|
<button type="button" class="btn btn-primary" @onclick="LogoutUser">Logout</button>
|
||||||
</Authorized>
|
</Authorized>
|
||||||
<NotAuthorized>
|
<NotAuthorized>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@LoginUser">Login</button>
|
<button type="button" class="btn btn-primary" @onclick="LoginUser">Login</button>
|
||||||
</NotAuthorized>
|
</NotAuthorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
{
|
{
|
||||||
returnurl += "/" + PageState.Page.Path;
|
returnurl += "/" + PageState.Page.Path;
|
||||||
}
|
}
|
||||||
UriHelper.NavigateTo("login?returnurl=" + returnurl);
|
NavigationManager.NavigateTo("login?returnurl=" + returnurl);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LogoutUser()
|
private async Task LogoutUser()
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
// client-side Blazor
|
// client-side Blazor
|
||||||
authstateprovider.NotifyAuthenticationChanged();
|
authstateprovider.NotifyAuthenticationChanged();
|
||||||
PageState.Reload = Constants.ReloadSite;
|
PageState.Reload = Constants.ReloadSite;
|
||||||
UriHelper.NavigateTo(NavigateUrl(PageState.Page.Path, "logout"));
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "logout"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@using Oqtane.Security
|
@using Oqtane.Security
|
||||||
@namespace Oqtane.Themes.Controls
|
@namespace Oqtane.Themes.Controls
|
||||||
@inherits ContainerBase
|
@inherits ContainerBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
@inject IPageModuleService PageModuleService
|
@inject IPageModuleService PageModuleService
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||||
@foreach (var action in actions)
|
@foreach (var action in actions)
|
||||||
{
|
{
|
||||||
<a class="dropdown-item" @onclick="@(async () => await ModuleAction(action.Action))">@action.Name</a>
|
<a class="dropdown-item" @onclick="(async () => await ModuleAction(action.Action))">@action.Name</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PageState.Reload = Constants.ReloadPage;
|
PageState.Reload = Constants.ReloadPage;
|
||||||
UriHelper.NavigateTo(url);
|
NavigationManager.NavigateTo(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
@using Oqtane.Themes
|
@using Oqtane.Themes
|
||||||
|
@using Microsoft.AspNetCore.Components.Authorization
|
||||||
@namespace Oqtane.Themes.Controls
|
@namespace Oqtane.Themes.Controls
|
||||||
@inherits ThemeObjectBase
|
@inherits ThemeObjectBase
|
||||||
@inject IUriHelper UriHelper
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<AuthorizeView>
|
<AuthorizeView>
|
||||||
<Authorizing>
|
<Authorizing>
|
||||||
<text>...</text>
|
<text>...</text>
|
||||||
</Authorizing>
|
</Authorizing>
|
||||||
<Authorized>
|
<Authorized>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@UpdateProfile">@context.User.Identity.Name</button>
|
<button type="button" class="btn btn-primary" @onclick="UpdateProfile">@context.User.Identity.Name</button>
|
||||||
</Authorized>
|
</Authorized>
|
||||||
<NotAuthorized>
|
<NotAuthorized>
|
||||||
<button type="button" class="btn btn-primary" @onclick="@RegisterUser">Register</button>
|
<button type="button" class="btn btn-primary" @onclick="RegisterUser">Register</button>
|
||||||
</NotAuthorized>
|
</NotAuthorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
|
|
||||||
|
@ -20,12 +21,12 @@
|
||||||
|
|
||||||
private void RegisterUser()
|
private void RegisterUser()
|
||||||
{
|
{
|
||||||
UriHelper.NavigateTo(NavigateUrl("register"));
|
NavigationManager.NavigateTo(NavigateUrl("register"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateProfile()
|
private void UpdateProfile()
|
||||||
{
|
{
|
||||||
UriHelper.NavigateTo(NavigateUrl("profile"));
|
NavigationManager.NavigateTo(NavigateUrl("profile"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<LangVersion>7.3</LangVersion>
|
<!--<RestoreAdditionalProjectSources>
|
||||||
<RestoreAdditionalProjectSources>
|
|
||||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
||||||
</RestoreAdditionalProjectSources>
|
</RestoreAdditionalProjectSources>-->
|
||||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||||
<Configurations>Debug;Release;Wasm</Configurations>
|
<Configurations>Debug;Release;Wasm</Configurations>
|
||||||
<Version>0.0.1</Version>
|
<Version>0.0.1</Version>
|
||||||
|
@ -38,11 +37,11 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="dbup" Version="4.2.0" />
|
<PackageReference Include="dbup" Version="4.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview8.19405.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview9.19424.4" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview8.19405.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview9.19424.4" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0-preview8.19405.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0-preview9.19424.4" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0-preview8.19405.11" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0-preview9.19423.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview8.19405.11" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview9.19423.6" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc2" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@(Html.AntiForgeryToken())
|
@(Html.AntiForgeryToken())
|
||||||
<app>@(await Html.RenderComponentAsync<App>())</app>
|
<app>@(await Html.RenderComponentAsync<App>(RenderMode.Server))</app>
|
||||||
|
|
||||||
<script src="js/site.js"></script>
|
<script src="js/site.js"></script>
|
||||||
<script src="js/interop.js"></script>
|
<script src="js/interop.js"></script>
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace Oqtane.Server
|
||||||
services.AddScoped<HttpClient>(s =>
|
services.AddScoped<HttpClient>(s =>
|
||||||
{
|
{
|
||||||
// creating the URI helper needs to wait until the JS Runtime is initialized, so defer it.
|
// creating the URI helper needs to wait until the JS Runtime is initialized, so defer it.
|
||||||
var uriHelper = s.GetRequiredService<IUriHelper>();
|
var NavigationManager = s.GetRequiredService<NavigationManager>();
|
||||||
var httpContextAccessor = s.GetRequiredService<IHttpContextAccessor>();
|
var httpContextAccessor = s.GetRequiredService<IHttpContextAccessor>();
|
||||||
var authToken = httpContextAccessor.HttpContext.Request.Cookies[".AspNetCore.Identity.Application"];
|
var authToken = httpContextAccessor.HttpContext.Request.Cookies[".AspNetCore.Identity.Application"];
|
||||||
var client = new HttpClient(new HttpClientHandler { UseCookies = false });
|
var client = new HttpClient(new HttpClientHandler { UseCookies = false });
|
||||||
|
@ -64,7 +64,7 @@ namespace Oqtane.Server
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Add("Cookie", ".AspNetCore.Identity.Application=" + authToken);
|
client.DefaultRequestHeaders.Add("Cookie", ".AspNetCore.Identity.Application=" + authToken);
|
||||||
}
|
}
|
||||||
client.BaseAddress = new Uri(uriHelper.GetBaseUri());
|
client.BaseAddress = new Uri(NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri);
|
||||||
return client;
|
return client;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<LangVersion>7.3</LangVersion>
|
|
||||||
<Configurations>Debug;Release;Wasm</Configurations>
|
<Configurations>Debug;Release;Wasm</Configurations>
|
||||||
<Version>0.0.1</Version>
|
<Version>0.0.1</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
|
@ -21,8 +20,8 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0-preview9.19421.4" />
|
||||||
<PackageReference Include="System.Text.Json" Version="4.6.0-preview8.19405.3" />
|
<PackageReference Include="System.Text.Json" Version="4.6.0-preview9.19421.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user