commit
19f8b3d429
|
@ -11,6 +11,10 @@ else
|
|||
{
|
||||
<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">
|
||||
<Header>
|
||||
<th> </th>
|
||||
|
@ -28,16 +32,32 @@ else
|
|||
}
|
||||
|
||||
@code {
|
||||
private List<UserRole> allroles;
|
||||
private List<UserRole> userroles;
|
||||
private string search;
|
||||
|
||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
userroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
|
||||
userroles = userroles.Where(item => item.Role.Name == Constants.RegisteredRole).ToList();
|
||||
allroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
|
||||
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)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<RepositoryType>Git</RepositoryType>
|
||||
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
||||
<RootNamespace>Oqtane</RootNamespace>
|
||||
<IsPackable>true</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -37,5 +38,4 @@
|
|||
<ItemGroup>
|
||||
<ProjectReference Include="..\Oqtane.Shared\Oqtane.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
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.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
|
||||
[HttpGet("name/{name}")]
|
||||
[HttpGet("name/{**name}")]
|
||||
public Alias Get(string name, string sync)
|
||||
{
|
||||
List<Alias> aliases = _aliases.GetAliases().ToList(); // cached
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<RepositoryType>Git</RepositoryType>
|
||||
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
||||
<RootNamespace>Oqtane</RootNamespace>
|
||||
<IsPackable>true</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="wwwroot\Modules\Templates\**" />
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using Oqtane.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
@ -44,6 +45,7 @@ namespace Oqtane.Shared
|
|||
path += $"/{action}";
|
||||
}
|
||||
}
|
||||
|
||||
return NavigateUrl(alias, path, parameters);
|
||||
}
|
||||
|
||||
|
@ -98,6 +100,7 @@ namespace Oqtane.Shared
|
|||
// remove assembly if fully qualified type
|
||||
typename = typename.Substring(0, typename.IndexOf(","));
|
||||
}
|
||||
|
||||
// segment 0 is the last segment, segment 1 is the second to last segment, etc...
|
||||
string[] segments = typename.Split('.');
|
||||
string name = "";
|
||||
|
@ -105,6 +108,7 @@ namespace Oqtane.Shared
|
|||
{
|
||||
name = segments[segments.Length - (segment + 1)];
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
@ -142,11 +146,14 @@ namespace Oqtane.Shared
|
|||
stringBuilder.Append('-');
|
||||
prevdash = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
result = stringBuilder.ToString().Trim('-');
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -245,10 +252,13 @@ namespace Oqtane.Shared
|
|||
{
|
||||
var separators = new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar};
|
||||
|
||||
for (int i =1;i < segments.Length; i++){
|
||||
if(Path.IsPathRooted(segments[i])){
|
||||
for (int i = 1; i < segments.Length; i++)
|
||||
{
|
||||
if (Path.IsPathRooted(segments[i]))
|
||||
{
|
||||
segments[i] = segments[i].TrimStart(separators);
|
||||
if(String.IsNullOrEmpty(segments[i])){
|
||||
if (String.IsNullOrEmpty(segments[i]))
|
||||
{
|
||||
segments[i] = " ";
|
||||
}
|
||||
}
|
||||
|
@ -273,5 +283,54 @@ namespace Oqtane.Shared
|
|||
!Constants.InvalidFileNameEndingChars.Any(name.EndsWith) &&
|
||||
!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>
|
||||
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
||||
<RootNamespace>Oqtane</RootNamespace>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
|
Loading…
Reference in New Issue
Block a user