commit
19f8b3d429
|
@ -11,6 +11,10 @@ else
|
||||||
{
|
{
|
||||||
<ActionLink Action="Add" Text="Add User"/>
|
<ActionLink Action="Add" Text="Add User"/>
|
||||||
|
|
||||||
|
<div class="d-flex p-1">
|
||||||
|
<input class="form-control mr-4" @bind="@search"/><button class="btn btn-outline-primary ml-1" @onclick="OnSearch">Search</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Pager Items="@userroles">
|
<Pager Items="@userroles">
|
||||||
<Header>
|
<Header>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
|
@ -28,16 +32,32 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
private List<UserRole> allroles;
|
||||||
private List<UserRole> userroles;
|
private List<UserRole> userroles;
|
||||||
|
private string search;
|
||||||
|
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
userroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
|
allroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
|
||||||
userroles = userroles.Where(item => item.Role.Name == Constants.RegisteredRole).ToList();
|
userroles = allroles.Where(item => item.Role.Name == Constants.RegisteredRole).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnSearch()
|
||||||
|
{
|
||||||
|
userroles = allroles
|
||||||
|
.Where(item => item.Role.Name == Constants.RegisteredRole &&
|
||||||
|
(
|
||||||
|
item.User.Username.Contains(search, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
item.User.Email.Contains(search, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
item.User.DisplayName.Contains(search, StringComparison.OrdinalIgnoreCase)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task DeleteUser(UserRole UserRole)
|
private async Task DeleteUser(UserRole UserRole)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
||||||
<RootNamespace>Oqtane</RootNamespace>
|
<RootNamespace>Oqtane</RootNamespace>
|
||||||
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -37,5 +38,4 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Oqtane.Shared\Oqtane.Shared.csproj" />
|
<ProjectReference Include="..\Oqtane.Shared\Oqtane.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
DEL "*.nupkg"
|
DEL "*.nupkg"
|
||||||
|
dotnet clean -c Release ..\Oqtane.sln
|
||||||
|
dotnet build -c Release ..\Oqtane.sln
|
||||||
|
dotnet pack -o .\ -c Release ..\Oqtane.sln
|
||||||
nuget.exe pack Oqtane.Framework.nuspec
|
nuget.exe pack Oqtane.Framework.nuspec
|
||||||
nuget.exe pack Oqtane.Client.nuspec
|
|
||||||
nuget.exe pack Oqtane.Server.nuspec
|
|
||||||
nuget.exe pack Oqtane.Shared.nuspec
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/name/xxx?sync=yyyyMMddHHmmssfff
|
// GET api/<controller>/name/xxx?sync=yyyyMMddHHmmssfff
|
||||||
[HttpGet("name/{name}")]
|
[HttpGet("name/{**name}")]
|
||||||
public Alias Get(string name, string sync)
|
public Alias Get(string name, string sync)
|
||||||
{
|
{
|
||||||
List<Alias> aliases = _aliases.GetAliases().ToList(); // cached
|
List<Alias> aliases = _aliases.GetAliases().ToList(); // cached
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
||||||
<RootNamespace>Oqtane</RootNamespace>
|
<RootNamespace>Oqtane</RootNamespace>
|
||||||
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="wwwroot\Modules\Templates\**" />
|
<Compile Remove="wwwroot\Modules\Templates\**" />
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -44,6 +45,7 @@ namespace Oqtane.Shared
|
||||||
path += $"/{action}";
|
path += $"/{action}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NavigateUrl(alias, path, parameters);
|
return NavigateUrl(alias, path, parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +100,7 @@ namespace Oqtane.Shared
|
||||||
// remove assembly if fully qualified type
|
// remove assembly if fully qualified type
|
||||||
typename = typename.Substring(0, typename.IndexOf(","));
|
typename = typename.Substring(0, typename.IndexOf(","));
|
||||||
}
|
}
|
||||||
|
|
||||||
// segment 0 is the last segment, segment 1 is the second to last segment, etc...
|
// segment 0 is the last segment, segment 1 is the second to last segment, etc...
|
||||||
string[] segments = typename.Split('.');
|
string[] segments = typename.Split('.');
|
||||||
string name = "";
|
string name = "";
|
||||||
|
@ -105,6 +108,7 @@ namespace Oqtane.Shared
|
||||||
{
|
{
|
||||||
name = segments[segments.Length - (segment + 1)];
|
name = segments[segments.Length - (segment + 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,11 +146,14 @@ namespace Oqtane.Shared
|
||||||
stringBuilder.Append('-');
|
stringBuilder.Append('-');
|
||||||
prevdash = true;
|
prevdash = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = stringBuilder.ToString().Trim('-');
|
result = stringBuilder.ToString().Trim('-');
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,10 +252,13 @@ namespace Oqtane.Shared
|
||||||
{
|
{
|
||||||
var separators = new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar};
|
var separators = new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar};
|
||||||
|
|
||||||
for (int i =1;i < segments.Length; i++){
|
for (int i = 1; i < segments.Length; i++)
|
||||||
if(Path.IsPathRooted(segments[i])){
|
{
|
||||||
|
if (Path.IsPathRooted(segments[i]))
|
||||||
|
{
|
||||||
segments[i] = segments[i].TrimStart(separators);
|
segments[i] = segments[i].TrimStart(separators);
|
||||||
if(String.IsNullOrEmpty(segments[i])){
|
if (String.IsNullOrEmpty(segments[i]))
|
||||||
|
{
|
||||||
segments[i] = " ";
|
segments[i] = " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,5 +283,54 @@ namespace Oqtane.Shared
|
||||||
!Constants.InvalidFileNameEndingChars.Any(name.EndsWith) &&
|
!Constants.InvalidFileNameEndingChars.Any(name.EndsWith) &&
|
||||||
!Constants.ReservedDevices.Split(',').Contains(name.ToUpper().Split('.')[0]));
|
!Constants.ReservedDevices.Split(',').Contains(name.ToUpper().Split('.')[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static bool TryGetQueryValue(
|
||||||
|
this Uri uri,
|
||||||
|
string key,
|
||||||
|
out string value,
|
||||||
|
string defaultValue = null)
|
||||||
|
{
|
||||||
|
value = defaultValue;
|
||||||
|
string query = uri.Query;
|
||||||
|
return !string.IsNullOrEmpty(query) && Utilities.ParseQueryString(query).TryGetValue(key, out value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool TryGetQueryValueInt(
|
||||||
|
this Uri uri,
|
||||||
|
string key,
|
||||||
|
out int value,
|
||||||
|
int defaultValue = 0)
|
||||||
|
{
|
||||||
|
value = defaultValue;
|
||||||
|
string s;
|
||||||
|
return uri.TryGetQueryValue(key, out s, (string) null) && int.TryParse(s, out value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Dictionary<string, string> ParseQueryString(string query)
|
||||||
|
{
|
||||||
|
Dictionary<string, string> dictionary = new Dictionary<string, string>();
|
||||||
|
if (!string.IsNullOrEmpty(query))
|
||||||
|
{
|
||||||
|
query = query.Substring(1);
|
||||||
|
string str = query;
|
||||||
|
char[] separator = new char[1] {'&'};
|
||||||
|
foreach (string key in str.Split(separator, StringSplitOptions.RemoveEmptyEntries))
|
||||||
|
{
|
||||||
|
if (key != "")
|
||||||
|
{
|
||||||
|
if (key.Contains("="))
|
||||||
|
{
|
||||||
|
string[] strArray = key.Split('=', StringSplitOptions.None);
|
||||||
|
dictionary.Add(strArray[0], strArray[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dictionary.Add(key, "true");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dictionary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
||||||
<RootNamespace>Oqtane</RootNamespace>
|
<RootNamespace>Oqtane</RootNamespace>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user