Compare commits
147 Commits
Author | SHA1 | Date | |
---|---|---|---|
38f2fa5733 | |||
7f15a5f464 | |||
0c5d992d18 | |||
57dd983c1f | |||
d89927ca96 | |||
63744d9ec2 | |||
c67526b5b0 | |||
1cb6bf2a6b | |||
ac9969c1b6 | |||
510cd23d5e | |||
c94ccbff69 | |||
93d0cc5e1a | |||
075ea0aafd | |||
e75fe19103 | |||
e76f1b9663 | |||
cb1c725ec1 | |||
98cd361fc0 | |||
d0c8399dd9 | |||
4effa8ec66 | |||
4065d87a74 | |||
eb9acc770c | |||
a8cd84e798 | |||
74e5b83026 | |||
4aa0b83807 | |||
fd592e8d9f | |||
bb21eba39f | |||
b09cb9d655 | |||
bbbe48b976 | |||
a036ee19a4 | |||
5b45c79357 | |||
760fc3b8d4 | |||
fc50a45ecd | |||
e3fe8c5914 | |||
2624b9c105 | |||
2f9f823330 | |||
6cc144d733 | |||
df404c12a4 | |||
faec53b3c5 | |||
e1ec58b297 | |||
38738e0844 | |||
abe0a1a806 | |||
809946685a | |||
20c8f1528d | |||
282579fcf2 | |||
c8e3fa88e7 | |||
aec5882de1 | |||
bc231b18cf | |||
6bcb769fe5 | |||
90110a653c | |||
3c561cc413 | |||
73f9622ba2 | |||
cf198ff781 | |||
648fc56495 | |||
ea6dc6b983 | |||
c0e8d09ce1 | |||
a471784cf3 | |||
1d2a4bf484 | |||
3fa620f3bc | |||
35f186b532 | |||
5cf35fd70a | |||
1eef08eaeb | |||
1750f28a9f | |||
41edbc5e22 | |||
04257f75e7 | |||
5fb602f733 | |||
94f0bdcce9 | |||
0ba24f9a3a | |||
aac7d6b97a | |||
bcc33af52b | |||
24fd42636a | |||
8d539d058c | |||
abda377f6f | |||
51bf822392 | |||
d3f135a9c7 | |||
07ba99cc41 | |||
336550c571 | |||
679cc04178 | |||
75fe4e7c89 | |||
410f8c74e5 | |||
05f67d6a2a | |||
3a6cde0e24 | |||
fe1de2b243 | |||
62a6b5f28a | |||
d648fa0f02 | |||
e706e8cf1f | |||
9eb8a7e65c | |||
11c610edf0 | |||
a65cdbd7ad | |||
97c56ba142 | |||
9fe72a1c98 | |||
7b40725534 | |||
5e1671afe3 | |||
50d74cbcee | |||
bc73e5e3d0 | |||
b02bdee8cb | |||
9db4985b14 | |||
6f281c256b | |||
807252c9e5 | |||
23e7f66188 | |||
57c500f4bc | |||
fe302aa9e4 | |||
f14f927df7 | |||
c3f74a5217 | |||
457d1bb563 | |||
25918056cb | |||
86517dd793 | |||
00ce083a2c | |||
bce262cd8e | |||
b5db62ef6a | |||
3703d87d50 | |||
f515def414 | |||
4bdf20822f | |||
49f4e64cb4 | |||
e615263706 | |||
2a7e256116 | |||
a083405b48 | |||
3ea280c82a | |||
192433f02d | |||
56a2e9dcea | |||
921cced1c8 | |||
b17f679f38 | |||
8e43fcab21 | |||
73c5092e46 | |||
56537e4785 | |||
3bd7d7196d | |||
7b5a192b82 | |||
d4be058d07 | |||
6c20fea46a | |||
2e7cfefb2e | |||
038894cf64 | |||
954e30d89f | |||
93d9c4534d | |||
468ca8c6a9 | |||
e7a4c08dea | |||
69d639ee42 | |||
a780569a6f | |||
568c283efd | |||
fccdd07a08 | |||
5e816ea912 | |||
cb2d529689 | |||
c5037e7084 | |||
fdc39d57fb | |||
4960e2c668 | |||
66cc3a1392 | |||
6e7c8e7b05 | |||
727b943fa3 | |||
a4a0334ec0 |
2
.deployment
Normal file
2
.deployment
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[config]
|
||||||
|
project = Oqtane.Server/Oqtane.Server.csproj
|
111
Oqtane.Client/Modules/Admin/Files/Details.razor
Normal file
111
Oqtane.Client/Modules/Admin/Files/Details.razor
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
@namespace Oqtane.Modules.Admin.Files
|
||||||
|
@inherits ModuleBase
|
||||||
|
@inject IFileService FileService
|
||||||
|
@inject IFolderService FolderService
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
|
@if (_folders != null)
|
||||||
|
{
|
||||||
|
<table class="table table-borderless">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label for="name" HelpText="The name of the file">Name: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input id="name" class="form-control" @bind="@_name" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label For="parent" HelpText="The folder where the file is located">Folder: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="parent" class="form-control" @bind="@_folderId">
|
||||||
|
@foreach (Folder folder in _folders)
|
||||||
|
{
|
||||||
|
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label for="size" HelpText="The size of the file (in bytes)">Size: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input id="size" class="form-control" @bind="@_size" readonly />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<button type="button" class="btn btn-success" @onclick="SaveFile">Save</button>
|
||||||
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<AuditInfo CreatedBy="@_createdBy" CreatedOn="@_createdOn" ModifiedBy="@_modifiedBy" ModifiedOn="@_modifiedOn"></AuditInfo>
|
||||||
|
}
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private int _fileId = -1;
|
||||||
|
private string _name;
|
||||||
|
private List<Folder> _folders;
|
||||||
|
private int _folderId = -1;
|
||||||
|
private int _size;
|
||||||
|
private string _createdBy;
|
||||||
|
private DateTime _createdOn;
|
||||||
|
private string _modifiedBy;
|
||||||
|
private DateTime _modifiedOn;
|
||||||
|
|
||||||
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
||||||
|
|
||||||
|
public override string Title => "File Management";
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_folders = await FolderService.GetFoldersAsync(PageState.Site.SiteId);
|
||||||
|
_fileId = Int32.Parse(PageState.QueryString["id"]);
|
||||||
|
File file = await FileService.GetFileAsync(_fileId);
|
||||||
|
if (file != null)
|
||||||
|
{
|
||||||
|
_name = file.Name;
|
||||||
|
_folderId = file.FolderId;
|
||||||
|
_size = file.Size;
|
||||||
|
_createdBy = file.CreatedBy;
|
||||||
|
_createdOn = file.CreatedOn;
|
||||||
|
_modifiedBy = file.ModifiedBy;
|
||||||
|
_modifiedOn = file.ModifiedOn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
await logger.LogError(ex, "Error Loading File {FileId} {Error}", _fileId, ex.Message);
|
||||||
|
AddModuleMessage("Error Loading File", MessageType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SaveFile()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_name.IsPathOrFileValid())
|
||||||
|
{
|
||||||
|
File file = await FileService.GetFileAsync(_fileId);
|
||||||
|
file.Name = _name;
|
||||||
|
file.FolderId = _folderId;
|
||||||
|
file = await FileService.UpdateFileAsync(file);
|
||||||
|
await logger.LogInformation("File Saved {File}", file);
|
||||||
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddModuleMessage("File Name Not Valid", MessageType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
await logger.LogError(ex, "Error Saving File {FileId} {Error}", _fileId, ex.Message);
|
||||||
|
AddModuleMessage("Error Saving File", MessageType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
@namespace Oqtane.Modules.Admin.Files
|
@namespace Oqtane.Modules.Admin.Files
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject IFolderService FolderService
|
@inject IFolderService FolderService
|
||||||
|
@inject IFileService FileService
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
@if (_folders != null)
|
@if (_folders != null)
|
||||||
@ -45,7 +46,7 @@
|
|||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||||
@if (!_isSystem && PageState.QueryString.ContainsKey("id"))
|
@if (!_isSystem && PageState.QueryString.ContainsKey("id"))
|
||||||
{
|
{
|
||||||
<button type="button" class="btn btn-danger" @onclick="DeleteFolder">Delete</button>
|
<ActionDialog Header="Delete Folder" Message="@("Are You Sure You Wish To Delete This Folder?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFolder())" />
|
||||||
}
|
}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
@ -174,7 +175,7 @@
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await logger.LogError(ex, "Error Saving Folder {FolderId} {Error}", _folderId, ex.Message);
|
await logger.LogError(ex, "Error Saving Folder {FolderId} {Error}", _folderId, ex.Message);
|
||||||
AddModuleMessage("Error Saving Module", MessageType.Error);
|
AddModuleMessage("Error Saving Folder", MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,9 +183,33 @@
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await FolderService.DeleteFolderAsync(_folderId);
|
bool isparent = false;
|
||||||
await logger.LogInformation("Folder Deleted {Folder}", _folderId);
|
foreach (Folder folder in _folders)
|
||||||
AddModuleMessage("Folder Deleted", MessageType.Success);
|
{
|
||||||
|
if (folder.ParentId == _folderId)
|
||||||
|
{
|
||||||
|
isparent = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isparent)
|
||||||
|
{
|
||||||
|
var files = await FileService.GetFilesAsync(_folderId);
|
||||||
|
if (files.Count == 0)
|
||||||
|
{
|
||||||
|
await FolderService.DeleteFolderAsync(_folderId);
|
||||||
|
await logger.LogInformation("Folder Deleted {Folder}", _folderId);
|
||||||
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddModuleMessage("Folder Has Files And Cannot Be Deleted", MessageType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddModuleMessage("Folder Has Subfolders And Cannot Be Deleted", MessageType.Warning);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
</table>
|
</table>
|
||||||
<Pager Items="@_files">
|
<Pager Items="@_files">
|
||||||
<Header>
|
<Header>
|
||||||
|
<th style="width: 1px;"> </th>
|
||||||
<th style="width: 1px;"> </th>
|
<th style="width: 1px;"> </th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Modified</th>
|
<th>Modified</th>
|
||||||
@ -35,6 +36,7 @@
|
|||||||
<th>Size</th>
|
<th>Size</th>
|
||||||
</Header>
|
</Header>
|
||||||
<Row>
|
<Row>
|
||||||
|
<td><ActionLink Action="Details" Text="Edit" Parameters="@($"id=" + context.FileId.ToString())" /></td>
|
||||||
<td><ActionDialog Header="Delete File" Message="@("Are You Sure You Wish To Delete " + context.Name + "?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFile(context))" /></td>
|
<td><ActionDialog Header="Delete File" Message="@("Are You Sure You Wish To Delete " + context.Name + "?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFile(context))" /></td>
|
||||||
<td><a href="@(ContentUrl(context.FileId))" target="_new">@context.Name</a></td>
|
<td><a href="@(ContentUrl(context.FileId))" target="_new">@context.Name</a></td>
|
||||||
<td>@context.ModifiedOn</td>
|
<td>@context.ModifiedOn</td>
|
||||||
|
@ -63,10 +63,18 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Label For="retention-log" HelpText="What items do you want in the retention log">Retention Log (Items): </Label>
|
<Label For="retention" HelpText="Number of log entries to retain for this job">Retention Log (Items): </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="retention-log" class="form-control" @bind="@_retentionHistory" />
|
<input id="retention" class="form-control" @bind="@_retentionHistory" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label For="next" HelpText="Next execution for this job.">Next Execution: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input id="next" class="form-control" @bind="@_nextExecution" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -83,6 +91,7 @@
|
|||||||
private string _startDate = string.Empty;
|
private string _startDate = string.Empty;
|
||||||
private string _endDate = string.Empty;
|
private string _endDate = string.Empty;
|
||||||
private string _retentionHistory = string.Empty;
|
private string _retentionHistory = string.Empty;
|
||||||
|
private string _nextExecution = string.Empty;
|
||||||
|
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
||||||
|
|
||||||
@ -102,6 +111,7 @@
|
|||||||
_startDate = (job.StartDate != null) ? job.StartDate.ToString() : string.Empty;
|
_startDate = (job.StartDate != null) ? job.StartDate.ToString() : string.Empty;
|
||||||
_endDate = (job.EndDate != null) ? job.EndDate.ToString() : string.Empty;
|
_endDate = (job.EndDate != null) ? job.EndDate.ToString() : string.Empty;
|
||||||
_retentionHistory = job.RetentionHistory.ToString();
|
_retentionHistory = job.RetentionHistory.ToString();
|
||||||
|
_nextExecution = job.NextExecution.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -140,6 +150,15 @@
|
|||||||
job.EndDate = DateTime.Parse(_endDate);
|
job.EndDate = DateTime.Parse(_endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_nextExecution == string.Empty)
|
||||||
|
{
|
||||||
|
job.NextExecution = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
job.NextExecution = DateTime.Parse(_nextExecution);
|
||||||
|
}
|
||||||
|
|
||||||
job.RetentionHistory = int.Parse(_retentionHistory);
|
job.RetentionHistory = int.Parse(_retentionHistory);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -22,7 +22,7 @@ else
|
|||||||
<td>@context.FinishDate</td>
|
<td>@context.FinishDate</td>
|
||||||
</Row>
|
</Row>
|
||||||
<Detail>
|
<Detail>
|
||||||
<td colspan="4">@context.Notes</td>
|
<td colspan="4">@((MarkupString)context.Notes)</td>
|
||||||
</Detail>
|
</Detail>
|
||||||
</Pager>
|
</Pager>
|
||||||
}
|
}
|
||||||
|
@ -5,55 +5,69 @@
|
|||||||
@inject IModuleService ModuleService
|
@inject IModuleService ModuleService
|
||||||
@inject ISystemService SystemService
|
@inject ISystemService SystemService
|
||||||
|
|
||||||
<table class="table table-borderless">
|
<table class="table table-borderless">
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Label For="owner" HelpText="Enter the name of the organization who is developing this module. It should not contain spaces or punctuation.">Owner Name: </Label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input id="owner" class="form-control" @bind="@_owner" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Label For="module" HelpText="Enter a name for this module. It should be in singular form (ie. Car) and not contain spaces or punctuation.">Module Name: </Label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input id="module" class="form-control" @bind="@_module" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Label For="description" HelpText="Enter s short description for the module">Description: </Label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<textarea id="description" class="form-control" @bind="@_description" rows="3"></textarea>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Label For="template" HelpText="Select a module template. Internal modules are created inside of the Oqtane solution. External modules are created outside of the Oqtane solution.">Template: </Label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="template" class="form-control" @onchange="(e => TemplateChanged(e))">
|
|
||||||
<option value="-"><Select Template></option>
|
|
||||||
<option value="internal">Internal</option>
|
|
||||||
<option value="external">External</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@if (!string.IsNullOrEmpty(_location))
|
|
||||||
{
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Label For="location" HelpText="Location where the module will be created">Location: </Label>
|
<Label For="owner" HelpText="Enter the name of the organization who is developing this module. It should not contain spaces or punctuation.">Owner Name: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="module" class="form-control" @bind="@_location" readonly />
|
<input id="owner" class="form-control" @bind="@_owner" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
<tr>
|
||||||
</table>
|
<td>
|
||||||
|
<Label For="module" HelpText="Enter a name for this module. It should not contain spaces or punctuation.">Module Name: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input id="module" class="form-control" @bind="@_module" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label For="description" HelpText="Enter s short description for the module">Description: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<textarea id="description" class="form-control" @bind="@_description" rows="3"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label For="template" HelpText="Select a module template. Internal modules are created inside of the Oqtane solution. External modules are created outside of the Oqtane solution.">Template: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="template" class="form-control" @onchange="(e => TemplateChanged(e))">
|
||||||
|
<option value="-"><Select Template></option>
|
||||||
|
<option value="internal">Internal</option>
|
||||||
|
<option value="external">External</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label For="reference" HelpText="Select a framework reference version">Framework Reference: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="reference" class="form-control" @bind="@_reference">
|
||||||
|
@foreach (string version in Constants.ReleaseVersions.Split(','))
|
||||||
|
{
|
||||||
|
<option value="@(version)">@(version)</option>
|
||||||
|
}
|
||||||
|
<option value="local">Local</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@if (!string.IsNullOrEmpty(_location))
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label For="location" HelpText="Location where the module will be created">Location: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input id="module" class="form-control" @bind="@_location" readonly />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</table>
|
||||||
|
|
||||||
<button type="button" class="btn btn-success" @onclick="CreateModule">Create Module</button>
|
<button type="button" class="btn btn-success" @onclick="CreateModule">Create Module</button>
|
||||||
|
|
||||||
@ -62,6 +76,7 @@
|
|||||||
private string _module = string.Empty;
|
private string _module = string.Empty;
|
||||||
private string _description = string.Empty;
|
private string _description = string.Empty;
|
||||||
private string _template = "-";
|
private string _template = "-";
|
||||||
|
public string _reference = Constants.Version;
|
||||||
private string _location = string.Empty;
|
private string _location = string.Empty;
|
||||||
|
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
||||||
@ -77,7 +92,7 @@
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(_owner) && !string.IsNullOrEmpty(_module) && _template != "-")
|
if (!string.IsNullOrEmpty(_owner) && !string.IsNullOrEmpty(_module) && _template != "-")
|
||||||
{
|
{
|
||||||
var moduleDefinition = new ModuleDefinition { Owner = _owner.Replace(" ", ""), Name = _module.Replace(" ", ""), Description = _description, Template = _template };
|
var moduleDefinition = new ModuleDefinition { Owner = _owner.Replace(" ", ""), Name = _module.Replace(" ", ""), Description = _description, Template = _template, Version = _reference };
|
||||||
await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition, ModuleState.ModuleId);
|
await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition, ModuleState.ModuleId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -105,11 +120,11 @@
|
|||||||
string[] path = systeminfo["serverpath"].Split('\\');
|
string[] path = systeminfo["serverpath"].Split('\\');
|
||||||
if (_template == "internal")
|
if (_template == "internal")
|
||||||
{
|
{
|
||||||
_location = string.Join("\\", path, 0, path.Length - 1) + "\\Oqtane.Client\\Modules\\" + _owner + "." + _module + "s";
|
_location = string.Join("\\", path, 0, path.Length - 1) + "\\Oqtane.Client\\Modules\\" + _owner + "." + _module;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_location = string.Join("\\", path, 0, path.Length - 2) + "\\" + _owner + "." + _module + "s";
|
_location = string.Join("\\", path, 0, path.Length - 2) + "\\" + _owner + "." + _module;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
{
|
{
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -75,12 +75,20 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Label For="license" HelpText="The license of the module">License: </Label>
|
<Label For="license" HelpText="The module license terms">License: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<textarea id="license" class="form-control" @bind="@_license" rows="5" disabled></textarea>
|
<textarea id="license" class="form-control" @bind="@_license" rows="5" disabled></textarea>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Label For="runtimes" HelpText="The Blazor runtimes which this module supports">Runtimes: </Label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input id="runtimes" class="form-control" @bind="@_runtimes" disabled />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</Section>
|
</Section>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
@ -110,6 +118,7 @@
|
|||||||
private string _url = "";
|
private string _url = "";
|
||||||
private string _contact = "";
|
private string _contact = "";
|
||||||
private string _license = "";
|
private string _license = "";
|
||||||
|
private string _runtimes = "";
|
||||||
private string _permissions;
|
private string _permissions;
|
||||||
private string _createdby;
|
private string _createdby;
|
||||||
private DateTime _createdon;
|
private DateTime _createdon;
|
||||||
@ -139,6 +148,7 @@
|
|||||||
_url = moduleDefinition.Url;
|
_url = moduleDefinition.Url;
|
||||||
_contact = moduleDefinition.Contact;
|
_contact = moduleDefinition.Contact;
|
||||||
_license = moduleDefinition.License;
|
_license = moduleDefinition.License;
|
||||||
|
_runtimes = moduleDefinition.Runtimes;
|
||||||
_permissions = moduleDefinition.Permissions;
|
_permissions = moduleDefinition.Permissions;
|
||||||
_createdby = moduleDefinition.CreatedBy;
|
_createdby = moduleDefinition.CreatedBy;
|
||||||
_createdon = moduleDefinition.CreatedOn;
|
_createdon = moduleDefinition.CreatedOn;
|
||||||
|
@ -86,7 +86,7 @@ else
|
|||||||
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", moduledefinitionname, version);
|
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", moduledefinitionname, version);
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -102,7 +102,7 @@ else
|
|||||||
{
|
{
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await ModuleDefinitionService.DeleteModuleDefinitionAsync(moduleDefinition.ModuleDefinitionId, moduleDefinition.SiteId);
|
await ModuleDefinitionService.DeleteModuleDefinitionAsync(moduleDefinition.ModuleDefinitionId, moduleDefinition.SiteId);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -31,9 +31,15 @@
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ModuleService.ImportModuleAsync(ModuleState.ModuleId, _content);
|
bool success = await ModuleService.ImportModuleAsync(ModuleState.ModuleId, _content);
|
||||||
StateHasChanged();
|
if (success)
|
||||||
NavigationManager.NavigateTo(NavigateUrl());
|
{
|
||||||
|
AddModuleMessage("Content Imported Successfully", MessageType.Success);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddModuleMessage("A Problem Was Encountered Importing Content. Please Ensure The Content Is Formatted Correctly For The Module.", MessageType.Warning);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -162,17 +162,6 @@
|
|||||||
<input id="Icon" class="form-control" @bind="@_icon" />
|
<input id="Icon" class="form-control" @bind="@_icon" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Label For="Default-Mode" HelpText="Select the default administration mode you want for this page">Default Mode? </Label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="Default-Mode" class="form-control" @bind="@_mode">
|
|
||||||
<option value="view">View Mode</option>
|
|
||||||
<option value="edit">Edit Mode</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Label For="Personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content">Personalizable? </Label>
|
<Label For="Personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content">Personalizable? </Label>
|
||||||
@ -217,7 +206,6 @@
|
|||||||
private string _isnavigation = "True";
|
private string _isnavigation = "True";
|
||||||
private string _url;
|
private string _url;
|
||||||
private string _ispersonalizable = "False";
|
private string _ispersonalizable = "False";
|
||||||
private string _mode = "view";
|
|
||||||
private string _themetype = "-";
|
private string _themetype = "-";
|
||||||
private string _layouttype = "-";
|
private string _layouttype = "-";
|
||||||
private string _containertype = "-";
|
private string _containertype = "-";
|
||||||
@ -311,7 +299,7 @@
|
|||||||
Page page = null;
|
Page page = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_name != string.Empty && !string.IsNullOrEmpty(_themetype) && (_layouts.Count == 0 || !string.IsNullOrEmpty(_layouttype)))
|
if (_name != string.Empty && !string.IsNullOrEmpty(_themetype) && (_layouts.Count == 0 || _layouttype != "-"))
|
||||||
{
|
{
|
||||||
page = new Page();
|
page = new Page();
|
||||||
page.SiteId = PageState.Page.SiteId;
|
page.SiteId = PageState.Page.SiteId;
|
||||||
@ -346,6 +334,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PagePathIsUnique(page.Path, page.SiteId, _pageList))
|
||||||
|
{
|
||||||
|
AddModuleMessage($"A page with path {_path} already exists for the selected parent page. The page path needs to be unique for the selected parent.", MessageType.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Page child;
|
Page child;
|
||||||
switch (_insert)
|
switch (_insert)
|
||||||
{
|
{
|
||||||
@ -367,7 +361,6 @@
|
|||||||
|
|
||||||
page.IsNavigation = (_isnavigation == null ? true : Boolean.Parse(_isnavigation));
|
page.IsNavigation = (_isnavigation == null ? true : Boolean.Parse(_isnavigation));
|
||||||
page.Url = _url;
|
page.Url = _url;
|
||||||
page.EditMode = (_mode == "edit" ? true : false);
|
|
||||||
page.ThemeType = (_themetype != "-") ? _themetype : string.Empty;
|
page.ThemeType = (_themetype != "-") ? _themetype : string.Empty;
|
||||||
if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType)
|
if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType)
|
||||||
{
|
{
|
||||||
@ -396,7 +389,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddModuleMessage("You Must Provide Page Name And Theme", MessageType.Warning);
|
AddModuleMessage("You Must Provide Page Name And Theme/Layout", MessageType.Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -407,4 +400,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool PagePathIsUnique(string pagePath, int siteId, List<Page> existingPages)
|
||||||
|
{
|
||||||
|
return !existingPages.Any(page => page.SiteId == siteId && page.Path == pagePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,17 +173,6 @@
|
|||||||
<input id="Icon" class="form-control" @bind="@_icon" />
|
<input id="Icon" class="form-control" @bind="@_icon" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Label For="Default-Mode" HelpText="Select the default administration mode you want for this page">Default Mode? </Label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="Default-Mode" class="form-control" @bind="@_mode">
|
|
||||||
<option value="view">View Mode</option>
|
|
||||||
<option value="edit">Edit Mode</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Label For="Personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content">Personalizable? </Label>
|
<Label For="Personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content">Personalizable? </Label>
|
||||||
@ -235,7 +224,6 @@
|
|||||||
private string _isnavigation;
|
private string _isnavigation;
|
||||||
private string _url;
|
private string _url;
|
||||||
private string _ispersonalizable;
|
private string _ispersonalizable;
|
||||||
private string _mode;
|
|
||||||
private string _themetype = "-";
|
private string _themetype = "-";
|
||||||
private string _layouttype = "-";
|
private string _layouttype = "-";
|
||||||
private string _containertype = "-";
|
private string _containertype = "-";
|
||||||
@ -290,7 +278,6 @@
|
|||||||
_isnavigation = page.IsNavigation.ToString();
|
_isnavigation = page.IsNavigation.ToString();
|
||||||
_url = page.Url;
|
_url = page.Url;
|
||||||
_ispersonalizable = page.IsPersonalizable.ToString();
|
_ispersonalizable = page.IsPersonalizable.ToString();
|
||||||
_mode = (page.EditMode) ? "edit" : "view";
|
|
||||||
_themetype = page.ThemeType;
|
_themetype = page.ThemeType;
|
||||||
if (_themetype == PageState.Site.DefaultThemeType)
|
if (_themetype == PageState.Site.DefaultThemeType)
|
||||||
{
|
{
|
||||||
@ -333,7 +320,7 @@
|
|||||||
_children = new List<Page>();
|
_children = new List<Page>();
|
||||||
if (_parentid == "-1")
|
if (_parentid == "-1")
|
||||||
{
|
{
|
||||||
foreach(Page p in PageState.Pages.Where(item => item.ParentId == null))
|
foreach (Page p in PageState.Pages.Where(item => item.ParentId == null))
|
||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
||||||
{
|
{
|
||||||
@ -433,6 +420,13 @@
|
|||||||
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(_path);
|
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PagePathIsUnique(page.Path, page.SiteId, page.PageId, _pageList))
|
||||||
|
{
|
||||||
|
AddModuleMessage($"A page with path {_path} already exists for the selected parent page. The page path needs to be unique for the selected parent.", MessageType.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_insert != "=")
|
if (_insert != "=")
|
||||||
{
|
{
|
||||||
Page child;
|
Page child;
|
||||||
@ -456,7 +450,6 @@
|
|||||||
}
|
}
|
||||||
page.IsNavigation = (_isnavigation == null || Boolean.Parse(_isnavigation));
|
page.IsNavigation = (_isnavigation == null || Boolean.Parse(_isnavigation));
|
||||||
page.Url = _url;
|
page.Url = _url;
|
||||||
page.EditMode = (_mode == "edit");
|
|
||||||
page.ThemeType = (_themetype != "-") ? _themetype : string.Empty;
|
page.ThemeType = (_themetype != "-") ? _themetype : string.Empty;
|
||||||
if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType)
|
if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType)
|
||||||
{
|
{
|
||||||
@ -512,4 +505,9 @@
|
|||||||
AddModuleMessage("Error Saving Page", MessageType.Error);
|
AddModuleMessage("Error Saving Page", MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool PagePathIsUnique(string pagePath, int siteId, int pageId, List<Page> existingPages)
|
||||||
|
{
|
||||||
|
return !existingPages.Any(page => page.SiteId == siteId && page.Path == pagePath && page.PageId != pageId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,6 +145,7 @@
|
|||||||
profile = new Profile();
|
profile = new Profile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
profile.SiteId = PageState.Site.SiteId;
|
||||||
profile.Name = _name;
|
profile.Name = _name;
|
||||||
profile.Title = _title;
|
profile.Title = _title;
|
||||||
profile.Description = _description;
|
profile.Description = _description;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@inject IThemeService ThemeService
|
@inject IThemeService ThemeService
|
||||||
@inject ISettingService SettingService
|
@inject ISettingService SettingService
|
||||||
|
|
||||||
@if (_themes != null)
|
@if (_initialized)
|
||||||
{
|
{
|
||||||
<table class="table table-borderless">
|
<table class="table table-borderless">
|
||||||
<tr>
|
<tr>
|
||||||
@ -211,6 +211,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
private bool _initialized = 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> _layouts = new List<ThemeControl>();
|
private List<ThemeControl> _layouts = new List<ThemeControl>();
|
||||||
@ -318,6 +319,8 @@
|
|||||||
_deletedby = site.DeletedBy;
|
_deletedby = site.DeletedBy;
|
||||||
_deletedon = site.DeletedOn;
|
_deletedon = site.DeletedOn;
|
||||||
_isdeleted = site.IsDeleted.ToString();
|
_isdeleted = site.IsDeleted.ToString();
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -445,7 +448,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddModuleMessage("You Must Provide A Site Name, Alias, And Default Theme/Container", MessageType.Warning);
|
AddModuleMessage("You Must Provide A Site Name, Alias, And Default Theme/Layout/Container", MessageType.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -402,7 +402,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddModuleMessage("You Must Provide A Tenant, Site Name, Alias, Default Theme/Container, And Site Template", MessageType.Warning);
|
AddModuleMessage("You Must Provide A Tenant, Site Name, Alias, Default Theme/Layout/Container, And Site Template", MessageType.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
@inject IAliasService AliasService
|
@inject IAliasService AliasService
|
||||||
@inject IThemeService ThemeService
|
@inject IThemeService ThemeService
|
||||||
|
|
||||||
@if (_themes != null)
|
@if (_initialized)
|
||||||
{
|
{
|
||||||
<table class="table table-borderless">
|
<table class="table table-borderless">
|
||||||
<tr>
|
<tr>
|
||||||
@ -106,6 +106,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
private bool _initialized = 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> _layouts = new List<ThemeControl>();
|
private List<ThemeControl> _layouts = new List<ThemeControl>();
|
||||||
@ -163,6 +164,8 @@
|
|||||||
_deletedby = site.DeletedBy;
|
_deletedby = site.DeletedBy;
|
||||||
_deletedon = site.DeletedOn;
|
_deletedon = site.DeletedOn;
|
||||||
_isdeleted = site.IsDeleted.ToString();
|
_isdeleted = site.IsDeleted.ToString();
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
{
|
{
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await ThemeService.InstallThemesAsync();
|
await ThemeService.InstallThemesAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -87,7 +87,7 @@ else
|
|||||||
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", themename, version);
|
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", themename, version);
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await ThemeService.InstallThemesAsync();
|
await ThemeService.InstallThemesAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -103,7 +103,7 @@ else
|
|||||||
{
|
{
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
|
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
@if (_upgradeavailable)
|
@if (_upgradeavailable)
|
||||||
{
|
{
|
||||||
<ModuleMessage Type="MessageType.Info" Message="Select The Upgrade Button To Install a New Framework Version"></ModuleMessage>
|
<ModuleMessage Type="MessageType.Info" Message="Select The Upgrade Button To Install a New Framework Version"></ModuleMessage>
|
||||||
@("Framework") @_package.Version <button type="button" class="btn btn-success" @onclick=@(async () => await Download(Constants.PackageId, Constants.Version))>Upgrade</button>
|
<button type="button" class="btn btn-success" @onclick=@(async () => await Download(Constants.PackageId, @_package.Version))>Upgrade To @_package.Version</button>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<Label HelpText="Upload a framework package and select Install to complete the installation">Framework: </Label>
|
<Label HelpText="Upload a framework package and select Install to complete the installation">Framework: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<FileManager Filter="nupkg" Folder="Framework" />
|
<FileManager Filter="nupkg" ShowFiles="false" Folder="Framework" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
{
|
{
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await InstallationService.Upgrade();
|
await InstallationService.Upgrade();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -88,7 +88,7 @@
|
|||||||
await PackageService.DownloadPackageAsync(packageid, version, "Framework");
|
await PackageService.DownloadPackageAsync(packageid, version, "Framework");
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
await interop.RedirectBrowser(NavigateUrl(), 3);
|
await interop.RedirectBrowser(NavigateUrl(), 10);
|
||||||
await InstallationService.Upgrade();
|
await InstallationService.Upgrade();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -75,10 +75,12 @@ else
|
|||||||
<TabPanel Name="Profile">
|
<TabPanel Name="Profile">
|
||||||
@if (profiles != null && settings != null)
|
@if (profiles != null && settings != null)
|
||||||
{
|
{
|
||||||
<table class="table table-borderless">
|
<table class="table table-borderless">
|
||||||
@foreach (Profile profile in profiles)
|
@foreach (Profile profile in profiles)
|
||||||
|
{
|
||||||
|
var p = profile;
|
||||||
|
if (!p.IsPrivate || UserSecurity.IsAuthorized(PageState.User, Constants.AdminRole))
|
||||||
{
|
{
|
||||||
var p = profile;
|
|
||||||
if (p.Category != category)
|
if (p.Category != category)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
@ -90,14 +92,22 @@ else
|
|||||||
}
|
}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="@p.Name" class="control-label">@p.Title: </label>
|
<Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" placeholder="@p.Description" @onchange="@(e => ProfileChanged(e, p.Name))" />
|
@if (p.IsRequired)
|
||||||
|
{
|
||||||
|
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
}
|
||||||
|
</table>
|
||||||
<button type="button" class="btn btn-primary" @onclick="Save">Save</button>
|
<button type="button" class="btn btn-primary" @onclick="Save">Save</button>
|
||||||
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||||
}
|
}
|
||||||
@ -241,7 +251,7 @@ else
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (username != string.Empty && email != string.Empty)
|
if (username != string.Empty && email != string.Empty && ValidateProfiles())
|
||||||
{
|
{
|
||||||
if (password == confirm)
|
if (password == confirm)
|
||||||
{
|
{
|
||||||
@ -261,6 +271,7 @@ else
|
|||||||
await UserService.UpdateUserAsync(user);
|
await UserService.UpdateUserAsync(user);
|
||||||
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
|
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
|
||||||
await logger.LogInformation("User Profile Saved");
|
await logger.LogInformation("User Profile Saved");
|
||||||
|
AddModuleMessage("User Profile Updated Successfully", MessageType.Success);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -269,7 +280,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddModuleMessage("You Must Provide A Username and Email Address", MessageType.Warning);
|
AddModuleMessage("You Must Provide A Username and Email Address As Well As All Required Profile Information", MessageType.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -279,6 +290,26 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ValidateProfiles()
|
||||||
|
{
|
||||||
|
bool valid = true;
|
||||||
|
foreach (Profile profile in profiles)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)) && !string.IsNullOrEmpty(profile.DefaultValue))
|
||||||
|
{
|
||||||
|
settings = SettingService.SetSetting(settings, profile.Name, profile.DefaultValue);
|
||||||
|
}
|
||||||
|
if (!profile.IsPrivate || UserSecurity.IsAuthorized(PageState.User, Constants.AdminRole))
|
||||||
|
{
|
||||||
|
if (profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
|
||||||
|
{
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
|
|
||||||
private void Cancel()
|
private void Cancel()
|
||||||
{
|
{
|
||||||
NavigationManager.NavigateTo(NavigateUrl(string.Empty));
|
NavigationManager.NavigateTo(NavigateUrl(string.Empty));
|
||||||
|
@ -71,10 +71,17 @@
|
|||||||
}
|
}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="@p.Name" class="control-label">@p.Title: </label>
|
<Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input class="form-control" maxlength="@p.MaxLength" placeholder="@p.Description" @onchange="@(e => ProfileChanged(e, p.Name))" />
|
@if (p.IsRequired)
|
||||||
|
{
|
||||||
|
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
@ -112,11 +119,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetProfileValue(string SettingName, string DefaultValue)
|
||||||
|
=> SettingService.GetSetting(settings, SettingName, DefaultValue);
|
||||||
|
|
||||||
private async Task SaveUser()
|
private async Task SaveUser()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (username != string.Empty && password != string.Empty && confirm != string.Empty && email != string.Empty)
|
if (username != string.Empty && password != string.Empty && confirm != string.Empty && email != string.Empty && ValidateProfiles())
|
||||||
{
|
{
|
||||||
if (password == confirm)
|
if (password == confirm)
|
||||||
{
|
{
|
||||||
@ -149,7 +159,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddModuleMessage("You Must Provide A Username, Password, and Email Address", MessageType.Warning);
|
AddModuleMessage("You Must Provide A Username, Password, Email Address And All Required Profile Information", MessageType.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -159,6 +169,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ValidateProfiles()
|
||||||
|
{
|
||||||
|
bool valid = true;
|
||||||
|
foreach (Profile profile in profiles)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)) && !string.IsNullOrEmpty(profile.DefaultValue))
|
||||||
|
{
|
||||||
|
settings = SettingService.SetSetting(settings, profile.Name, profile.DefaultValue);
|
||||||
|
}
|
||||||
|
if (profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
|
||||||
|
{
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
|
|
||||||
private void ProfileChanged(ChangeEventArgs e, string SettingName)
|
private void ProfileChanged(ChangeEventArgs e, string SettingName)
|
||||||
{
|
{
|
||||||
var value = (string)e.Value;
|
var value = (string)e.Value;
|
||||||
|
@ -98,10 +98,17 @@ else
|
|||||||
}
|
}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="@p.Name" class="control-label">@p.Title: </label>
|
<Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" placeholder="@p.Description" @onchange="@(e => ProfileChanged(e, p.Name))" />
|
@if (p.IsRequired)
|
||||||
|
{
|
||||||
|
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
@ -180,7 +187,7 @@ else
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (username != string.Empty && email != string.Empty)
|
if (username != string.Empty && email != string.Empty && ValidateProfiles())
|
||||||
{
|
{
|
||||||
if (password == confirm)
|
if (password == confirm)
|
||||||
{
|
{
|
||||||
@ -213,7 +220,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddModuleMessage("You Must Provide A Username, Password, and Email Address", MessageType.Warning);
|
AddModuleMessage("You Must Provide A Username, Password, Email Address, And All Required Profile Information", MessageType.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -223,6 +230,23 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ValidateProfiles()
|
||||||
|
{
|
||||||
|
bool valid = true;
|
||||||
|
foreach (Profile profile in profiles)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)) && !string.IsNullOrEmpty(profile.DefaultValue))
|
||||||
|
{
|
||||||
|
settings = SettingService.SetSetting(settings, profile.Name, profile.DefaultValue);
|
||||||
|
}
|
||||||
|
if (profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
|
||||||
|
{
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
|
|
||||||
private void ProfileChanged(ChangeEventArgs e, string SettingName)
|
private void ProfileChanged(ChangeEventArgs e, string SettingName)
|
||||||
{
|
{
|
||||||
var value = (string)e.Value;
|
var value = (string)e.Value;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
@if (_visible)
|
@if (_visible)
|
||||||
{
|
{
|
||||||
<div class="app-admin-modal">
|
<div class="app-actiondialog">
|
||||||
<div class="modal" tabindex="-1" role="dialog">
|
<div class="modal" tabindex="-1" role="dialog">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
private bool _visible = false;
|
private bool _visible = false;
|
||||||
private bool _editmode = true;
|
private bool _editmode = false;
|
||||||
private bool _authorized = false;
|
private bool _authorized = false;
|
||||||
private string _iconSpan = string.Empty;
|
private string _iconSpan = string.Empty;
|
||||||
|
|
||||||
@ -66,7 +66,7 @@
|
|||||||
public bool Disabled { get; set; } // optional
|
public bool Disabled { get; set; } // optional
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string EditMode { get; set; } // optional - specifies if a user must be in edit mode to see the action - default is true
|
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 Action OnClick { get; set; } // required if an Action is specified - executes a method in the calling component
|
public Action OnClick { get; set; } // required if an Action is specified - executes a method in the calling component
|
||||||
@ -84,6 +84,7 @@
|
|||||||
{
|
{
|
||||||
Class = "btn btn-success";
|
Class = "btn btn-success";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(EditMode))
|
if (!string.IsNullOrEmpty(EditMode))
|
||||||
{
|
{
|
||||||
_editmode = bool.Parse(EditMode);
|
_editmode = bool.Parse(EditMode);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
|
|
||||||
@if (_authorized)
|
@if (_authorized)
|
||||||
@ -21,7 +20,7 @@
|
|||||||
private string _parameters = string.Empty;
|
private string _parameters = string.Empty;
|
||||||
private string _classname = "btn btn-primary";
|
private string _classname = "btn btn-primary";
|
||||||
private string _style = string.Empty;
|
private string _style = string.Empty;
|
||||||
private bool _editmode = true;
|
private bool _editmode = false;
|
||||||
private bool _authorized = false;
|
private bool _authorized = false;
|
||||||
private string _iconSpan = string.Empty;
|
private string _iconSpan = string.Empty;
|
||||||
|
|
||||||
@ -47,7 +46,7 @@
|
|||||||
public bool Disabled { get; set; } // optional
|
public bool Disabled { get; set; } // optional
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string EditMode { get; set; } // optional - specifies if a user must be in edit mode to see the action - default is true
|
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 string IconName { get; set; } // optional - specifies an icon for the link - default is no icon
|
public string IconName { get; set; } // optional - specifies an icon for the link - default is no icon
|
||||||
@ -90,7 +89,7 @@
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(IconName))
|
if (!string.IsNullOrEmpty(IconName))
|
||||||
{
|
{
|
||||||
_iconSpan = $"<span class=\"oi oi-{IconName}\"></span>{(IconOnly?"":" ")}";
|
_iconSpan = $"<span class=\"oi oi-{IconName}\"></span>{(IconOnly ? "" : " ")}";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
|
|
||||||
@if (_text != string.Empty)
|
@if (_text != string.Empty)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
|
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
@inject IFolderService FolderService
|
@inject IFolderService FolderService
|
||||||
@inject IFileService FileService
|
@inject IFileService FileService
|
||||||
|
|
||||||
@ -56,16 +54,16 @@
|
|||||||
<div>
|
<div>
|
||||||
@if (UploadMultiple)
|
@if (UploadMultiple)
|
||||||
{
|
{
|
||||||
<input type="file" id="@_fileinputid" name="file" accept="@_filter" multiple/>
|
<input type="file" id="@_fileinputid" name="file" accept="@_filter" multiple />
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<input type="file" id="@_fileinputid" name="file" accept="@_filter"/>
|
<input type="file" id="@_fileinputid" name="file" accept="@_filter" />
|
||||||
}
|
}
|
||||||
<span id="@_progressinfoid"></span><progress id="@_progressbarid" style="width: 150px; visibility: hidden;"></progress>
|
<span id="@_progressinfoid"></span><progress id="@_progressbarid" style="width: 150px; visibility: hidden;"></progress>
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
<button type="button" class="btn btn-success" @onclick="UploadFile">Upload</button>
|
<button type="button" class="btn btn-success" @onclick="UploadFile">Upload</button>
|
||||||
@if (_showfiles && GetFileId() != -1)
|
@if (ShowFiles && GetFileId() != -1)
|
||||||
{
|
{
|
||||||
<button type="button" class="btn btn-danger" @onclick="DeleteFile">Delete</button>
|
<button type="button" class="btn btn-danger" @onclick="DeleteFile">Delete</button>
|
||||||
}
|
}
|
||||||
@ -88,7 +86,6 @@
|
|||||||
private string _id;
|
private string _id;
|
||||||
private List<Folder> _folders;
|
private List<Folder> _folders;
|
||||||
private List<File> _files = new List<File>();
|
private List<File> _files = new List<File>();
|
||||||
private bool _showfiles = true;
|
|
||||||
private string _fileinputid = string.Empty;
|
private string _fileinputid = string.Empty;
|
||||||
private string _progressinfoid = string.Empty;
|
private string _progressinfoid = string.Empty;
|
||||||
private string _progressbarid = string.Empty;
|
private string _progressbarid = string.Empty;
|
||||||
@ -134,7 +131,7 @@
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(Folder))
|
if (!string.IsNullOrEmpty(Folder))
|
||||||
{
|
{
|
||||||
_folders = new List<Folder> {new Folder {FolderId = -1, Name = Folder}};
|
_folders = new List<Folder> { new Folder { FolderId = -1, Name = Folder } };
|
||||||
FolderId = -1;
|
FolderId = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -163,7 +160,7 @@
|
|||||||
|
|
||||||
await GetFiles();
|
await GetFiles();
|
||||||
|
|
||||||
// create unique id for component
|
// create unique id for component
|
||||||
_guid = Guid.NewGuid().ToString("N");
|
_guid = Guid.NewGuid().ToString("N");
|
||||||
_fileinputid = _guid + "FileInput";
|
_fileinputid = _guid + "FileInput";
|
||||||
_progressinfoid = _guid + "ProgressInfo";
|
_progressinfoid = _guid + "ProgressInfo";
|
||||||
@ -211,7 +208,7 @@
|
|||||||
_message = string.Empty;
|
_message = string.Empty;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FolderId = int.Parse((string) e.Value);
|
FolderId = int.Parse((string)e.Value);
|
||||||
await GetFiles();
|
await GetFiles();
|
||||||
FileId = -1;
|
FileId = -1;
|
||||||
_image = string.Empty;
|
_image = string.Empty;
|
||||||
@ -227,7 +224,7 @@
|
|||||||
private async Task FileChanged(ChangeEventArgs e)
|
private async Task FileChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
_message = string.Empty;
|
_message = string.Empty;
|
||||||
FileId = int.Parse((string) e.Value);
|
FileId = int.Parse((string)e.Value);
|
||||||
|
|
||||||
await SetImage();
|
await SetImage();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
@ -244,8 +241,8 @@
|
|||||||
var maxwidth = 200;
|
var maxwidth = 200;
|
||||||
var maxheight = 200;
|
var maxheight = 200;
|
||||||
|
|
||||||
var ratioX = (double) maxwidth / (double) file.ImageWidth;
|
var ratioX = (double)maxwidth / (double)file.ImageWidth;
|
||||||
var ratioY = (double) maxheight / (double) file.ImageHeight;
|
var ratioY = (double)maxheight / (double)file.ImageHeight;
|
||||||
var ratio = ratioX < ratioY ? ratioX : ratioY;
|
var ratio = ratioX < ratioY ? ratioX : ratioY;
|
||||||
|
|
||||||
_image = "<img src=\"" + ContentUrl(FileId) + "\" alt=\"" + file.Name +
|
_image = "<img src=\"" + ContentUrl(FileId) + "\" alt=\"" + file.Name +
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(HelpText))
|
@if (!string.IsNullOrEmpty(HelpText))
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(_message))
|
@if (!string.IsNullOrEmpty(_message))
|
||||||
{
|
{
|
||||||
<div class="@_classname" role="alert">@_message</div>
|
<div class="@_classname" role="alert">
|
||||||
|
@_message
|
||||||
|
@if (Type == MessageType.Error && UserSecurity.IsAuthorized(PageState.User, Constants.HostRole))
|
||||||
|
{
|
||||||
|
@((MarkupString)" ")<NavLink href="@NavigateUrl("admin/log")">View Details</NavLink>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,41 +1,39 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
@typeparam TableItem
|
@typeparam TableItem
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@if(Format == "Table")
|
@if (Format == "Table")
|
||||||
{
|
{
|
||||||
<table class="@Class">
|
<table class="@Class">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>@Header</tr>
|
<tr>@Header</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@foreach (var item in ItemList)
|
||||||
|
{
|
||||||
|
<tr>@Row(item)</tr>
|
||||||
|
@if (Detail != null)
|
||||||
|
{
|
||||||
|
<tr>@Detail(item)</tr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
}
|
||||||
|
@if (Format == "Grid")
|
||||||
|
{
|
||||||
|
<div class="@Class">
|
||||||
|
<div class="row">@Header</div>
|
||||||
@foreach (var item in ItemList)
|
@foreach (var item in ItemList)
|
||||||
{
|
{
|
||||||
<tr>@Row(item)</tr>
|
<div class="row">@Row(item)</div>
|
||||||
@if (Detail != null)
|
@if (Detail != null)
|
||||||
{
|
{
|
||||||
<tr>@Detail(item)</tr>
|
<div class="row">@Detail(item)</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</tbody>
|
</div>
|
||||||
</table>
|
|
||||||
}
|
|
||||||
@if(Format == "Grid")
|
|
||||||
{
|
|
||||||
<div class="@Class">
|
|
||||||
<div class="row">@Header</div>
|
|
||||||
@foreach (var item in ItemList)
|
|
||||||
{
|
|
||||||
<div class="row">@Row(item)</div>
|
|
||||||
@if (Detail != null)
|
|
||||||
{
|
|
||||||
<div class="row">@Detail(item)</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
<div class="mx-auto text-center">
|
<div class="mx-auto text-center">
|
||||||
@if (_page > _maxPages)
|
@if (_page > _maxPages)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
@inject IRoleService RoleService
|
@inject IRoleService RoleService
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
|
|
||||||
@ -39,7 +38,7 @@
|
|||||||
<th scope="col">User</th>
|
<th scope="col">User</th>
|
||||||
@foreach (PermissionString permission in _permissions)
|
@foreach (PermissionString permission in _permissions)
|
||||||
{
|
{
|
||||||
<th style="text-align: center; width: 1px;">@permission.PermissionName</th>
|
<th style="text-align: center; width: 1px;">@permission.PermissionName</th>
|
||||||
}
|
}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -48,7 +47,7 @@
|
|||||||
{
|
{
|
||||||
string userid = "[" + user.UserId.ToString() + "]";
|
string userid = "[" + user.UserId.ToString() + "]";
|
||||||
<tr>
|
<tr>
|
||||||
<td >@user.DisplayName</td>
|
<td>@user.DisplayName</td>
|
||||||
@foreach (PermissionString permission in _permissions)
|
@foreach (PermissionString permission in _permissions)
|
||||||
{
|
{
|
||||||
var p = permission;
|
var p = permission;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
|
|
||||||
<div class="row" style="margin-bottom: 50px;">
|
<div class="row" style="margin-bottom: 50px;">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@ -108,7 +107,7 @@
|
|||||||
public string DebugLevel { get; set; } = "info";
|
public string DebugLevel { get; set; } = "info";
|
||||||
|
|
||||||
public override List<Resource> Resources => new List<Resource>()
|
public override List<Resource> Resources => new List<Resource>()
|
||||||
{
|
{
|
||||||
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill1.3.6.min.js" },
|
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill1.3.6.min.js" },
|
||||||
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-blot-formatter.min.js" },
|
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-blot-formatter.min.js" },
|
||||||
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-interop.js" }
|
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-interop.js" }
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
|
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
|
|
||||||
@if (Name == Parent.ActiveTab)
|
@if (Name == Parent.ActiveTab)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
@inherits ModuleBase
|
@inherits ModuleControlBase
|
||||||
@attribute [OqtaneIgnore]
|
|
||||||
|
|
||||||
<CascadingValue Value="this">
|
<CascadingValue Value="this">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@namespace Oqtane.Modules.Controls
|
@namespace Oqtane.Modules.Controls
|
||||||
|
@inherits ModuleControlBase
|
||||||
|
|
||||||
<img src="@_src" title="@_title" @onclick="SetValue" />
|
<img src="@_src" title="@_title" @onclick="SetValue" />
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
@if (PageState.EditMode)
|
@if (PageState.EditMode)
|
||||||
{
|
{
|
||||||
<br /><ActionLink Action="Edit" /><br /><br />
|
<br /><ActionLink Action="Edit" EditMode="true" /><br /><br />
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
@ -21,23 +21,23 @@ namespace Oqtane.Modules.HtmlText.Services
|
|||||||
|
|
||||||
public async Task<HtmlTextInfo> GetHtmlTextAsync(int moduleId)
|
public async Task<HtmlTextInfo> GetHtmlTextAsync(int moduleId)
|
||||||
{
|
{
|
||||||
var htmltext = await GetJsonAsync<List<HtmlTextInfo>>($"{ApiUrl}/{moduleId}?entityid={moduleId}");
|
var htmltext = await GetJsonAsync<List<HtmlTextInfo>>(CreateAuthorizationPolicyUrl($"{ApiUrl}/{moduleId}", moduleId));
|
||||||
return htmltext.FirstOrDefault();
|
return htmltext.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task AddHtmlTextAsync(HtmlTextInfo htmlText)
|
public async Task AddHtmlTextAsync(HtmlTextInfo htmlText)
|
||||||
{
|
{
|
||||||
await PostJsonAsync($"{ApiUrl}?entityid={htmlText.ModuleId}", htmlText);
|
await PostJsonAsync(CreateAuthorizationPolicyUrl($"{ApiUrl}", htmlText.ModuleId), htmlText);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateHtmlTextAsync(HtmlTextInfo htmlText)
|
public async Task UpdateHtmlTextAsync(HtmlTextInfo htmlText)
|
||||||
{
|
{
|
||||||
await PutJsonAsync($"{ApiUrl}/{htmlText.HtmlTextId}?entityid={htmlText.ModuleId}", htmlText);
|
await PutJsonAsync(CreateAuthorizationPolicyUrl($"{ApiUrl}/{htmlText.HtmlTextId}", htmlText.ModuleId), htmlText);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DeleteHtmlTextAsync(int moduleId)
|
public async Task DeleteHtmlTextAsync(int moduleId)
|
||||||
{
|
{
|
||||||
await DeleteAsync($"{ApiUrl}/{moduleId}?entityid={moduleId}");
|
await DeleteAsync(CreateAuthorizationPolicyUrl($"{ApiUrl}/{moduleId}", moduleId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,54 @@ namespace Oqtane.Modules
|
|||||||
return Utilities.ContentUrl(PageState.Alias, fileid);
|
return Utilities.ContentUrl(PageState.Alias, fileid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual Dictionary<string, string> GetUrlParameters(string parametersTemplate = "")
|
||||||
|
{
|
||||||
|
var urlParameters = new Dictionary<string, string>();
|
||||||
|
string[] templateSegments;
|
||||||
|
var parameters = PageState.UrlParameters.Split('/', StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
var parameterId = 0;
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(parametersTemplate))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < parameters.Length; i++)
|
||||||
|
{
|
||||||
|
urlParameters.TryAdd("parameter" + i, parameters[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
templateSegments = parametersTemplate.Split('/', StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
|
if (parameters.Length == templateSegments.Length)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < parameters.Length; i++)
|
||||||
|
{
|
||||||
|
if (parameters.Length > i)
|
||||||
|
{
|
||||||
|
if (templateSegments[i] == parameters[i])
|
||||||
|
{
|
||||||
|
urlParameters.TryAdd("parameter" + parameterId, parameters[i]);
|
||||||
|
parameterId++;
|
||||||
|
}
|
||||||
|
else if (templateSegments[i].StartsWith("{") && templateSegments[i].EndsWith("}"))
|
||||||
|
{
|
||||||
|
var key = templateSegments[i].Replace("{", "");
|
||||||
|
key = key.Replace("}", "");
|
||||||
|
urlParameters.TryAdd(key, parameters[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i = parameters.Length;
|
||||||
|
urlParameters.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return urlParameters;
|
||||||
|
}
|
||||||
|
|
||||||
// user feedback methods
|
// user feedback methods
|
||||||
public void AddModuleMessage(string message, MessageType type)
|
public void AddModuleMessage(string message, MessageType type)
|
||||||
{
|
{
|
||||||
@ -154,12 +202,15 @@ namespace Oqtane.Modules
|
|||||||
case "add":
|
case "add":
|
||||||
logFunction = LogFunction.Create;
|
logFunction = LogFunction.Create;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "edit":
|
case "edit":
|
||||||
logFunction = LogFunction.Update;
|
logFunction = LogFunction.Update;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "delete":
|
case "delete":
|
||||||
logFunction = LogFunction.Delete;
|
logFunction = LogFunction.Delete;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logFunction = LogFunction.Read;
|
logFunction = LogFunction.Read;
|
||||||
break;
|
break;
|
||||||
|
10
Oqtane.Client/Modules/ModuleControlBase.cs
Normal file
10
Oqtane.Client/Modules/ModuleControlBase.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using Oqtane.Shared;
|
||||||
|
|
||||||
|
namespace Oqtane.Modules
|
||||||
|
{
|
||||||
|
[OqtaneIgnore]
|
||||||
|
public abstract class ModuleControlBase : ModuleBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@
|
|||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<RazorLangVersion>3.0</RazorLangVersion>
|
<RazorLangVersion>3.0</RazorLangVersion>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.4</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<RepositoryUrl>https://github.com/oqtane</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.1</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.4</PackageReleaseNotes>
|
||||||
<RootNamespace>Oqtane</RootNamespace>
|
<RootNamespace>Oqtane</RootNamespace>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -170,6 +170,19 @@ namespace Oqtane.Services
|
|||||||
// can be used to override the default alias
|
// can be used to override the default alias
|
||||||
public Alias Alias { get; set; }
|
public Alias Alias { get; set; }
|
||||||
|
|
||||||
|
// add entityid parameter to url for custom authorization policy
|
||||||
|
public string CreateAuthorizationPolicyUrl(string url, int entityId)
|
||||||
|
{
|
||||||
|
if (url.Contains("?"))
|
||||||
|
{
|
||||||
|
return url + "&entityid=" + entityId.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return url + "?entityid=" + entityId.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Obsolete("This method is obsolete. Use CreateApiUrl(Alias alias, string serviceName) instead.", false)]
|
[Obsolete("This method is obsolete. Use CreateApiUrl(Alias alias, string serviceName) instead.", false)]
|
||||||
public string CreateApiUrl(Alias alias, string absoluteUri, string serviceName)
|
public string CreateApiUrl(Alias alias, string absoluteUri, string serviceName)
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,10 @@
|
|||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Utilize, moduledefinition.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Utilize, moduledefinition.Permissions))
|
||||||
{
|
{
|
||||||
<option value="@moduledefinition.ModuleDefinitionName">@moduledefinition.Name</option>
|
if (moduledefinition.Runtimes == "" || moduledefinition.Runtimes.Contains(PageState.Runtime.ToString()))
|
||||||
|
{
|
||||||
|
<option value="@moduledefinition.ModuleDefinitionName">@moduledefinition.Name</option>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@ -196,26 +199,17 @@
|
|||||||
|
|
||||||
@if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions) || (PageState.Page.IsPersonalizable && PageState.User != null))
|
@if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions) || (PageState.Page.IsPersonalizable && PageState.User != null))
|
||||||
{
|
{
|
||||||
@if (PageState.Page.EditMode)
|
if (PageState.EditMode)
|
||||||
{
|
{
|
||||||
<button type="button" class="btn @ButtonClass active" aria-pressed="true" autocomplete="off">
|
<button type="button" class="btn @ButtonClass active" data-toggle="button" aria-pressed="true" autocomplete="off" @onclick="(async () => await ToggleEditMode(PageState.EditMode))">
|
||||||
<span class="oi oi-pencil"></span>
|
<span class="oi oi-pencil"></span>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (PageState.EditMode)
|
<button type="button" class="btn @ButtonClass" data-toggle="button" aria-pressed="false" autocomplete="off" @onclick="(async () => await ToggleEditMode(PageState.EditMode))">
|
||||||
{
|
<span class="oi oi-pencil"></span>
|
||||||
<button type="button" class="btn @ButtonClass active" data-toggle="button" aria-pressed="true" autocomplete="off" @onclick="(async () => await ToggleEditMode(PageState.EditMode))">
|
</button>
|
||||||
<span class="oi oi-pencil"></span>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<button type="button" class="btn @ButtonClass" data-toggle="button" aria-pressed="false" autocomplete="off" @onclick="(async () => await ToggleEditMode(PageState.EditMode))">
|
|
||||||
<span class="oi oi-pencil"></span>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
@inherits ModuleActionsBase
|
@inherits ModuleActionsBase
|
||||||
@attribute [OqtaneIgnore]
|
@attribute [OqtaneIgnore]
|
||||||
|
|
||||||
@if (PageState.EditMode && !PageState.Page.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, ModuleState.Permissions))
|
@if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, ModuleState.Permissions))
|
||||||
{
|
{
|
||||||
<div class="app-moduleactions">
|
<div class="app-moduleactions">
|
||||||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"></a>
|
<a class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"></a>
|
||||||
@ -15,7 +15,18 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<a class="dropdown-item" @onclick="(async () => await ModuleAction(action))">@action.Name</a>
|
<a class="dropdown-item" @onclick="(async () => await ModuleAction(action))">
|
||||||
|
@if (string.IsNullOrEmpty(action.Icon))
|
||||||
|
{
|
||||||
|
@((MarkupString) " ");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<span class="oi oi-@action.Icon" aria-hidden="true"></span>
|
||||||
|
}
|
||||||
|
|
||||||
|
@action.Name
|
||||||
|
</a>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,7 +19,7 @@ namespace Oqtane.Themes.Controls
|
|||||||
[Inject] public IPageModuleService PageModuleService { get; set; }
|
[Inject] public IPageModuleService PageModuleService { get; set; }
|
||||||
[Inject] public IModuleService ModuleService { get; set; }
|
[Inject] public IModuleService ModuleService { get; set; }
|
||||||
|
|
||||||
protected List<ActionViewModel> Actions;
|
public List<ActionViewModel> Actions;
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
@ -31,51 +31,52 @@ namespace Oqtane.Themes.Controls
|
|||||||
var actionList = new List<ActionViewModel>();
|
var actionList = new List<ActionViewModel>();
|
||||||
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, ModuleState.Permissions))
|
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, ModuleState.Permissions))
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel {Name = "Manage Settings", Action = async (u, m) => await Settings(u, m)});
|
actionList.Add(new ActionViewModel {Icon = Icons.Cog, Name = "Manage Settings", Action = async (u, m) => await Settings(u, m)});
|
||||||
|
|
||||||
if (UserSecurity.GetPermissionStrings(ModuleState.Permissions).FirstOrDefault(item => item.PermissionName == PermissionNames.View).Permissions.Split(';').Contains(Constants.AllUsersRole))
|
if (UserSecurity.GetPermissionStrings(ModuleState.Permissions).FirstOrDefault(item => item.PermissionName == PermissionNames.View).Permissions.Split(';').Contains(Constants.AllUsersRole))
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel { Name = "Unpublish Module", Action = async (s, m) => await Unpublish(s, m) });
|
actionList.Add(new ActionViewModel {Icon=Icons.CircleX, Name = "Unpublish Module", Action = async (s, m) => await Unpublish(s, m) });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel { Name = "Publish Module", Action = async (s, m) => await Publish(s, m) });
|
actionList.Add(new ActionViewModel {Icon=Icons.CircleCheck, Name = "Publish Module", Action = async (s, m) => await Publish(s, m) });
|
||||||
}
|
}
|
||||||
actionList.Add(new ActionViewModel { Name = "Delete Module", Action = async (u, m) => await DeleteModule(u, m) });
|
actionList.Add(new ActionViewModel {Icon=Icons.Trash, Name = "Delete Module", Action = async (u, m) => await DeleteModule(u, m) });
|
||||||
|
|
||||||
if (ModuleState.ModuleDefinition != null && ModuleState.ModuleDefinition.ServerManagerType != "")
|
if (ModuleState.ModuleDefinition != null && ModuleState.ModuleDefinition.ServerManagerType != "")
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel { Name = "" });
|
actionList.Add(new ActionViewModel { Name = "" });
|
||||||
actionList.Add(new ActionViewModel {Name = "Import Content", Action = async (u, m) => await EditUrlAsync(u, m.ModuleId, "Import")});
|
actionList.Add(new ActionViewModel {Icon=Icons.CloudUpload, Name = "Import Content", Action = async (u, m) => await EditUrlAsync(u, m.ModuleId, "Import")});
|
||||||
actionList.Add(new ActionViewModel {Name = "Export Content", Action = async (u, m) => await EditUrlAsync(u, m.ModuleId, "Export")});
|
actionList.Add(new ActionViewModel {Icon = Icons.CloudDownload, Name = "Export Content", Action = async (u, m) => await EditUrlAsync(u, m.ModuleId, "Export")});
|
||||||
}
|
}
|
||||||
|
|
||||||
actionList.Add(new ActionViewModel {Name = ""});
|
actionList.Add(new ActionViewModel {Name = ""});
|
||||||
|
|
||||||
if (ModuleState.PaneModuleIndex > 0)
|
if (ModuleState.PaneModuleIndex > 0)
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel {Name = "Move To Top", Action = async (s, m) => await MoveTop(s, m)});
|
actionList.Add(new ActionViewModel {Icon = Icons.DataTransferUpload ,Name = "Move To Top", Action = async (s, m) => await MoveTop(s, m)});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ModuleState.PaneModuleIndex > 0)
|
if (ModuleState.PaneModuleIndex > 0)
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel {Name = "Move Up", Action = async (s, m) => await MoveUp(s, m)});
|
actionList.Add(new ActionViewModel {Icon = Icons.ArrowThickTop, Name = "Move Up", Action = async (s, m) => await MoveUp(s, m)});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ModuleState.PaneModuleIndex < (ModuleState.PaneModuleCount - 1))
|
if (ModuleState.PaneModuleIndex < (ModuleState.PaneModuleCount - 1))
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel {Name = "Move Down", Action = async (s, m) => await MoveDown(s, m)});
|
actionList.Add(new ActionViewModel {Icon = Icons.ArrowThickBottom, Name = "Move Down", Action = async (s, m) => await MoveDown(s, m)});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ModuleState.PaneModuleIndex < (ModuleState.PaneModuleCount - 1))
|
if (ModuleState.PaneModuleIndex < (ModuleState.PaneModuleCount - 1))
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel {Name = "Move To Bottom", Action = async (s, m) => await MoveBottom(s, m)});
|
actionList.Add(new ActionViewModel {Icon = Icons.DataTransferDownload, Name = "Move To Bottom", Action = async (s, m) => await MoveBottom(s, m)});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (string pane in PageState.Page.Panes)
|
foreach (string pane in PageState.Page.Panes)
|
||||||
{
|
{
|
||||||
if (pane != ModuleState.Pane)
|
if (pane != ModuleState.Pane)
|
||||||
{
|
{
|
||||||
actionList.Add(new ActionViewModel {Name = "Move To " + pane + " Pane", Action = async (s, m) => await MoveToPane(s, pane, m)});
|
actionList.Add(new ActionViewModel {Icon = Icons.AccountLogin, Name = "Move To " + pane + " Pane", Action = async (s, m) => await MoveToPane(s, pane, m)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,8 +203,8 @@ namespace Oqtane.Themes.Controls
|
|||||||
|
|
||||||
public class ActionViewModel
|
public class ActionViewModel
|
||||||
{
|
{
|
||||||
|
public string Icon { get; set; }
|
||||||
public string Name { set; get; }
|
public string Name { set; get; }
|
||||||
|
|
||||||
public Func<string, PageModule, Task<string>> Action { set; get; }
|
public Func<string, PageModule, Task<string>> Action { set; get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
{
|
{
|
||||||
_moduleState = Module; // passed in from Pane component
|
_moduleState = Module; // passed in from Pane component
|
||||||
string container = _moduleState.ContainerType;
|
string container = _moduleState.ContainerType;
|
||||||
if (PageState.ModuleId != -1 && PageState.Action != "" && _moduleState.UseAdminContainer)
|
if (PageState.ModuleId != -1 && _moduleState.UseAdminContainer)
|
||||||
{
|
{
|
||||||
container = Constants.DefaultAdminContainer;
|
container = Constants.DefaultAdminContainer;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ namespace Oqtane.UI
|
|||||||
public List<Module> Modules { get; set; }
|
public List<Module> Modules { get; set; }
|
||||||
public Uri Uri { get; set; }
|
public Uri Uri { get; set; }
|
||||||
public Dictionary<string, string> QueryString { get; set; }
|
public Dictionary<string, string> QueryString { get; set; }
|
||||||
|
public string UrlParameters { get; set; }
|
||||||
public int ModuleId { get; set; }
|
public int ModuleId { get; set; }
|
||||||
public string Action { get; set; }
|
public string Action { get; set; }
|
||||||
public bool EditMode { get; set; }
|
public bool EditMode { get; set; }
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@namespace Oqtane.UI
|
@using Microsoft.AspNetCore.Components.Rendering
|
||||||
|
@namespace Oqtane.UI
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
@inject IModuleService ModuleService
|
@inject IModuleService ModuleService
|
||||||
@inject IModuleDefinitionService ModuleDefinitionService
|
@inject IModuleDefinitionService ModuleDefinitionService
|
||||||
@ -25,25 +26,25 @@
|
|||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
if (PageState.EditMode && !PageState.Page.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane)
|
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane)
|
||||||
{
|
{
|
||||||
_paneadminborder = "app-pane-admin-border";
|
_paneadminborder = "app-pane-admin-border";
|
||||||
_panetitle = "<div class=\"app-pane-admin-title\">" + Name + " Pane</div>";
|
_panetitle = "<div class=\"app-pane-admin-title\">" + Name + " Pane</div>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_paneadminborder = "container";
|
_paneadminborder = "";
|
||||||
_panetitle = "";
|
_panetitle = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicComponent = builder =>
|
DynamicComponent = builder =>
|
||||||
{
|
{
|
||||||
if (PageState.ModuleId != -1 && PageState.Action != "")
|
if (PageState.ModuleId != -1 && PageState.Action != Constants.DefaultAction)
|
||||||
{
|
{
|
||||||
if (Name.ToLower() == Constants.AdminPane.ToLower())
|
if (Name.ToLower() == Constants.AdminPane.ToLower())
|
||||||
{
|
{
|
||||||
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
|
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
|
||||||
if (module != null)
|
if (module != null && !module.IsDeleted)
|
||||||
{
|
{
|
||||||
var typename = module.ModuleType;
|
var typename = module.ModuleType;
|
||||||
// check for core module actions component
|
// check for core module actions component
|
||||||
@ -88,10 +89,7 @@
|
|||||||
{
|
{
|
||||||
module.Title = module.ControlTitle;
|
module.Title = module.ControlTitle;
|
||||||
}
|
}
|
||||||
|
CreateComponent(builder, module);
|
||||||
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
|
|
||||||
builder.AddAttribute(1, "Module", module);
|
|
||||||
builder.CloseComponent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -106,14 +104,12 @@
|
|||||||
if (PageState.ModuleId != -1)
|
if (PageState.ModuleId != -1)
|
||||||
{
|
{
|
||||||
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
|
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
|
||||||
if (module != null && module.Pane.ToLower() == Name.ToLower())
|
if (module != null && module.Pane.ToLower() == Name.ToLower() && !module.IsDeleted)
|
||||||
{
|
{
|
||||||
// check if user is authorized to view module
|
// check if user is authorized to view module
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))
|
||||||
{
|
{
|
||||||
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
|
CreateComponent(builder, module);
|
||||||
builder.AddAttribute(1, "Module", module);
|
|
||||||
builder.CloseComponent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,14 +120,19 @@
|
|||||||
// check if user is authorized to view module
|
// check if user is authorized to view module
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))
|
||||||
{
|
{
|
||||||
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
|
CreateComponent(builder, module);
|
||||||
builder.AddAttribute(1, "Module", module);
|
|
||||||
builder.SetKey(module.PageModuleId);
|
|
||||||
builder.CloseComponent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CreateComponent(RenderTreeBuilder builder, Module module)
|
||||||
|
{
|
||||||
|
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
|
||||||
|
builder.AddAttribute(1, "Module", module);
|
||||||
|
builder.SetKey(module.PageModuleId);
|
||||||
|
builder.CloseComponent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,8 @@
|
|||||||
User user = null;
|
User user = null;
|
||||||
List<Module> modules;
|
List<Module> modules;
|
||||||
var moduleid = -1;
|
var moduleid = -1;
|
||||||
var action = "";
|
var action = string.Empty;
|
||||||
|
var urlparameters = string.Empty;
|
||||||
var editmode = false;
|
var editmode = false;
|
||||||
var reload = Reload.None;
|
var reload = Reload.None;
|
||||||
var lastsyncdate = DateTime.UtcNow;
|
var lastsyncdate = DateTime.UtcNow;
|
||||||
@ -179,21 +180,60 @@
|
|||||||
// extract admin route elements from path
|
// extract admin route elements from path
|
||||||
var segments = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
var segments = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
int result;
|
int result;
|
||||||
// check if path has moduleid and action specification ie. pagename/moduleid/action/
|
|
||||||
if (segments.Length >= 2 && int.TryParse(segments[segments.Length - 2], out result))
|
int modIdPos = 0;
|
||||||
|
int actionPos = 0;
|
||||||
|
int urlParametersPos = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < segments.Length; i++)
|
||||||
{
|
{
|
||||||
action = segments[segments.Length - 1];
|
|
||||||
moduleid = result;
|
if (segments[i] == Constants.UrlParametersDelimiter)
|
||||||
path = path.Replace(moduleid.ToString() + "/" + action + "/", "");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// check if path has moduleid specification ie. pagename/moduleid/
|
|
||||||
if (segments.Length >= 1 && int.TryParse(segments[segments.Length - 1], out result))
|
|
||||||
{
|
{
|
||||||
moduleid = result;
|
urlParametersPos = i + 1;
|
||||||
path = path.Replace(moduleid.ToString() + "/", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i >= urlParametersPos && urlParametersPos != 0)
|
||||||
|
{
|
||||||
|
urlparameters += "/" + segments[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (segments[i] == Constants.ModuleDelimiter)
|
||||||
|
{
|
||||||
|
modIdPos = i + 1;
|
||||||
|
actionPos = modIdPos + 1;
|
||||||
|
if (actionPos > segments.Length - 1)
|
||||||
|
{
|
||||||
|
action = Constants.DefaultAction;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
action = segments[actionPos];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if path has moduleid and action specification ie. pagename/moduleid/action/
|
||||||
|
if (modIdPos > 0)
|
||||||
|
{
|
||||||
|
int.TryParse(segments[modIdPos], out result);
|
||||||
|
moduleid = result;
|
||||||
|
if (actionPos > segments.Length - 1)
|
||||||
|
{
|
||||||
|
path = path.Replace(segments[modIdPos - 1] + "/" + segments[modIdPos] + "/", "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
path = path.Replace(segments[modIdPos - 1] + "/" + segments[modIdPos] + "/" + segments[actionPos] + "/", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (urlParametersPos > 0)
|
||||||
|
{
|
||||||
|
path = path.Replace(segments[urlParametersPos - 1] + urlparameters + "/", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove trailing slash so it can be used as a key for Pages
|
// remove trailing slash so it can be used as a key for Pages
|
||||||
@ -220,17 +260,14 @@
|
|||||||
{
|
{
|
||||||
page = pages.Where(item => item.Path == path).FirstOrDefault();
|
page = pages.Where(item => item.Path == path).FirstOrDefault();
|
||||||
reload = Reload.Page;
|
reload = Reload.Page;
|
||||||
if (page != null)
|
editmode = false;
|
||||||
{
|
|
||||||
editmode = page.EditMode;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page != null)
|
if (page != null)
|
||||||
{
|
{
|
||||||
if (PageState == null)
|
if (PageState == null)
|
||||||
{
|
{
|
||||||
editmode = page.EditMode;
|
editmode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if user is authorized to view page
|
// check if user is authorized to view page
|
||||||
@ -263,6 +300,7 @@
|
|||||||
Modules = modules,
|
Modules = modules,
|
||||||
Uri = new Uri(_absoluteUri, UriKind.Absolute),
|
Uri = new Uri(_absoluteUri, UriKind.Absolute),
|
||||||
QueryString = querystring,
|
QueryString = querystring,
|
||||||
|
UrlParameters = urlparameters,
|
||||||
ModuleId = moduleid,
|
ModuleId = moduleid,
|
||||||
Action = action,
|
Action = action,
|
||||||
EditMode = editmode,
|
EditMode = editmode,
|
||||||
@ -360,6 +398,13 @@
|
|||||||
|
|
||||||
string panes = "";
|
string panes = "";
|
||||||
Type themetype = Type.GetType(page.ThemeType);
|
Type themetype = Type.GetType(page.ThemeType);
|
||||||
|
if (themetype == null)
|
||||||
|
{
|
||||||
|
// fallback
|
||||||
|
page.ThemeType = Constants.DefaultTheme;
|
||||||
|
page.LayoutType = Constants.DefaultLayout;
|
||||||
|
themetype = Type.GetType(Constants.DefaultTheme);
|
||||||
|
}
|
||||||
if (themetype != null)
|
if (themetype != null)
|
||||||
{
|
{
|
||||||
var themeobject = Activator.CreateInstance(themetype) as IThemeControl;
|
var themeobject = Activator.CreateInstance(themetype) as IThemeControl;
|
||||||
@ -401,7 +446,7 @@
|
|||||||
if (module.PageId == page.PageId || module.ModuleId == moduleid)
|
if (module.PageId == page.PageId || module.ModuleId == moduleid)
|
||||||
{
|
{
|
||||||
var typename = string.Empty;
|
var typename = string.Empty;
|
||||||
if (module.ModuleDefinition != null)
|
if (module.ModuleDefinition != null && (module.ModuleDefinition.Runtimes == "" || module.ModuleDefinition.Runtimes.Contains(GetRuntime().ToString())))
|
||||||
{
|
{
|
||||||
typename = module.ModuleDefinition.ControlTypeTemplate;
|
typename = module.ModuleDefinition.ControlTypeTemplate;
|
||||||
}
|
}
|
||||||
|
@ -54,11 +54,6 @@
|
|||||||
DynamicComponent = builder =>
|
DynamicComponent = builder =>
|
||||||
{
|
{
|
||||||
var themeType = Type.GetType(PageState.Page.ThemeType);
|
var themeType = Type.GetType(PageState.Page.ThemeType);
|
||||||
if (themeType == null)
|
|
||||||
{
|
|
||||||
// fallback
|
|
||||||
themeType = Type.GetType(Constants.DefaultTheme);
|
|
||||||
}
|
|
||||||
builder.OpenComponent(0, themeType);
|
builder.OpenComponent(0, themeType);
|
||||||
builder.CloseComponent();
|
builder.CloseComponent();
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Client</id>
|
<id>Oqtane.Client</id>
|
||||||
<version>1.0.1</version>
|
<version>1.0.4</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
<tags>oqtane</tags>
|
<tags>oqtane</tags>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.1</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.4</releaseNotes>
|
||||||
<summary>A modular application framework for Blazor</summary>
|
<summary>A modular application framework for Blazor</summary>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Framework</id>
|
<id>Oqtane.Framework</id>
|
||||||
<version>1.0.1</version>
|
<version>1.0.4</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@ -13,16 +13,11 @@
|
|||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
<tags>oqtane framework</tags>
|
<tags>oqtane framework</tags>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.1</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.4</releaseNotes>
|
||||||
<summary>A modular application framework for Blazor</summary>
|
<summary>A modular application framework for Blazor</summary>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.dll" target="lib\netcoreapp3.1" />
|
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\*.*" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.pdb" target="lib\netcoreapp3.1" />
|
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\wwwroot\**\*.*" target="wwwroot" />
|
||||||
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.dll" target="lib\netcoreapp3.1" />
|
|
||||||
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.pdb" target="lib\netcoreapp3.1" />
|
|
||||||
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.dll" target="lib\netcoreapp3.1" />
|
|
||||||
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.pdb" target="lib\netcoreapp3.1" />
|
|
||||||
<file src="..\Oqtane.Server\wwwroot\**\*.*" target="wwwroot" />
|
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
@ -2,7 +2,7 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Server</id>
|
<id>Oqtane.Server</id>
|
||||||
<version>1.0.1</version>
|
<version>1.0.4</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
<tags>oqtane</tags>
|
<tags>oqtane</tags>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.1</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.4</releaseNotes>
|
||||||
<summary>A modular application framework for Blazor</summary>
|
<summary>A modular application framework for Blazor</summary>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Shared</id>
|
<id>Oqtane.Shared</id>
|
||||||
<version>1.0.1</version>
|
<version>1.0.4</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
<tags>oqtane</tags>
|
<tags>oqtane</tags>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.1</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.4</releaseNotes>
|
||||||
<summary>A modular application framework for Blazor</summary>
|
<summary>A modular application framework for Blazor</summary>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
1
Oqtane.Package/install.ps1
Normal file
1
Oqtane.Package/install.ps1
Normal file
@ -0,0 +1 @@
|
|||||||
|
Compress-Archive -Path "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\*" -DestinationPath "..\Oqtane.Server\bin\Release\Oqtane.Framework.1.0.4.Install.zip" -Force
|
Binary file not shown.
@ -1,5 +1,18 @@
|
|||||||
DEL "*.nupkg"
|
del "*.nupkg"
|
||||||
dotnet clean -c Release ..\Oqtane.sln
|
dotnet clean -c Release ..\Oqtane.sln
|
||||||
dotnet build -c Release ..\Oqtane.sln
|
dotnet build -c Release ..\Oqtane.sln
|
||||||
dotnet pack -o .\ -c Release ..\Oqtane.sln
|
nuget.exe pack Oqtane.Client.nuspec
|
||||||
|
nuget.exe pack Oqtane.Server.nuspec
|
||||||
|
nuget.exe pack Oqtane.Shared.nuspec
|
||||||
|
del /F/Q/S "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish" > NUL
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish"
|
||||||
|
dotnet publish ..\Oqtane.Server\Oqtane.Server.csproj /p:Configuration=Release
|
||||||
|
del "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\appsettings.json"
|
||||||
|
ren "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\appsettings.release.json" "appsettings.json"
|
||||||
|
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ".\install.ps1"
|
||||||
|
del "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\appsettings.json"
|
||||||
|
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ".\upgrade.ps1"
|
||||||
|
del "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\Oqtane.Upgrade.*"
|
||||||
nuget.exe pack Oqtane.Framework.nuspec
|
nuget.exe pack Oqtane.Framework.nuspec
|
||||||
|
|
||||||
|
|
||||||
|
1
Oqtane.Package/upgrade.ps1
Normal file
1
Oqtane.Package/upgrade.ps1
Normal file
@ -0,0 +1 @@
|
|||||||
|
Compress-Archive -Path "..\Oqtane.Server\bin\Release\netcoreapp3.1\publish\*" -DestinationPath "..\Oqtane.Server\bin\Release\Oqtane.Framework.1.0.4.Upgrade.zip" -Force
|
@ -1,4 +1,4 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@ -135,8 +135,20 @@ namespace Oqtane.Controllers
|
|||||||
[Authorize(Roles = Constants.RegisteredRole)]
|
[Authorize(Roles = Constants.RegisteredRole)]
|
||||||
public Models.File Put(int id, [FromBody] Models.File file)
|
public Models.File Put(int id, [FromBody] Models.File file)
|
||||||
{
|
{
|
||||||
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, EntityNames.Folder, file.Folder.FolderId, PermissionNames.Edit))
|
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, EntityNames.Folder, file.FolderId, PermissionNames.Edit))
|
||||||
{
|
{
|
||||||
|
file.Folder = _folders.GetFolder(file.FolderId);
|
||||||
|
Models.File _file = _files.GetFile(id, false);
|
||||||
|
if (_file.Name != file.Name || _file.FolderId != file.FolderId)
|
||||||
|
{
|
||||||
|
string folderpath = GetFolderPath(file.Folder);
|
||||||
|
if (!Directory.Exists(folderpath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(folderpath);
|
||||||
|
}
|
||||||
|
System.IO.File.Move(Path.Combine(GetFolderPath(_file.Folder), _file.Name), Path.Combine(folderpath, file.Name));
|
||||||
|
}
|
||||||
|
file.Extension = Path.GetExtension(file.Name).ToLower().Replace(".", "");
|
||||||
file = _files.UpdateFile(file);
|
file = _files.UpdateFile(file);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "File Updated {File}", file);
|
_logger.Log(LogLevel.Information, this, LogFunction.Update, "File Updated {File}", file);
|
||||||
}
|
}
|
||||||
@ -483,7 +495,7 @@ namespace Oqtane.Controllers
|
|||||||
string[] folders = folderpath.Split(separators, StringSplitOptions.RemoveEmptyEntries);
|
string[] folders = folderpath.Split(separators, StringSplitOptions.RemoveEmptyEntries);
|
||||||
foreach (string folder in folders)
|
foreach (string folder in folders)
|
||||||
{
|
{
|
||||||
path = Utilities.PathCombine(path, folder, "\\");
|
path = Utilities.PathCombine(path, folder, Path.DirectorySeparatorChar.ToString());
|
||||||
if (!Directory.Exists(path))
|
if (!Directory.Exists(path))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(path);
|
Directory.CreateDirectory(path);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
@ -10,20 +11,25 @@ using Oqtane.Extensions;
|
|||||||
using Oqtane.Infrastructure;
|
using Oqtane.Infrastructure;
|
||||||
using Oqtane.Repository;
|
using Oqtane.Repository;
|
||||||
using Oqtane.Security;
|
using Oqtane.Security;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
|
||||||
namespace Oqtane.Controllers
|
namespace Oqtane.Controllers
|
||||||
{
|
{
|
||||||
[Route("{alias}/api/[controller]")]
|
[Route("{alias}/api/[controller]")]
|
||||||
public class FolderController : Controller
|
public class FolderController : Controller
|
||||||
{
|
{
|
||||||
|
private readonly IWebHostEnvironment _environment;
|
||||||
private readonly IFolderRepository _folders;
|
private readonly IFolderRepository _folders;
|
||||||
private readonly IUserPermissions _userPermissions;
|
private readonly IUserPermissions _userPermissions;
|
||||||
|
private readonly ITenantResolver _tenants;
|
||||||
private readonly ILogManager _logger;
|
private readonly ILogManager _logger;
|
||||||
|
|
||||||
public FolderController(IFolderRepository folders, IUserPermissions userPermissions, ILogManager logger)
|
public FolderController(IWebHostEnvironment environment, IFolderRepository folders, IUserPermissions userPermissions, ITenantResolver tenants, ILogManager logger)
|
||||||
{
|
{
|
||||||
|
_environment = environment;
|
||||||
_folders = folders;
|
_folders = folders;
|
||||||
_userPermissions = userPermissions;
|
_userPermissions = userPermissions;
|
||||||
|
_tenants = tenants;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +118,7 @@ namespace Oqtane.Controllers
|
|||||||
Folder parent = _folders.GetFolder(folder.ParentId.Value);
|
Folder parent = _folders.GetFolder(folder.ParentId.Value);
|
||||||
folder.Path = Utilities.PathCombine(parent.Path, folder.Name);
|
folder.Path = Utilities.PathCombine(parent.Path, folder.Name);
|
||||||
}
|
}
|
||||||
folder.Path = Utilities.PathCombine(folder.Path, "\\");
|
folder.Path = Utilities.PathCombine(folder.Path, Path.DirectorySeparatorChar.ToString());
|
||||||
folder = _folders.AddFolder(folder);
|
folder = _folders.AddFolder(folder);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Folder Added {Folder}", folder);
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Folder Added {Folder}", folder);
|
||||||
}
|
}
|
||||||
@ -142,12 +148,19 @@ namespace Oqtane.Controllers
|
|||||||
{
|
{
|
||||||
if (folder.IsPathValid())
|
if (folder.IsPathValid())
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(folder.Path) && folder.ParentId != null)
|
if (folder.ParentId != null)
|
||||||
{
|
{
|
||||||
Folder parent = _folders.GetFolder(folder.ParentId.Value);
|
Folder parent = _folders.GetFolder(folder.ParentId.Value);
|
||||||
folder.Path = Utilities.PathCombine(parent.Path, folder.Name);
|
folder.Path = Utilities.PathCombine(parent.Path, folder.Name);
|
||||||
}
|
}
|
||||||
folder.Path = Utilities.PathCombine(folder.Path, "\\");
|
folder.Path = Utilities.PathCombine(folder.Path, Path.DirectorySeparatorChar.ToString());
|
||||||
|
|
||||||
|
Models.Folder _folder = _folders.GetFolder(id, false);
|
||||||
|
if (_folder.Path != folder.Path && Directory.Exists(GetFolderPath(_folder)))
|
||||||
|
{
|
||||||
|
Directory.Move(GetFolderPath(_folder), GetFolderPath(folder));
|
||||||
|
}
|
||||||
|
|
||||||
folder = _folders.UpdateFolder(folder);
|
folder = _folders.UpdateFolder(folder);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Folder Updated {Folder}", folder);
|
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Folder Updated {Folder}", folder);
|
||||||
}
|
}
|
||||||
@ -201,6 +214,11 @@ namespace Oqtane.Controllers
|
|||||||
{
|
{
|
||||||
if (_userPermissions.IsAuthorized(User, EntityNames.Folder, id, PermissionNames.Edit))
|
if (_userPermissions.IsAuthorized(User, EntityNames.Folder, id, PermissionNames.Edit))
|
||||||
{
|
{
|
||||||
|
Models.Folder _folder = _folders.GetFolder(id, false);
|
||||||
|
if (Directory.Exists(GetFolderPath(_folder)))
|
||||||
|
{
|
||||||
|
Directory.Delete(GetFolderPath(_folder));
|
||||||
|
}
|
||||||
_folders.DeleteFolder(id);
|
_folders.DeleteFolder(id);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Folder Deleted {FolderId}", id);
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Folder Deleted {FolderId}", id);
|
||||||
}
|
}
|
||||||
@ -210,5 +228,10 @@ namespace Oqtane.Controllers
|
|||||||
HttpContext.Response.StatusCode = 401;
|
HttpContext.Response.StatusCode = 401;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetFolderPath(Folder folder)
|
||||||
|
{
|
||||||
|
return Utilities.PathCombine(_environment.ContentRootPath, "Content", "Tenants", _tenants.GetTenant().TenantId.ToString(), "Sites", folder.SiteId.ToString(), folder.Path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ namespace Oqtane.Controllers
|
|||||||
var pages = _pages.GetPages(module.SiteId).ToList();
|
var pages = _pages.GetPages(module.SiteId).ToList();
|
||||||
foreach (Page page in pages)
|
foreach (Page page in pages)
|
||||||
{
|
{
|
||||||
if (page.PageId != pageModule.PageId && !page.EditMode)
|
if (page.PageId != pageModule.PageId && !page.Path.StartsWith("admin/"))
|
||||||
{
|
{
|
||||||
_pageModules.AddPageModule(new PageModule { PageId = page.PageId, ModuleId = pageModule.ModuleId, Title = pageModule.Title, Pane = pageModule.Pane, Order = pageModule.Order, ContainerType = pageModule.ContainerType });
|
_pageModules.AddPageModule(new PageModule { PageId = page.PageId, ModuleId = pageModule.ModuleId, Title = pageModule.Title, Pane = pageModule.Pane, Order = pageModule.Order, ContainerType = pageModule.ContainerType });
|
||||||
}
|
}
|
||||||
|
21
Oqtane.Server/Controllers/ModuleControllerBase.cs
Normal file
21
Oqtane.Server/Controllers/ModuleControllerBase.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Oqtane.Infrastructure;
|
||||||
|
|
||||||
|
namespace Oqtane.Controllers
|
||||||
|
{
|
||||||
|
public class ModuleControllerBase : Controller
|
||||||
|
{
|
||||||
|
protected readonly ILogManager _logger;
|
||||||
|
protected int _entityId = -1; // passed as a querystring parameter for policy authorization and used for validation
|
||||||
|
|
||||||
|
public ModuleControllerBase(ILogManager logger, IHttpContextAccessor accessor)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
if (accessor.HttpContext.Request.Query.ContainsKey("entityid"))
|
||||||
|
{
|
||||||
|
_entityId = int.Parse(accessor.HttpContext.Request.Query["entityid"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -15,6 +15,7 @@ using System;
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Oqtane.Controllers
|
namespace Oqtane.Controllers
|
||||||
{
|
{
|
||||||
@ -94,8 +95,8 @@ namespace Oqtane.Controllers
|
|||||||
[Authorize(Roles = Constants.HostRole)]
|
[Authorize(Roles = Constants.HostRole)]
|
||||||
public void InstallModules()
|
public void InstallModules()
|
||||||
{
|
{
|
||||||
_installationManager.InstallPackages("Modules", true);
|
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Modules Installed");
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Modules Installed");
|
||||||
|
_installationManager.InstallPackages("Modules", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/<controller>/5?siteid=x
|
// DELETE api/<controller>/5?siteid=x
|
||||||
@ -110,6 +111,7 @@ namespace Oqtane.Controllers
|
|||||||
{
|
{
|
||||||
Type moduletype = Type.GetType(moduledefinition.ServerManagerType);
|
Type moduletype = Type.GetType(moduledefinition.ServerManagerType);
|
||||||
|
|
||||||
|
// execute uninstall logic
|
||||||
foreach (Tenant tenant in _tenants.GetTenants())
|
foreach (Tenant tenant in _tenants.GetTenants())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -131,24 +133,27 @@ namespace Oqtane.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// use assets.json to clean up file resources
|
||||||
|
string assetfilepath = Path.Combine(_environment.WebRootPath, "Modules", Utilities.GetTypeName(moduledefinition.ModuleDefinitionName), "assets.json");
|
||||||
|
if (System.IO.File.Exists(assetfilepath))
|
||||||
|
{
|
||||||
|
List<string> assets = JsonSerializer.Deserialize<List<string>>(System.IO.File.ReadAllText(assetfilepath));
|
||||||
|
foreach(string asset in assets)
|
||||||
|
{
|
||||||
|
if (System.IO.File.Exists(asset))
|
||||||
|
{
|
||||||
|
System.IO.File.Delete(asset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Module Assets Removed For {ModuleDefinitionName}", moduledefinition.ModuleDefinitionName);
|
||||||
|
}
|
||||||
|
|
||||||
// clean up module static resource folder
|
// clean up module static resource folder
|
||||||
string folder = Path.Combine(_environment.WebRootPath, Path.Combine("Modules", Utilities.GetTypeName(moduledefinition.ModuleDefinitionName)));
|
string folder = Path.Combine(_environment.WebRootPath, Path.Combine("Modules", Utilities.GetTypeName(moduledefinition.ModuleDefinitionName)));
|
||||||
if (Directory.Exists(folder))
|
if (Directory.Exists(folder))
|
||||||
{
|
{
|
||||||
Directory.Delete(folder, true);
|
Directory.Delete(folder, true);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Module Static Resources Removed For {ModuleDefinitionName}", moduledefinition.ModuleDefinitionName);
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Module Resources Folder Removed For {ModuleDefinitionName}", moduledefinition.ModuleDefinitionName);
|
||||||
}
|
|
||||||
|
|
||||||
// get root assembly name ( note that this only works if modules follow a specific naming convention for their assemblies )
|
|
||||||
string assemblyname = Utilities.GetAssemblyName(moduledefinition.ModuleDefinitionName).ToLower();
|
|
||||||
assemblyname = assemblyname.Replace(".client", "").Replace(".oqtane", "");
|
|
||||||
|
|
||||||
// remove module assemblies from /bin
|
|
||||||
string binfolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
|
||||||
foreach (string file in Directory.EnumerateFiles(binfolder, assemblyname + "*.*"))
|
|
||||||
{
|
|
||||||
System.IO.File.Delete(file);
|
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Module Assembly {Filename} Removed For {ModuleDefinitionName}", file, moduledefinition.ModuleDefinitionName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove module definition
|
// remove module definition
|
||||||
@ -170,19 +175,19 @@ namespace Oqtane.Controllers
|
|||||||
{
|
{
|
||||||
string rootPath;
|
string rootPath;
|
||||||
DirectoryInfo rootFolder = Directory.GetParent(_environment.ContentRootPath);
|
DirectoryInfo rootFolder = Directory.GetParent(_environment.ContentRootPath);
|
||||||
string templatePath = Utilities.PathCombine(_environment.WebRootPath, "Modules", "Templates", moduleDefinition.Template,"\\");
|
string templatePath = Utilities.PathCombine(_environment.WebRootPath, "Modules", "Templates", moduleDefinition.Template,Path.DirectorySeparatorChar.ToString());
|
||||||
|
|
||||||
if (moduleDefinition.Template == "internal")
|
if (moduleDefinition.Template == "internal")
|
||||||
{
|
{
|
||||||
rootPath = Utilities.PathCombine(rootFolder.FullName,"\\");
|
rootPath = Utilities.PathCombine(rootFolder.FullName,Path.DirectorySeparatorChar.ToString());
|
||||||
moduleDefinition.ModuleDefinitionName = moduleDefinition.Owner + "." + moduleDefinition.Name + "s, Oqtane.Client";
|
moduleDefinition.ModuleDefinitionName = moduleDefinition.Owner + "." + moduleDefinition.Name + ", Oqtane.Client";
|
||||||
moduleDefinition.ServerManagerType = moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Manager." + moduleDefinition.Name + "Manager, Oqtane.Server";
|
moduleDefinition.ServerManagerType = moduleDefinition.Owner + "." + moduleDefinition.Name + ".Manager." + moduleDefinition.Name + "Manager, Oqtane.Server";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rootPath = Utilities.PathCombine(rootFolder.Parent.FullName , moduleDefinition.Owner + "." + moduleDefinition.Name + "s","\\");
|
rootPath = Utilities.PathCombine(rootFolder.Parent.FullName , moduleDefinition.Owner + "." + moduleDefinition.Name,Path.DirectorySeparatorChar.ToString());
|
||||||
moduleDefinition.ModuleDefinitionName = moduleDefinition.Owner + "." + moduleDefinition.Name + "s, " + moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Client.Oqtane";
|
moduleDefinition.ModuleDefinitionName = moduleDefinition.Owner + "." + moduleDefinition.Name + ", " + moduleDefinition.Owner + "." + moduleDefinition.Name + ".Client.Oqtane";
|
||||||
moduleDefinition.ServerManagerType = moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Manager." + moduleDefinition.Name + "Manager, " + moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Server.Oqtane";
|
moduleDefinition.ServerManagerType = moduleDefinition.Owner + "." + moduleDefinition.Name + ".Manager." + moduleDefinition.Name + "Manager, " + moduleDefinition.Owner + "." + moduleDefinition.Name + ".Server.Oqtane";
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessTemplatesRecursively(new DirectoryInfo(templatePath), rootPath, rootFolder.Name, templatePath, moduleDefinition);
|
ProcessTemplatesRecursively(new DirectoryInfo(templatePath), rootPath, rootFolder.Name, templatePath, moduleDefinition);
|
||||||
@ -196,8 +201,8 @@ namespace Oqtane.Controllers
|
|||||||
{
|
{
|
||||||
// add embedded resources to project
|
// add embedded resources to project
|
||||||
List<string> resources = new List<string>();
|
List<string> resources = new List<string>();
|
||||||
resources.Add(Utilities.PathCombine("Modules", moduleDefinition.Owner + "." + moduleDefinition.Name + "s", "Scripts", moduleDefinition.Owner + "." + moduleDefinition.Name + "s.1.0.0.sql"));
|
resources.Add(Utilities.PathCombine("Modules", moduleDefinition.Owner + "." + moduleDefinition.Name, "Scripts", moduleDefinition.Owner + "." + moduleDefinition.Name + ".1.0.0.sql"));
|
||||||
resources.Add(Utilities.PathCombine("Modules", moduleDefinition.Owner + "." + moduleDefinition.Name + "s", "Scripts", moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Uninstall.sql"));
|
resources.Add(Utilities.PathCombine("Modules", moduleDefinition.Owner + "." + moduleDefinition.Name, "Scripts", moduleDefinition.Owner + "." + moduleDefinition.Name + ".Uninstall.sql"));
|
||||||
EmbedResourceFiles(Utilities.PathCombine(rootPath, "Oqtane.Server", "Oqtane.Server.csproj"), resources);
|
EmbedResourceFiles(Utilities.PathCombine(rootPath, "Oqtane.Server", "Oqtane.Server.csproj"), resources);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +240,20 @@ namespace Oqtane.Controllers
|
|||||||
text = text.Replace("[ServerManagerType]", moduleDefinition.ServerManagerType);
|
text = text.Replace("[ServerManagerType]", moduleDefinition.ServerManagerType);
|
||||||
text = text.Replace("[Folder]", folderPath);
|
text = text.Replace("[Folder]", folderPath);
|
||||||
text = text.Replace("[File]", Path.GetFileName(filePath));
|
text = text.Replace("[File]", Path.GetFileName(filePath));
|
||||||
text = text.Replace("[FrameworkVersion]", Constants.Version);
|
if (moduleDefinition.Version == "local")
|
||||||
|
{
|
||||||
|
text = text.Replace("[FrameworkVersion]", Constants.Version);
|
||||||
|
text = text.Replace("[ClientReference]", "<Reference Include=\"Oqtane.Client\"><HintPath>..\\..\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\netcoreapp3.1\\Oqtane.Client.dll</HintPath></Reference>");
|
||||||
|
text = text.Replace("[ServerReference]", "<Reference Include=\"Oqtane.Server\"><HintPath>..\\..\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\netcoreapp3.1\\Oqtane.Server.dll</HintPath></Reference>");
|
||||||
|
text = text.Replace("[SharedReference]", "<Reference Include=\"Oqtane.Shared\"><HintPath>..\\..\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\netcoreapp3.1\\Oqtane.Shared.dll</HintPath></Reference>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
text = text.Replace("[FrameworkVersion]", moduleDefinition.Version);
|
||||||
|
text = text.Replace("[ClientReference]", "<PackageReference Include=\"Oqtane.Client\" Version=\"" + moduleDefinition.Version + "\" />");
|
||||||
|
text = text.Replace("[ServerReference]", "<PackageReference Include=\"Oqtane.Server\" Version=\"" + moduleDefinition.Version + "\" />");
|
||||||
|
text = text.Replace("[SharedReference]", "<PackageReference Include=\"Oqtane.Shared\" Version=\"" + moduleDefinition.Version + "\" />");
|
||||||
|
}
|
||||||
System.IO.File.WriteAllText(filePath, text);
|
System.IO.File.WriteAllText(filePath, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ namespace Oqtane.Controllers
|
|||||||
_syncManager.AddSyncEvent(_tenants.GetTenant().TenantId, EntityNames.Site, page.SiteId);
|
_syncManager.AddSyncEvent(_tenants.GetTenant().TenantId, EntityNames.Site, page.SiteId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Page Added {Page}", page);
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Page Added {Page}", page);
|
||||||
|
|
||||||
if (!page.EditMode)
|
if (!page.Path.StartsWith("admin/"))
|
||||||
{
|
{
|
||||||
var modules = _modules.GetModules(page.SiteId).Where(item => item.AllPages).ToList();
|
var modules = _modules.GetModules(page.SiteId).Where(item => item.AllPages).ToList();
|
||||||
foreach (Module module in modules)
|
foreach (Module module in modules)
|
||||||
@ -163,7 +163,6 @@ namespace Oqtane.Controllers
|
|||||||
page.Order = 0;
|
page.Order = 0;
|
||||||
page.IsNavigation = false;
|
page.IsNavigation = false;
|
||||||
page.Url = "";
|
page.Url = "";
|
||||||
page.EditMode = false;
|
|
||||||
page.ThemeType = parent.ThemeType;
|
page.ThemeType = parent.ThemeType;
|
||||||
page.LayoutType = parent.LayoutType;
|
page.LayoutType = parent.LayoutType;
|
||||||
page.DefaultContainerType = parent.DefaultContainerType;
|
page.DefaultContainerType = parent.DefaultContainerType;
|
||||||
|
@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||||||
using Oqtane.Enums;
|
using Oqtane.Enums;
|
||||||
using Oqtane.Infrastructure;
|
using Oqtane.Infrastructure;
|
||||||
using Oqtane.Repository;
|
using Oqtane.Repository;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
// ReSharper disable StringIndexOfIsCultureSpecific.1
|
// ReSharper disable StringIndexOfIsCultureSpecific.1
|
||||||
|
|
||||||
@ -43,8 +44,8 @@ namespace Oqtane.Controllers
|
|||||||
[Authorize(Roles = Constants.HostRole)]
|
[Authorize(Roles = Constants.HostRole)]
|
||||||
public void InstallThemes()
|
public void InstallThemes()
|
||||||
{
|
{
|
||||||
_installationManager.InstallPackages("Themes", true);
|
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Themes Installed");
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Themes Installed");
|
||||||
|
_installationManager.InstallPackages("Themes", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/<controller>/xxx
|
// DELETE api/<controller>/xxx
|
||||||
@ -56,19 +57,29 @@ namespace Oqtane.Controllers
|
|||||||
Theme theme = themes.Where(item => item.ThemeName == themename).FirstOrDefault();
|
Theme theme = themes.Where(item => item.ThemeName == themename).FirstOrDefault();
|
||||||
if (theme != null && Utilities.GetAssemblyName(theme.ThemeName) != "Oqtane.Client")
|
if (theme != null && Utilities.GetAssemblyName(theme.ThemeName) != "Oqtane.Client")
|
||||||
{
|
{
|
||||||
|
// use assets.json to clean up file resources
|
||||||
|
string assetfilepath = Path.Combine(_environment.WebRootPath, "Modules", Utilities.GetTypeName(theme.ThemeName), "assets.json");
|
||||||
|
if (System.IO.File.Exists(assetfilepath))
|
||||||
|
{
|
||||||
|
List<string> assets = JsonSerializer.Deserialize<List<string>>(System.IO.File.ReadAllText(assetfilepath));
|
||||||
|
foreach (string asset in assets)
|
||||||
|
{
|
||||||
|
if (System.IO.File.Exists(asset))
|
||||||
|
{
|
||||||
|
System.IO.File.Delete(asset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Assets Removed For {ThemeName}", theme.ThemeName);
|
||||||
|
}
|
||||||
|
|
||||||
// clean up theme static resource folder
|
// clean up theme static resource folder
|
||||||
string folder = Path.Combine(_environment.WebRootPath, "Themes" , Utilities.GetTypeName(theme.ThemeName));
|
string folder = Path.Combine(_environment.WebRootPath, "Themes" , Utilities.GetTypeName(theme.ThemeName));
|
||||||
if (Directory.Exists(folder))
|
if (Directory.Exists(folder))
|
||||||
{
|
{
|
||||||
Directory.Delete(folder, true);
|
Directory.Delete(folder, true);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Static Resources Removed For {ThemeName}", theme.ThemeName);
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Resource Folder Removed For {ThemeName}", theme.ThemeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove theme assembly from /bin
|
|
||||||
string binfolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
|
||||||
System.IO.File.Delete(Path.Combine(binfolder, Utilities.GetAssemblyName(theme.ThemeName) + ".dll"));
|
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Assembly {Filename} Removed For {ThemeName}", Utilities.GetAssemblyName(theme.ThemeName) + ".dll", themename);
|
|
||||||
|
|
||||||
_installationManager.RestartApplication();
|
_installationManager.RestartApplication();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ using System.Linq;
|
|||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using Oqtane.Enums;
|
using Oqtane.Enums;
|
||||||
using Oqtane.Infrastructure;
|
using Oqtane.Infrastructure;
|
||||||
@ -174,7 +175,7 @@ namespace Oqtane.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add folder for user
|
// add folder for user
|
||||||
Folder folder = _folders.GetFolder(user.SiteId, Utilities.PathCombine("Users","\\"));
|
Folder folder = _folders.GetFolder(user.SiteId, Utilities.PathCombine("Users",Path.DirectorySeparatorChar.ToString()));
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
_folders.AddFolder(new Folder
|
_folders.AddFolder(new Folder
|
||||||
@ -182,7 +183,7 @@ namespace Oqtane.Controllers
|
|||||||
SiteId = folder.SiteId,
|
SiteId = folder.SiteId,
|
||||||
ParentId = folder.FolderId,
|
ParentId = folder.FolderId,
|
||||||
Name = "My Folder",
|
Name = "My Folder",
|
||||||
Path = Utilities.PathCombine(folder.Path, newUser.UserId.ToString(),"\\"),
|
Path = Utilities.PathCombine(folder.Path, newUser.UserId.ToString(),Path.DirectorySeparatorChar.ToString()),
|
||||||
Order = 1,
|
Order = 1,
|
||||||
IsSystem = true,
|
IsSystem = true,
|
||||||
Permissions = "[{\"PermissionName\":\"Browse\",\"Permissions\":\"[" + newUser.UserId.ToString() + "]\"},{\"PermissionName\":\"View\",\"Permissions\":\"All Users\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"[" +
|
Permissions = "[{\"PermissionName\":\"Browse\",\"Permissions\":\"[" + newUser.UserId.ToString() + "]\"},{\"PermissionName\":\"View\",\"Permissions\":\"All Users\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"[" +
|
||||||
|
@ -342,46 +342,48 @@ namespace Oqtane.Infrastructure
|
|||||||
if (!string.IsNullOrEmpty(moduledefinition.ReleaseVersions) && !string.IsNullOrEmpty(moduledefinition.ServerManagerType))
|
if (!string.IsNullOrEmpty(moduledefinition.ReleaseVersions) && !string.IsNullOrEmpty(moduledefinition.ServerManagerType))
|
||||||
{
|
{
|
||||||
Type moduletype = Type.GetType(moduledefinition.ServerManagerType);
|
Type moduletype = Type.GetType(moduledefinition.ServerManagerType);
|
||||||
|
if (moduletype != null)
|
||||||
string[] versions = moduledefinition.ReleaseVersions.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
using (var db = new InstallationContext(NormalizeConnectionString(_config.GetConnectionString(SettingKeys.ConnectionStringKey))))
|
|
||||||
{
|
{
|
||||||
foreach (var tenant in db.Tenant.ToList())
|
string[] versions = moduledefinition.ReleaseVersions.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
using (var db = new InstallationContext(NormalizeConnectionString(_config.GetConnectionString(SettingKeys.ConnectionStringKey))))
|
||||||
{
|
{
|
||||||
int index = Array.FindIndex(versions, item => item == moduledefinition.Version);
|
foreach (var tenant in db.Tenant.ToList())
|
||||||
if (tenant.Name == install.TenantName && install.TenantName != Constants.MasterTenant)
|
|
||||||
{
|
{
|
||||||
index = -1;
|
int index = Array.FindIndex(versions, item => item == moduledefinition.Version);
|
||||||
}
|
if (tenant.Name == install.TenantName && install.TenantName != Constants.MasterTenant)
|
||||||
if (index != (versions.Length - 1))
|
|
||||||
{
|
|
||||||
if (index == -1) index = 0;
|
|
||||||
for (int i = index; i < versions.Length; i++)
|
|
||||||
{
|
{
|
||||||
try
|
index = -1;
|
||||||
|
}
|
||||||
|
if (index != (versions.Length - 1))
|
||||||
|
{
|
||||||
|
if (index == -1) index = 0;
|
||||||
|
for (int i = index; i < versions.Length; i++)
|
||||||
{
|
{
|
||||||
if (moduletype.GetInterface("IInstallable") != null)
|
try
|
||||||
{
|
{
|
||||||
var moduleobject = ActivatorUtilities.CreateInstance(scope.ServiceProvider, moduletype);
|
if (moduletype.GetInterface("IInstallable") != null)
|
||||||
|
{
|
||||||
|
var moduleobject = ActivatorUtilities.CreateInstance(scope.ServiceProvider, moduletype);
|
||||||
((IInstallable)moduleobject).Install(tenant, versions[i]);
|
((IInstallable)moduleobject).Install(tenant, versions[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sql.ExecuteScript(tenant, moduletype.Assembly, Utilities.GetTypeName(moduledefinition.ModuleDefinitionName) + "." + versions[i] + ".sql");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
sql.ExecuteScript(tenant, moduletype.Assembly, Utilities.GetTypeName(moduledefinition.ModuleDefinitionName) + "." + versions[i] + ".sql");
|
result.Message = "An Error Occurred Installing " + moduledefinition.Name + " Version " + versions[i] + " - " + ex.Message.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
result.Message = "An Error Occurred Installing " + moduledefinition.Name + " Version " + versions[i] + " - " + ex.Message.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (string.IsNullOrEmpty(result.Message) && moduledefinition.Version != versions[versions.Length - 1])
|
||||||
if (string.IsNullOrEmpty(result.Message) && moduledefinition.Version != versions[versions.Length - 1])
|
{
|
||||||
{
|
moduledefinition.Version = versions[versions.Length - 1];
|
||||||
moduledefinition.Version = versions[versions.Length - 1];
|
db.Entry(moduledefinition).State = EntityState.Modified;
|
||||||
db.Entry(moduledefinition).State = EntityState.Modified;
|
db.SaveChanges();
|
||||||
db.SaveChanges();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -461,7 +463,7 @@ namespace Oqtane.Infrastructure
|
|||||||
userroles.AddUserRole(userRole);
|
userroles.AddUserRole(userRole);
|
||||||
|
|
||||||
// add user folder
|
// add user folder
|
||||||
var folder = folders.GetFolder(user.SiteId, Utilities.PathCombine("Users", "\\"));
|
var folder = folders.GetFolder(user.SiteId, Utilities.PathCombine("Users", Path.DirectorySeparatorChar.ToString()));
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
folders.AddFolder(new Folder
|
folders.AddFolder(new Folder
|
||||||
@ -469,7 +471,7 @@ namespace Oqtane.Infrastructure
|
|||||||
SiteId = folder.SiteId,
|
SiteId = folder.SiteId,
|
||||||
ParentId = folder.FolderId,
|
ParentId = folder.FolderId,
|
||||||
Name = "My Folder",
|
Name = "My Folder",
|
||||||
Path = Utilities.PathCombine(folder.Path, user.UserId.ToString(), "\\"),
|
Path = Utilities.PathCombine(folder.Path, user.UserId.ToString(), Path.DirectorySeparatorChar.ToString()),
|
||||||
Order = 1,
|
Order = 1,
|
||||||
IsSystem = true,
|
IsSystem = true,
|
||||||
Permissions = new List<Permission>
|
Permissions = new List<Permission>
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
using System.Reflection;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using Microsoft.Extensions.Hosting;
|
using System.Reflection;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using System.Text.Json;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Oqtane.Shared;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Oqtane.Shared;
|
||||||
|
|
||||||
namespace Oqtane.Infrastructure
|
namespace Oqtane.Infrastructure
|
||||||
{
|
{
|
||||||
@ -80,6 +82,8 @@ namespace Oqtane.Infrastructure
|
|||||||
// if compatible with framework version
|
// if compatible with framework version
|
||||||
if (frameworkversion == "" || Version.Parse(Constants.Version).CompareTo(Version.Parse(frameworkversion)) >= 0)
|
if (frameworkversion == "" || Version.Parse(Constants.Version).CompareTo(Version.Parse(frameworkversion)) >= 0)
|
||||||
{
|
{
|
||||||
|
List<string> assets = new List<string>();
|
||||||
|
|
||||||
// module and theme packages must be in form of name.1.0.0.nupkg
|
// module and theme packages must be in form of name.1.0.0.nupkg
|
||||||
string name = Path.GetFileNameWithoutExtension(packagename);
|
string name = Path.GetFileNameWithoutExtension(packagename);
|
||||||
string[] segments = name?.Split('.');
|
string[] segments = name?.Split('.');
|
||||||
@ -88,7 +92,7 @@ namespace Oqtane.Infrastructure
|
|||||||
// deploy to appropriate locations
|
// deploy to appropriate locations
|
||||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
{
|
{
|
||||||
string foldername = Path.GetDirectoryName(entry.FullName).Split('\\')[0];
|
string foldername = Path.GetDirectoryName(entry.FullName).Split(Path.DirectorySeparatorChar)[0];
|
||||||
string filename = Path.GetFileName(entry.FullName);
|
string filename = Path.GetFileName(entry.FullName);
|
||||||
|
|
||||||
switch (foldername)
|
switch (foldername)
|
||||||
@ -96,13 +100,32 @@ namespace Oqtane.Infrastructure
|
|||||||
case "lib":
|
case "lib":
|
||||||
filename = Path.Combine(binFolder, filename);
|
filename = Path.Combine(binFolder, filename);
|
||||||
ExtractFile(entry, filename);
|
ExtractFile(entry, filename);
|
||||||
|
assets.Add(filename);
|
||||||
break;
|
break;
|
||||||
case "wwwroot":
|
case "wwwroot":
|
||||||
filename = Path.Combine(webRootPath, Utilities.PathCombine(entry.FullName.Replace("wwwroot/", "").Split('/')));
|
filename = Path.Combine(webRootPath.Replace(Path.DirectorySeparatorChar + "wwwroot", ""), Utilities.PathCombine(entry.FullName.Split('/')));
|
||||||
ExtractFile(entry, filename);
|
ExtractFile(entry, filename);
|
||||||
|
assets.Add(filename);
|
||||||
|
break;
|
||||||
|
case "runtimes":
|
||||||
|
var destSubFolder = Path.GetDirectoryName(entry.FullName);
|
||||||
|
filename = Path.Combine(binFolder, destSubFolder, filename);
|
||||||
|
ExtractFile(entry, filename);
|
||||||
|
assets.Add(filename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save list of assets
|
||||||
|
if (assets.Count != 0)
|
||||||
|
{
|
||||||
|
string assetfilepath = Path.Combine(webRootPath, "Modules", name, "assets.json");
|
||||||
|
if (File.Exists(assetfilepath))
|
||||||
|
{
|
||||||
|
File.Delete(assetfilepath);
|
||||||
|
}
|
||||||
|
File.WriteAllText(assetfilepath, JsonSerializer.Serialize(assets));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +144,15 @@ namespace Oqtane.Infrastructure
|
|||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
||||||
}
|
}
|
||||||
entry.ExtractToFile(filename, true);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
entry.ExtractToFile(filename, true);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// an error occurred extracting the file
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpgradeFramework()
|
public void UpgradeFramework()
|
||||||
@ -131,7 +162,7 @@ namespace Oqtane.Infrastructure
|
|||||||
{
|
{
|
||||||
// get package with highest version and clean up any others
|
// get package with highest version and clean up any others
|
||||||
string packagename = "";
|
string packagename = "";
|
||||||
foreach(string package in Directory.GetFiles(folder, "Oqtane.Framework.*.nupkg"))
|
foreach (string package in Directory.GetFiles(folder, "Oqtane.Framework.*.nupkg"))
|
||||||
{
|
{
|
||||||
if (packagename != "")
|
if (packagename != "")
|
||||||
{
|
{
|
||||||
@ -163,12 +194,13 @@ namespace Oqtane.Infrastructure
|
|||||||
packageversion = node.InnerText;
|
packageversion = node.InnerText;
|
||||||
}
|
}
|
||||||
reader.Close();
|
reader.Close();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure package version is higher than current framework version
|
// ensure package version is greater than or equal to current framework version
|
||||||
if (packageversion != "" && Version.Parse(Constants.Version).CompareTo(Version.Parse(packageversion)) < 0)
|
if (packageversion != "" && Version.Parse(Constants.Version).CompareTo(Version.Parse(packageversion)) <= 0)
|
||||||
{
|
{
|
||||||
FinishUpgrade();
|
FinishUpgrade();
|
||||||
}
|
}
|
||||||
@ -179,28 +211,26 @@ namespace Oqtane.Infrastructure
|
|||||||
private void FinishUpgrade()
|
private void FinishUpgrade()
|
||||||
{
|
{
|
||||||
// check if upgrade application exists
|
// check if upgrade application exists
|
||||||
|
string Upgrader = "Oqtane.Upgrade.dll";
|
||||||
string folder = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
string folder = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
||||||
if (folder == null || !File.Exists(Path.Combine(folder, "Oqtane.Upgrade.exe"))) return;
|
if (folder == null || !File.Exists(Path.Combine(folder, Upgrader))) return;
|
||||||
|
|
||||||
// run upgrade application
|
// run upgrade application
|
||||||
var process = new Process
|
using (var process = new Process())
|
||||||
{
|
{
|
||||||
StartInfo =
|
process.StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = Path.Combine(folder, "Oqtane.Upgrade.exe"),
|
WorkingDirectory = folder,
|
||||||
Arguments = "\"" + _environment.ContentRootPath + "\" \"" + _environment.WebRootPath + "\"",
|
FileName = "dotnet",
|
||||||
ErrorDialog = false,
|
Arguments = Path.Combine(folder, Upgrader) + " \"" + _environment.ContentRootPath + "\" \"" + _environment.WebRootPath + "\"",
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
|
ErrorDialog = false,
|
||||||
CreateNoWindow = true,
|
CreateNoWindow = true,
|
||||||
RedirectStandardOutput = false,
|
RedirectStandardOutput = false,
|
||||||
RedirectStandardError = false
|
RedirectStandardError = false
|
||||||
}
|
};
|
||||||
|
process.Start();
|
||||||
};
|
};
|
||||||
process.Start();
|
|
||||||
process.Dispose();
|
|
||||||
|
|
||||||
// stop application so upgrade application can proceed
|
|
||||||
RestartApplication();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RestartApplication()
|
public void RestartApplication()
|
||||||
|
11
Oqtane.Server/Infrastructure/Interfaces/IHostResources.cs
Normal file
11
Oqtane.Server/Infrastructure/Interfaces/IHostResources.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using Oqtane.Models;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Oqtane.Infrastructure
|
||||||
|
{
|
||||||
|
public interface IHostResources
|
||||||
|
{
|
||||||
|
List<Resource> Resources { get; } // identifies global resources for an application
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -27,6 +27,8 @@ namespace Oqtane.Infrastructure
|
|||||||
|
|
||||||
protected async Task ExecuteAsync(CancellationToken stoppingToken)
|
protected async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
{
|
{
|
||||||
|
await Task.Yield(); // required so that this method does not block startup
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
while (!stoppingToken.IsCancellationRequested)
|
while (!stoppingToken.IsCancellationRequested)
|
||||||
@ -41,21 +43,26 @@ namespace Oqtane.Infrastructure
|
|||||||
Job job = jobs.GetJobs().Where(item => item.JobType == jobType).FirstOrDefault();
|
Job job = jobs.GetJobs().Where(item => item.JobType == jobType).FirstOrDefault();
|
||||||
if (job != null && job.IsEnabled && !job.IsExecuting)
|
if (job != null && job.IsEnabled && !job.IsExecuting)
|
||||||
{
|
{
|
||||||
// set next execution date
|
// get next execution date
|
||||||
|
DateTime NextExecution;
|
||||||
if (job.NextExecution == null)
|
if (job.NextExecution == null)
|
||||||
{
|
{
|
||||||
if (job.StartDate != null)
|
if (job.StartDate != null)
|
||||||
{
|
{
|
||||||
job.NextExecution = job.StartDate;
|
NextExecution = job.StartDate.Value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
job.NextExecution = DateTime.UtcNow;
|
NextExecution = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NextExecution = job.NextExecution.Value;
|
||||||
|
}
|
||||||
|
|
||||||
// determine if the job should be run
|
// determine if the job should be run
|
||||||
if (job.NextExecution <= DateTime.UtcNow && (job.EndDate == null || job.EndDate >= DateTime.UtcNow))
|
if (NextExecution <= DateTime.UtcNow && (job.EndDate == null || job.EndDate >= DateTime.UtcNow))
|
||||||
{
|
{
|
||||||
IJobLogRepository jobLogs = scope.ServiceProvider.GetRequiredService<IJobLogRepository>();
|
IJobLogRepository jobLogs = scope.ServiceProvider.GetRequiredService<IJobLogRepository>();
|
||||||
|
|
||||||
@ -89,7 +96,7 @@ namespace Oqtane.Infrastructure
|
|||||||
jobLogs.UpdateJobLog(log);
|
jobLogs.UpdateJobLog(log);
|
||||||
|
|
||||||
// update the job
|
// update the job
|
||||||
job.NextExecution = CalculateNextExecution(job.NextExecution.Value, job.Frequency, job.Interval);
|
job.NextExecution = CalculateNextExecution(NextExecution, job.Frequency, job.Interval);
|
||||||
job.IsExecuting = false;
|
job.IsExecuting = false;
|
||||||
jobs.UpdateJob(job);
|
jobs.UpdateJob(job);
|
||||||
|
|
||||||
|
@ -20,11 +20,15 @@ namespace Oqtane.Infrastructure
|
|||||||
{
|
{
|
||||||
string log = "";
|
string log = "";
|
||||||
|
|
||||||
// iterate through aliases in this installation
|
// iterate through tenants in this installation
|
||||||
|
List<int> tenants = new List<int>();
|
||||||
var aliasRepository = provider.GetRequiredService<IAliasRepository>();
|
var aliasRepository = provider.GetRequiredService<IAliasRepository>();
|
||||||
List<Alias> aliases = aliasRepository.GetAliases().ToList();
|
List<Alias> aliases = aliasRepository.GetAliases().ToList();
|
||||||
foreach (Alias alias in aliases)
|
foreach (Alias alias in aliases)
|
||||||
{
|
{
|
||||||
|
if (tenants.Contains(alias.TenantId)) continue;
|
||||||
|
tenants.Add(alias.TenantId);
|
||||||
|
|
||||||
// use the SiteState to set the Alias explicitly so the tenant can be resolved
|
// use the SiteState to set the Alias explicitly so the tenant can be resolved
|
||||||
var siteState = provider.GetRequiredService<SiteState>();
|
var siteState = provider.GetRequiredService<SiteState>();
|
||||||
siteState.Alias = alias;
|
siteState.Alias = alias;
|
||||||
@ -34,11 +38,11 @@ namespace Oqtane.Infrastructure
|
|||||||
var settingRepository = provider.GetRequiredService<ISettingRepository>();
|
var settingRepository = provider.GetRequiredService<ISettingRepository>();
|
||||||
var notificationRepository = provider.GetRequiredService<INotificationRepository>();
|
var notificationRepository = provider.GetRequiredService<INotificationRepository>();
|
||||||
|
|
||||||
// iterate through sites
|
// iterate through sites for this tenant
|
||||||
List<Site> sites = siteRepository.GetSites().ToList();
|
List<Site> sites = siteRepository.GetSites().ToList();
|
||||||
foreach (Site site in sites)
|
foreach (Site site in sites)
|
||||||
{
|
{
|
||||||
log += "Processing Notifications For Site: " + site.Name + "\n\n";
|
log += "Processing Notifications For Site: " + site.Name + "<br />";
|
||||||
|
|
||||||
// get site settings
|
// get site settings
|
||||||
List<Setting> sitesettings = settingRepository.GetSettings(EntityNames.Site, site.SiteId).ToList();
|
List<Setting> sitesettings = settingRepository.GetSettings(EntityNames.Site, site.SiteId).ToList();
|
||||||
@ -101,14 +105,14 @@ namespace Oqtane.Infrastructure
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// error
|
// error
|
||||||
log += ex.Message + "\n\n";
|
log += ex.Message + "<br />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log += "Notifications Delivered: " + sent + "\n\n";
|
log += "Notifications Delivered: " + sent + "<br />";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log += "SMTP Not Configured" + "\n\n";
|
log += "SMTP Not Configured" + "<br />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,7 +120,6 @@ namespace Oqtane.Infrastructure
|
|||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Dictionary<string, string> GetSettings(List<Setting> settings)
|
private Dictionary<string, string> GetSettings(List<Setting> settings)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> dictionary = new Dictionary<string, string>();
|
Dictionary<string, string> dictionary = new Dictionary<string, string>();
|
||||||
|
@ -42,7 +42,6 @@ namespace Oqtane.SiteTemplates
|
|||||||
Icon = "home",
|
Icon = "home",
|
||||||
IsNavigation = true,
|
IsNavigation = true,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission> {
|
PagePermissions = new List<Permission> {
|
||||||
new Permission(PermissionNames.View, Constants.AllUsersRole, true),
|
new Permission(PermissionNames.View, Constants.AllUsersRole, true),
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -89,7 +88,6 @@ namespace Oqtane.SiteTemplates
|
|||||||
Icon = "lock-locked",
|
Icon = "lock-locked",
|
||||||
IsNavigation = true,
|
IsNavigation = true,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission> {
|
PagePermissions = new List<Permission> {
|
||||||
new Permission(PermissionNames.View, Constants.RegisteredRole, true),
|
new Permission(PermissionNames.View, Constants.RegisteredRole, true),
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -114,7 +112,6 @@ namespace Oqtane.SiteTemplates
|
|||||||
Icon = "target",
|
Icon = "target",
|
||||||
IsNavigation = true,
|
IsNavigation = true,
|
||||||
IsPersonalizable = true,
|
IsPersonalizable = true,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission> {
|
PagePermissions = new List<Permission> {
|
||||||
new Permission(PermissionNames.View, Constants.AllUsersRole, true),
|
new Permission(PermissionNames.View, Constants.AllUsersRole, true),
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -134,7 +131,7 @@ namespace Oqtane.SiteTemplates
|
|||||||
|
|
||||||
if (System.IO.File.Exists(Path.Combine(_environment.WebRootPath, "images", "logo-white.png")))
|
if (System.IO.File.Exists(Path.Combine(_environment.WebRootPath, "images", "logo-white.png")))
|
||||||
{
|
{
|
||||||
string folderpath = Utilities.PathCombine(_environment.ContentRootPath, "Content", "Tenants", site.TenantId.ToString(), "Sites", site.SiteId.ToString(),"\\");
|
string folderpath = Utilities.PathCombine(_environment.ContentRootPath, "Content", "Tenants", site.TenantId.ToString(), "Sites", site.SiteId.ToString(), Path.DirectorySeparatorChar.ToString());
|
||||||
System.IO.Directory.CreateDirectory(folderpath);
|
System.IO.Directory.CreateDirectory(folderpath);
|
||||||
if (!System.IO.File.Exists(Path.Combine(folderpath, "logo-white.png")))
|
if (!System.IO.File.Exists(Path.Combine(folderpath, "logo-white.png")))
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,6 @@ namespace Oqtane.SiteTemplates
|
|||||||
Icon = "home",
|
Icon = "home",
|
||||||
IsNavigation = true,
|
IsNavigation = true,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission> {
|
PagePermissions = new List<Permission> {
|
||||||
new Permission(PermissionNames.View, Constants.AllUsersRole, true),
|
new Permission(PermissionNames.View, Constants.AllUsersRole, true),
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
|
@ -8,24 +8,18 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Oqtane.Enums;
|
using Oqtane.Enums;
|
||||||
using Oqtane.Infrastructure;
|
using Oqtane.Infrastructure;
|
||||||
|
using Oqtane.Controllers;
|
||||||
|
|
||||||
namespace Oqtane.Modules.HtmlText.Controllers
|
namespace Oqtane.Modules.HtmlText.Controllers
|
||||||
{
|
{
|
||||||
[Route("{alias}/api/[controller]")]
|
[Route("{alias}/api/[controller]")]
|
||||||
public class HtmlTextController : Controller
|
public class HtmlTextController : ModuleControllerBase
|
||||||
{
|
{
|
||||||
private readonly IHtmlTextRepository _htmlText;
|
private readonly IHtmlTextRepository _htmlText;
|
||||||
private readonly ILogManager _logger;
|
|
||||||
private int _entityId = -1; // passed as a querystring parameter for authorization and used for validation
|
|
||||||
|
|
||||||
public HtmlTextController(IHtmlTextRepository htmlText, ILogManager logger, IHttpContextAccessor httpContextAccessor)
|
public HtmlTextController(IHtmlTextRepository htmlText, ILogManager logger, IHttpContextAccessor accessor) : base(logger, accessor)
|
||||||
{
|
{
|
||||||
_htmlText = htmlText;
|
_htmlText = htmlText;
|
||||||
_logger = logger;
|
|
||||||
if (httpContextAccessor.HttpContext.Request.Query.ContainsKey("entityid"))
|
|
||||||
{
|
|
||||||
_entityId = int.Parse(httpContextAccessor.HttpContext.Request.Query["entityid"]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/5
|
// GET api/<controller>/5
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.4</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<RepositoryUrl>https://github.com/oqtane</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.1</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v1.0.4</PackageReleaseNotes>
|
||||||
<RootNamespace>Oqtane</RootNamespace>
|
<RootNamespace>Oqtane</RootNamespace>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -32,6 +32,7 @@
|
|||||||
<EmbeddedResource Include="Scripts\Tenant.00.09.02.00.sql" />
|
<EmbeddedResource Include="Scripts\Tenant.00.09.02.00.sql" />
|
||||||
<EmbeddedResource Include="Scripts\Tenant.01.00.01.00.sql" />
|
<EmbeddedResource Include="Scripts\Tenant.01.00.01.00.sql" />
|
||||||
<EmbeddedResource Include="Scripts\Tenant.01.00.01.01.sql" />
|
<EmbeddedResource Include="Scripts\Tenant.01.00.01.01.sql" />
|
||||||
|
<EmbeddedResource Include="Scripts\Tenant.01.00.02.01.sql" />
|
||||||
<EmbeddedResource Include="Modules\HtmlText\Scripts\HtmlText.1.0.0.sql" />
|
<EmbeddedResource Include="Modules\HtmlText\Scripts\HtmlText.1.0.0.sql" />
|
||||||
<EmbeddedResource Include="Modules\HtmlText\Scripts\HtmlText.Uninstall.sql" />
|
<EmbeddedResource Include="Modules\HtmlText\Scripts\HtmlText.Uninstall.sql" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -48,5 +49,16 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Oqtane.Client\Oqtane.Client.csproj" />
|
<ProjectReference Include="..\Oqtane.Client\Oqtane.Client.csproj" />
|
||||||
<ProjectReference Include="..\Oqtane.Shared\Oqtane.Shared.csproj" />
|
<ProjectReference Include="..\Oqtane.Shared\Oqtane.Shared.csproj" />
|
||||||
|
<ProjectReference Include="..\Oqtane.Upgrade\Oqtane.Upgrade.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
<ItemGroup>
|
||||||
|
<UpgradeFiles Include="$(ProjectDir)bin\Release\netcoreapp3.1\Oqtane.Upgrade.deps.json" />
|
||||||
|
<UpgradeFiles Include="$(ProjectDir)bin\Release\netcoreapp3.1\Oqtane.Upgrade.dll" />
|
||||||
|
<UpgradeFiles Include="$(ProjectDir)bin\Release\netcoreapp3.1\Oqtane.Upgrade.pdb" />
|
||||||
|
<UpgradeFiles Include="$(ProjectDir)bin\Release\netcoreapp3.1\Oqtane.Upgrade.runtimeconfig.json" />
|
||||||
|
<TemplateFiles Include="$(ProjectDir)wwwroot\Modules\Templates\**\*.*" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Target Name="AddPayloadsFolder" AfterTargets="Publish">
|
||||||
|
<Copy SourceFiles="@(UpgradeFiles)" DestinationFiles="@(UpgradeFiles->'$(PublishDir)%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="false" />
|
||||||
|
<Copy SourceFiles="@(TemplateFiles)" DestinationFiles="@(TemplateFiles->'$(PublishDir)wwwroot\Modules\Templates\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="false" />
|
||||||
|
</Target></Project>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
@using Microsoft.Extensions.Configuration
|
@using Microsoft.Extensions.Configuration
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
@model Oqtane.Pages.HostModel
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@ -16,6 +17,7 @@
|
|||||||
<link id="app-manifest" rel="manifest" />
|
<link id="app-manifest" rel="manifest" />
|
||||||
<link rel="stylesheet" href="css/app.css" />
|
<link rel="stylesheet" href="css/app.css" />
|
||||||
<script src="js/loadjs.min.js"></script>
|
<script src="js/loadjs.min.js"></script>
|
||||||
|
@Html.Raw(@Model.Resources)
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@(Html.AntiForgeryToken())
|
@(Html.AntiForgeryToken())
|
||||||
@ -30,7 +32,7 @@
|
|||||||
<environment include="Development">
|
<environment include="Development">
|
||||||
An unhandled exception has occurred. See browser dev tools for details.
|
An unhandled exception has occurred. See browser dev tools for details.
|
||||||
</environment>
|
</environment>
|
||||||
<a href="~/" class="reload">Reload</a>
|
<a href="" class="reload">Reload</a>
|
||||||
<a class="dismiss">🗙</a>
|
<a class="dismiss">🗙</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
62
Oqtane.Server/Pages/_Host.cshtml.cs
Normal file
62
Oqtane.Server/Pages/_Host.cshtml.cs
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
using Oqtane.Infrastructure;
|
||||||
|
using Oqtane.Shared;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Oqtane.Pages
|
||||||
|
{
|
||||||
|
public class HostModel : PageModel
|
||||||
|
{
|
||||||
|
public string Resources = "";
|
||||||
|
|
||||||
|
public void OnGet()
|
||||||
|
{
|
||||||
|
var assemblies = AppDomain.CurrentDomain.GetOqtaneAssemblies();
|
||||||
|
foreach (Assembly assembly in assemblies)
|
||||||
|
{
|
||||||
|
var types = assembly.GetTypes().Where(item => item.GetInterfaces().Contains(typeof(IHostResources)));
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
var obj = Activator.CreateInstance(type) as IHostResources;
|
||||||
|
foreach (var resource in obj.Resources)
|
||||||
|
{
|
||||||
|
switch (resource.ResourceType)
|
||||||
|
{
|
||||||
|
case ResourceType.Stylesheet:
|
||||||
|
Resources += "<link rel=\"stylesheet\" href=\"" + resource.Url + "\"" + CrossOrigin(resource.CrossOrigin) + Integrity(resource.Integrity) + " />" + Environment.NewLine;
|
||||||
|
break;
|
||||||
|
case ResourceType.Script:
|
||||||
|
Resources += "<script src=\"" + resource.Url + "\"" + CrossOrigin(resource.CrossOrigin) + Integrity(resource.Integrity) + "></script>" + Environment.NewLine;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string CrossOrigin(string crossorigin)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(crossorigin))
|
||||||
|
{
|
||||||
|
return " crossorigin=\"" + crossorigin + "\"";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string Integrity(string integrity)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(integrity))
|
||||||
|
{
|
||||||
|
return " integrity=\"" + integrity + "\"";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -45,7 +45,21 @@ namespace Oqtane.Repository
|
|||||||
|
|
||||||
public File GetFile(int fileId)
|
public File GetFile(int fileId)
|
||||||
{
|
{
|
||||||
File file = _db.File.Where(item => item.FileId == fileId).Include(item => item.Folder).FirstOrDefault();
|
return GetFile(fileId, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public File GetFile(int fileId, bool tracking)
|
||||||
|
{
|
||||||
|
File file;
|
||||||
|
if (tracking)
|
||||||
|
{
|
||||||
|
file = _db.File.Where(item => item.FileId == fileId).Include(item => item.Folder).FirstOrDefault();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
file = _db.File.AsNoTracking().Where(item => item.FileId == fileId).Include(item => item.Folder).FirstOrDefault();
|
||||||
|
}
|
||||||
if (file != null)
|
if (file != null)
|
||||||
{
|
{
|
||||||
IEnumerable<Permission> permissions = _permissions.GetPermissions(EntityNames.Folder, file.FolderId).ToList();
|
IEnumerable<Permission> permissions = _permissions.GetPermissions(EntityNames.Folder, file.FolderId).ToList();
|
||||||
|
@ -47,7 +47,20 @@ namespace Oqtane.Repository
|
|||||||
|
|
||||||
public Folder GetFolder(int folderId)
|
public Folder GetFolder(int folderId)
|
||||||
{
|
{
|
||||||
Folder folder = _db.Folder.Find(folderId);
|
return GetFolder(folderId, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Folder GetFolder(int folderId, bool tracking)
|
||||||
|
{
|
||||||
|
Folder folder;
|
||||||
|
if (tracking)
|
||||||
|
{
|
||||||
|
folder = _db.Folder.Where(item => item.FolderId == folderId).FirstOrDefault();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
folder = _db.Folder.AsNoTracking().Where(item => item.FolderId == folderId).FirstOrDefault();
|
||||||
|
}
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
folder.Permissions = _permissions.GetPermissionString(EntityNames.Folder, folder.FolderId);
|
folder.Permissions = _permissions.GetPermissionString(EntityNames.Folder, folder.FolderId);
|
||||||
|
@ -9,6 +9,7 @@ namespace Oqtane.Repository
|
|||||||
File AddFile(File file);
|
File AddFile(File file);
|
||||||
File UpdateFile(File file);
|
File UpdateFile(File file);
|
||||||
File GetFile(int fileId);
|
File GetFile(int fileId);
|
||||||
|
File GetFile(int fileId, bool tracking);
|
||||||
void DeleteFile(int fileId);
|
void DeleteFile(int fileId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ namespace Oqtane.Repository
|
|||||||
Folder AddFolder(Folder folder);
|
Folder AddFolder(Folder folder);
|
||||||
Folder UpdateFolder(Folder folder);
|
Folder UpdateFolder(Folder folder);
|
||||||
Folder GetFolder(int folderId);
|
Folder GetFolder(int folderId);
|
||||||
|
Folder GetFolder(int folderId, bool tracking);
|
||||||
Folder GetFolder(int siteId, string path);
|
Folder GetFolder(int siteId, string path);
|
||||||
void DeleteFolder(int folderId);
|
void DeleteFolder(int folderId);
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ namespace Oqtane.Repository
|
|||||||
ModuleDefinition moduledefinition = moduledefinitions.Where(item => item.ModuleDefinitionName == module.ModuleDefinitionName).FirstOrDefault();
|
ModuleDefinition moduledefinition = moduledefinitions.Where(item => item.ModuleDefinitionName == module.ModuleDefinitionName).FirstOrDefault();
|
||||||
if (moduledefinition != null)
|
if (moduledefinition != null)
|
||||||
{
|
{
|
||||||
ModuleContent modulecontent = JsonSerializer.Deserialize<ModuleContent>(content);
|
ModuleContent modulecontent = JsonSerializer.Deserialize<ModuleContent>(content.Replace("\n", ""));
|
||||||
if (modulecontent.ModuleDefinitionName == moduledefinition.ModuleDefinitionName)
|
if (modulecontent.ModuleDefinitionName == moduledefinition.ModuleDefinitionName)
|
||||||
{
|
{
|
||||||
if (moduledefinition.ServerManagerType != "")
|
if (moduledefinition.ServerManagerType != "")
|
||||||
@ -147,9 +147,10 @@ namespace Oqtane.Repository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// error occurred during import
|
// error occurred during import
|
||||||
|
string error = ex.Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
@ -21,7 +21,7 @@ namespace Oqtane.Repository
|
|||||||
return _db.Notification
|
return _db.Notification
|
||||||
.Where(item => item.SiteId == siteId)
|
.Where(item => item.SiteId == siteId)
|
||||||
.Where(item => item.IsDelivered == false)
|
.Where(item => item.IsDelivered == false)
|
||||||
.Where(item => item.SendOn < System.DateTime.UtcNow)
|
.Where(item => item.SendOn == null || item.SendOn < System.DateTime.UtcNow)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.LockLocked,
|
Icon = Icons.LockLocked,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -88,7 +87,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.Person,
|
Icon = Icons.Person,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -119,7 +117,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.Person,
|
Icon = Icons.Person,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -149,7 +146,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.Person,
|
Icon = Icons.Person,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = false,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -175,7 +171,7 @@ namespace Oqtane.Repository
|
|||||||
// admin pages
|
// admin pages
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
{
|
{
|
||||||
Name = "Admin", Parent = "", Path = "admin", Icon = "", IsNavigation = false, IsPersonalizable = false, EditMode = true,
|
Name = "Admin", Parent = "", Path = "admin", Icon = "", IsNavigation = false, IsPersonalizable = false,
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -203,7 +199,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.Home,
|
Icon = Icons.Home,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -231,7 +226,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.Layers,
|
Icon = Icons.Layers,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -259,7 +253,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.People,
|
Icon = Icons.People,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -287,7 +280,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.Person,
|
Icon = Icons.Person,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -315,7 +307,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.LockLocked,
|
Icon = Icons.LockLocked,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -343,7 +334,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.File,
|
Icon = Icons.File,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -371,7 +361,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.Trash,
|
Icon = Icons.Trash,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||||
@ -401,7 +390,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.MagnifyingGlass,
|
Icon = Icons.MagnifyingGlass,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -428,7 +416,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = Icons.List,
|
Icon = Icons.List,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -450,7 +437,7 @@ namespace Oqtane.Repository
|
|||||||
});
|
});
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
{
|
{
|
||||||
Name = "Site Management", Parent = "Admin", Path = "admin/sites", Icon = Icons.Globe, IsNavigation = false, IsPersonalizable = false, EditMode = true,
|
Name = "Site Management", Parent = "Admin", Path = "admin/sites", Icon = Icons.Globe, IsNavigation = false, IsPersonalizable = false,
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -472,7 +459,7 @@ namespace Oqtane.Repository
|
|||||||
});
|
});
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
{
|
{
|
||||||
Name = "Module Management", Parent = "Admin", Path = "admin/modules", Icon = Icons.Browser, IsNavigation = false, IsPersonalizable = false, EditMode = true,
|
Name = "Module Management", Parent = "Admin", Path = "admin/modules", Icon = Icons.Browser, IsNavigation = false, IsPersonalizable = false,
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -494,7 +481,7 @@ namespace Oqtane.Repository
|
|||||||
});
|
});
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
{
|
{
|
||||||
Name = "Theme Management", Parent = "Admin", Path = "admin/themes", Icon = Icons.Brush, IsNavigation = false, IsPersonalizable = false, EditMode = true,
|
Name = "Theme Management", Parent = "Admin", Path = "admin/themes", Icon = Icons.Brush, IsNavigation = false, IsPersonalizable = false,
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -516,7 +503,7 @@ namespace Oqtane.Repository
|
|||||||
});
|
});
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
{
|
{
|
||||||
Name = "Scheduled Jobs", Parent = "Admin", Path = "admin/jobs", Icon = Icons.Timer, IsNavigation = false, IsPersonalizable = false, EditMode = true,
|
Name = "Scheduled Jobs", Parent = "Admin", Path = "admin/jobs", Icon = Icons.Timer, IsNavigation = false, IsPersonalizable = false,
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -544,7 +531,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = "spreadsheet",
|
Icon = "spreadsheet",
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -572,7 +558,6 @@ namespace Oqtane.Repository
|
|||||||
Icon = "medical-cross",
|
Icon = "medical-cross",
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
IsPersonalizable = false,
|
IsPersonalizable = false,
|
||||||
EditMode = true,
|
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -594,7 +579,7 @@ namespace Oqtane.Repository
|
|||||||
});
|
});
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
{
|
{
|
||||||
Name = "System Update", Parent = "Admin", Path = "admin/update", Icon = Icons.Aperture, IsNavigation = false, IsPersonalizable = false, EditMode = true,
|
Name = "System Update", Parent = "Admin", Path = "admin/update", Icon = Icons.Aperture, IsNavigation = false, IsPersonalizable = false,
|
||||||
PagePermissions = new List<Permission>
|
PagePermissions = new List<Permission>
|
||||||
{
|
{
|
||||||
new Permission(PermissionNames.View, Constants.HostRole, true),
|
new Permission(PermissionNames.View, Constants.HostRole, true),
|
||||||
@ -692,7 +677,7 @@ namespace Oqtane.Repository
|
|||||||
});
|
});
|
||||||
_folderRepository.AddFolder(new Folder
|
_folderRepository.AddFolder(new Folder
|
||||||
{
|
{
|
||||||
SiteId = site.SiteId, ParentId = folder.FolderId, Name = "Users", Path = Utilities.PathCombine("Users","\\"), Order = 1, IsSystem = true,
|
SiteId = site.SiteId, ParentId = folder.FolderId, Name = "Users", Path = Utilities.PathCombine("Users",Path.DirectorySeparatorChar.ToString()), Order = 1, IsSystem = true,
|
||||||
Permissions = "[{\"PermissionName\":\"Browse\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]"
|
Permissions = "[{\"PermissionName\":\"Browse\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"View\",\"Permissions\":\"Administrators\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"Administrators\"}]"
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -754,7 +739,6 @@ namespace Oqtane.Repository
|
|||||||
Order = 1,
|
Order = 1,
|
||||||
Url = "",
|
Url = "",
|
||||||
IsNavigation = pagetemplate.IsNavigation,
|
IsNavigation = pagetemplate.IsNavigation,
|
||||||
EditMode = pagetemplate.EditMode,
|
|
||||||
ThemeType = "",
|
ThemeType = "",
|
||||||
LayoutType = "",
|
LayoutType = "",
|
||||||
DefaultContainerType = "",
|
DefaultContainerType = "",
|
||||||
|
9
Oqtane.Server/Scripts/Tenant.01.00.02.01.sql
Normal file
9
Oqtane.Server/Scripts/Tenant.01.00.02.01.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Version 1.0.2.1 migration script
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[Page]
|
||||||
|
DROP COLUMN EditMode
|
||||||
|
GO
|
3
Oqtane.Server/Scripts/Tenant.01.00.04.01.sql
Normal file
3
Oqtane.Server/Scripts/Tenant.01.00.04.01.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE [dbo].[Page]
|
||||||
|
ALTER COLUMN [Path] [nvarchar](256) NOT NULL
|
||||||
|
GO
|
@ -72,7 +72,7 @@ namespace Oqtane
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// register authorization services
|
// register custom authorization policies
|
||||||
services.AddAuthorizationCore(options =>
|
services.AddAuthorizationCore(options =>
|
||||||
{
|
{
|
||||||
options.AddPolicy("ViewPage", policy => policy.Requirements.Add(new PermissionRequirement(EntityNames.Page, PermissionNames.View)));
|
options.AddPolicy("ViewPage", policy => policy.Requirements.Add(new PermissionRequirement(EntityNames.Page, PermissionNames.View)));
|
||||||
|
15
Oqtane.Server/appsettings.release.json
Normal file
15
Oqtane.Server/appsettings.release.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"Runtime": "Server",
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": ""
|
||||||
|
},
|
||||||
|
"Installation": {
|
||||||
|
"DefaultAlias": "",
|
||||||
|
"HostPassword": "",
|
||||||
|
"HostEmail": "",
|
||||||
|
"SiteTemplate": "",
|
||||||
|
"DefaultTheme": "",
|
||||||
|
"DefaultLayout": "",
|
||||||
|
"DefaultContainer": ""
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
@using Oqtane.Modules.Controls
|
@using Oqtane.Modules.Controls
|
||||||
@using [Owner].[Module]s.Services
|
@using [Owner].[Module].Services
|
||||||
@using [Owner].[Module]s.Models
|
@using [Owner].[Module].Models
|
||||||
|
|
||||||
@namespace [Owner].[Module]s
|
@namespace [Owner].[Module]
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject I[Module]Service [Module]Service
|
@inject I[Module]Service [Module]Service
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@ -10,10 +10,10 @@
|
|||||||
<table class="table table-borderless">
|
<table class="table table-borderless">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label class="control-label">Name: </label>
|
<Label For="name" HelpText="Enter a name">Name: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="_name" class="form-control" @bind="@_name" />
|
<input id="name" class="form-control" @bind="@_name" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
public override string Actions => "Add,Edit";
|
public override string Actions => "Add,Edit";
|
||||||
|
|
||||||
|
public override string Title => "Manage [Module]";
|
||||||
|
|
||||||
public override List<Resource> Resources => new List<Resource>()
|
public override List<Resource> Resources => new List<Resource>()
|
||||||
{
|
{
|
||||||
new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" }
|
new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" }
|
||||||
@ -50,7 +52,7 @@
|
|||||||
if (PageState.Action == "Edit")
|
if (PageState.Action == "Edit")
|
||||||
{
|
{
|
||||||
_id = Int32.Parse(PageState.QueryString["id"]);
|
_id = Int32.Parse(PageState.QueryString["id"]);
|
||||||
[Module] [Module] = await [Module]Service.Get[Module]Async(_id);
|
[Module] [Module] = await [Module]Service.Get[Module]Async(_id, ModuleState.ModuleId);
|
||||||
if ([Module] != null)
|
if ([Module] != null)
|
||||||
{
|
{
|
||||||
_name = [Module].Name;
|
_name = [Module].Name;
|
||||||
@ -82,7 +84,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[Module] [Module] = await [Module]Service.Get[Module]Async(_id);
|
[Module] [Module] = await [Module]Service.Get[Module]Async(_id, ModuleState.ModuleId);
|
||||||
[Module].Name = _name;
|
[Module].Name = _name;
|
||||||
await [Module]Service.Update[Module]Async([Module]);
|
await [Module]Service.Update[Module]Async([Module]);
|
||||||
await logger.LogInformation("[Module] Updated {[Module]}", [Module]);
|
await logger.LogInformation("[Module] Updated {[Module]}", [Module]);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
@using [Owner].[Module]s.Services
|
@using [Owner].[Module].Services
|
||||||
@using [Owner].[Module]s.Models
|
@using [Owner].[Module].Models
|
||||||
|
|
||||||
@namespace [Owner].[Module]s
|
@namespace [Owner].[Module]
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject I[Module]Service [Module]Service
|
@inject I[Module]Service [Module]Service
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@ -17,16 +17,16 @@ else
|
|||||||
<br />
|
<br />
|
||||||
@if (@_[Module]s.Count != 0)
|
@if (@_[Module]s.Count != 0)
|
||||||
{
|
{
|
||||||
<Pager Items="@_[Module]s" Format="Grid">
|
<Pager Items="@_[Module]s">
|
||||||
<Header>
|
<Header>
|
||||||
<div class="col"><strong>[Module]s</strong></div>
|
<th style="width: 1px;"> </th>
|
||||||
|
<th style="width: 1px;"> </th>
|
||||||
|
<th>Name</th>
|
||||||
</Header>
|
</Header>
|
||||||
<Row>
|
<Row>
|
||||||
<div class="col">
|
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.[Module]Id.ToString())" /></td>
|
||||||
<ActionLink Action="Edit" Parameters="@($"id=" + context.[Module]Id.ToString())" />
|
<td><ActionDialog Header="Delete [Module]" Message="@("Are You Sure You Wish To Delete The " + context.Name + " [Module]?")" Action="Delete" Security="SecurityAccessLevel.Edit" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" /></td>
|
||||||
<ActionDialog Header="Delete [Module]" Message="@("Are You Sure You Wish To Delete The " + context.Name + " [Module]?")" Action="Delete" Security="SecurityAccessLevel.Edit" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" />
|
<td>@context.Name</td>
|
||||||
@context.Name
|
|
||||||
</div>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Pager>
|
</Pager>
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ else
|
|||||||
<hr />
|
<hr />
|
||||||
[Module] Module Created Successfully. Use Edit Mode To Add A [Module]. You Can Access The Files At The Following Locations:<br /><br />
|
[Module] Module Created Successfully. Use Edit Mode To Add A [Module]. You Can Access The Files At The Following Locations:<br /><br />
|
||||||
[RootPath]Client\<br />
|
[RootPath]Client\<br />
|
||||||
- [Owner].[Module]s.Client.csproj - client project<br />
|
- [Owner].[Module].Client.csproj - client project<br />
|
||||||
- _Imports.razor - global imports for module components<br />
|
- _Imports.razor - global imports for module components<br />
|
||||||
- Edit.razor - component for adding or editing content<br />
|
- Edit.razor - component for adding or editing content<br />
|
||||||
- Index.razor - main component for your module **the content you are reading is in this file**<br />
|
- Index.razor - main component for your module **the content you are reading is in this file**<br />
|
||||||
@ -50,22 +50,22 @@ else
|
|||||||
- Services\I[Module]Service.cs - interface for defining service API methods<br />
|
- Services\I[Module]Service.cs - interface for defining service API methods<br />
|
||||||
- Services\[Module]Service.cs - implements service API interface methods<br /><br />
|
- Services\[Module]Service.cs - implements service API interface methods<br /><br />
|
||||||
[RootPath]Package\<br />
|
[RootPath]Package\<br />
|
||||||
- [Owner].[Module]s.nuspec - nuget manifest for packaging module<br />
|
- [Owner].[Module].nuspec - nuget manifest for packaging module<br />
|
||||||
- [Owner].[Module]s.Package.csproj - packaging project<br />
|
- [Owner].[Module].Package.csproj - packaging project<br />
|
||||||
- debug.cmd - copies assemblies to Oqtane bin folder when in Debug mode<br />
|
- debug.cmd - copies assemblies to Oqtane bin folder when in Debug mode<br />
|
||||||
- release.cmd - creates nuget package and deploys to Oqtane wwwroot/modules folder when in Release mode<br /><br />
|
- release.cmd - creates nuget package and deploys to Oqtane wwwroot/modules folder when in Release mode<br /><br />
|
||||||
[RootPath]Server\<br />
|
[RootPath]Server\<br />
|
||||||
- [Owner].[Module]s.Server.csproj - server project<br />
|
- [Owner].[Module].Server.csproj - server project<br />
|
||||||
- Controllers\[Module]Controller.cs - API methods implemented using a REST pattern<br />
|
- Controllers\[Module]Controller.cs - API methods implemented using a REST pattern<br />
|
||||||
- Manager\[Module]Manager.cs - implements optional module interfaces for features such as import/export of content<br />
|
- Manager\[Module]Manager.cs - implements optional module interfaces for features such as import/export of content<br />
|
||||||
- Repository\I[Module]Repository.cs - interface for defining repository methods<br />
|
- Repository\I[Module]Repository.cs - interface for defining repository methods<br />
|
||||||
- Repository\[Module]Respository.cs - implements repository interface methods for data access using EF Core<br />
|
- Repository\[Module]Respository.cs - implements repository interface methods for data access using EF Core<br />
|
||||||
- Repository\[Module]Context.cs - provides a DB Context for data access<br />
|
- Repository\[Module]Context.cs - provides a DB Context for data access<br />
|
||||||
- Scripts\[Owner].[Module]s.1.0.0.sql - database schema definition script<br />
|
- Scripts\[Owner].[Module].1.0.0.sql - database schema definition script<br />
|
||||||
- Scripts\[Owner].[Module]s.Uninstall.sql - database uninstall script<br />
|
- Scripts\[Owner].[Module].Uninstall.sql - database uninstall script<br />
|
||||||
- wwwroot\Module.css - module style sheet<br /><br />
|
- wwwroot\Module.css - module style sheet<br /><br />
|
||||||
[RootPath]Shared\<br />
|
[RootPath]Shared\<br />
|
||||||
- [Owner].[Module]s.csproj - shared project<br />
|
- [Owner].[Module].csproj - shared project<br />
|
||||||
- Models\[Module].cs - model definition<br /><br />
|
- Models\[Module].cs - model definition<br /><br />
|
||||||
|
|
||||||
<!-- The content above is for informational purposes only and can be safely removed -->
|
<!-- The content above is for informational purposes only and can be safely removed -->
|
||||||
@ -73,7 +73,8 @@ else
|
|||||||
@code {
|
@code {
|
||||||
public override List<Resource> Resources => new List<Resource>()
|
public override List<Resource> Resources => new List<Resource>()
|
||||||
{
|
{
|
||||||
new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" }
|
new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" },
|
||||||
|
new Resource { ResourceType = ResourceType.Script, Url = ModulePath() + "Module.js" }
|
||||||
};
|
};
|
||||||
|
|
||||||
List<[Module]> _[Module]s;
|
List<[Module]> _[Module]s;
|
||||||
@ -95,7 +96,7 @@ else
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await [Module]Service.Delete[Module]Async([Module].[Module]Id);
|
await [Module]Service.Delete[Module]Async([Module].[Module]Id, ModuleState.ModuleId);
|
||||||
await logger.LogInformation("[Module] Deleted {[Module]}", [Module]);
|
await logger.LogInformation("[Module] Deleted {[Module]}", [Module]);
|
||||||
_[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId);
|
_[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId);
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
15
Oqtane.Server/wwwroot/Modules/Templates/External/Client/Interop.cs
vendored
Normal file
15
Oqtane.Server/wwwroot/Modules/Templates/External/Client/Interop.cs
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using Microsoft.JSInterop;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace [Owner].[Module]
|
||||||
|
{
|
||||||
|
public class Interop
|
||||||
|
{
|
||||||
|
private readonly IJSRuntime _jsRuntime;
|
||||||
|
|
||||||
|
public Interop(IJSRuntime jsRuntime)
|
||||||
|
{
|
||||||
|
_jsRuntime = jsRuntime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using Oqtane.Modules;
|
using Oqtane.Modules;
|
||||||
|
|
||||||
namespace [Owner].[Module]s
|
namespace [Owner].[Module]
|
||||||
{
|
{
|
||||||
public class ModuleInfo : IModule
|
public class ModuleInfo : IModule
|
||||||
{
|
{
|
||||||
@ -12,7 +12,7 @@ namespace [Owner].[Module]s
|
|||||||
Version = "1.0.0",
|
Version = "1.0.0",
|
||||||
ServerManagerType = "[ServerManagerType]",
|
ServerManagerType = "[ServerManagerType]",
|
||||||
ReleaseVersions = "1.0.0",
|
ReleaseVersions = "1.0.0",
|
||||||
Dependencies = "[Owner].[Module]s.Shared.Oqtane"
|
Dependencies = "[Owner].[Module].Shared.Oqtane"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using [Owner].[Module]s.Models;
|
using [Owner].[Module].Models;
|
||||||
|
|
||||||
namespace [Owner].[Module]s.Services
|
namespace [Owner].[Module].Services
|
||||||
{
|
{
|
||||||
public interface I[Module]Service
|
public interface I[Module]Service
|
||||||
{
|
{
|
||||||
Task<List<[Module]>> Get[Module]sAsync(int ModuleId);
|
Task<List<Models.[Module]>> Get[Module]sAsync(int ModuleId);
|
||||||
|
|
||||||
Task<[Module]> Get[Module]Async(int [Module]Id);
|
Task<Models.[Module]> Get[Module]Async(int [Module]Id, int ModuleId);
|
||||||
|
|
||||||
Task<[Module]> Add[Module]Async([Module] [Module]);
|
Task<Models.[Module]> Add[Module]Async(Models.[Module] [Module]);
|
||||||
|
|
||||||
Task<[Module]> Update[Module]Async([Module] [Module]);
|
Task<Models.[Module]> Update[Module]Async(Models.[Module] [Module]);
|
||||||
|
|
||||||
Task Delete[Module]Async(int [Module]Id);
|
Task Delete[Module]Async(int [Module]Id, int ModuleId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@ using System.Threading.Tasks;
|
|||||||
using Oqtane.Modules;
|
using Oqtane.Modules;
|
||||||
using Oqtane.Services;
|
using Oqtane.Services;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using [Owner].[Module]s.Models;
|
using [Owner].[Module].Models;
|
||||||
|
|
||||||
namespace [Owner].[Module]s.Services
|
namespace [Owner].[Module].Services
|
||||||
{
|
{
|
||||||
public class [Module]Service : ServiceBase, I[Module]Service, IService
|
public class [Module]Service : ServiceBase, I[Module]Service, IService
|
||||||
{
|
{
|
||||||
@ -18,32 +18,32 @@ namespace [Owner].[Module]s.Services
|
|||||||
_siteState = siteState;
|
_siteState = siteState;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string Apiurl=> CreateApiUrl(_siteState.Alias, "[Module]");
|
private string Apiurl => CreateApiUrl(_siteState.Alias, "[Module]");
|
||||||
|
|
||||||
public async Task<List<[Module]>> Get[Module]sAsync(int ModuleId)
|
public async Task<List<Models.[Module]>> Get[Module]sAsync(int ModuleId)
|
||||||
{
|
{
|
||||||
List<[Module]> [Module]s = await GetJsonAsync<List<[Module]>>($"{Apiurl}?moduleid={ModuleId}");
|
List<Models.[Module]> [Module]s = await GetJsonAsync<List<Models.[Module]>>(CreateAuthorizationPolicyUrl($"{Apiurl}?moduleid={ModuleId}", ModuleId));
|
||||||
return [Module]s.OrderBy(item => item.Name).ToList();
|
return [Module]s.OrderBy(item => item.Name).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<[Module]> Get[Module]Async(int [Module]Id)
|
public async Task<Models.[Module]> Get[Module]Async(int [Module]Id, int ModuleId)
|
||||||
{
|
{
|
||||||
return await GetJsonAsync<[Module]>($"{Apiurl}/{[Module]Id}");
|
return await GetJsonAsync<Models.[Module]>(CreateAuthorizationPolicyUrl($"{Apiurl}/{[Module]Id}", ModuleId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<[Module]> Add[Module]Async([Module] [Module])
|
public async Task<Models.[Module]> Add[Module]Async(Models.[Module] [Module])
|
||||||
{
|
{
|
||||||
return await PostJsonAsync<[Module]>($"{Apiurl}?entityid={[Module].ModuleId}", [Module]);
|
return await PostJsonAsync<Models.[Module]>(CreateAuthorizationPolicyUrl($"{Apiurl}", [Module].ModuleId), [Module]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<[Module]> Update[Module]Async([Module] [Module])
|
public async Task<Models.[Module]> Update[Module]Async(Models.[Module] [Module])
|
||||||
{
|
{
|
||||||
return await PutJsonAsync<[Module]>($"{Apiurl}/{[Module].[Module]Id}?entityid={[Module].ModuleId}", [Module]);
|
return await PutJsonAsync<Models.[Module]>(CreateAuthorizationPolicyUrl($"{Apiurl}/{[Module].[Module]Id}", [Module].ModuleId), [Module]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Delete[Module]Async(int [Module]Id)
|
public async Task Delete[Module]Async(int [Module]Id, int ModuleId)
|
||||||
{
|
{
|
||||||
await DeleteAsync($"{Apiurl}/{[Module]Id}");
|
await DeleteAsync(CreateAuthorizationPolicyUrl($"{Apiurl}/{[Module]Id}", ModuleId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
@namespace [Owner].[Module]s
|
@namespace [Owner].[Module]
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject ISettingService SettingService
|
@inject ISettingService SettingService
|
||||||
|
|
||||||
<table class="table table-borderless">
|
<table class="table table-borderless">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="Setting" class="control-label">Setting: </label>
|
<Label For="value" HelpText="Enter a value">Name: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" class="form-control" @bind="_value" />
|
<input id="value" type="text" class="form-control" @bind="@_value" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
<Authors>[Owner]</Authors>
|
<Authors>[Owner]</Authors>
|
||||||
<Company>[Owner]</Company>
|
<Company>[Owner]</Company>
|
||||||
<Description>[Description]</Description>
|
<Description>[Description]</Description>
|
||||||
<Product>[Owner].[Module]s</Product>
|
<Product>[Owner].[Module]</Product>
|
||||||
<Copyright>[Owner]</Copyright>
|
<Copyright>[Owner]</Copyright>
|
||||||
<AssemblyName>[Owner].[Module]s.Client.Oqtane</AssemblyName>
|
<AssemblyName>[Owner].[Module].Client.Oqtane</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -21,12 +21,12 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Shared\[Owner].[Module]s.Shared.csproj" />
|
<ProjectReference Include="..\Shared\[Owner].[Module].Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Oqtane.Client" Version="1.0.1" />
|
[ClientReference]
|
||||||
<PackageReference Include="Oqtane.Shared" Version="1.0.1" />
|
[SharedReference]
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
@ -6,9 +6,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Client\[Owner].[Module]s.Client.csproj" />
|
<ProjectReference Include="..\Client\[Owner].[Module].Client.csproj" />
|
||||||
<ProjectReference Include="..\Server\[Owner].[Module]s.Server.csproj" />
|
<ProjectReference Include="..\Server\[Owner].[Module].Server.csproj" />
|
||||||
<ProjectReference Include="..\Shared\[Owner].[Module]s.Shared.csproj" />
|
<ProjectReference Include="..\Shared\[Owner].[Module].Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>[Owner].[Module]s</id>
|
<id>[Owner].[Module]</id>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<authors>[Owner]</authors>
|
<authors>[Owner]</authors>
|
||||||
<owners>[Owner]</owners>
|
<owners>[Owner]</owners>
|
||||||
<title>[Module]s</title>
|
<title>[Module]</title>
|
||||||
<description>[Module]s</description>
|
<description>[Module]</description>
|
||||||
<copyright>[Owner]</copyright>
|
<copyright>[Owner]</copyright>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<license type="expression">MIT</license>
|
<license type="expression">MIT</license>
|
||||||
@ -20,12 +20,12 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.dll" target="lib\netstandard2.1" />
|
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module].Client.Oqtane.dll" target="lib\netstandard2.1" />
|
||||||
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.pdb" target="lib\netstandard2.1" />
|
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module].Client.Oqtane.pdb" target="lib\netstandard2.1" />
|
||||||
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.dll" target="lib\netcoreapp3.1" />
|
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module].Server.Oqtane.dll" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" target="lib\netcoreapp3.1" />
|
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module].Server.Oqtane.pdb" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" target="lib\netstandard2.1" />
|
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module].Shared.Oqtane.dll" target="lib\netstandard2.1" />
|
||||||
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" target="lib\netstandard2.1" />
|
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module].Shared.Oqtane.pdb" target="lib\netstandard2.1" />
|
||||||
<file src="..\Server\wwwroot\**\*.*" target="wwwroot" />
|
<file src="..\Server\wwwroot\**\*.*" target="wwwroot" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
@ -1,7 +1,7 @@
|
|||||||
XCOPY "..\Client\bin\Debug\netstandard2.1\[Owner].[Module]s.Client.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Client\bin\Debug\netstandard2.1\[Owner].[Module].Client.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Client\bin\Debug\netstandard2.1\[Owner].[Module]s.Client.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Client\bin\Debug\netstandard2.1\[Owner].[Module].Client.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module].Server.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module].Server.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module].Shared.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module].Shared.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Server\wwwroot\Modules\[Owner].[Module]s\*" "..\..\[RootFolder]\Oqtane.Server\wwwroot\Modules\[Owner].[Module]s\" /Y /S /I
|
XCOPY "..\Server\wwwroot\Modules\[Owner].[Module]\*" "..\..\[RootFolder]\Oqtane.Server\wwwroot\Modules\[Owner].[Module]\" /Y /S /I
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user