@@ -7,6 +7,9 @@ const updateOsStore = useUpdateOsStore();
77const { changelogModalVisible } = storeToRefs (updateOsStore );
88const { t } = useI18n ();
99
10+ onBeforeMount (() => {
11+ // Register custom elements if needed for ColorSwitcherCe
12+ });
1013
1114async function showChangelogModalFromReleasesEndpoint() {
1215 const response = await fetch (' https://releases.unraid.net/os?branch=stable¤t_version=6.12.3' );
@@ -26,6 +29,7 @@ function showChangelogModalWithTestData() {
2629 sha256: ' 1234567890'
2730 });
2831}
32+
2933function showChangelogWithoutPretty() {
3034 updateOsStore .setReleaseForUpdate ({
3135 version: ' 6.12.3' ,
@@ -52,37 +56,59 @@ function showChangelogBrokenParse() {
5256 });
5357}
5458
59+ function showChangelogFromLocalhost() {
60+ updateOsStore .setReleaseForUpdate ({
61+ version: ' 6.12.3' ,
62+ date: ' 2023-07-15' ,
63+ changelog: ' https://raw.githubusercontent.com/unraid/docs/main/docs/unraid-os/release-notes/6.12.3.md' ,
64+ changelogPretty: ' http://localhost:3000/unraid-os/release-notes/6.12.3' ,
65+ name: ' 6.12.3' ,
66+ isEligible: true ,
67+ isNewer: true ,
68+ sha256: ' 1234567890'
69+ });
70+ }
71+
5572 </script >
5673
5774<template >
5875 <div class =" container mx-auto p-6" >
5976 <h1 class =" text-2xl font-bold mb-6" >Changelog</h1 >
6077 <UpdateOsChangelogModal :t =" t" :open =" changelogModalVisible" />
61- <div class =" mb-6 flex flex-col gap-4 max-w-md" >
62- <button
63- class =" px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
64- @click =" showChangelogModalFromReleasesEndpoint"
65- >
66- Test Changelog Modal (from releases endpoint)
67- </button >
68- <button
69- class =" px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600"
70- @click =" showChangelogModalWithTestData"
71- >
72- Test Changelog Modal (with test data)
73- </button >
74- <button
75- class =" px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600"
76- @click =" showChangelogWithoutPretty"
77- >
78- Test Without Pretty Changelog
79- </button >
80- <button
81- class =" px-4 py-2 bg-yellow-500 text-white rounded hover:bg-yellow-600"
82- @click =" showChangelogBrokenParse"
83- >
84- Test Broken Parse Changelog
85- </button >
78+ <div class =" mb-6 flex flex-col gap-4" >
79+ <ColorSwitcherCe />
80+ <div class =" max-w-md flex flex-col gap-4" >
81+ <button
82+ class =" px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
83+ @click =" showChangelogModalFromReleasesEndpoint"
84+ >
85+ Test Changelog Modal (from releases endpoint)
86+ </button >
87+ <button
88+ class =" px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600"
89+ @click =" showChangelogFromLocalhost"
90+ >
91+ Test Local Pretty Changelog (:3000)
92+ </button >
93+ <button
94+ class =" px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600"
95+ @click =" showChangelogModalWithTestData"
96+ >
97+ Test Changelog Modal (with test data)
98+ </button >
99+ <button
100+ class =" px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600"
101+ @click =" showChangelogWithoutPretty"
102+ >
103+ Test Without Pretty Changelog
104+ </button >
105+ <button
106+ class =" px-4 py-2 bg-yellow-500 text-white rounded hover:bg-yellow-600"
107+ @click =" showChangelogBrokenParse"
108+ >
109+ Test Broken Parse Changelog
110+ </button >
111+ </div >
86112 </div >
87113 </div >
88114</template >
0 commit comments