Additional properties added to Route model to improve abstraction, modified Site Settings to support settings moved to the server.

This commit is contained in:
Shaun Walker
2021-12-02 16:33:16 -05:00
parent 43d166fb7d
commit a216e2b92e
3 changed files with 253 additions and 221 deletions

View File

@ -4,12 +4,16 @@ using Oqtane.Shared;
namespace Oqtane.Models
{
/// <summary>
/// A route is comprised of multiple components:
/// A route is comprised of multiple components ( some optional depending on context )
/// {scheme}://{hostname}/{aliaspath}/{pagepath}/*/{moduleid}/{action}/!/{urlparameters}?{query}#{fragment}
/// </summary>
public class Route
{
// default constructor accepts an absolute route url and alias
/// <summary>
/// default constructor
/// the route parameter can be obtained from NavigationManager.Uri on client or HttpContext.Request.GetEncodedUrl() on server
/// the aliaspath parameter can be obtained from PageState.Alias.Path on client or TenantManager.GetAlias().Path on server
/// </summary>
public Route(string route, string aliaspath)
{
Uri uri = new Uri(route);
@ -120,5 +124,27 @@ namespace Oqtane.Models
/// A route may contain a fragment located after the # delimiter
/// </summary>
public string Fragment { get; set; }
/// <summary>
/// The root url contains the resource identifier for the root of an Oqtane installation ( including scheme )
/// </summary>
public string RootUrl
{
get
{
return Scheme + "://" + Authority;
}
}
/// <summary>
/// The site url contains the resource identifier for the home page of a specific Oqtane site ( including scheme and possibly an alias path )
/// </summary>
public string SiteUrl
{
get
{
return Scheme + "://" + Authority + ((!string.IsNullOrEmpty(AliasPath)) ? "/" + AliasPath : "");
}
}
}
}