mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
fix: 解决获取版本升级信息失败的问题 (#4914)
This commit is contained in:
parent
34eb20a679
commit
75c23271df
@ -42,10 +42,19 @@ func (u *UpgradeService) SearchUpgrade() (*dto.UpgradeInfo, error) {
|
||||
}
|
||||
|
||||
upgrade.TestVersion, upgrade.NewVersion, upgrade.LatestVersion = u.loadVersionByMode(DeveloperMode.Value, currentVersion.Value)
|
||||
itemVersion := upgrade.LatestVersion
|
||||
if upgrade.NewVersion != "" {
|
||||
var itemVersion string
|
||||
if len(upgrade.LatestVersion) != 0 {
|
||||
itemVersion = upgrade.LatestVersion
|
||||
}
|
||||
if len(upgrade.NewVersion) != 0 {
|
||||
itemVersion = upgrade.NewVersion
|
||||
}
|
||||
if (global.CONF.System.Mode == "dev" || DeveloperMode.Value == "enable") && len(upgrade.TestVersion) != 0 {
|
||||
itemVersion = upgrade.TestVersion
|
||||
}
|
||||
if len(itemVersion) == 0 {
|
||||
return &upgrade, nil
|
||||
}
|
||||
notes, err := u.loadReleaseNotes(fmt.Sprintf("%s/%s/%s/release/1panel-%s-release-notes", global.CONF.System.RepoUrl, global.CONF.System.Mode, itemVersion, itemVersion))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("load releases-notes of version %s failed, err: %v", itemVersion, err)
|
||||
|
Loading…
Reference in New Issue
Block a user