optimizations and fixes
This commit is contained in:
@ -9,6 +9,7 @@ namespace Oqtane.Services
|
||||
Task<List<Page>> GetPagesAsync(int SiteId);
|
||||
Task<Page> GetPageAsync(int PageId);
|
||||
Task<Page> GetPageAsync(int PageId, int UserId);
|
||||
Task<Page> GetPageAsync(string Path, int SiteId);
|
||||
Task<Page> AddPageAsync(Page Page);
|
||||
Task<Page> AddPageAsync(int PageId, int UserId);
|
||||
Task<Page> UpdatePageAsync(Page Page);
|
||||
|
@ -59,13 +59,13 @@ namespace Oqtane.Services
|
||||
|
||||
public async Task LoadModuleDefinitionsAsync(int SiteId)
|
||||
{
|
||||
// get list of modules from the server
|
||||
List<ModuleDefinition> moduledefinitions = await GetModuleDefinitionsAsync(SiteId);
|
||||
|
||||
// download assemblies to browser when running client-side Blazor
|
||||
var authstateprovider = (IdentityAuthenticationStateProvider)_serviceProvider.GetService(typeof(IdentityAuthenticationStateProvider));
|
||||
if (authstateprovider != null)
|
||||
{
|
||||
// get list of modules from the server
|
||||
List<ModuleDefinition> moduledefinitions = await GetModuleDefinitionsAsync(SiteId);
|
||||
|
||||
// get list of loaded assemblies on the client ( in the client-side hosting module the browser client has its own app domain )
|
||||
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
|
||||
|
@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Shared;
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
@ -44,6 +45,18 @@ namespace Oqtane.Services
|
||||
return await _http.GetJsonAsync<Page>(apiurl + "/" + PageId.ToString() + "?userid=" + UserId.ToString());
|
||||
}
|
||||
|
||||
public async Task<Page> GetPageAsync(string Path, int SiteId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _http.GetJsonAsync<Page>(apiurl + "/path/" + SiteId.ToString() + "?path=" + WebUtility.UrlEncode(Path));
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<Page> AddPageAsync(Page Page)
|
||||
{
|
||||
return await _http.PostJsonAsync<Page>(apiurl, Page);
|
||||
|
Reference in New Issue
Block a user