mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Apply suggestions from code review
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
@@ -992,7 +992,7 @@
|
||||
"argocd": {
|
||||
"apps": "Apps",
|
||||
"synced": "Synced",
|
||||
"outOfSync": "OutOfSync",
|
||||
"outOfSync": "Out Of Sync",
|
||||
"healthy": "Healthy",
|
||||
"degraded": "Degraded",
|
||||
"progressing": "Progressing",
|
||||
|
||||
@@ -20,9 +20,8 @@ export default function Component({ service }) {
|
||||
if (status === "apps") {
|
||||
return { status, count: appsData?.items?.length };
|
||||
}
|
||||
const apiStatus = status.charAt(0).toUpperCase() + status.slice(1);
|
||||
const count = appsData?.items?.filter(
|
||||
(item) => item.status?.sync?.status === apiStatus || item.status?.health?.status === apiStatus,
|
||||
(item) => item.status?.sync?.status.toLowerCase() === status.toLowerCase() || item.status?.health?.status.toLowerCase() === status.toLowerCase(),
|
||||
).length;
|
||||
return { status, count };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user