Merge pull request #82 from oqtane/dev

sync
This commit is contained in:
Shaun Walker 2021-02-16 06:42:56 -05:00 committed by GitHub
commit cd89b2bf7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 15 deletions

View File

@ -7,6 +7,7 @@
@inject ISettingService SettingService @inject ISettingService SettingService
@inject IStringLocalizer<Index> Localizer @inject IStringLocalizer<Index> Localizer
@using System.Text.RegularExpressions @using System.Text.RegularExpressions
@using System.IO;
@if (string.IsNullOrEmpty(_moduledefinitionname)) @if (string.IsNullOrEmpty(_moduledefinitionname))
{ {
@ -171,14 +172,18 @@ else
Dictionary<string, string> systeminfo = await SystemService.GetSystemInfoAsync(); Dictionary<string, string> systeminfo = await SystemService.GetSystemInfoAsync();
if (systeminfo != null) if (systeminfo != null)
{ {
string[] path = systeminfo["serverpath"].Split('\\'); string[] path = systeminfo["serverpath"].Split(Path.DirectorySeparatorChar);
if (_template == "internal") if (_template == "internal")
{ {
_location = string.Join("\\", path, 0, path.Length - 1) + "\\Oqtane.Client\\Modules\\" + _owner + "." + _module; _location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 1) +
Path.DirectorySeparatorChar + "Oqtane.Client" +
Path.DirectorySeparatorChar + "Modules" +
Path.DirectorySeparatorChar + _owner + "." + _module;
} }
else else
{ {
_location = string.Join("\\", path, 0, path.Length - 2) + "\\" + _owner + "." + _module; _location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 2) +
Path.DirectorySeparatorChar + _owner + "." + _module;
} }
} }
} }

View File

@ -16,13 +16,14 @@
<div class="d-flex"> <div class="d-flex">
<hr class="app-rule" /> <hr class="app-rule" />
</div> </div>
<div class="collapse" id="@Name"> <div class="collapse @_show" id="@Name">
@ChildContent @ChildContent
</div> </div>
@code { @code {
private string _heading = string.Empty; private string _heading = string.Empty;
private string _expanded = string.Empty; private string _expanded = string.Empty;
private string _show = string.Empty;
[Parameter] [Parameter]
public RenderFragment ChildContent { get; set; } public RenderFragment ChildContent { get; set; }
@ -40,6 +41,7 @@
{ {
_heading = (!string.IsNullOrEmpty(Heading)) ? Heading : Name; _heading = (!string.IsNullOrEmpty(Heading)) ? Heading : Name;
_expanded = (!string.IsNullOrEmpty(Expanded)) ? Expanded : "false"; _expanded = (!string.IsNullOrEmpty(Expanded)) ? Expanded : "false";
if (_expanded == "true") { _show = "show"; }
} }
protected override void OnParametersSet() protected override void OnParametersSet()

View File

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Threading; using System.Threading;
@ -37,11 +37,11 @@ namespace Oqtane.Services
{ {
if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar))) if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar)))
{ {
folderPath = Utilities.PathCombine(folderPath,"\\"); folderPath = Utilities.PathCombine(folderPath, System.IO.Path.DirectorySeparatorChar.ToString());
} }
var path = WebUtility.UrlEncode(folderPath); var path = WebUtility.UrlEncode(folderPath);
return await GetJsonAsync<List<File>>($"{Apiurl}/{siteId}/{path}"); return await GetJsonAsync<List<File>>($"{Apiurl}/{siteId}/{path}");
} }

View File

@ -1,4 +1,4 @@
using Oqtane.Models; using Oqtane.Models;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
@ -37,11 +37,11 @@ namespace Oqtane.Services
{ {
if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar))) if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar)))
{ {
folderPath = Utilities.PathCombine(folderPath, "\\"); folderPath = Utilities.PathCombine(folderPath, System.IO.Path.DirectorySeparatorChar.ToString());
} }
var path = WebUtility.UrlEncode(folderPath); var path = WebUtility.UrlEncode(folderPath);
return await GetJsonAsync<Folder>($"{ApiUrl}/{siteId}/{path}"); return await GetJsonAsync<Folder>($"{ApiUrl}/{siteId}/{path}");
} }

View File

@ -178,7 +178,7 @@ namespace Microsoft.Extensions.DependencyInjection
private static Assembly ResolveDependencies(AssemblyLoadContext context, AssemblyName name) private static Assembly ResolveDependencies(AssemblyLoadContext context, AssemblyName name)
{ {
var assemblyPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) + "\\" + name.Name + ".dll"; var assemblyPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) + Path.DirectorySeparatorChar + name.Name + ".dll";
if (File.Exists(assemblyPath)) if (File.Exists(assemblyPath))
{ {
return context.LoadFromStream(new MemoryStream(File.ReadAllBytes(assemblyPath))); return context.LoadFromStream(new MemoryStream(File.ReadAllBytes(assemblyPath)));

View File

@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<Configurations>Debug;Release</Configurations> <Configurations>Debug;Release</Configurations>
<Version>2.0.0</Version> <Version>2.0.0</Version>
<Product>Oqtane</Product> <Product>Oqtane</Product>

View File

@ -44,7 +44,7 @@ namespace Oqtane.Shared {
public const string MasterTenant = TenantNames.Master; public const string MasterTenant = TenantNames.Master;
public const string DefaultSite = "Default Site"; public const string DefaultSite = "Default Site";
const string RoleObsoleteMessage = "Use the corresponding memeber from Oqtane.Shared.RoleNames"; const string RoleObsoleteMessage = "Use the corresponding member from Oqtane.Shared.RoleNames";
[Obsolete(RoleObsoleteMessage)] [Obsolete(RoleObsoleteMessage)]
public const string AllUsersRole = RoleNames.Everyone; public const string AllUsersRole = RoleNames.Everyone;