Initial migration
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
@using Oqtane.Shared
|
||||
@namespace Oqtane.Modules.Admin.Login
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IJSRuntime jsRuntime
|
||||
@inject IUserService UserService
|
||||
@inject IServiceProvider ServiceProvider
|
||||
@ -36,8 +36,8 @@
|
||||
<input type="checkbox" class="form-check-input" name="Remember" @bind="@Remember" />
|
||||
</div>
|
||||
</div>
|
||||
<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-primary" @onclick="Login">Login</button>
|
||||
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||
</div>
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
@ -88,7 +88,7 @@
|
||||
{
|
||||
authstateprovider.NotifyAuthenticationChanged();
|
||||
PageState.Reload = Constants.ReloadSite;
|
||||
UriHelper.NavigateTo(NavigateUrl(ReturnUrl));
|
||||
NavigationManager.NavigateTo(NavigateUrl(ReturnUrl));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -100,6 +100,6 @@
|
||||
private void Cancel()
|
||||
{
|
||||
string ReturnUrl = PageState.QueryString["returnurl"];
|
||||
UriHelper.NavigateTo(ReturnUrl);
|
||||
NavigationManager.NavigateTo(ReturnUrl);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
@using Oqtane.Shared
|
||||
@namespace Oqtane.Modules.Admin.ModuleDefinitions
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IFileService FileService
|
||||
@inject IModuleDefinitionService ModuleDefinitionService
|
||||
|
||||
@ -45,6 +45,6 @@ else
|
||||
{
|
||||
await ModuleDefinitionService.InstallModulesAsync();
|
||||
PageState.Reload = Constants.ReloadApplication;
|
||||
UriHelper.NavigateTo(NavigateUrl());
|
||||
NavigationManager.NavigateTo(NavigateUrl());
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@using Oqtane.Modules.Controls
|
||||
@namespace Oqtane.Modules.Admin.ModuleSettings
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IThemeService ThemeService
|
||||
@inject IModuleService ModuleService
|
||||
@inject IPageModuleService PageModuleService
|
||||
@ -64,7 +64,7 @@
|
||||
|
||||
@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>
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
}
|
||||
|
||||
PageState.Reload = Constants.ReloadPage;
|
||||
UriHelper.NavigateTo(NavigateUrl());
|
||||
NavigationManager.NavigateTo(NavigateUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@using Oqtane.Security
|
||||
@namespace Oqtane.Modules.Admin.Pages
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IPageService PageService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<label for="Name" class="control-label">Parent: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @onchange="@(e => ParentChanged(e))">
|
||||
<select class="form-control" @onchange="(e => ParentChanged(e))">
|
||||
<option value=""><Site Root></option>
|
||||
@foreach (Page page in pages)
|
||||
{
|
||||
@ -129,7 +129,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</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>
|
||||
|
||||
@code {
|
||||
@ -176,7 +176,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
private void ParentChanged(UIChangeEventArgs e)
|
||||
private void ParentChanged(ChangeEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -254,7 +254,7 @@
|
||||
await PageService.UpdatePageOrderAsync(page.SiteId, page.ParentId);
|
||||
|
||||
PageState.Reload = Constants.ReloadSite;
|
||||
UriHelper.NavigateTo(NavigateUrl());
|
||||
NavigationManager.NavigateTo(NavigateUrl());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
@using Oqtane.Security
|
||||
@namespace Oqtane.Modules.Admin.Pages
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IPageService PageService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
@ -111,7 +111,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</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>
|
||||
<br />
|
||||
<br />
|
||||
@ -181,11 +181,11 @@
|
||||
PageState.Reload = Constants.ReloadSite;
|
||||
if (PageState.Page.Name == "Page Management")
|
||||
{
|
||||
UriHelper.NavigateTo(NavigateUrl());
|
||||
NavigationManager.NavigateTo(NavigateUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
UriHelper.NavigateTo(NavigateUrl(""));
|
||||
NavigationManager.NavigateTo(NavigateUrl(""));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -7,7 +7,7 @@
|
||||
@using Oqtane.Security
|
||||
@namespace Oqtane.Modules.Admin.Pages
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IPageService PageService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<label for="Name" class="control-label">Parent: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @onchange="@(e => ParentChanged(e))">
|
||||
<select class="form-control" @onchange="(e => ParentChanged(e))">
|
||||
<option value=""><Site Root></option>
|
||||
@foreach (Page page in pages)
|
||||
{
|
||||
@ -138,7 +138,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</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>
|
||||
<br />
|
||||
<br />
|
||||
@ -215,7 +215,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
private void ParentChanged(UIChangeEventArgs e)
|
||||
private void ParentChanged(ChangeEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -298,7 +298,7 @@
|
||||
await PageService.UpdatePageOrderAsync(page.SiteId, currentparentid);
|
||||
|
||||
PageState.Reload = Constants.ReloadSite;
|
||||
UriHelper.NavigateTo(NavigateUrl());
|
||||
NavigationManager.NavigateTo(NavigateUrl());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
@using Oqtane.Services
|
||||
@namespace Oqtane.Modules.Admin.Profile
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IUserService UserService
|
||||
@inject IProfileService ProfileService
|
||||
@inject ISettingService SettingService
|
||||
@ -49,13 +49,13 @@
|
||||
<label for="@p.Name" class="control-label">@p.Title: </label>
|
||||
</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>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<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-primary" @onclick="SaveUser">Save</button>
|
||||
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||
<br />
|
||||
<br />
|
||||
}
|
||||
@ -107,7 +107,7 @@
|
||||
await UserService.UpdateUserAsync(user);
|
||||
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
|
||||
|
||||
UriHelper.NavigateTo("");
|
||||
NavigationManager.NavigateTo("");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -117,10 +117,10 @@
|
||||
|
||||
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;
|
||||
settings = SettingService.SetSetting(settings, SettingName, value);
|
||||
|
@ -4,7 +4,7 @@
|
||||
@using Oqtane.Services
|
||||
@namespace Oqtane.Modules.Admin.Register
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IUserService UserService
|
||||
|
||||
<div class="container">
|
||||
@ -16,8 +16,8 @@
|
||||
<label for="Password" class="control-label">Password: </label>
|
||||
<input type="password" name="Password" class="form-control" placeholder="Password" @bind="@Password" />
|
||||
</div>
|
||||
<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-primary" @onclick="RegisterUser">Register</button>
|
||||
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@ -36,11 +36,11 @@
|
||||
user.IsHost = false;
|
||||
user.Password = Password;
|
||||
await UserService.AddUserAsync(user);
|
||||
UriHelper.NavigateTo("");
|
||||
NavigationManager.NavigateTo("");
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
UriHelper.NavigateTo(NavigateUrl("")); // navigate to home
|
||||
NavigationManager.NavigateTo(NavigateUrl("")); // navigate to home
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
@using Oqtane.Security
|
||||
@namespace Oqtane.Modules.Admin.Sites
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject ITenantService TenantService
|
||||
@inject IAliasService AliasService
|
||||
@inject ISiteService SiteService
|
||||
@ -58,7 +58,7 @@ else
|
||||
</td>
|
||||
</tr>
|
||||
</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>
|
||||
}
|
||||
|
||||
@ -113,6 +113,6 @@ else
|
||||
|
||||
await PageService.AddPageAsync(p);
|
||||
|
||||
UriHelper.NavigateTo(url, true);
|
||||
NavigationManager.NavigateTo(url, true);
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@
|
||||
<tr>
|
||||
<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 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>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -3,7 +3,7 @@
|
||||
@inherits ModuleBase
|
||||
Current count: @currentCount
|
||||
<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 />
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
@using Oqtane.Shared;
|
||||
@namespace Oqtane.Modules.HtmlText
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject HttpClient http
|
||||
@inject SiteState sitestate
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</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>
|
||||
<br />
|
||||
<br />
|
||||
@ -44,7 +44,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
@ -65,7 +65,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
@ -80,7 +80,7 @@
|
||||
await htmltextservice.AddHtmlTextAsync(htmltext);
|
||||
}
|
||||
PageState.Reload = Constants.ReloadPage;
|
||||
UriHelper.NavigateTo(NavigateUrl());
|
||||
NavigationManager.NavigateTo(NavigateUrl());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
@using Oqtane.Shared;
|
||||
@namespace Oqtane.Modules.HtmlText
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject HttpClient http
|
||||
@inject SiteState sitestate
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
|
@ -13,18 +13,18 @@ namespace Oqtane.Modules.HtmlText.Services
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
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.sitestate = sitestate;
|
||||
this.urihelper = urihelper;
|
||||
this.NavigationManager = NavigationManager;
|
||||
}
|
||||
|
||||
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)
|
||||
|
Reference in New Issue
Block a user