mirror of
https://github.com/unraid/api.git
synced 2026-01-07 00:59:48 -06:00
feat: downgradeOs callback for non stable osCurrentBranch
This commit is contained in:
@@ -39,7 +39,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
|
||||
const serverStore = useServerStore();
|
||||
|
||||
const { rebootType } = storeToRefs(serverStore);
|
||||
const { rebootType, osVersionBranch } = storeToRefs(serverStore);
|
||||
|
||||
const subtitle = computed(() => {
|
||||
if (rebootType.value === 'update') {
|
||||
@@ -48,6 +48,8 @@ const subtitle = computed(() => {
|
||||
return '';
|
||||
});
|
||||
|
||||
const showExternalDowngrade = computed(() => osVersionBranch.value !== 'stable');
|
||||
|
||||
onBeforeMount(() => {
|
||||
serverStore.setRebootVersion(props.rebootVersion);
|
||||
});
|
||||
@@ -59,6 +61,7 @@ onBeforeMount(() => {
|
||||
:title="t('Downgrade Unraid OS')"
|
||||
:subtitle="subtitle"
|
||||
:downgrade-not-available="restoreVersion === '' && rebootType === ''"
|
||||
:show-external-downgrade="showExternalDowngrade"
|
||||
:t="t"
|
||||
/>
|
||||
<UpdateOsDowngrade
|
||||
|
||||
@@ -24,6 +24,7 @@ import BrandLoadingWhite from '~/components/Brand/LoadingWhite.vue';
|
||||
export interface Props {
|
||||
downgradeNotAvailable?: boolean;
|
||||
restoreVersion?: string | undefined;
|
||||
showExternalDowngrade?: boolean;
|
||||
t: ComposerTranslation;
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
@@ -31,6 +32,7 @@ export interface Props {
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
downgradeNotAvailable: false,
|
||||
restoreVersion: undefined,
|
||||
showExternalDowngrade: false,
|
||||
title: undefined,
|
||||
subtitle: undefined,
|
||||
});
|
||||
@@ -68,11 +70,13 @@ const regExpOutput = computed(() => {
|
||||
const showRebootButton = computed(() => rebootType.value === 'downgrade' || rebootType.value === 'update');
|
||||
|
||||
const checkButton = computed((): ButtonProps => {
|
||||
if (showRebootButton.value) {
|
||||
if (showRebootButton.value || props.showExternalDowngrade) {
|
||||
return {
|
||||
btnStyle: 'outline',
|
||||
click: () => {
|
||||
accountStore.updateOs();
|
||||
props.showExternalDowngrade
|
||||
? accountStore.downgradeOs()
|
||||
: accountStore.updateOs();
|
||||
},
|
||||
icon: ArrowTopRightOnSquareIcon,
|
||||
text: props.t('More options'),
|
||||
|
||||
Reference in New Issue
Block a user