Skip to content

Commit 54a893f

Browse files
pujitmzackspear
authored andcommitted
feat(web): open official release notes via header os version
1 parent 04a3362 commit 54a893f

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

web/components/HeaderOsVersion.ce.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useI18n } from 'vue-i18n';
1010
import 'tailwindcss/tailwind.css';
1111
import '~/assets/main.css';
1212
13-
import { WEBGUI_TOOLS_DOWNGRADE, WEBGUI_TOOLS_UPDATE } from '~/helpers/urls';
13+
import { getReleaseNotesUrl, WEBGUI_TOOLS_DOWNGRADE, WEBGUI_TOOLS_UPDATE } from '~/helpers/urls';
1414
import { useServerStore } from '~/store/server';
1515
import { useUpdateOsStore } from '~/store/updateOs';
1616
import { useUpdateOsActionsStore } from '~/store/updateOsActions';
@@ -70,10 +70,12 @@ const updateOsStatus = computed(() => {
7070

7171
<template>
7272
<div class="flex flex-row justify-start gap-x-4px">
73-
<button
73+
<a
7474
class="group leading-none"
7575
:title="t('View release notes')"
76-
@click="updateOsActionsStore.viewReleaseNotes(t('{0} Release Notes', [osVersion]))"
76+
:href="getReleaseNotesUrl(osVersion).toString()"
77+
target="_blank"
78+
rel="noopener"
7779
>
7880
<UiBadge
7981
color="custom"
@@ -84,7 +86,7 @@ const updateOsStatus = computed(() => {
8486
>
8587
{{ osVersion }}
8688
</UiBadge>
87-
</button>
89+
</a>
8890
<component
8991
:is="updateOsStatus.href ? 'a' : 'button'"
9092
v-if="updateOsStatus"

web/helpers/urls.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ const WEBGUI_TOOLS_UPDATE = new URL('/Tools/Update', WEBGUI);
2424
const OS_RELEASES = new URL(import.meta.env.VITE_OS_RELEASES ?? 'https://releases.unraid.net/os');
2525

2626
const DOCS_RELEASE_NOTES = new URL('/go/release-notes/', DOCS);
27+
28+
/**
29+
* @param version - An Unraid OS version string (x.x.x-suffix).
30+
* Suffix indicates special releases, such as RCs or betas.
31+
* @returns A URL object pointing to the release notes for the specified Unraid OS version.
32+
*/
33+
const getReleaseNotesUrl = (version: string): URL => {
34+
const osVersion = version.split('-')[0];
35+
return new URL(`/unraid-os/release-notes/${osVersion}`, DOCS);
36+
}
37+
2738
const DOCS_REGISTRATION_LICENSING = new URL('/go/faq-licensing/', DOCS);
2839
const DOCS_REGISTRATION_REPLACE_KEY = new URL('/go/changing-the-flash-device/', DOCS);
2940

@@ -43,6 +54,7 @@ export {
4354
OS_RELEASES,
4455
DOCS,
4556
DOCS_RELEASE_NOTES,
57+
getReleaseNotesUrl,
4658
DOCS_REGISTRATION_LICENSING,
4759
DOCS_REGISTRATION_REPLACE_KEY,
4860
WEBGUI,
@@ -54,4 +66,4 @@ export {
5466
WEBGUI_TOOLS_UPDATE,
5567
SUPPORT,
5668
UNRAID_NET_SUPPORT,
57-
};
69+
};

0 commit comments

Comments
 (0)