diff --git a/src/components/Settings/SoftwareUpgradeSettings.vue b/src/components/Settings/SoftwareUpgradeSettings.vue index 5b0a6929..a9531304 100644 --- a/src/components/Settings/SoftwareUpgradeSettings.vue +++ b/src/components/Settings/SoftwareUpgradeSettings.vue @@ -51,25 +51,34 @@ <v-list-item> <v-list-item-content> <v-list-item-title> Select a release to upgrade to:</v-list-item-title> + <v-list-item-subtitle> + Minimum required version: {{ minimum?.tag_name }}</v-list-item-subtitle + > <span v-if="loading"> <v-alert>Loading releases...</v-alert></span> + <v-alert v-if="!loading && !filteredReleases?.length">No releases to show.</v-alert> <v-radio-group v-model="selectedRelease"> <v-radio v-for="release in filteredReleases" :key="release.tag_name" :disabled=" - isCurrentRelease(release) || !isUpgradeOrAllowedDowngrade(release, current) + isCurrentRelease(release) || + !isUpgradeOrAllowedDowngrade(release, current) || + isBelowMinimum(release) " :label="`${release.tag_name}${ !isUpgradeOrAllowedDowngrade(release, current) - ? ' (cannot downgrade)' - : '' || (isCurrentRelease(release) ? ' (current)' : '') + ? ' (cannot downgrade, ' + : ' (' || (isCurrentRelease(release) ? ' (current, ' : '(') + }${ + isVersionUnstable(release) + ? `${isBelowMinimum(release) ? 'below minimum' : 'unstable'})` + : ')' }`" :value="release.tag_name" > </v-radio> </v-radio-group> - <v-alert v-if="!loading && !filteredReleases?.length">No releases to show.</v-alert> <div> <v-alert v-if="showPrereleases" color="primary" max-width="500px"> You are viewing prereleases, please install such versions at your own risk! @@ -141,15 +150,14 @@ async function loadReleases() { } const filteredReleases = computed(() => { - const currentlyUnstable = isCurrentUnstable(); return loadedClientReleases.value.filter((release) => { - const isMinimumVersion = minor(release.tag_name) === minor(minimum.value!.tag_name); + const isMinimumVersionOrHigher = minor(release.tag_name) === minor(minimum.value!.tag_name); const isReleaseCandidate = isVersionUnstable(release); const isDraft = release.draft; return ( - isMinimumVersion && - (currentlyUnstable || showPrereleases.value || !isReleaseCandidate) && + isMinimumVersionOrHigher && + (isCurrentUnstable() || showPrereleases.value || !isReleaseCandidate) && !isDraft ); }); @@ -166,7 +174,7 @@ function isCurrentUnstable() { } function isVersionUnstable(release?: IRelease) { - if (release?.tag_name.length) { + if (release?.tag_name?.length) { return ( release.prerelease || release.tag_name.includes("rc") || release.tag_name.includes("unstable") ); @@ -174,6 +182,10 @@ function isVersionUnstable(release?: IRelease) { return false; } +function isBelowMinimum(release: IRelease) { + return compare(release.tag_name, minimum.value!.tag_name) === -1; +} + function isUpgradeOrAllowedDowngrade(release: IRelease, current?: IRelease) { // If no current release is known, we need to throw if (!current) { @@ -182,7 +194,11 @@ function isUpgradeOrAllowedDowngrade(release: IRelease, current?: IRelease) { if (allowDowngrade.value) { return true; } - return compare(release.tag_name, current.tag_name) !== -1; + + return ( + compare(release.tag_name, current.tag_name) !== -1 && + compare(minimum.value!.tag_name, current.tag_name) !== -1 + ); } function isCurrentRelease(release: IRelease) { diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index 68da6365..46183b84 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -50,7 +50,14 @@ <v-btn icon @click="showHelp = true"> <v-icon>help</v-icon> </v-btn> - <v-dialog v-model="showHelp" eager fullscreen transition="dialog-bottom-transition" width="90%"> + <v-dialog + v-model="showHelp" + style="background-color: white" + eager + fullscreen + transition="dialog-bottom-transition" + width="90%" + > <v-btn @click="showHelp = false" >Close Help <v-icon>close</v-icon> @@ -61,7 +68,12 @@ Showing help from docs.fdm-monster.net </v-toolbar> - <iframe height="100%" src="https://docs.fdm-monster.net/software_usage" width="100%" /> + <iframe + style="background-color: white" + height="100%" + src="https://docs.fdm-monster.net" + width="100%" + /> </v-card> </v-dialog> </v-app-bar>