Package enhancements for Marketplace
This commit is contained in:
parent
1b2de37c4e
commit
9a3b458c45
|
@ -17,7 +17,10 @@
|
||||||
<hr class="app-rule" />
|
<hr class="app-rule" />
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse @_show" id="@Name">
|
<div class="collapse @_show" id="@Name">
|
||||||
@ChildContent
|
@if (ChildContent != null)
|
||||||
|
{
|
||||||
|
@ChildContent
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
@ -26,7 +29,7 @@
|
||||||
private string _show = string.Empty;
|
private string _show = string.Empty;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public RenderFragment ChildContent { get; set; }
|
public RenderFragment ChildContent { get; set; } = null;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Name { get; set; } // required - the name of the section
|
public string Name { get; set; } // required - the name of the section
|
||||||
|
|
|
@ -27,6 +27,17 @@ namespace Oqtane.Services
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package);
|
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of packages matching the given parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="search"></param>
|
||||||
|
/// <param name="price"></param>
|
||||||
|
/// <param name="package"></param>
|
||||||
|
/// <param name="sort"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package, string sort);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a specific package
|
/// Returns a specific package
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -23,7 +23,12 @@ namespace Oqtane.Services
|
||||||
|
|
||||||
public async Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package)
|
public async Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package)
|
||||||
{
|
{
|
||||||
return await GetJsonAsync<List<Package>>($"{Apiurl}?type={type}&search={WebUtility.UrlEncode(search)}&price={price}&package={package}");
|
return await GetPackagesAsync(type, search, price, package, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package, string sort)
|
||||||
|
{
|
||||||
|
return await GetJsonAsync<List<Package>>($"{Apiurl}?type={type}&search={WebUtility.UrlEncode(search)}&price={price}&package={package}&sort={sort}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Package> GetPackageAsync(string packageId, string version)
|
public async Task<Package> GetPackageAsync(string packageId, string version)
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace Oqtane.Controllers
|
||||||
public Folder GetByPath(int siteId, string path)
|
public Folder GetByPath(int siteId, string path)
|
||||||
{
|
{
|
||||||
var folderPath = WebUtility.UrlDecode(path).Replace("\\", "/");
|
var folderPath = WebUtility.UrlDecode(path).Replace("\\", "/");
|
||||||
if (!folderPath.EndsWith("/"))
|
if (!folderPath.EndsWith("/") && folderPath != "")
|
||||||
{
|
{
|
||||||
folderPath += "/";
|
folderPath += "/";
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace Oqtane.Controllers
|
||||||
|
|
||||||
// GET: api/<controller>?type=x&search=y&price=z&package=a
|
// GET: api/<controller>?type=x&search=y&price=z&package=a
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IEnumerable<Package>> Get(string type, string search, string price, string package)
|
public async Task<IEnumerable<Package>> Get(string type, string search, string price, string package, string sort)
|
||||||
{
|
{
|
||||||
// get packages
|
// get packages
|
||||||
List<Package> packages = new List<Package>();
|
List<Package> packages = new List<Package>();
|
||||||
|
@ -44,7 +44,7 @@ namespace Oqtane.Controllers
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Add("Referer", HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value);
|
client.DefaultRequestHeaders.Add("Referer", HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value);
|
||||||
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(Constants.PackageId, Constants.Version));
|
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(Constants.PackageId, Constants.Version));
|
||||||
packages = await GetJson<List<Package>>(client, Constants.PackageRegistryUrl + $"/api/registry/packages/?id={_configManager.GetInstallationId()}&type={type.ToLower()}&version={Constants.Version}&search={search}&price={price}&package={package}");
|
packages = await GetJson<List<Package>>(client, Constants.PackageRegistryUrl + $"/api/registry/packages/?id={_configManager.GetInstallationId()}&type={type.ToLower()}&version={Constants.Version}&search={search}&price={price}&package={package}&sort={sort}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return packages;
|
return packages;
|
||||||
|
|
|
@ -7,14 +7,8 @@ using System.Linq;
|
||||||
using Oqtane.Security;
|
using Oqtane.Security;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using Oqtane.Enums;
|
using Oqtane.Enums;
|
||||||
using Oqtane.Extensions;
|
|
||||||
using Oqtane.Infrastructure;
|
using Oqtane.Infrastructure;
|
||||||
using Oqtane.Repository;
|
using Oqtane.Repository;
|
||||||
using Oqtane.Modules.Admin.Users;
|
|
||||||
using System.IO;
|
|
||||||
using Oqtane.Services;
|
|
||||||
using Oqtane.UI;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Oqtane.Controllers
|
namespace Oqtane.Controllers
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,6 +101,7 @@ namespace Oqtane.Repository
|
||||||
ModuleDefinition.IsPortable = moduleDefinition.IsPortable;
|
ModuleDefinition.IsPortable = moduleDefinition.IsPortable;
|
||||||
ModuleDefinition.Resources = moduleDefinition.Resources;
|
ModuleDefinition.Resources = moduleDefinition.Resources;
|
||||||
ModuleDefinition.IsEnabled = moduleDefinition.IsEnabled;
|
ModuleDefinition.IsEnabled = moduleDefinition.IsEnabled;
|
||||||
|
ModuleDefinition.PackageName = moduleDefinition.PackageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ModuleDefinition;
|
return ModuleDefinition;
|
||||||
|
|
|
@ -89,6 +89,7 @@ namespace Oqtane.Repository
|
||||||
Theme.Containers = theme.Containers;
|
Theme.Containers = theme.Containers;
|
||||||
Theme.ThemeSettingsType = theme.ThemeSettingsType;
|
Theme.ThemeSettingsType = theme.ThemeSettingsType;
|
||||||
Theme.ContainerSettingsType = theme.ContainerSettingsType;
|
Theme.ContainerSettingsType = theme.ContainerSettingsType;
|
||||||
|
Theme.PackageName = theme.PackageName;
|
||||||
Themes.Add(Theme);
|
Themes.Add(Theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,11 @@ namespace Oqtane.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// logo
|
||||||
|
/// </summary>
|
||||||
|
public int? LogoFileId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// License for the Package.
|
/// License for the Package.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -62,6 +67,11 @@ namespace Oqtane.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PackageUrl { get; set; }
|
public string PackageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The direct Url for getting support for the product
|
||||||
|
/// </summary>
|
||||||
|
public string SupportUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates if any known security vulnerabilities exist
|
/// Indicates if any known security vulnerabilities exist
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user