From 85f679e313c3ccd2ff880aa1d0e63520c265484b Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Fri, 29 Aug 2025 18:17:38 +0000 Subject: [PATCH] fix: correct template selection in install script The script was incorrectly prefixing storage name twice when listing templates, resulting in ISOs:ISOs:vztmpl/... format instead of ISOs:vztmpl/... This caused template existence checks to fail and always trigger downloads. addresses #381 --- .../src/components/Dashboard/CompactNodeCard.tsx | 2 +- frontend-modern/src/components/Dashboard/MetricBar.tsx | 2 +- frontend-modern/src/components/Dashboard/NodeCard.tsx | 6 +++--- frontend-modern/src/components/Dashboard/PBSCard.tsx | 4 ++-- frontend-modern/src/components/Storage/Storage.tsx | 4 ++-- install.sh | 6 ++++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/frontend-modern/src/components/Dashboard/CompactNodeCard.tsx b/frontend-modern/src/components/Dashboard/CompactNodeCard.tsx index 2fdc575a7..df71f67c9 100644 --- a/frontend-modern/src/components/Dashboard/CompactNodeCard.tsx +++ b/frontend-modern/src/components/Dashboard/CompactNodeCard.tsx @@ -42,7 +42,7 @@ const CompactNodeCard: Component = (props) => { // Mini progress bar for compact mode const MiniProgressBar = (props: { value: number; type: 'cpu' | 'mem' | 'disk' }) => ( -
+
= 90 ? 'bg-red-500' : diff --git a/frontend-modern/src/components/Dashboard/MetricBar.tsx b/frontend-modern/src/components/Dashboard/MetricBar.tsx index 799dae8fc..7fc95bb8b 100644 --- a/frontend-modern/src/components/Dashboard/MetricBar.tsx +++ b/frontend-modern/src/components/Dashboard/MetricBar.tsx @@ -54,7 +54,7 @@ export function MetricBar(props: MetricBarProps) { return (
-
+
= (props) => { // Early return if node data is incomplete if (!props.node || !props.node.memory || !props.node.disk) { return ( -
+
Loading node data...
); @@ -68,7 +68,7 @@ const NodeCard: Component = (props) => { }[colorClass] || 'bg-gray-500/70 dark:bg-gray-500/60'; return ( -
+
{label} {percentage}% @@ -131,7 +131,7 @@ const NodeCard: Component = (props) => { }; return ( -
+
{/* Header */}

diff --git a/frontend-modern/src/components/Dashboard/PBSCard.tsx b/frontend-modern/src/components/Dashboard/PBSCard.tsx index d87282beb..254ca60be 100644 --- a/frontend-modern/src/components/Dashboard/PBSCard.tsx +++ b/frontend-modern/src/components/Dashboard/PBSCard.tsx @@ -70,7 +70,7 @@ const PBSCard: Component = (props) => { }[colorClass] || 'bg-gray-500/60 dark:bg-gray-500/50'; return ( -
+
{text} @@ -125,7 +125,7 @@ const PBSCard: Component = (props) => { }; return ( -
+
{/* Header */}

diff --git a/frontend-modern/src/components/Storage/Storage.tsx b/frontend-modern/src/components/Storage/Storage.tsx index 88d28996a..a879c4713 100644 --- a/frontend-modern/src/components/Storage/Storage.tsx +++ b/frontend-modern/src/components/Storage/Storage.tsx @@ -269,7 +269,7 @@ const Storage: Component = () => { Shared - Usage + Usage Free Total @@ -361,7 +361,7 @@ const Storage: Component = () => { -
+
/dev/null | tail -n +2 | awk -v storage="$tmpl_storage" '{print storage ":" $1}' || true) + # pveam list output already includes the storage prefix in the path + local STORAGE_TEMPLATES=$(pveam list "$tmpl_storage" 2>/dev/null | tail -n +2 | awk '{print $1}' || true) if [[ -n "$STORAGE_TEMPLATES" ]]; then if [[ -n "$ALL_TEMPLATES" ]]; then ALL_TEMPLATES="${ALL_TEMPLATES}\n${STORAGE_TEMPLATES}" @@ -671,11 +672,12 @@ create_lxc_container() { fi # Download template if it doesn't exist - # For storage:vztmpl format, we need to check if template exists using pveam + # Check if template exists - pveam list shows full paths like storage:vztmpl/file.tar.zst local TEMPLATE_EXISTS=false if [[ "$TEMPLATE" =~ ^([^:]+):vztmpl/(.+)$ ]]; then local STORAGE_NAME="${BASH_REMATCH[1]}" local TEMPLATE_FILE="${BASH_REMATCH[2]}" + # Check if this exact template exists in pveam list if pveam list "$STORAGE_NAME" 2>/dev/null | grep -q "$TEMPLATE_FILE"; then TEMPLATE_EXISTS=true fi