Revert "fix #5894 - allow user to select upgrade version"
This commit is contained in:
@@ -11,22 +11,11 @@
|
||||
{
|
||||
<TabStrip>
|
||||
<TabPanel Name="Download" ResourceKey="Download">
|
||||
@if (_versions.Count > 0 && _upgradeable)
|
||||
@if (_package != null && _upgradeavailable)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="version" HelpText="Select the framework upgrade version" ResourceKey="Version">Version: </Label>
|
||||
<div class="col-sm-9">
|
||||
<select id="backup" class="form-select" @bind="@_version">
|
||||
@foreach (var version in _versions)
|
||||
{
|
||||
<option value="@version">@version</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="backup" HelpText="Specify if you want to backup files during the upgrade process. Disabling this option will reduce the time required for the upgrade." ResourceKey="Backup">Backup Files? </Label>
|
||||
<Label Class="col-sm-3" HelpText="Specify if you want to backup files during the upgrade process. Disabling this option will reduce the time required for the upgrade." ResourceKey="Backup">Backup Files? </Label>
|
||||
<div class="col-sm-9">
|
||||
<select id="backup" class="form-select" @bind="@_backup">
|
||||
<option value="True">@SharedLocalizer["Yes"]</option>
|
||||
@@ -38,7 +27,7 @@
|
||||
<br />
|
||||
@if (!_downloaded)
|
||||
{
|
||||
<button type="button" class="btn btn-primary" @onclick=@(async () => await Download(Constants.PackageId, _version))>@SharedLocalizer["Download"] @_version</button>
|
||||
<button type="button" class="btn btn-primary" @onclick=@(async () => await Download(Constants.PackageId, @_package.Version))>@SharedLocalizer["Download"] @_package.Version</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -77,9 +66,8 @@
|
||||
@code {
|
||||
private bool _initialized = false;
|
||||
private bool _downloaded = false;
|
||||
private List<string> _versions = new List<string>();
|
||||
private string _version;
|
||||
private bool _upgradeable = false;
|
||||
private Package _package;
|
||||
private bool _upgradeavailable = false;
|
||||
private string _backup = "True";
|
||||
|
||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
||||
@@ -96,18 +84,18 @@
|
||||
{
|
||||
AddModuleMessage(Localizer["Disclaimer.Text"], MessageType.Warning);
|
||||
|
||||
var packages = await PackageService.GetPackagesAsync("framework", "", "", "");
|
||||
List<Package> packages = await PackageService.GetPackagesAsync("framework", "", "", "");
|
||||
if (packages != null)
|
||||
{
|
||||
_version = packages.First(item => item.PackageId.StartsWith(Constants.PackageId)).Version;
|
||||
foreach (var version in Constants.ReleaseVersions.Split(','))
|
||||
_package = packages.Where(item => item.PackageId.StartsWith(Constants.PackageId)).FirstOrDefault();
|
||||
if (_package != null)
|
||||
{
|
||||
if (Version.Parse(version).CompareTo(Version.Parse(Constants.Version)) > 0)
|
||||
{
|
||||
_versions.Add(version);
|
||||
}
|
||||
_upgradeavailable = (Version.Parse(_package.Version).CompareTo(Version.Parse(Constants.Version)) > 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_package = new Package { Name = Constants.PackageId, Version = Constants.Version };
|
||||
}
|
||||
_upgradeable = (Version.Parse(_version).CompareTo(Version.Parse(Constants.Version)) > 0);
|
||||
}
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
@@ -156,10 +156,4 @@
|
||||
<data name="Backup.HelpText" xml:space="preserve">
|
||||
<value>Specify if you want to backup files during the upgrade process. Disabling this option will reduce the time required for the upgrade.</value>
|
||||
</data>
|
||||
<data name="Version.Text" xml:space="preserve">
|
||||
<value>Version:</value>
|
||||
</data>
|
||||
<data name="Version.HelpText" xml:space="preserve">
|
||||
<value>Select the framework upgrade version</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user