Merge pull request #3797 from sbwalker/dev
fix #3793 - render issues on .NET MAUI
This commit is contained in:
commit
b2e3d33c80
|
@ -27,6 +27,7 @@
|
||||||
private List<Page> _pages;
|
private List<Page> _pages;
|
||||||
|
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View;
|
||||||
|
public override string RenderMode => RenderModes.Static;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
@if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.PermissionList) && PageState.Action == Constants.DefaultAction)
|
@if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.PermissionList) && PageState.Action == Constants.DefaultAction)
|
||||||
{
|
{
|
||||||
@if (PageState.Site.RenderMode == RenderModes.Interactive)
|
@if (PageState.RenderMode == RenderModes.Interactive)
|
||||||
{
|
{
|
||||||
<ModuleActionsInteractive PageState="@PageState" ModuleState="@ModuleState" />
|
<ModuleActionsInteractive PageState="@PageState" ModuleState="@ModuleState" />
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
@if (_canViewAdminDashboard || UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.PermissionList))
|
@if (_canViewAdminDashboard || UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.PermissionList))
|
||||||
{
|
{
|
||||||
@if (PageState.Site.RenderMode == RenderModes.Interactive)
|
@if (PageState.RenderMode == RenderModes.Interactive)
|
||||||
{
|
{
|
||||||
<ControlPanelInteractive PageState="@PageState" SiteState="@SiteState" ButtonClass="@ButtonClass" ContainerClass="@ContainerClass" HeaderClass="@HeaderClass" BodyClass="@BodyClass" ShowLanguageSwitcher="@ShowLanguageSwitcher" LanguageDropdownAlignment="@LanguageDropdownAlignment" />
|
<ControlPanelInteractive PageState="@PageState" SiteState="@SiteState" ButtonClass="@ButtonClass" ContainerClass="@ContainerClass" HeaderClass="@HeaderClass" BodyClass="@BodyClass" ShowLanguageSwitcher="@ShowLanguageSwitcher" LanguageDropdownAlignment="@LanguageDropdownAlignment" />
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@namespace Oqtane.UI
|
@namespace Oqtane.UI
|
||||||
@inject SiteState SiteState
|
@inject SiteState SiteState
|
||||||
|
|
||||||
@if (PageState.Site.RenderMode == RenderModes.Interactive || ModuleState.RenderMode == RenderModes.Static)
|
@if (PageState.RenderMode == RenderModes.Interactive || ModuleState.RenderMode == RenderModes.Static)
|
||||||
{
|
{
|
||||||
<RenderModeBoundary ModuleState="@ModuleState" PageState="@PageState" SiteState="@SiteState" />
|
<RenderModeBoundary ModuleState="@ModuleState" PageState="@PageState" SiteState="@SiteState" />
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,30 @@
|
||||||
{
|
{
|
||||||
headcontent = AddHeadContent(headcontent, PageState.Page.HeadContent);
|
headcontent = AddHeadContent(headcontent, PageState.Page.HeadContent);
|
||||||
}
|
}
|
||||||
|
if (PageState.RenderMode == RenderModes.Static)
|
||||||
|
{
|
||||||
|
string batch = DateTime.UtcNow.ToString("yyyyMMddHHmmssfff");
|
||||||
|
int count = 0;
|
||||||
|
foreach (Resource resource in PageState.Page.Resources.Where(item => item.ResourceType == ResourceType.Stylesheet && item.Level == ResourceLevel.Module))
|
||||||
|
{
|
||||||
|
// if (resource.Url.StartsWith("~"))
|
||||||
|
// {
|
||||||
|
// resource.Url = resource.Url.Replace("~", "/Themes/" + Utilities.GetTypeName(name) + "/").Replace("//", "/");
|
||||||
|
// }
|
||||||
|
if (!resource.Url.Contains("://") && PageState.Alias.BaseUrl != "" && !resource.Url.StartsWith(PageState.Alias.BaseUrl))
|
||||||
|
{
|
||||||
|
resource.Url = PageState.Alias.BaseUrl + resource.Url;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!headcontent.Contains(resource.Url, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
string id = "id=\"app-stylesheet-" + resource.Level.ToString().ToLower() + "-" + batch + "-" + count.ToString("00") + "\" ";
|
||||||
|
headcontent += "<link " + id + "rel=\"stylesheet\" href=\"" + resource.Url + "\"" + (!string.IsNullOrEmpty(resource.Integrity) ? " integrity=\"" + resource.Integrity + "\"" : "") + (!string.IsNullOrEmpty(resource.CrossOrigin) ? " crossorigin=\"" + resource.CrossOrigin + "\"" : "") + " type=\"text/css\"/>" + Environment.NewLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
SiteState.Properties.HeadContent = headcontent;
|
SiteState.Properties.HeadContent = headcontent;
|
||||||
|
|
||||||
DynamicComponent = builder =>
|
DynamicComponent = builder =>
|
||||||
|
|
|
@ -537,6 +537,7 @@
|
||||||
{
|
{
|
||||||
if (resources != null)
|
if (resources != null)
|
||||||
{
|
{
|
||||||
|
string batch = DateTime.UtcNow.ToString("yyyyMMddHHmmssfff");
|
||||||
int count = 0;
|
int count = 0;
|
||||||
foreach (var resource in resources.Where(item => item.ResourceType == ResourceType.Stylesheet))
|
foreach (var resource in resources.Where(item => item.ResourceType == ResourceType.Stylesheet))
|
||||||
{
|
{
|
||||||
|
@ -552,7 +553,7 @@
|
||||||
if (!_styleSheets.Contains(resource.Url, StringComparison.OrdinalIgnoreCase))
|
if (!_styleSheets.Contains(resource.Url, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
string id = "id=\"app-stylesheet-" + ResourceLevel.Page.ToString().ToLower() + "-" + DateTime.UtcNow.ToString("yyyyMMddHHmmssfff") + "-" + count.ToString("00") + "\" ";
|
string id = "id=\"app-stylesheet-" + ResourceLevel.Page.ToString().ToLower() + "-" + batch + "-" + count.ToString("00") + "\" ";
|
||||||
_styleSheets += "<link " + id + "rel=\"stylesheet\" href=\"" + resource.Url + "\"" + (!string.IsNullOrEmpty(resource.Integrity) ? " integrity=\"" + resource.Integrity + "\"" : "") + (!string.IsNullOrEmpty(resource.CrossOrigin) ? " crossorigin=\"" + resource.CrossOrigin + "\"" : "") + " type=\"text/css\"/>" + Environment.NewLine;
|
_styleSheets += "<link " + id + "rel=\"stylesheet\" href=\"" + resource.Url + "\"" + (!string.IsNullOrEmpty(resource.Integrity) ? " integrity=\"" + resource.Integrity + "\"" : "") + (!string.IsNullOrEmpty(resource.CrossOrigin) ? " crossorigin=\"" + resource.CrossOrigin + "\"" : "") + " type=\"text/css\"/>" + Environment.NewLine;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -568,7 +569,5 @@
|
||||||
AddScript(resource, alias);
|
AddScript(resource, alias);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user