mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-08-16 04:39:15 +00:00
feat: keep upgrade button appear (#1003)
* feat: keep upgrade button appear Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: copilot review Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
44297ada16
commit
d4223ad2ae
@ -55,8 +55,12 @@ export default {
|
|||||||
!this.latestUpgrade.isUpgradeFailed;
|
!this.latestUpgrade.isUpgradeFailed;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
canUpgrade() {
|
||||||
|
return this.versionOptions.length > 0 && !this.isUpgradeInProgress;
|
||||||
|
},
|
||||||
|
|
||||||
versionOptions() {
|
versionOptions() {
|
||||||
const versions = this.$store.getters['harvester/all'](HCI.VERSION);
|
const versions = this.$store.getters['harvester/all'](HCI.VERSION) || [];
|
||||||
|
|
||||||
return versions.map((V) => V.metadata.name);
|
return versions.map((V) => V.metadata.name);
|
||||||
},
|
},
|
||||||
@ -154,14 +158,23 @@ export default {
|
|||||||
:cluster="currentCluster.nameDisplay"
|
:cluster="currentCluster.nameDisplay"
|
||||||
/>
|
/>
|
||||||
</h1>
|
</h1>
|
||||||
|
<span
|
||||||
|
v-clean-tooltip="{
|
||||||
|
content: canUpgrade ? t('harvester.upgradePage.upgradeAvailable') : t('harvester.upgradePage.upgradeUnavailable'),
|
||||||
|
triggers: ['hover', 'focus', 'touch'],
|
||||||
|
}"
|
||||||
|
class="upgrade-btn-wrap"
|
||||||
|
:tabindex="canUpgrade ? -1 : 0"
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
v-if="versionOptions.length && !isUpgradeInProgress"
|
:disabled="!canUpgrade"
|
||||||
type="button"
|
type="button"
|
||||||
class="btn bg-warning btn-sm"
|
class="btn bg-warning btn-sm"
|
||||||
@click="open"
|
@click="open"
|
||||||
>
|
>
|
||||||
<t k="harvester.upgradePage.upgrade" />
|
<t k="harvester.upgradePage.upgrade" />
|
||||||
</button>
|
</button>
|
||||||
|
</span>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ModalWithCard
|
<ModalWithCard
|
||||||
@ -296,6 +309,18 @@ export default {
|
|||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.upgrade-btn-wrap {
|
||||||
|
display: inline-flex;
|
||||||
|
|
||||||
|
button {
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.currentVersion {
|
.currentVersion {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -1099,6 +1099,8 @@ harvester:
|
|||||||
downloadLog: Download Log
|
downloadLog: Download Log
|
||||||
logStatus: Log Download Status
|
logStatus: Log Download Status
|
||||||
dismissMessage: Dismiss it
|
dismissMessage: Dismiss it
|
||||||
|
upgradeAvailable: Upgrade Available
|
||||||
|
upgradeUnavailable: Upgrade Unavailable
|
||||||
upgradeInfo:
|
upgradeInfo:
|
||||||
warning: WARNING
|
warning: WARNING
|
||||||
doc: Read the <a href="{url}" target="_blank">documentation</a> before starting the upgrade process. Ensure that you complete procedures that are relevant to your environment and the version you are upgrading to.
|
doc: Read the <a href="{url}" target="_blank">documentation</a> before starting the upgrade process. Ensure that you complete procedures that are relevant to your environment and the version you are upgrading to.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user