package management modifications

This commit is contained in:
Shaun Walker
2021-06-24 18:02:01 -04:00
parent 161ab56701
commit 52bcdb12c5
5 changed files with 126 additions and 125 deletions

View File

@ -7,12 +7,10 @@
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_packages != null)
{
<TabStrip>
@if (_packages.Count > 0)
{
<TabPanel Name="Download" ResourceKey="Download">
@if (_packages != null && _packages.Count > 0)
{
<ModuleMessage Type="MessageType.Info" Message="Download one or more modules from the list below. Once you are ready click Install to complete the installation."></ModuleMessage>
<table class="table table-borderless" style=" margin: auto; width: 50% !important;">
@ -39,8 +37,12 @@
</td>
</Row>
</Pager>
</TabPanel>
}
else
{
<ModuleMessage Type="MessageType.Info" Message="No Modules Available For Download "></ModuleMessage>
}
</TabPanel>
<TabPanel Name="Upload" ResourceKey="Upload">
<table class="table table-borderless">
<tr>
@ -57,7 +59,6 @@
<button type="button" class="btn btn-success" @onclick="InstallModules">@Localizer["Install"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
}
@code {
private List<Package> _packages;
@ -83,6 +84,8 @@
var moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
_packages = await PackageService.GetPackagesAsync("module", _search);
if (_packages != null)
{
foreach (Package package in _packages.ToArray())
{
if (moduledefinitions.Exists(item => item.PackageName == package.PackageId))
@ -91,6 +94,7 @@
}
}
}
}
private async Task Search()
{

View File

@ -7,12 +7,10 @@
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_packages != null)
{
<TabStrip>
@if (_packages.Count > 0)
{
<TabPanel Name="Download" ResourceKey="Download">
@if (_packages != null && _packages.Count > 0)
{
<ModuleMessage Type="MessageType.Info" Message="Download one or more themes from the list below. Once you are ready click Install to complete the installation."></ModuleMessage>
<table class="table table-borderless" style=" margin: auto; width: 50% !important;">
@ -39,8 +37,12 @@
</td>
</Row>
</Pager>
</TabPanel>
}
else
{
<ModuleMessage Type="MessageType.Info" Message="No Themes Available For Download"></ModuleMessage>
}
</TabPanel>
<TabPanel Name="Upload" ResourceKey="Upload">
<table class="table table-borderless">
<tr>
@ -57,7 +59,6 @@
<button type="button" class="btn btn-success" @onclick="InstallThemes">@Localizer["Install"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
}
@code {
private List<Package> _packages;
@ -83,6 +84,8 @@
var themes = await ThemeService.GetThemesAsync();
_packages = await PackageService.GetPackagesAsync("theme", _search);
if (_packages != null)
{
foreach (Package package in _packages.ToArray())
{
if (themes.Exists(item => item.PackageName == package.PackageId))
@ -91,6 +94,7 @@
}
}
}
}
private async Task Search()
{

View File

@ -6,11 +6,9 @@
@inject IInstallationService InstallationService
@inject IStringLocalizer<Index> Localizer
@if (_package != null)
{
<TabStrip>
<TabPanel Name="Download" ResourceKey="Download">
@if (_upgradeavailable)
@if (_package != null && _upgradeavailable)
{
<ModuleMessage Type="MessageType.Info" Message="Select The Download Button To Download The Framework Upgrade Package And Then Select Upgrade"></ModuleMessage>
<button type="button" class="btn btn-primary" @onclick=@(async () => await Download(Constants.PackageId, @_package.Version))>@Localizer["Download"] @_package.Version</button>
@ -36,7 +34,6 @@
<button type="button" class="btn btn-success" @onclick="Upgrade">@Localizer["Upgrade"]</button>
</TabPanel>
</TabStrip>
}
@code {
private Package _package;

View File

@ -172,13 +172,8 @@
}
// format path and remove alias
path = path.Replace("//", "/");
if (!path.EndsWith("/"))
{
path += "/";
}
path = path.Replace("//", "/"); // in case of doubleslash at end
path += (!path.EndsWith("/")) ? "/" : "";
if (SiteState.Alias.Path != "" && path.StartsWith(SiteState.Alias.Path))
{
path = path.Substring(SiteState.Alias.Path.Length + 1);

View File

@ -1,4 +1,5 @@
del "*.nupkg"
del "*.zip"
dotnet clean -c Release ..\Oqtane.sln
dotnet build -c Release ..\Oqtane.sln
copy /Y/B/V "..\Oqtane.Server\bin\Release\net5.0\System.Drawing.Common.dll" "..\Oqtane.Server\bin\Release\net5.0\publish\System.Drawing.Common.dll"