commit
f19428d359
51
Oqtane.Client/Modules/Admin/Files/Add.razor
Normal file
51
Oqtane.Client/Modules/Admin/Files/Add.razor
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
@namespace Oqtane.Modules.Admin.Files
|
||||||
|
@inherits ModuleBase
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject IFileService FileService
|
||||||
|
|
||||||
|
<table class="table table-borderless">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="Name" class="control-label">Files: </label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<FileUpload Multiple="true" @ref="fileupload"></FileUpload>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<button type="button" class="btn btn-primary" @onclick="UploadFile">Upload</button>
|
||||||
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
|
|
||||||
|
|
||||||
|
@code {
|
||||||
|
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Admin; } }
|
||||||
|
|
||||||
|
FileUpload fileupload;
|
||||||
|
|
||||||
|
private async Task UploadFile()
|
||||||
|
{
|
||||||
|
string[] files = await fileupload.GetFiles();
|
||||||
|
if (files.Length > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (await FileService.UploadFilesAsync(PageState.Site.SiteRootPath, files, ""))
|
||||||
|
{
|
||||||
|
ModuleInstance.AddModuleMessage("Files Uploaded Successfully", MessageType.Success);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ModuleInstance.AddModuleMessage("Upload Failed", MessageType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ModuleInstance.AddModuleMessage("Upload Failed. " + ex.Message, MessageType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ModuleInstance.AddModuleMessage("You Must Select Some Files To Upload", MessageType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
44
Oqtane.Client/Modules/Admin/Files/Index.razor
Normal file
44
Oqtane.Client/Modules/Admin/Files/Index.razor
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
@namespace Oqtane.Modules.Admin.Files
|
||||||
|
@inherits ModuleBase
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject IFileService FileService
|
||||||
|
|
||||||
|
@if (Files == null)
|
||||||
|
{
|
||||||
|
<p><em>Loading...</em></p>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<ActionLink Action="Add" Text="Add File" Style="float: right; margin: 10px;" />
|
||||||
|
|
||||||
|
<Pager Items="@Files">
|
||||||
|
<Header>
|
||||||
|
<th>Name</th>
|
||||||
|
<th> </th>
|
||||||
|
</Header>
|
||||||
|
<Row>
|
||||||
|
<td>@context</td>
|
||||||
|
<td>
|
||||||
|
<button type="button" class="btn btn-danger" @onclick=@(async () => await DeleteFile(context))>Delete</button>
|
||||||
|
</td>
|
||||||
|
</Row>
|
||||||
|
</Pager>
|
||||||
|
}
|
||||||
|
|
||||||
|
@code {
|
||||||
|
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Admin; } }
|
||||||
|
|
||||||
|
List<string> Files;
|
||||||
|
|
||||||
|
protected override async Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
Files = await FileService.GetFilesAsync(PageState.Site.SiteRootPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DeleteFile(string filename)
|
||||||
|
{
|
||||||
|
await FileService.DeleteFileAsync(PageState.Site.SiteRootPath, filename);
|
||||||
|
Files = await FileService.GetFilesAsync(PageState.Site.SiteRootPath);
|
||||||
|
ModuleInstance.AddModuleMessage("File Deleted", MessageType.Success);
|
||||||
|
}
|
||||||
|
}
|
|
@ -58,7 +58,6 @@
|
||||||
string username = "";
|
string username = "";
|
||||||
string email = "";
|
string email = "";
|
||||||
string displayname = "";
|
string displayname = "";
|
||||||
string category = "";
|
|
||||||
string createdby;
|
string createdby;
|
||||||
DateTime createdon;
|
DateTime createdon;
|
||||||
string modifiedby;
|
string modifiedby;
|
||||||
|
|
|
@ -88,5 +88,9 @@
|
||||||
classname = "btn btn-warning"; // alert developer of missing module comtrol
|
classname = "btn btn-warning"; // alert developer of missing module comtrol
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
authorized = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
|
@ -37,19 +38,34 @@ namespace Oqtane.Services
|
||||||
bool success = false;
|
bool success = false;
|
||||||
var interop = new Interop(jsRuntime);
|
var interop = new Interop(jsRuntime);
|
||||||
await interop.UploadFiles(apiurl + "/upload", Folder, FileUploadName);
|
await interop.UploadFiles(apiurl + "/upload", Folder, FileUploadName);
|
||||||
List<string> files = await GetFilesAsync(Folder);
|
|
||||||
if (files.Count > 0)
|
// uploading files is asynchronous so we need to wait for the upload to complete
|
||||||
|
int attempts = 0;
|
||||||
|
while (attempts < 5 && success == false)
|
||||||
{
|
{
|
||||||
success = true;
|
Thread.Sleep(2000); // wait 2 seconds
|
||||||
foreach (string file in Files)
|
|
||||||
|
List<string> files = await GetFilesAsync(Folder);
|
||||||
|
if (files.Count > 0)
|
||||||
{
|
{
|
||||||
if (!files.Contains(file))
|
success = true;
|
||||||
|
foreach (string file in Files)
|
||||||
{
|
{
|
||||||
success = false;
|
if (!files.Contains(file))
|
||||||
|
{
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
attempts += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task DeleteFileAsync(string Folder, string File)
|
||||||
|
{
|
||||||
|
await http.DeleteAsync(apiurl + "?folder=" + Folder + "&file=" + File);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,5 +8,6 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
Task<List<string>> GetFilesAsync(string Folder);
|
Task<List<string>> GetFilesAsync(string Folder);
|
||||||
Task<bool> UploadFilesAsync(string Folder, string[] Files, string FileUploadName);
|
Task<bool> UploadFilesAsync(string Folder, string[] Files, string FileUploadName);
|
||||||
|
Task DeleteFileAsync(string Folder, string File);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,11 @@
|
||||||
@code {
|
@code {
|
||||||
string logo = "";
|
string logo = "";
|
||||||
|
|
||||||
protected override Task OnParametersSetAsync()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
if (PageState.Site.Logo != "")
|
if (PageState.Site.Logo != "")
|
||||||
{
|
{
|
||||||
logo = "<a href=\"" + PageState.Alias.Url + "\"><img src=\"" + PageState.Alias.SiteRootUrl + PageState.Site.Logo + "\" alt=\"" + PageState.Site.Name + "\"/></a>";
|
logo = "<a href=\"" + PageState.Alias.Url + "\"><img src=\"" + PageState.Alias.BaseUrl + "/" + PageState.Site.SiteRootPath + PageState.Site.Logo + "\" alt=\"" + PageState.Site.Name + "\"/></a>";
|
||||||
}
|
}
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Oqtane.Shared;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -12,7 +14,8 @@ namespace Oqtane.Controllers
|
||||||
public class FileController : Controller
|
public class FileController : Controller
|
||||||
{
|
{
|
||||||
private readonly IWebHostEnvironment environment;
|
private readonly IWebHostEnvironment environment;
|
||||||
|
private readonly string WhiteList = "jpg,jpeg,jpe,gif,bmp,png,mov,wmv,avi,mp4,mp3,doc,docx,xls,xlsx,ppt,pptx,pdf,txt,zip,nupkg";
|
||||||
|
|
||||||
public FileController(IWebHostEnvironment environment)
|
public FileController(IWebHostEnvironment environment)
|
||||||
{
|
{
|
||||||
this.environment = environment;
|
this.environment = environment;
|
||||||
|
@ -23,14 +26,12 @@ namespace Oqtane.Controllers
|
||||||
public IEnumerable<string> Get(string folder)
|
public IEnumerable<string> Get(string folder)
|
||||||
{
|
{
|
||||||
List<string> files = new List<string>();
|
List<string> files = new List<string>();
|
||||||
folder = folder.Replace("/", "\\");
|
folder = GetFolder(folder);
|
||||||
if (folder.StartsWith("\\")) folder = folder.Substring(1);
|
|
||||||
folder = Path.Combine(environment.WebRootPath, folder);
|
|
||||||
if (Directory.Exists(folder))
|
if (Directory.Exists(folder))
|
||||||
{
|
{
|
||||||
foreach(string file in Directory.GetFiles(folder))
|
foreach (string file in Directory.GetFiles(folder))
|
||||||
{
|
{
|
||||||
files.Add(file);
|
files.Add(Path.GetFileName(file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return files;
|
return files;
|
||||||
|
@ -38,16 +39,12 @@ namespace Oqtane.Controllers
|
||||||
|
|
||||||
// POST api/<controller>/upload
|
// POST api/<controller>/upload
|
||||||
[HttpPost("upload")]
|
[HttpPost("upload")]
|
||||||
|
[Authorize(Roles = Constants.AdminRole)]
|
||||||
public async Task UploadFile(string folder, IFormFile file)
|
public async Task UploadFile(string folder, IFormFile file)
|
||||||
{
|
{
|
||||||
if (file.Length > 0)
|
if (file.Length > 0)
|
||||||
{
|
{
|
||||||
if (!folder.Contains(":\\"))
|
folder = GetFolder(folder);
|
||||||
{
|
|
||||||
folder = folder.Replace("/", "\\");
|
|
||||||
if (folder.StartsWith("\\")) folder = folder.Substring(1);
|
|
||||||
folder = Path.Combine(environment.WebRootPath, folder);
|
|
||||||
}
|
|
||||||
if (!Directory.Exists(folder))
|
if (!Directory.Exists(folder))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(folder);
|
Directory.CreateDirectory(folder);
|
||||||
|
@ -85,7 +82,7 @@ namespace Oqtane.Controllers
|
||||||
await chunk.CopyToAsync(stream);
|
await chunk.CopyToAsync(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
@ -99,6 +96,13 @@ namespace Oqtane.Controllers
|
||||||
{
|
{
|
||||||
System.IO.File.Delete(filepart);
|
System.IO.File.Delete(filepart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for allowable file extensions
|
||||||
|
if (!WhiteList.Contains(Path.GetExtension(filename).Replace(".", "")))
|
||||||
|
{
|
||||||
|
System.IO.File.Delete(Path.Combine(folder, filename));
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,5 +117,24 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DELETE api/<controller>/?folder=x&file=y
|
||||||
|
[HttpDelete]
|
||||||
|
[Authorize(Roles = Constants.AdminRole)]
|
||||||
|
public void Delete(string folder, string file)
|
||||||
|
{
|
||||||
|
file = Path.Combine(GetFolder(folder) + file);
|
||||||
|
if (System.IO.File.Exists(file))
|
||||||
|
{
|
||||||
|
System.IO.File.Delete(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetFolder(string folder)
|
||||||
|
{
|
||||||
|
folder = folder.Replace("/", "\\");
|
||||||
|
if (folder.StartsWith("\\")) folder = folder.Substring(1);
|
||||||
|
return Path.Combine(environment.WebRootPath, folder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -59,11 +59,8 @@ namespace Oqtane.Repository
|
||||||
SiteTemplate.Add(new PageTemplate { Name = "Page Management", Parent = "Admin", Path = "admin/pages", Order = 1, Icon = "layers", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
SiteTemplate.Add(new PageTemplate { Name = "Page Management", Parent = "Admin", Path = "admin/pages", Order = 1, Icon = "layers", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
||||||
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Pages, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Page Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Pages, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Page Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
||||||
}});
|
}});
|
||||||
SiteTemplate.Add(new PageTemplate { Name = "Module Management", Parent = "Admin", Path = "admin/modules", Order = 1, Icon = "browser", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
SiteTemplate.Add(new PageTemplate { Name = "File Management", Parent = "Admin", Path = "admin/files", Order = 1, Icon = "file", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
||||||
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.ModuleDefinitions, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Module Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Files, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "File Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
||||||
}});
|
|
||||||
SiteTemplate.Add(new PageTemplate { Name = "Theme Management", Parent = "Admin", Path = "admin/themes", Order = 1, Icon = "brush", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
|
||||||
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Themes, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Theme Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
|
||||||
}});
|
}});
|
||||||
SiteTemplate.Add(new PageTemplate { Name = "User Management", Parent = "Admin", Path = "admin/users", Order = 1, Icon = "person", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
SiteTemplate.Add(new PageTemplate { Name = "User Management", Parent = "Admin", Path = "admin/users", Order = 1, Icon = "person", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
||||||
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Users, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "User Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Users, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "User Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
||||||
|
@ -74,6 +71,12 @@ namespace Oqtane.Repository
|
||||||
SiteTemplate.Add(new PageTemplate { Name = "Tenant Management", Parent = "Admin", Path = "admin/tenants", Order = 1, Icon = "list", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
SiteTemplate.Add(new PageTemplate { Name = "Tenant Management", Parent = "Admin", Path = "admin/tenants", Order = 1, Icon = "list", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
||||||
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Tenants, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Tenant Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Tenants, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Tenant Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
||||||
}});
|
}});
|
||||||
|
SiteTemplate.Add(new PageTemplate { Name = "Module Management", Parent = "Admin", Path = "admin/modules", Order = 1, Icon = "browser", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
||||||
|
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.ModuleDefinitions, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Module Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
||||||
|
}});
|
||||||
|
SiteTemplate.Add(new PageTemplate { Name = "Theme Management", Parent = "Admin", Path = "admin/themes", Order = 1, Icon = "brush", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
||||||
|
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Themes, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Theme Management", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
||||||
|
}});
|
||||||
SiteTemplate.Add(new PageTemplate { Name = "Upgrade Service", Parent = "Admin", Path = "admin/upgrade", Order = 1, Icon = "aperture", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
SiteTemplate.Add(new PageTemplate { Name = "Upgrade Service", Parent = "Admin", Path = "admin/upgrade", Order = 1, Icon = "aperture", IsNavigation = false, EditMode = true, PagePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", PageTemplateModules = new List<PageTemplateModule> {
|
||||||
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Upgrade, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Upgrade Service", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.Admin.Upgrade, Oqtane.Client", ModulePermissions = "[{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]", Title = "Upgrade Service", Pane = "Top", ContainerType = "Oqtane.Themes.Theme2.Container2, Oqtane.Client", Content = "" }
|
||||||
}});
|
}});
|
||||||
|
|
|
@ -57,41 +57,5 @@ namespace Oqtane.Models
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public string TenantRootPath
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Tenants/" + TenantId.ToString() + "/";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public string TenantRootUrl
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return BaseUrl + "/Tenants/" + TenantId.ToString() + "/";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public string SiteRootPath
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Tenants/" + TenantId.ToString() + "/Sites/" + SiteId.ToString() + "/";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public string SiteRootUrl
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return BaseUrl + "/Tenants/" + TenantId.ToString() + "/Sites/" + SiteId.ToString() + "/";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Oqtane.Models
|
namespace Oqtane.Models
|
||||||
{
|
{
|
||||||
|
@ -19,5 +20,23 @@ namespace Oqtane.Models
|
||||||
public string DeletedBy { get; set; }
|
public string DeletedBy { get; set; }
|
||||||
public DateTime? DeletedOn { get; set; }
|
public DateTime? DeletedOn { get; set; }
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public string TenantRootPath
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return "Tenants/" + TenantId.ToString() + "/";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public string SiteRootPath
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return "Tenants/" + TenantId.ToString() + "/Sites/" + SiteId.ToString() + "/";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user