From cd4bcefa582b3a55e3d3b5c8e1ff785d168d4833 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:19:05 +0100 Subject: [PATCH] [API] Update build.func to set the status message correct (#1878) * Testing * Testing * update /data/page.tsx * Update page.tsx --- frontend/src/app/data/page.tsx | 12 ++++++++++- misc/build.func | 37 ++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/data/page.tsx b/frontend/src/app/data/page.tsx index acdc5519..44feb217 100644 --- a/frontend/src/app/data/page.tsx +++ b/frontend/src/app/data/page.tsx @@ -195,7 +195,17 @@ const DataFetcher: React.FC = () => { {paginatedData.map((item, index) => ( - {item.status === "done" ? "✔️" : item.status === "failed" ? "❌" : item.status} + + {item.status === "done" ? ( + "✔️" + ) : item.status === "failed" ? ( + "❌" + ) : item.status === "installing" ? ( + "🔄" + ) : ( + item.status + )} + {item.nsapp} {item.os_type} {item.os_version} diff --git a/misc/build.func b/misc/build.func index 13f1c8b7..3e623537 100644 --- a/misc/build.func +++ b/misc/build.func @@ -73,6 +73,7 @@ error_handler() { local exit_code="$?" local line_number="$1" local command="$2" + post_update_to_api "failed" local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}" echo -e "\n$error_message\n" } @@ -813,7 +814,7 @@ post_to_api() { "nsapp": "$NSAPP", "method": "$METHOD", "pve_version": "$pve_version", - "status": "failed", + "status": "installing", "random_id": "$RANDOM_UUID" } EOF @@ -829,26 +830,31 @@ EOF } -post_update_to_api() { - local API_URL="http://api.community-scripts.org/upload/updatestatus" +POST_UPDATE_DONE=false - JSON_PAYLOAD=$(cat <