Frontend
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"use client";
|
||||
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { extractDate } from "@/lib/time";
|
||||
import { Script, AppVersion } from "@/lib/types";
|
||||
@@ -39,7 +39,7 @@ function ScriptItem({
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
fetchVersions(item.slug)
|
||||
fetchVersions()
|
||||
.then((fetchedVersions) => {
|
||||
console.log("Fetched Versions: ", fetchedVersions);
|
||||
if (Array.isArray(fetchedVersions)) {
|
||||
@@ -51,7 +51,7 @@ useEffect(() => {
|
||||
}
|
||||
})
|
||||
.catch((error) => console.error("Error fetching versions:", error));
|
||||
}, [item.name]);
|
||||
}, []);
|
||||
|
||||
const defaultInstallMethod = item.install_methods?.[0];
|
||||
const os = defaultInstallMethod?.resources?.os || "Proxmox Node";
|
||||
@@ -103,7 +103,9 @@ const version = defaultInstallMethod?.resources?.version || "";
|
||||
{versions.length === 0 ? (
|
||||
<p>Loading versions...</p>
|
||||
) : (
|
||||
<p>Version: {versions[0].version}</p>
|
||||
<p>Version: {
|
||||
versions.find((v) => v.name === item.slug.replace(/[^a-z0-9]/g, ''))?.version || "Not found"
|
||||
}</p>
|
||||
)}
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user