fix issues with installer
This commit is contained in:
parent
829e004ee5
commit
b0487798c2
|
@ -31,7 +31,7 @@
|
|||
@inject IVisitorRepository VisitorRepository
|
||||
@inject IJwtManager JwtManager
|
||||
|
||||
@if (_pageState != null)
|
||||
@if (_initialized)
|
||||
{
|
||||
<!DOCTYPE html>
|
||||
<html lang="@_language">
|
||||
|
@ -93,6 +93,7 @@
|
|||
}
|
||||
|
||||
@code {
|
||||
private bool _initialized = false;
|
||||
private string _renderMode = RenderModes.Interactive;
|
||||
private string _runtime = Runtimes.Server;
|
||||
private bool _prerender = true;
|
||||
|
@ -266,6 +267,7 @@
|
|||
_message = "Site Not Configured Correctly - No Matching Alias Exists For Host Name";
|
||||
}
|
||||
}
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
private void HandleDefaultAliasRedirect(Alias alias, string url)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Oqtane.Extensions;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Repository;
|
||||
using Oqtane.Shared;
|
||||
|
|
|
@ -27,11 +27,11 @@ namespace Oqtane.Services
|
|||
private readonly ILanguageRepository _languages;
|
||||
private readonly IUserPermissions _userPermissions;
|
||||
private readonly ISettingRepository _settings;
|
||||
private readonly ITenantManager _tenantManager;
|
||||
private readonly ISyncManager _syncManager;
|
||||
private readonly ILogManager _logger;
|
||||
private readonly IMemoryCache _cache;
|
||||
private readonly IHttpContextAccessor _accessor;
|
||||
private readonly Alias _alias;
|
||||
|
||||
public ServerSiteService(ISiteRepository sites, IPageRepository pages, IThemeRepository themes, IPageModuleRepository pageModules, IModuleDefinitionRepository moduleDefinitions, ILanguageRepository languages, IUserPermissions userPermissions, ISettingRepository settings, ITenantManager tenantManager, ISyncManager syncManager, ILogManager logger, IMemoryCache cache, IHttpContextAccessor accessor)
|
||||
{
|
||||
|
@ -43,11 +43,11 @@ namespace Oqtane.Services
|
|||
_languages = languages;
|
||||
_userPermissions = userPermissions;
|
||||
_settings = settings;
|
||||
_tenantManager = tenantManager;
|
||||
_syncManager = syncManager;
|
||||
_logger = logger;
|
||||
_cache = cache;
|
||||
_accessor = accessor;
|
||||
_alias = tenantManager.GetAlias();
|
||||
}
|
||||
|
||||
public async Task<List<Site>> GetSitesAsync()
|
||||
|
@ -80,8 +80,9 @@ namespace Oqtane.Services
|
|||
|
||||
private Site GetSite(int siteid)
|
||||
{
|
||||
var alias = _tenantManager.GetAlias();
|
||||
var site = _sites.GetSite(siteid);
|
||||
if (site != null && site.SiteId == _alias.SiteId)
|
||||
if (site != null && site.SiteId == alias.SiteId)
|
||||
{
|
||||
// site settings
|
||||
site.Settings = _settings.GetSettings(EntityNames.Site, site.SiteId)
|
||||
|
@ -179,8 +180,9 @@ namespace Oqtane.Services
|
|||
{
|
||||
if (_accessor.HttpContext.User.IsInRole(RoleNames.Host))
|
||||
{
|
||||
var alias = _tenantManager.GetAlias();
|
||||
site = _sites.AddSite(site);
|
||||
_syncManager.AddSyncEvent(_alias.TenantId, EntityNames.Site, site.SiteId, SyncEventActions.Create);
|
||||
_syncManager.AddSyncEvent(alias.TenantId, EntityNames.Site, site.SiteId, SyncEventActions.Create);
|
||||
_logger.Log(site.SiteId, LogLevel.Information, this, LogFunction.Create, "Site Added {Site}", site);
|
||||
}
|
||||
else
|
||||
|
@ -194,17 +196,18 @@ namespace Oqtane.Services
|
|||
{
|
||||
if (_accessor.HttpContext.User.IsInRole(RoleNames.Admin))
|
||||
{
|
||||
var alias = _tenantManager.GetAlias();
|
||||
var current = _sites.GetSite(site.SiteId, false);
|
||||
if (site.SiteId == _alias.SiteId && site.TenantId == _alias.TenantId && current != null)
|
||||
if (site.SiteId == alias.SiteId && site.TenantId == alias.TenantId && current != null)
|
||||
{
|
||||
site = _sites.UpdateSite(site);
|
||||
_syncManager.AddSyncEvent(_alias.TenantId, EntityNames.Site, site.SiteId, SyncEventActions.Update);
|
||||
_syncManager.AddSyncEvent(alias.TenantId, EntityNames.Site, site.SiteId, SyncEventActions.Update);
|
||||
string action = SyncEventActions.Refresh;
|
||||
if (current.RenderMode != site.RenderMode || current.Runtime != site.Runtime)
|
||||
{
|
||||
action = SyncEventActions.Reload;
|
||||
}
|
||||
_syncManager.AddSyncEvent(_alias.TenantId, EntityNames.Site, site.SiteId, action);
|
||||
_syncManager.AddSyncEvent(alias.TenantId, EntityNames.Site, site.SiteId, action);
|
||||
_logger.Log(site.SiteId, LogLevel.Information, this, LogFunction.Update, "Site Updated {Site}", site);
|
||||
}
|
||||
else
|
||||
|
@ -224,11 +227,12 @@ namespace Oqtane.Services
|
|||
{
|
||||
if (_accessor.HttpContext.User.IsInRole(RoleNames.Host))
|
||||
{
|
||||
var alias = _tenantManager.GetAlias();
|
||||
var site = _sites.GetSite(siteId);
|
||||
if (site != null && site.SiteId == _alias.SiteId)
|
||||
if (site != null && site.SiteId == alias.SiteId)
|
||||
{
|
||||
_sites.DeleteSite(siteId);
|
||||
_syncManager.AddSyncEvent(_alias.TenantId, EntityNames.Site, site.SiteId, SyncEventActions.Delete);
|
||||
_syncManager.AddSyncEvent(alias.TenantId, EntityNames.Site, site.SiteId, SyncEventActions.Delete);
|
||||
_logger.Log(siteId, LogLevel.Information, this, LogFunction.Delete, "Site Deleted {SiteId}", siteId);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Oqtane.Shared
|
|||
public class Constants
|
||||
{
|
||||
public static readonly string Version = "5.1.0";
|
||||
public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,2.0.0,2.0.1,2.0.2,2.1.0,2.2.0,2.3.0,2.3.1,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.1.1,3.1.2,3.1.3,3.1.4,3.2.0,3.2.1,3.3.0,3.3.1,3.4.0,3.4.1,3.4.2,3.4.3,4.0.0,4.0.1,4.0.2,4.0.3,4.0.4,4.0.5,4.0.6,5.0.0,5.0.1,5.0.2,5.1.0";
|
||||
public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,2.0.0,2.0.1,2.0.2,2.1.0,2.2.0,2.3.0,2.3.1,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.1.1,3.1.2,3.1.3,3.1.4,3.2.0,3.2.1,3.3.0,3.3.1,3.4.0,3.4.1,3.4.2,3.4.3,4.0.0,4.0.1,4.0.2,4.0.3,4.0.4,4.0.5,4.0.6,5.0.0,5.0.1,5.0.2,5.0.3,5.1.0";
|
||||
public const string PackageId = "Oqtane.Framework";
|
||||
public const string ClientId = "Oqtane.Client";
|
||||
public const string UpdaterPackageId = "Oqtane.Updater";
|
||||
|
|
Loading…
Reference in New Issue
Block a user