commit
1feb6ec452
@ -350,7 +350,7 @@ else
|
|||||||
var localizationCookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture));
|
var localizationCookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture));
|
||||||
await interop.SetCookie(CookieRequestCultureProvider.DefaultCookieName, localizationCookieValue, 360);
|
await interop.SetCookie(CookieRequestCultureProvider.DefaultCookieName, localizationCookieValue, 360);
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigationManager.Uri, forceLoad: true);
|
NavigationManager.NavigateTo(NavigationManager.Uri, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,13 +152,11 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row mb-1 align-items-center">
|
<div class="row mb-1 align-items-center">
|
||||||
<PermissionGrid EntityName="@EntityNames.Page" Permissions="@_permissions" @ref="_permissionGrid" />
|
<PermissionGrid EntityName="@EntityNames.Page" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
}
|
}
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel Name="PageModules" ResourceKey="PageModules" Heading=@Localizer["PageModules.Heading"]>
|
<TabPanel Name="PageModules" Heading="Modules" ResourceKey="PageModules">
|
||||||
@if(_pageModules != null)
|
@if(_pageModules != null)
|
||||||
{
|
{
|
||||||
<Pager Items="_pageModules">
|
<Pager Items="_pageModules">
|
||||||
@ -169,10 +167,10 @@
|
|||||||
<th>@Localizer["ModuleDefinition"]</th>
|
<th>@Localizer["ModuleDefinition"]</th>
|
||||||
</Header>
|
</Header>
|
||||||
<Row>
|
<Row>
|
||||||
<td><button type="button" class="btn btn-info" @onclick="() => LoadModuleSettings(context)">@SharedLocalizer["Settings"]</button></td>
|
<td><ActionLink Action="Settings" Text="Edit" ModuleId="@context.ModuleId" Security="SecurityAccessLevel.Edit" Permissions="@context.Permissions" ResourceKey="ModuleSettings" /></td>
|
||||||
<td><button type="button" class="btn btn-danger" @onclick="@(async() => await DeleteModule(context))">@SharedLocalizer["Delete"]</button></td>
|
<td><ActionDialog Header="Delete Module" Message="Are You Sure You Wish To Delete This Module?" Action="Delete" Security="SecurityAccessLevel.Edit" Permissions="@context.Permissions" Class="btn btn-danger" OnClick="@(async () => await DeleteModule(context))" ResourceKey="DeleteModule" /></td>
|
||||||
<td>@context.Title</td>
|
<td>@context.Title</td>
|
||||||
<td>@(context.ModuleDefinition.Name.Length > 0 ? context.ModuleDefinition.Name : context.ModuleDefinitionName)</td>
|
<td>@context.ModuleDefinition.Name</td>
|
||||||
</Row>
|
</Row>
|
||||||
</Pager>
|
</Pager>
|
||||||
}
|
}
|
||||||
@ -190,135 +188,131 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
||||||
|
|
||||||
private ElementReference form;
|
private ElementReference form;
|
||||||
private bool validated = false;
|
private bool validated = false;
|
||||||
private List<Theme> _themeList;
|
private List<Theme> _themeList;
|
||||||
private List<ThemeControl> _themes = new List<ThemeControl>();
|
private List<ThemeControl> _themes = new List<ThemeControl>();
|
||||||
private List<ThemeControl> _containers = new List<ThemeControl>();
|
private List<ThemeControl> _containers = new List<ThemeControl>();
|
||||||
private List<Page> _pageList;
|
private List<Page> _pageList;
|
||||||
private List<Module> _pageModules;
|
private List<Module> _pageModules;
|
||||||
private int _pageId;
|
private int _pageId;
|
||||||
private string _name;
|
private string _name;
|
||||||
private string _title;
|
private string _title;
|
||||||
private string _path;
|
private string _path;
|
||||||
private string _currentparentid;
|
private string _currentparentid;
|
||||||
private string _parentid = "-1";
|
private string _parentid = "-1";
|
||||||
private string _insert = "=";
|
private string _insert = "=";
|
||||||
private List<Page> _children;
|
private List<Page> _children;
|
||||||
private int _childid = -1;
|
private int _childid = -1;
|
||||||
private string _isnavigation;
|
private string _isnavigation;
|
||||||
private string _isclickable;
|
private string _isclickable;
|
||||||
private string _url;
|
private string _url;
|
||||||
private string _ispersonalizable;
|
private string _ispersonalizable;
|
||||||
private string _themetype;
|
private string _themetype;
|
||||||
private string _containertype = "-";
|
private string _containertype = "-";
|
||||||
private string _icon;
|
private string _icon;
|
||||||
private string _permissions = null;
|
private string _permissions = null;
|
||||||
private string _createdby;
|
private string _createdby;
|
||||||
private DateTime _createdon;
|
private DateTime _createdon;
|
||||||
private string _modifiedby;
|
private string _modifiedby;
|
||||||
private DateTime _modifiedon;
|
private DateTime _modifiedon;
|
||||||
private string _deletedby;
|
private string _deletedby;
|
||||||
private DateTime? _deletedon;
|
private DateTime? _deletedon;
|
||||||
private PermissionGrid _permissionGrid;
|
private PermissionGrid _permissionGrid;
|
||||||
private Type _themeSettingsType;
|
private Type _themeSettingsType;
|
||||||
private object _themeSettings;
|
private object _themeSettings;
|
||||||
private RenderFragment ThemeSettingsComponent { get; set; }
|
private RenderFragment ThemeSettingsComponent { get; set; }
|
||||||
private bool _refresh = false;
|
private bool _refresh = false;
|
||||||
protected Page page;
|
protected Page page;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_pageList = PageState.Pages;
|
_pageList = PageState.Pages;
|
||||||
_children = PageState.Pages.Where(item => item.ParentId == null).ToList();
|
_children = PageState.Pages.Where(item => item.ParentId == null).ToList();
|
||||||
_themeList = await ThemeService.GetThemesAsync();
|
_themeList = await ThemeService.GetThemesAsync();
|
||||||
_themes = ThemeService.GetThemeControls(_themeList);
|
_themes = ThemeService.GetThemeControls(_themeList);
|
||||||
|
|
||||||
_pageId = Int32.Parse(PageState.QueryString["id"]);
|
_pageId = Int32.Parse(PageState.QueryString["id"]);
|
||||||
page = PageState.Pages.FirstOrDefault(item => item.PageId == _pageId);
|
page = PageState.Pages.FirstOrDefault(item => item.PageId == _pageId);
|
||||||
|
|
||||||
if (page != null)
|
if (page != null)
|
||||||
{
|
{
|
||||||
_name = page.Name;
|
_name = page.Name;
|
||||||
_title = page.Title;
|
_title = page.Title;
|
||||||
_path = page.Path;
|
_path = page.Path;
|
||||||
_pageModules = PageState.Modules.Where(m => m.PageId == page.PageId && m.IsDeleted == false).ToList();
|
_pageModules = PageState.Modules.Where(m => m.PageId == page.PageId && m.IsDeleted == false).ToList();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(_path))
|
if (string.IsNullOrEmpty(_path))
|
||||||
{
|
{
|
||||||
_path = "/";
|
_path = "/";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_path.Contains("/"))
|
if (_path.Contains("/"))
|
||||||
{
|
{
|
||||||
_path = _path.Substring(_path.LastIndexOf("/") + 1);
|
_path = _path.Substring(_path.LastIndexOf("/") + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page.ParentId == null)
|
if (page.ParentId == null)
|
||||||
{
|
{
|
||||||
_parentid = "-1";
|
_parentid = "-1";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_parentid = page.ParentId.ToString();
|
_parentid = page.ParentId.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
_currentparentid = _parentid;
|
_currentparentid = _parentid;
|
||||||
_isnavigation = page.IsNavigation.ToString();
|
_isnavigation = page.IsNavigation.ToString();
|
||||||
_isclickable = page.IsClickable.ToString();
|
_isclickable = page.IsClickable.ToString();
|
||||||
_url = page.Url;
|
_url = page.Url;
|
||||||
_ispersonalizable = page.IsPersonalizable.ToString();
|
_ispersonalizable = page.IsPersonalizable.ToString();
|
||||||
_themetype = page.ThemeType;
|
_themetype = page.ThemeType;
|
||||||
if (string.IsNullOrEmpty(_themetype))
|
if (string.IsNullOrEmpty(_themetype))
|
||||||
{
|
{
|
||||||
_themetype = PageState.Site.DefaultThemeType;
|
_themetype = PageState.Site.DefaultThemeType;
|
||||||
}
|
}
|
||||||
_containers = ThemeService.GetContainerControls(_themeList, _themetype);
|
_containers = ThemeService.GetContainerControls(_themeList, _themetype);
|
||||||
_containertype = page.DefaultContainerType;
|
_containertype = page.DefaultContainerType;
|
||||||
if (string.IsNullOrEmpty(_containertype))
|
if (string.IsNullOrEmpty(_containertype))
|
||||||
{
|
{
|
||||||
_containertype = PageState.Site.DefaultContainerType;
|
_containertype = PageState.Site.DefaultContainerType;
|
||||||
}
|
}
|
||||||
_icon = page.Icon;
|
_icon = page.Icon;
|
||||||
_permissions = page.Permissions;
|
_permissions = page.Permissions;
|
||||||
_createdby = page.CreatedBy;
|
_createdby = page.CreatedBy;
|
||||||
_createdon = page.CreatedOn;
|
_createdon = page.CreatedOn;
|
||||||
_modifiedby = page.ModifiedBy;
|
_modifiedby = page.ModifiedBy;
|
||||||
_modifiedon = page.ModifiedOn;
|
_modifiedon = page.ModifiedOn;
|
||||||
_deletedby = page.DeletedBy;
|
_deletedby = page.DeletedBy;
|
||||||
_deletedon = page.DeletedOn;
|
_deletedon = page.DeletedOn;
|
||||||
|
|
||||||
ThemeSettings();
|
ThemeSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await logger.LogError(ex, "Error Loading Page {PageId} {Error}", _pageId, ex.Message);
|
await logger.LogError(ex, "Error Loading Page {PageId} {Error}", _pageId, ex.Message);
|
||||||
AddModuleMessage(Localizer["Error.Page.Load"], MessageType.Error);
|
AddModuleMessage(Localizer["Error.Page.Load"], MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void LoadModuleSettings(Module module)
|
private async Task DeleteModule(Module module)
|
||||||
{
|
{
|
||||||
NavigationManager.NavigateTo(EditUrl(module.ModuleId, "Settings"));
|
try
|
||||||
}
|
{
|
||||||
|
PageModule pagemodule = await PageModuleService.GetPageModuleAsync(page.PageId, module.ModuleId);
|
||||||
private async Task DeleteModule(Module module)
|
pagemodule.IsDeleted = true;
|
||||||
{
|
await PageModuleService.UpdatePageModuleAsync(pagemodule);
|
||||||
try
|
await logger.LogInformation(LogFunction.Update,"Module Deleted {Title}", module.Title);
|
||||||
{
|
_pageModules.RemoveAll(item => item.PageModuleId == pagemodule.PageModuleId);
|
||||||
PageModule pagemodule = await PageModuleService.GetPageModuleAsync(page.PageId,module.ModuleId);
|
StateHasChanged();
|
||||||
pagemodule.IsDeleted = true;
|
NavigationManager.NavigateTo(NavigationManager.Uri + "&tab=PageModules");
|
||||||
|
|
||||||
await PageModuleService.UpdatePageModuleAsync(pagemodule);
|
|
||||||
await logger.LogInformation(LogFunction.Update,"Module Deleted {Title}", module.Title);
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, true));
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<th>@Localizer["DeletedOn"]</th>
|
<th>@Localizer["DeletedOn"]</th>
|
||||||
</Header>
|
</Header>
|
||||||
<Row>
|
<Row>
|
||||||
<td><button @onclick="@(() => RestorePage(context))" class="btn btn-info" title="Restore">Restore</button></td>
|
<td><button type="button" @onclick="@(() => RestorePage(context))" class="btn btn-info" title="Restore">Restore</button></td>
|
||||||
<td><ActionDialog Header="Delete Page" Message="@string.Format(Localizer["Confirm.Page.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" ResourceKey="DeletePage" /></td>
|
<td><ActionDialog Header="Delete Page" Message="@string.Format(Localizer["Confirm.Page.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" ResourceKey="DeletePage" /></td>
|
||||||
<td>@context.Name</td>
|
<td>@context.Name</td>
|
||||||
<td>@context.DeletedBy</td>
|
<td>@context.DeletedBy</td>
|
||||||
@ -34,9 +34,7 @@
|
|||||||
</Pager>
|
</Pager>
|
||||||
@if (_pages.Any())
|
@if (_pages.Any())
|
||||||
{
|
{
|
||||||
<div style="text-align:right;">
|
<br /><ActionDialog Header="Delete All Pages" Message="Are You Sure You Wish To Permanently Delete All Pages?" Action="Delete All Pages" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteAllPages())" ResourceKey="DeleteAllPages" />
|
||||||
<ActionDialog Header="Delete All Pages" Message="Are You Sure You Wish To Permanently Delete All Pages?" Action="Delete All Pages" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteAllPages())" ResourceKey="DeleteAllPages" />
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
@ -58,7 +56,7 @@
|
|||||||
<th>@Localizer["DeletedOn"]</th>
|
<th>@Localizer["DeletedOn"]</th>
|
||||||
</Header>
|
</Header>
|
||||||
<Row>
|
<Row>
|
||||||
<td><button @onclick="@(() => RestoreModule(context))" class="btn btn-info" title="Restore">@Localizer["Restore"]</button></td>
|
<td><button type="button" @onclick="@(() => RestoreModule(context))" class="btn btn-info" title="Restore">@Localizer["Restore"]</button></td>
|
||||||
<td><ActionDialog Header="Delete Module" Message="@string.Format(Localizer["Confirm.Module.Delete"], context.Title)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteModule(context))" ResourceKey="DeleteModule" /></td>
|
<td><ActionDialog Header="Delete Module" Message="@string.Format(Localizer["Confirm.Module.Delete"], context.Title)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteModule(context))" ResourceKey="DeleteModule" /></td>
|
||||||
<td>@PageState.Pages.Find(item => item.PageId == context.PageId).Name</td>
|
<td>@PageState.Pages.Find(item => item.PageId == context.PageId).Name</td>
|
||||||
<td>@context.Title</td>
|
<td>@context.Title</td>
|
||||||
@ -68,9 +66,7 @@
|
|||||||
</Pager>
|
</Pager>
|
||||||
@if (_modules.Any())
|
@if (_modules.Any())
|
||||||
{
|
{
|
||||||
<div style="text-align:right;">
|
<br /><ActionDialog Header="Delete All Modules" Message="Are You Sure You Wish To Permanently Delete All Modules?" Action="Delete All Modules" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteAllModules())" ResourceKey="DeleteAllModules" />
|
||||||
<ActionDialog Header="Delete All Modules" Message="Are You Sure You Wish To Permanently Delete All Modules?" Action="Delete All Modules" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteAllModules())" ResourceKey="DeleteAllModules" />
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ else
|
|||||||
<input class="form-control" @bind="@_search" />
|
<input class="form-control" @bind="@_search" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<button class="btn btn-secondary" @onclick="OnSearch">@SharedLocalizer["Search"]</button>
|
<button type="button" class="btn btn-secondary" @onclick="OnSearch">@SharedLocalizer["Search"]</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
@if (!string.IsNullOrEmpty(Action))
|
@if (!string.IsNullOrEmpty(Action))
|
||||||
{
|
{
|
||||||
<button type="button" class="@Class" @onclick="Confirm">@((MarkupString)_iconSpan) @Localize(Action)</button>
|
<button type="button" class="@Class" @onclick="Confirm">@((MarkupString)_iconSpan) @Text</button>
|
||||||
}
|
}
|
||||||
<button type="button" class="btn btn-secondary" @onclick="DisplayModal">@Localize("Cancel")</button>
|
<button type="button" class="btn btn-secondary" @onclick="DisplayModal">@Localize("Cancel")</button>
|
||||||
</div>
|
</div>
|
||||||
@ -30,16 +30,17 @@
|
|||||||
{
|
{
|
||||||
if (Disabled)
|
if (Disabled)
|
||||||
{
|
{
|
||||||
<button class="@Class" disabled>@((MarkupString)_iconSpan) @Text</button>
|
<button type="button" class="@Class" disabled>@((MarkupString)_iconSpan) @Text</button>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<button class="@Class" @onclick="DisplayModal">@((MarkupString)_iconSpan) @Text</button>
|
<button type="button" class="@Class" @onclick="DisplayModal">@((MarkupString)_iconSpan) @Text</button>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private bool _visible = false;
|
private bool _visible = false;
|
||||||
|
private string _permissions = string.Empty;
|
||||||
private bool _editmode = false;
|
private bool _editmode = false;
|
||||||
private bool _authorized = false;
|
private bool _authorized = false;
|
||||||
private string _iconSpan = string.Empty;
|
private string _iconSpan = string.Empty;
|
||||||
@ -59,6 +60,9 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
|
public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string Permissions { get; set; } // optional - can be used to specify a permission string
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Class { get; set; } // optional
|
public string Class { get; set; } // optional
|
||||||
|
|
||||||
@ -105,6 +109,7 @@
|
|||||||
Header = Localize(nameof(Header), Header);
|
Header = Localize(nameof(Header), Header);
|
||||||
Message = Localize(nameof(Message), Message);
|
Message = Localize(nameof(Message), Message);
|
||||||
|
|
||||||
|
_permissions = (string.IsNullOrEmpty(Permissions)) ? ModuleState.Permissions : Permissions;
|
||||||
_authorized = IsAuthorized();
|
_authorized = IsAuthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,10 +143,10 @@
|
|||||||
authorized = true;
|
authorized = true;
|
||||||
break;
|
break;
|
||||||
case SecurityAccessLevel.View:
|
case SecurityAccessLevel.View:
|
||||||
authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.View, ModuleState.Permissions);
|
authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.View, _permissions);
|
||||||
break;
|
break;
|
||||||
case SecurityAccessLevel.Edit:
|
case SecurityAccessLevel.Edit:
|
||||||
authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, ModuleState.Permissions);
|
authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, _permissions);
|
||||||
break;
|
break;
|
||||||
case SecurityAccessLevel.Admin:
|
case SecurityAccessLevel.Admin:
|
||||||
authorized = UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin);
|
authorized = UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin);
|
||||||
|
@ -6,101 +6,118 @@
|
|||||||
{
|
{
|
||||||
if (Disabled)
|
if (Disabled)
|
||||||
{
|
{
|
||||||
<button class="@_classname" style="@_style" disabled>@((MarkupString)_iconSpan) @_text</button>
|
<button type="button" class="@_classname" style="@_style" disabled>@((MarkupString)_iconSpan) @_text</button>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<NavLink class="@_classname" href="@_url" style="@_style">@((MarkupString)_iconSpan) @_text</NavLink>
|
if (OnClick == null)
|
||||||
}
|
{
|
||||||
|
<NavLink class="@_classname" href="@_url" style="@_style">@((MarkupString)_iconSpan) @_text</NavLink>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<button type="button" class="@_classname" style="@_style" onclick="@OnClick">@((MarkupString)_iconSpan) @_text</button>
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private string _text = string.Empty;
|
private string _text = string.Empty;
|
||||||
private string _url = string.Empty;
|
private string _parameters = string.Empty;
|
||||||
private string _parameters = string.Empty;
|
private string _url = string.Empty;
|
||||||
private string _classname = "btn btn-primary";
|
private string _permissions = string.Empty;
|
||||||
private string _style = string.Empty;
|
private bool _editmode = false;
|
||||||
private bool _editmode = false;
|
private bool _authorized = false;
|
||||||
private bool _authorized = false;
|
private string _classname = "btn btn-primary";
|
||||||
private string _iconSpan = string.Empty;
|
private string _style = string.Empty;
|
||||||
|
private string _iconSpan = string.Empty;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Action { get; set; } // required
|
public string Action { get; set; } // required
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
|
public string Text { get; set; } // optional - defaults to Action if not specified
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Text { get; set; } // optional - defaults to Action if not specified
|
public string Parameters { get; set; } // optional - querystring parameters should be in the form of "id=x&name=y"
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Parameters { get; set; } // optional - querystring parameter should be in the form of "id=x&name=y"
|
public int ModuleId { get; set; } = -1; // optional - allows the link to target a specific moduleid
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Class { get; set; } // optional - defaults to primary if not specified
|
public Action OnClick { get; set; } = null; // optional - executes a method in the calling component
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Style { get; set; } // optional
|
public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public bool Disabled { get; set; } // optional
|
public string Permissions { get; set; } // optional - can be used to specify a permission string
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string EditMode { get; set; } // optional - specifies if an authorized user must be in edit mode to see the action - default is false.
|
public bool Disabled { get; set; } // optional
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string IconName { get; set; } // optional - specifies an icon for the link - default is no icon
|
public string EditMode { get; set; } // optional - specifies if an authorized user must be in edit mode to see the action - default is false.
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public bool IconOnly { get; set; } // optional - specifies only icon in link
|
public string Class { get; set; } // optional - defaults to primary if not specified
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
[Parameter]
|
||||||
{
|
public string Style { get; set; } // optional
|
||||||
base.OnParametersSet();
|
|
||||||
|
|
||||||
_text = Action;
|
[Parameter]
|
||||||
if (!string.IsNullOrEmpty(Text))
|
public string IconName { get; set; } // optional - specifies an icon for the link - default is no icon
|
||||||
{
|
|
||||||
_text = Text;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IconOnly && !string.IsNullOrEmpty(IconName))
|
[Parameter]
|
||||||
{
|
public bool IconOnly { get; set; } // optional - specifies only icon in link
|
||||||
_text = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Parameters))
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
_parameters = Parameters;
|
base.OnParametersSet();
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Class))
|
_text = Action;
|
||||||
{
|
if (!string.IsNullOrEmpty(Text))
|
||||||
_classname = Class;
|
{
|
||||||
}
|
_text = Text;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Style))
|
if (IconOnly && !string.IsNullOrEmpty(IconName))
|
||||||
{
|
{
|
||||||
_style = Style;
|
_text = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(EditMode))
|
if (!string.IsNullOrEmpty(Parameters))
|
||||||
{
|
{
|
||||||
_editmode = bool.Parse(EditMode);
|
_parameters = Parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(IconName))
|
if (!string.IsNullOrEmpty(Class))
|
||||||
{
|
{
|
||||||
if (!IconName.Contains(" "))
|
_classname = Class;
|
||||||
{
|
}
|
||||||
IconName = "oi oi-" + IconName;
|
|
||||||
}
|
|
||||||
_iconSpan = $"<span class=\"{IconName}\"></span>{(IconOnly ? "" : " ")}";
|
|
||||||
|
|
||||||
}
|
if (!string.IsNullOrEmpty(Style))
|
||||||
|
{
|
||||||
|
_style = Style;
|
||||||
|
}
|
||||||
|
|
||||||
_text = Localize(nameof(Text), _text);
|
if (!string.IsNullOrEmpty(EditMode))
|
||||||
_url = EditUrl(Action, _parameters);
|
{
|
||||||
|
_editmode = bool.Parse(EditMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(IconName))
|
||||||
|
{
|
||||||
|
if (!IconName.Contains(" "))
|
||||||
|
{
|
||||||
|
IconName = "oi oi-" + IconName;
|
||||||
|
}
|
||||||
|
_iconSpan = $"<span class=\"{IconName}\"></span>{(IconOnly ? "" : " ")}";
|
||||||
|
}
|
||||||
|
|
||||||
|
_permissions = (string.IsNullOrEmpty(Permissions)) ? ModuleState.Permissions : Permissions;
|
||||||
|
_text = Localize(nameof(Text), _text);
|
||||||
|
_url = (ModuleId == -1) ? EditUrl(Action, _parameters) : EditUrl(ModuleId, Action, _parameters);
|
||||||
_authorized = IsAuthorized();
|
_authorized = IsAuthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,10 +153,10 @@
|
|||||||
authorized = true;
|
authorized = true;
|
||||||
break;
|
break;
|
||||||
case SecurityAccessLevel.View:
|
case SecurityAccessLevel.View:
|
||||||
authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, ModuleState.Permissions);
|
authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, _permissions);
|
||||||
break;
|
break;
|
||||||
case SecurityAccessLevel.Edit:
|
case SecurityAccessLevel.Edit:
|
||||||
authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, ModuleState.Permissions);
|
authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, _permissions);
|
||||||
break;
|
break;
|
||||||
case SecurityAccessLevel.Admin:
|
case SecurityAccessLevel.Admin:
|
||||||
authorized = UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin);
|
authorized = UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin);
|
||||||
|
@ -43,16 +43,12 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public bool Refresh { get; set; } // optional - used in scenarios where TabPanels are added/removed dynamically within a parent form. ActiveTab may need to be reset as well when this property is used.
|
public bool Refresh { get; set; } // optional - used in scenarios where TabPanels are added/removed dynamically within a parent form. ActiveTab may need to be reset as well when this property is used.
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
if (PageState.QueryString.ContainsKey("tab"))
|
if (PageState.QueryString.ContainsKey("tab"))
|
||||||
{
|
{
|
||||||
ActiveTab = PageState.QueryString["tab"];
|
ActiveTab = PageState.QueryString["tab"];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
|
||||||
{
|
|
||||||
if (_tabPanels == null || Refresh)
|
if (_tabPanels == null || Refresh)
|
||||||
{
|
{
|
||||||
_tabPanels = new List<TabPanel>();
|
_tabPanels = new List<TabPanel>();
|
||||||
|
@ -136,7 +136,12 @@ namespace Oqtane.Modules
|
|||||||
|
|
||||||
public string ImageUrl(int fileid, int width, int height, string mode)
|
public string ImageUrl(int fileid, int width, int height, string mode)
|
||||||
{
|
{
|
||||||
return Utilities.ImageUrl(PageState.Alias, fileid, width, height, mode);
|
return ImageUrl(fileid, width, height, mode, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ImageUrl(int fileid, int width, int height, string mode, int rotate)
|
||||||
|
{
|
||||||
|
return Utilities.ImageUrl(PageState.Alias, fileid, width, height, mode, rotate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Dictionary<string, string> GetUrlParameters(string parametersTemplate = "")
|
public virtual Dictionary<string, string> GetUrlParameters(string parametersTemplate = "")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
@ -232,15 +232,24 @@
|
|||||||
<value>Move: </value>
|
<value>Move: </value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ModuleDefinition" xml:space="preserve">
|
<data name="ModuleDefinition" xml:space="preserve">
|
||||||
<value>Module Name / Definition</value>
|
<value>Module</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ModuleTitle" xml:space="preserve">
|
<data name="ModuleTitle" xml:space="preserve">
|
||||||
<value>Module Title</value>
|
<value>Title</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PageModules.Heading" xml:space="preserve">
|
<data name="PageModules.Heading" xml:space="preserve">
|
||||||
<value>Page Modules</value>
|
<value>Modules</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Settings.Text" xml:space="preserve">
|
<data name="ModuleSettings.Text" xml:space="preserve">
|
||||||
<value />
|
<value>Edit</value>
|
||||||
|
</data>
|
||||||
|
<data name="DeleteModule.Header" xml:space="preserve">
|
||||||
|
<value>Delete Module</value>
|
||||||
|
</data>
|
||||||
|
<data name="DeleteModule.Message" xml:space="preserve">
|
||||||
|
<value>Are You Sure You Wish To Delete This Module?</value>
|
||||||
|
</data>
|
||||||
|
<data name="DeleteModule.Text" xml:space="preserve">
|
||||||
|
<value>Delete</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
@if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions))
|
@if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
<button class="btn @ButtonClass" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasControlPanel" aria-controls="offcanvasControlPanel">
|
<button type="button" class="btn @ButtonClass" data-bs-toggle="offcanvas" data-bs-target="#offcanvasControlPanel" aria-controls="offcanvasControlPanel">
|
||||||
<span class="oi oi-cog"></span>
|
<span class="oi oi-cog"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@ -50,7 +50,7 @@
|
|||||||
{
|
{
|
||||||
<div class="row d-flex">
|
<div class="row d-flex">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button data-bs-dismiss="offcanvas" type="button" class="btn btn-primary col-12" @onclick=@(async () => Navigate("Admin"))>@Localizer["AdminDash"]</button>
|
<button type="button" data-bs-dismiss="offcanvas" class="btn btn-primary col-12" @onclick=@(async () => Navigate("Admin"))>@Localizer["AdminDash"]</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
@if (MenuPages.Any())
|
@if (MenuPages.Any())
|
||||||
{
|
{
|
||||||
<span class="app-menu-toggler navbar-expand-md">
|
<span class="app-menu-toggler navbar-expand-md">
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#Menu" aria-controls="Menu" aria-expanded="false" aria-label="Toggle Navigation">
|
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#Menu" aria-controls="Menu" aria-expanded="false" aria-label="Toggle Navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
@if (MenuPages.Any())
|
@if (MenuPages.Any())
|
||||||
{
|
{
|
||||||
<span class="app-menu-toggler">
|
<span class="app-menu-toggler">
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#Menu" aria-controls="Menu" aria-expanded="false" aria-label="Toggle Navigation">
|
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#Menu" aria-controls="Menu" aria-expanded="false" aria-label="Toggle Navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -106,7 +106,12 @@ namespace Oqtane.Themes
|
|||||||
|
|
||||||
public string ImageUrl(int fileid, int width, int height, string mode)
|
public string ImageUrl(int fileid, int width, int height, string mode)
|
||||||
{
|
{
|
||||||
return Utilities.ImageUrl(PageState.Alias, fileid, width, height, mode);
|
return ImageUrl(fileid, width, height, mode, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ImageUrl(int fileid, int width, int height, string mode, int rotate)
|
||||||
|
{
|
||||||
|
return Utilities.ImageUrl(PageState.Alias, fileid, width, height, mode, rotate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -508,8 +508,8 @@ namespace Oqtane.Controllers
|
|||||||
return System.IO.File.Exists(errorPath) ? PhysicalFile(errorPath, MimeUtilities.GetMimeType(errorPath)) : null;
|
return System.IO.File.Exists(errorPath) ? PhysicalFile(errorPath, MimeUtilities.GetMimeType(errorPath)) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("image/{id}/{width}/{height}/{mode?}")]
|
[HttpGet("image/{id}/{width}/{height}/{mode?}/{rotate?}")]
|
||||||
public IActionResult GetImage(int id, int width, int height, string mode)
|
public IActionResult GetImage(int id, int width, int height, string mode, string rotate)
|
||||||
{
|
{
|
||||||
var file = _files.GetFile(id);
|
var file = _files.GetFile(id);
|
||||||
if (file != null && file.Folder.SiteId == _alias.SiteId && _userPermissions.IsAuthorized(User, PermissionNames.View, file.Folder.Permissions))
|
if (file != null && file.Folder.SiteId == _alias.SiteId && _userPermissions.IsAuthorized(User, PermissionNames.View, file.Folder.Permissions))
|
||||||
@ -520,6 +520,7 @@ namespace Oqtane.Controllers
|
|||||||
if (System.IO.File.Exists(filepath))
|
if (System.IO.File.Exists(filepath))
|
||||||
{
|
{
|
||||||
mode = (string.IsNullOrEmpty(mode)) ? "crop" : mode;
|
mode = (string.IsNullOrEmpty(mode)) ? "crop" : mode;
|
||||||
|
rotate = (string.IsNullOrEmpty(rotate)) ? "0" : rotate;
|
||||||
|
|
||||||
string imagepath = filepath.Replace(Path.GetExtension(filepath), "." + width.ToString() + "x" + height.ToString() + "." + mode.ToLower() + ".png");
|
string imagepath = filepath.Replace(Path.GetExtension(filepath), "." + width.ToString() + "x" + height.ToString() + "." + mode.ToLower() + ".png");
|
||||||
if (!System.IO.File.Exists(imagepath))
|
if (!System.IO.File.Exists(imagepath))
|
||||||
@ -528,7 +529,7 @@ namespace Oqtane.Controllers
|
|||||||
!string.IsNullOrEmpty(file.Folder.ImageSizes) && file.Folder.ImageSizes.ToLower().Split(",").Contains(width.ToString() + "x" + height.ToString()))
|
!string.IsNullOrEmpty(file.Folder.ImageSizes) && file.Folder.ImageSizes.ToLower().Split(",").Contains(width.ToString() + "x" + height.ToString()))
|
||||||
&& Enum.TryParse(mode, true, out ResizeMode resizemode))
|
&& Enum.TryParse(mode, true, out ResizeMode resizemode))
|
||||||
{
|
{
|
||||||
imagepath = CreateImage(filepath, width, height, resizemode.ToString(), imagepath);
|
imagepath = CreateImage(filepath, width, height, resizemode.ToString(), rotate, imagepath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -568,7 +569,7 @@ namespace Oqtane.Controllers
|
|||||||
return System.IO.File.Exists(errorPath) ? PhysicalFile(errorPath, MimeUtilities.GetMimeType(errorPath)) : null;
|
return System.IO.File.Exists(errorPath) ? PhysicalFile(errorPath, MimeUtilities.GetMimeType(errorPath)) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string CreateImage(string filepath, int width, int height, string mode, string imagepath)
|
private string CreateImage(string filepath, int width, int height, string mode, string rotate, string imagepath)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -585,6 +586,11 @@ namespace Oqtane.Controllers
|
|||||||
})
|
})
|
||||||
.BackgroundColor(new Rgba32(255, 255, 255, 0)));
|
.BackgroundColor(new Rgba32(255, 255, 255, 0)));
|
||||||
|
|
||||||
|
if (rotate != "0" && int.TryParse(rotate, out int angle))
|
||||||
|
{
|
||||||
|
image.Mutate(x => x.Rotate(angle));
|
||||||
|
}
|
||||||
|
|
||||||
image.Save(imagepath, new PngEncoder());
|
image.Save(imagepath, new PngEncoder());
|
||||||
}
|
}
|
||||||
stream.Close();
|
stream.Close();
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Oqtane.Databases.Interfaces;
|
||||||
|
using Oqtane.Migrations.EntityBuilders;
|
||||||
|
using Oqtane.Repository;
|
||||||
|
|
||||||
|
namespace Oqtane.Migrations.Tenant
|
||||||
|
{
|
||||||
|
[DbContext(typeof(TenantDBContext))]
|
||||||
|
[Migration("Tenant.03.00.01.01")]
|
||||||
|
public class ChangeFileNameColumnsSize : MultiDatabaseMigration
|
||||||
|
{
|
||||||
|
public ChangeFileNameColumnsSize(IDatabase database) : base(database)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
if (ActiveDatabase.Name != "Sqlite")
|
||||||
|
{
|
||||||
|
var fileEntityBuilder = new FileEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||||
|
|
||||||
|
// Drop the index is needed because the Name is already associated with IX_File
|
||||||
|
fileEntityBuilder.DropForeignKey("FK_File_Folder");
|
||||||
|
fileEntityBuilder.DropIndex("IX_File");
|
||||||
|
fileEntityBuilder.AlterStringColumn("Name", 256);
|
||||||
|
fileEntityBuilder.AddIndex("IX_File", new[] { "FolderId", "Name" }, true);
|
||||||
|
fileEntityBuilder.AddForeignKey("FK_File_Folder");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
if (ActiveDatabase.Name != "Sqlite")
|
||||||
|
{
|
||||||
|
var fileEntityBuilder = new FileEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||||
|
|
||||||
|
fileEntityBuilder.DropIndex("IX_File");
|
||||||
|
fileEntityBuilder.AlterStringColumn("Name", 50);
|
||||||
|
fileEntityBuilder.AddIndex("IX_File", new[] { "FolderId", "Name" }, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<title>Oqtane</title>
|
<title>@Model.Title</title>
|
||||||
<base href="~/" />
|
<base href="~/" />
|
||||||
<link id="app-favicon" rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
<link id="app-favicon" rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||||
<!-- stub the PWA manifest but defer the assignment of href -->
|
<!-- stub the PWA manifest but defer the assignment of href -->
|
||||||
|
@ -40,6 +40,7 @@ namespace Oqtane.Pages
|
|||||||
public RenderMode RenderMode = RenderMode.Server;
|
public RenderMode RenderMode = RenderMode.Server;
|
||||||
public string HeadResources = "";
|
public string HeadResources = "";
|
||||||
public string BodyResources = "";
|
public string BodyResources = "";
|
||||||
|
public string Title = "";
|
||||||
|
|
||||||
public void OnGet()
|
public void OnGet()
|
||||||
{
|
{
|
||||||
@ -80,6 +81,7 @@ namespace Oqtane.Pages
|
|||||||
{
|
{
|
||||||
RenderMode = (RenderMode)Enum.Parse(typeof(RenderMode), site.RenderMode, true);
|
RenderMode = (RenderMode)Enum.Parse(typeof(RenderMode), site.RenderMode, true);
|
||||||
}
|
}
|
||||||
|
Title = site.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if culture not specified
|
// if culture not specified
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 318 B |
BIN
Oqtane.Server/wwwroot/oqtane.ico
Normal file
BIN
Oqtane.Server/wwwroot/oqtane.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
@ -113,9 +113,14 @@ namespace Oqtane.Shared
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static string ImageUrl(Alias alias, int fileId, int width, int height, string mode)
|
public static string ImageUrl(Alias alias, int fileId, int width, int height, string mode)
|
||||||
|
{
|
||||||
|
return ImageUrl(alias, fileId, width, height, mode, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ImageUrl(Alias alias, int fileId, int width, int height, string mode, int rotate)
|
||||||
{
|
{
|
||||||
var aliasUrl = (alias != null && !string.IsNullOrEmpty(alias.Path)) ? "/" + alias.Path : "";
|
var aliasUrl = (alias != null && !string.IsNullOrEmpty(alias.Path)) ? "/" + alias.Path : "";
|
||||||
return $"{aliasUrl}{Constants.ImageUrl}{fileId}/{width}/{height}/{mode}";
|
return $"{aliasUrl}{Constants.ImageUrl}{fileId}/{width}/{height}/{mode}/{rotate}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string TenantUrl(Alias alias, string url)
|
public static string TenantUrl(Alias alias, string url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user