diff --git a/__mocks__/patternfly-react-core.tsx b/__mocks__/patternfly-react-core.tsx index 54538e3a3..c1ea92e7a 100644 --- a/__mocks__/patternfly-react-core.tsx +++ b/__mocks__/patternfly-react-core.tsx @@ -122,6 +122,26 @@ export const Spinner: React.FC = ({ size, ...rest }) => ( ); +export const DescriptionList: React.FC = ({ children, className }) => ( +
{children}
+); + +export const DescriptionListGroup: React.FC = ({ children, className }) => ( +
{children}
+); + +export const DescriptionListTermHelpText: React.FC = ({ children, className }) => ( +
{children}
+); + +export const DescriptionListTermHelpTextButton: React.FC = ({ children }) => ( + +); + +export const DescriptionListDescription: React.FC = ({ children }) => ( +
{children}
+); + export enum ButtonVariant { plain = 'plain', primary = 'primary', diff --git a/console-extensions.json b/console-extensions.json index 11e3163d4..ec729422a 100644 --- a/console-extensions.json +++ b/console-extensions.json @@ -366,6 +366,20 @@ "component": { "$codeRef": "DashboardOverviewPage" } } }, + { + "type": "console.navigation/resource-ns", + "properties": { + "id": "argocd", + "name": "ArgoCD Instances", + "perspective": "admin", + "section": "gitops-navigation-section", + "model": { + "group": "argoproj.io", + "kind": "ArgoCD", + "version": "v1beta1" + } + } + }, { "type": "console.navigation/resource-ns", "properties": { @@ -450,6 +464,42 @@ } } }, + { + "type": "console.page/resource/list", + "flags": { + "required": [ + "ARGOCD" + ] + }, + "properties": { + "model": { + "group": "argoproj.io", + "kind": "ArgoCD", + "version": "v1beta1" + }, + "component": { + "$codeRef": "ArgoCDList" + } + } + }, + { + "type": "console.page/resource/details", + "flags": { + "required": [ + "ARGOCD" + ] + }, + "properties": { + "model": { + "group": "argoproj.io", + "kind": "ArgoCD", + "version": "v1beta1" + }, + "component": { + "$codeRef": "ArgoCDDetails" + } + } + }, { "type": "console.page/resource/list", "flags": { @@ -576,6 +626,25 @@ } } }, + { + "type": "console.yaml-template", + "flags": { + "required": [ + "ARGOCD" + ] + }, + "properties": { + "name": "default", + "model": { + "group": "argoproj.io", + "kind": "ArgoCD", + "version": "v1beta1" + }, + "template": { + "$codeRef": "yamlTemplates.defaultArgoCDYamlTemplate" + } + } + }, { "type": "console.yaml-template", "flags": { diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 228f1a8a5..93263479f 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -6,6 +6,7 @@ - [ApplicationSets in the GitOps Console](applicationsets.md) - [AppProjects in the GitOps Console](appprojects-rbac.md) - [ImageUpdaters in the GitOps Console](image-updaters.md) +- [ArgoCD Instances in the GitOps Console](argocd-instances.md) - [Rollouts in the GitOps Console](rollouts.md) - [Graphs and topology views](topology.md) - [Filter, search, and paginate resources](filter-resources.md) diff --git a/docs/argocd-instances.md b/docs/argocd-instances.md new file mode 100644 index 000000000..52c39ce3d --- /dev/null +++ b/docs/argocd-instances.md @@ -0,0 +1,83 @@ +# ArgoCD Instances in the GitOps Console + +The GitOps Console plugin provides list and details pages for Argo CD custom resources (ArgoCD instances) in the OpenShift web console. You can search and filter instances, create them from a YAML template, and review component health and SSO configuration. + +The **ArgoCD Instances** page is available when the ArgoCD custom resource definition is installed on the cluster. + +## Prerequisites + +* You have access to the OpenShift web console. +* The GitOps Console plugin is enabled. See [Enable the GitOps Console plugin](admin-enable-plugin.md). +* The ArgoCD CRD is installed on the cluster. +* You can list ArgoCD instances in the selected namespace (or across namespaces, depending on your permissions). + +## List page + +1. In the **Administrator** or **Core platform** perspective, navigate to **GitOps** → **ArgoCD Instances**. + +2. Optional: Use the **Project** dropdown to limit the list to one project (namespace), or choose all projects. + +The ArgoCD Instances list page includes: + +* **Filtering**: Filter by **Status**: Healthy, Progressing, Degraded, Unknown. Status is derived from the operator-reported lifecycle phase (Available, Pending, Failed, Unknown) of the ArgoCD resource. +* **Search**: Use the search field to match by **Name** or **Label**. Choose the mode from the dropdown next to the field. +* **Create action**: Click **Create ArgoCD** to open the YAML editor with a default ArgoCD template. +* **Pagination**: Browse results in pages of 10, 20, 50, or 100 items (default 50). Search and filters change which rows are included. See [Filter, search, and paginate resources](filter-resources.md). + +### Table columns + +| Column | Default | Description | +|---------------|--------------------------------------------|-----------------------------------------------------------------------------| +| **Name** | Always shown | ArgoCD instance name, with a link to the details page. | +| **Namespace** | Shown by default when viewing all projects | Namespace of the ArgoCD instance. Available only when viewing all projects. | +| **Status** | Shown by default | Overall health, derived from the resource's lifecycle phase. | +| **Version** | Shown by default | Requested Argo CD version. | +| **Age** | Shown by default | Time since the resource was created. | +| **Actions** | Always shown | Row kebab menu. | + +For more details on how to show or hide columns, restore defaults, or reset column widths, see [Manage table columns](manage-columns.md). + +### Row actions + +From the row kebab, you can: + +* **Edit labels** +* **Edit annotations** +* **Edit ArgoCD** (opens the YAML editor) +* **Delete ArgoCD** + +## ArgoCD instance details page + +1. From the ArgoCD Instances list, click an instance name. + +2. Use the page header **Actions** menu for the same edit and delete actions as the list. + +The details page includes the following tabs. + +### Details tab + +**Summary** + +* **Name** +* **Namespace** +* **Server**: Link to the Argo CD server host, once provisioned. +* **Version**: Requested Argo CD version. +* **SSO**: Configured provider (**Keycloak**, **Dex**, or **Dex / OpenShift OAuth**), or **SSO degraded** if the SSO component is unhealthy. +* **RBAC**: Link to the `argocd-rbac-cm` ConfigMap. +* **Notifications**: Link to the `argocd-notifications-cm` ConfigMap, when notifications are enabled. +* **Created at** + +**Managed components** + +Lists the health status (Healthy, Progressing, Degraded, Unknown) of each Argo CD component reported on the resource status (for example server, repo, redis, applicationController, applicationSetController, sso, notificationsController, commitServer). The list is built from whatever components the operator reports, so newly added components show up automatically. + +### YAML tab + +The **YAML** tab provides a live editor for the ArgoCD manifest. Use it to inspect or update the full resource definition. + +## Related information + +* [Filter, search, and paginate resources](filter-resources.md) +* [Manage table columns](manage-columns.md) +* [Applications in the GitOps Console](applications.md) +* [Troubleshooting](troubleshooting.md) diff --git a/locales/en/plugin__gitops-plugin.json b/locales/en/plugin__gitops-plugin.json index 6c36b1c13..be0ed366f 100644 --- a/locales/en/plugin__gitops-plugin.json +++ b/locales/en/plugin__gitops-plugin.json @@ -117,9 +117,48 @@ "Progressive Sync Flow View": "Progressive Sync Flow View", "Expand or collapse all progressive sync step groups": "Expand or collapse all progressive sync step groups", "No Applications In This Step": "No Applications In This Step", + "Error: Missing required route parameters": "Error: Missing required route parameters", + "SSO degraded": "SSO degraded", + "Keycloak": "Keycloak", + "Dex / OpenShift OAuth": "Dex / OpenShift OAuth", + "Dex": "Dex", + "The health status of the {{component}} component.": "The health status of the {{component}} component.", + "Namespace defines the space within which each name must be unique.": "Namespace defines the space within which each name must be unique.", + "Server": "Server", + "The hostname of the Argo CD server, once provisioned.": "The hostname of the Argo CD server, once provisioned.", + "Version": "Version", + "The requested Argo CD version to install.": "The requested Argo CD version to install.", + "SSO": "SSO", + "The single sign-on provider configured for Argo CD.": "The single sign-on provider configured for Argo CD.", + "RBAC": "RBAC", + "The ConfigMap that defines the RBAC policy for Argo CD.": "The ConfigMap that defines the RBAC policy for Argo CD.", + "Notifications": "Notifications", + "The ConfigMap that defines the notification templates for Argo CD.": "The ConfigMap that defines the notification templates for Argo CD.", + "Created at": "Created at", + "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.", + "Managed components": "Managed components", + "ArgoCD": "ArgoCD", + "No ArgoCD Instances match the search filter": "No ArgoCD Instances match the search filter", + "Try removing the filter or searching for a different term to see more ArgoCD Instances.": "Try removing the filter or searching for a different term to see more ArgoCD Instances.", + "There are no ArgoCD Instances in this namespace.": "There are no ArgoCD Instances in this namespace.", + "There are no ArgoCD Instances in all namespaces.": "There are no ArgoCD Instances in all namespaces.", + "No matching ArgoCD Instances": "No matching ArgoCD Instances", + "No ArgoCD Instances": "No ArgoCD Instances", + "Unable to load data": "Unable to load data", + "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.": "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.", + "ArgoCD Instances": "ArgoCD Instances", + "Create ArgoCD": "Create ArgoCD", + "Age": "Age", + "Actions": "Actions", + "Healthy": "Healthy", + "Degraded": "Degraded", + "Progressing": "Progressing", + "Unknown": "Unknown", + "There was an error retrieving the ArgoCD. Check your connection and reload the page.": "There was an error retrieving the ArgoCD. Check your connection and reload the page.", + "Edit ArgoCD": "Edit ArgoCD", + "Delete ArgoCD": "Delete ArgoCD", "Edit ImageUpdater": "Edit ImageUpdater", "Delete ImageUpdater": "Delete ImageUpdater", - "Error: Missing required route parameters": "Error: Missing required route parameters", "True": "True", "False": "False", "ImageUpdater details": "ImageUpdater details", @@ -143,7 +182,6 @@ "There are no ImageUpdaters in all namespaces.": "There are no ImageUpdaters in all namespaces.", "No matching ImageUpdaters": "No matching ImageUpdaters", "No ImageUpdaters": "No ImageUpdaters", - "Unable to load data": "Unable to load data", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "There was an error retrieving ImageUpdaters. Check your connection and reload the page.", "ImageUpdaters": "ImageUpdaters", "Create ImageUpdater": "Create ImageUpdater", @@ -170,12 +208,8 @@ "Application Overview": "Application Overview", "Infrastructure": "Infrastructure", "GitOps Overview": "GitOps Overview", - "Healthy": "Healthy", - "Progressing": "Progressing", - "Degraded": "Degraded", "Missing": "Missing", "Suspended": "Suspended", - "Unknown": "Unknown", "Health status": "Health status", "Unable to retrieve applications": "Unable to retrieve applications", "Error retrieving applications: {{x}}": "Error retrieving applications: {{x}}", @@ -270,7 +304,6 @@ "Application sync activity over time": "Application sync activity over time", "Application model does not exist": "Application model does not exist", "The Argo CD Application CRD does not exist. Check that the GitOps Operator is installed.": "The Argo CD Application CRD does not exist. Check that the GitOps Operator is installed.", - "Server": "Server", "Deny": "Deny", "Allow": "Allow", "No destinations configured": "No destinations configured", @@ -385,7 +418,6 @@ "Retry": "Retry", "Restart": "Restart", "Rollback": "Rollback", - "Age": "Age", "Info": "Info", "Ready containers": "Ready containers", "ready": "ready", @@ -448,13 +480,10 @@ "No Argo CD ApplicationSets": "No Argo CD ApplicationSets", "There was an error retrieving applicationsets. Check your connection and reload the page.": "There was an error retrieving applicationsets. Check your connection and reload the page.", "No labels": "No labels", - "Namespace defines the space within which each name must be unique.": "Namespace defines the space within which each name must be unique.", "Map of string keys and values that can be used to organize and categorize (scope and select) objects.": "Map of string keys and values that can be used to organize and categorize (scope and select) objects.", "Edit": "Edit", "Annotations": "Annotations", "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.", - "Created at": "Created at", - "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.", "Extra": "Extra", "Manage columns": "Manage columns", @@ -481,7 +510,6 @@ "Stop": "Stop", "Refresh": "Refresh", "Refresh (Hard)": "Refresh (Hard)", - "Actions": "Actions", "You don't have permission to perform this action": "You don't have permission to perform this action", "annotations": "annotations", "annotation": "annotation", diff --git a/locales/es/plugin__gitops-plugin.json b/locales/es/plugin__gitops-plugin.json index fca26e120..e68c446e2 100644 --- a/locales/es/plugin__gitops-plugin.json +++ b/locales/es/plugin__gitops-plugin.json @@ -61,7 +61,6 @@ "Started At": "Iniciado a las", "When the operation was started.": "Cuándo se inició la operación.", "Duration": "Duración", - "Invalid duration": "Invalid duration", "How long the operation took to complete.": "Cuánto tiempo tardó en completarse la operación.", "Finished At": "Finalizado a las", "When the operation was finished.": "Cuándo terminó la operación.", @@ -118,9 +117,48 @@ "Progressive Sync Flow View": "Vista del flujo de sincronización progresiva", "Expand or collapse all progressive sync step groups": "Expandir o contraer todos los grupos de pasos de sincronización progresiva", "No Applications In This Step": "No hay aplicaciones en este paso", + "Error: Missing required route parameters": "Error: faltan parámetros de ruta obligatorios", + "SSO degraded": "SSO degraded", + "Keycloak": "Keycloak", + "Dex / OpenShift OAuth": "Dex / OpenShift OAuth", + "Dex": "Dex", + "The health status of the {{component}} component.": "The health status of the {{component}} component.", + "Namespace defines the space within which each name must be unique.": "El espacio de nombre define el espacio dentro del cual cada nombre debe ser único.", + "Server": "Servidor", + "The hostname of the Argo CD server, once provisioned.": "The hostname of the Argo CD server, once provisioned.", + "Version": "Version", + "The requested Argo CD version to install.": "The requested Argo CD version to install.", + "SSO": "SSO", + "The single sign-on provider configured for Argo CD.": "The single sign-on provider configured for Argo CD.", + "RBAC": "RBAC", + "The ConfigMap that defines the RBAC policy for Argo CD.": "The ConfigMap that defines the RBAC policy for Argo CD.", + "Notifications": "Notifications", + "The ConfigMap that defines the notification templates for Argo CD.": "The ConfigMap that defines the notification templates for Argo CD.", + "Created at": "Creado en", + "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time es una envoltura de time. Tiempo que admite la serialización correcta a YAML y JSON.", + "Managed components": "Managed components", + "ArgoCD": "ArgoCD", + "No ArgoCD Instances match the search filter": "No ArgoCD Instances match the search filter", + "Try removing the filter or searching for a different term to see more ArgoCD Instances.": "Try removing the filter or searching for a different term to see more ArgoCD Instances.", + "There are no ArgoCD Instances in this namespace.": "There are no ArgoCD Instances in this namespace.", + "There are no ArgoCD Instances in all namespaces.": "There are no ArgoCD Instances in all namespaces.", + "No matching ArgoCD Instances": "No matching ArgoCD Instances", + "No ArgoCD Instances": "No ArgoCD Instances", + "Unable to load data": "No se pudieron cargar los datos", + "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.": "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.", + "ArgoCD Instances": "ArgoCD Instances", + "Create ArgoCD": "Create ArgoCD", + "Age": "Edad", + "Actions": "Acciones", + "Healthy": "En buen estado", + "Degraded": "Degradado", + "Progressing": "En curso", + "Unknown": "Desconocido", + "There was an error retrieving the ArgoCD. Check your connection and reload the page.": "There was an error retrieving the ArgoCD. Check your connection and reload the page.", + "Edit ArgoCD": "Edit ArgoCD", + "Delete ArgoCD": "Delete ArgoCD", "Edit ImageUpdater": "Editar ImageUpdater", "Delete ImageUpdater": "Eliminar ImageUpdater", - "Error: Missing required route parameters": "Error: faltan parámetros de ruta obligatorios", "True": "Verdadero", "False": "Falso", "ImageUpdater details": "Detalles de ImageUpdater", @@ -144,7 +182,6 @@ "There are no ImageUpdaters in all namespaces.": "No hay ImageUpdaters en todos los espacios de nombre.", "No matching ImageUpdaters": "No hay ImageUpdaters que coincidan", "No ImageUpdaters": "Sin ImageUpdaters", - "Unable to load data": "No se pudieron cargar los datos", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "Se produjo un error al recuperar los ImageUpdaters. Compruebe su conexión y vuelva a cargar la página.", "ImageUpdaters": "ImageUpdaters", "Create ImageUpdater": "Crear ImageUpdater", @@ -171,12 +208,8 @@ "Application Overview": "Visión general de la aplicación", "Infrastructure": "Infraestructura", "GitOps Overview": "Visión general de GitOps", - "Healthy": "En buen estado", - "Progressing": "En curso", - "Degraded": "Degradado", "Missing": "Faltante", "Suspended": "Suspendido", - "Unknown": "Desconocido", "Health status": "Estado", "Unable to retrieve applications": "No se pueden recuperar las aplicaciones", "Error retrieving applications: {{x}}": "Error al recuperar las aplicaciones: {{x}}.", @@ -255,13 +288,13 @@ "Recent Operations": "Operaciones recientes", "(Last {{x}} operations)": "(Últimas {{x}} operaciones)", "No recent operations": "No hay operaciones recientes", + "Reconciliations (24h sliding window)": "Conciliaciones (período móvil de 24 horas)", "Application Reconciliation Performance (24 hours)": "Rendimiento de conciliación de aplicaciones (24 horas)", "Unable to retrieve metrics data": "No se pudieron recuperar los datos de métricas", "Cannot retrieve data for the Argo CD reconciliation performance. Check that the cluster metrics monitoring is enabled.": "No se pueden recuperar los datos de rendimiento de la conciliación de Argo CD. Verifique que el monitoreo de las métricas del clúster esté habilitada.", "Application reconciliation performance over time": "Rendimiento de la conciliación de aplicaciones a lo largo del tiempo", "View in Observe/Metrics": "Ver en Observar/Métricas", "Syncs (24h sliding window)": "Sincronizaciones (período móvil de 24 horas)", - "Reconciliations (24h sliding window)": "Conciliaciones (período móvil de 24 horas)", "Synced": "Sincronizado", "Out of Sync": "Desincronizado", "Application Sync Activity (24 hours)": "Actividad de sincronización de aplicaciones (24 horas)", @@ -271,7 +304,6 @@ "Application sync activity over time": "Actividad de sincronización de aplicaciones a lo largo del tiempo", "Application model does not exist": "No existe un modelo de aplicación", "The Argo CD Application CRD does not exist. Check that the GitOps Operator is installed.": "No existe la CRD de aplicación de Argo CD. Compruebe que el operador de GitOps esté instalado.", - "Server": "Servidor", "Deny": "Denegar", "Allow": "Permitir", "No destinations configured": "No hay destinos configurados", @@ -360,6 +392,7 @@ "Clusters": "Clústeres", "Manual Sync": "Sincronización manual", "Time Zone": "Zona horaria", + "Invalid duration": "Invalid duration", "All": "Todo", "Allowed": "Permitido", "Denied": "Denegado", @@ -385,7 +418,6 @@ "Retry": "Reintentar", "Restart": "Reiniciar", "Rollback": "Revertir", - "Age": "Edad", "Info": "Información", "Ready containers": "Contenedores listos", "ready": "listo", @@ -448,13 +480,10 @@ "No Argo CD ApplicationSets": "Sin ApplicationSets de Argo CD", "There was an error retrieving applicationsets. Check your connection and reload the page.": "Se produjo un error al recuperar los applicationsets. Compruebe su conexión y vuelva a cargar la página.", "No labels": "Sin etiquetas", - "Namespace defines the space within which each name must be unique.": "El espacio de nombre define el espacio dentro del cual cada nombre debe ser único.", "Map of string keys and values that can be used to organize and categorize (scope and select) objects.": "Mapa de claves y valores de cadena que se pueden usar para organizar y categorizar (delimitar el alcance y seleccionar) objetos.", "Edit": "Editar", "Annotations": "Anotaciones", "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.": "Las anotaciones son mapas de valores clave no estructurados que se almacenan con un recurso y que pueden configurarse mediante herramientas externas para almacenar y recuperar metadatos arbitrarios. No pueden consultarse y deben conservarse al modificar objetos.", - "Created at": "Creado en", - "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time es una envoltura de time. Tiempo que admite la serialización correcta a YAML y JSON.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "Las referencias del propietario vinculan este recurso con su objeto principal. Por ejemplo, las aplicaciones generadas por un ApplicationSet tendrán a ese ApplicationSet como propietario. Esta relación permite una gestión adecuada del ciclo de vida de los recursos y la recolección de basura.", "Extra": "Adicional", "Manage columns": "Administrar columnas", @@ -481,7 +510,6 @@ "Stop": "Detener", "Refresh": "Actualizar", "Refresh (Hard)": "Actualizar (forzada)", - "Actions": "Acciones", "You don't have permission to perform this action": "No tiene permiso para realizar esta acción.", "annotations": "anotaciones", "annotation": "anotación", diff --git a/locales/fr/plugin__gitops-plugin.json b/locales/fr/plugin__gitops-plugin.json index 70055b9f0..b102e27d7 100644 --- a/locales/fr/plugin__gitops-plugin.json +++ b/locales/fr/plugin__gitops-plugin.json @@ -61,7 +61,6 @@ "Started At": "Commencé à", "When the operation was started.": "Lorsque l'opération a commencé.", "Duration": "Durée", - "Invalid duration": "Invalid duration", "How long the operation took to complete.": "Combien de temps a duré l'opération ?", "Finished At": "Terminé à", "When the operation was finished.": "Lorsque l'opération fut terminée.", @@ -118,9 +117,48 @@ "Progressive Sync Flow View": "Vue du flux de synchronisation progressive", "Expand or collapse all progressive sync step groups": "Développer ou réduire tous les groupes de pas de synchronisation progressive", "No Applications In This Step": "Aucune candidature à cette étape", + "Error: Missing required route parameters": "Erreur : Paramètres d'itinéraire requis manquants", + "SSO degraded": "SSO degraded", + "Keycloak": "Keycloak", + "Dex / OpenShift OAuth": "Dex / OpenShift OAuth", + "Dex": "Dex", + "The health status of the {{component}} component.": "The health status of the {{component}} component.", + "Namespace defines the space within which each name must be unique.": "L'espace de noms définit l'espace dans lequel chaque nom doit être unique.", + "Server": "Serveur", + "The hostname of the Argo CD server, once provisioned.": "The hostname of the Argo CD server, once provisioned.", + "Version": "Version", + "The requested Argo CD version to install.": "The requested Argo CD version to install.", + "SSO": "SSO", + "The single sign-on provider configured for Argo CD.": "The single sign-on provider configured for Argo CD.", + "RBAC": "RBAC", + "The ConfigMap that defines the RBAC policy for Argo CD.": "The ConfigMap that defines the RBAC policy for Argo CD.", + "Notifications": "Notifications", + "The ConfigMap that defines the notification templates for Argo CD.": "The ConfigMap that defines the notification templates for Argo CD.", + "Created at": "Heure de création", + "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Le temps est un emballage autour du temps. Temps permettant une sérialisation correcte en YAML et JSON.", + "Managed components": "Managed components", + "ArgoCD": "ArgoCD", + "No ArgoCD Instances match the search filter": "No ArgoCD Instances match the search filter", + "Try removing the filter or searching for a different term to see more ArgoCD Instances.": "Try removing the filter or searching for a different term to see more ArgoCD Instances.", + "There are no ArgoCD Instances in this namespace.": "There are no ArgoCD Instances in this namespace.", + "There are no ArgoCD Instances in all namespaces.": "There are no ArgoCD Instances in all namespaces.", + "No matching ArgoCD Instances": "No matching ArgoCD Instances", + "No ArgoCD Instances": "No ArgoCD Instances", + "Unable to load data": "Impossible de charger les données", + "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.": "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.", + "ArgoCD Instances": "ArgoCD Instances", + "Create ArgoCD": "Create ArgoCD", + "Age": "Âge", + "Actions": "Actions", + "Healthy": "Sain", + "Degraded": "Dégradé", + "Progressing": "En cours", + "Unknown": "Inconnu", + "There was an error retrieving the ArgoCD. Check your connection and reload the page.": "There was an error retrieving the ArgoCD. Check your connection and reload the page.", + "Edit ArgoCD": "Edit ArgoCD", + "Delete ArgoCD": "Delete ArgoCD", "Edit ImageUpdater": "Modifier ImageUpdater", "Delete ImageUpdater": "Supprimer ImageUpdater", - "Error: Missing required route parameters": "Erreur : Paramètres d'itinéraire requis manquants", "True": "Vrai", "False": "Faux", "ImageUpdater details": "Détails d'ImageUpdater", @@ -144,7 +182,6 @@ "There are no ImageUpdaters in all namespaces.": "Il n'existe aucun ImageUpdater dans tous les espaces de noms.", "No matching ImageUpdaters": "Aucun modérateur d'images correspondant", "No ImageUpdaters": "Aucun modérateur d'images", - "Unable to load data": "Impossible de charger les données", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "Une erreur s'est produite lors de la récupération des mises à jour d'images. Vérifiez votre connexion et rechargez la page.", "ImageUpdaters": "Mise à jour des images", "Create ImageUpdater": "Créer un outil de mise à jour d'images", @@ -171,12 +208,8 @@ "Application Overview": "Présentation de l'application", "Infrastructure": "Infrastructure", "GitOps Overview": "Aperçu de GitOps", - "Healthy": "Sain", - "Progressing": "En cours", - "Degraded": "Dégradé", "Missing": "Manquant", "Suspended": "Suspendu", - "Unknown": "Inconnu", "Health status": "État de fonctionnement", "Unable to retrieve applications": "Impossible de récupérer les applications", "Error retrieving applications: {{x}}": "Erreur lors de la récupération des applications : {{x}}", @@ -255,13 +288,13 @@ "Recent Operations": "Opérations récentes", "(Last {{x}} operations)": "(Dernières {{x}} opérations)", "No recent operations": "Aucune opération récente", + "Reconciliations (24h sliding window)": "Rapprochements (fenêtre glissante de 24 heures)", "Application Reconciliation Performance (24 hours)": "Performance de rapprochement des applications (24 heures)", "Unable to retrieve metrics data": "Impossible de récupérer les données de métriques", "Cannot retrieve data for the Argo CD reconciliation performance. Check that the cluster metrics monitoring is enabled.": "Impossible de récupérer les données relatives aux performances de réconciliation des CD Argo. Vérifiez que la surveillance des métriques du cluster est activée.", "Application reconciliation performance over time": "Performances de réconciliation des applications au fil du temps", "View in Observe/Metrics": "Afficher dans Observer/Métriques", "Syncs (24h sliding window)": "Synchronisations (fenêtre glissante de 24 heures)", - "Reconciliations (24h sliding window)": "Rapprochements (fenêtre glissante de 24 heures)", "Synced": "Synchronisé", "Out of Sync": "Désynchronisation", "Application Sync Activity (24 hours)": "Activité de synchronisation des applications (24 heures)", @@ -271,7 +304,6 @@ "Application sync activity over time": "Activité de synchronisation de l'application au fil du temps", "Application model does not exist": "Le modèle d'application n'existe pas.", "The Argo CD Application CRD does not exist. Check that the GitOps Operator is installed.": "L'application Argo CD CRD n'existe pas. Vérifiez que l'opérateur GitOps est installé.", - "Server": "Serveur", "Deny": "Refuser", "Allow": "Autoriser", "No destinations configured": "Aucune destination configurée", @@ -360,6 +392,7 @@ "Clusters": "Clusters", "Manual Sync": "Synchronisation manuelle", "Time Zone": "Fuseau horaire", + "Invalid duration": "Invalid duration", "All": "Tous", "Allowed": "Autorisé", "Denied": "Refusé", @@ -385,7 +418,6 @@ "Retry": "Réessayer", "Restart": "Redémarrage", "Rollback": "Restaurer", - "Age": "Âge", "Info": "Info", "Ready containers": "Conteneurs prêts à l'emploi", "ready": "Prêt", @@ -448,13 +480,10 @@ "No Argo CD ApplicationSets": "Aucun ensemble d'applications Argo CD", "There was an error retrieving applicationsets. Check your connection and reload the page.": "Une erreur s'est produite lors de la récupération des ensembles d'applications. Vérifiez votre connexion et rechargez la page.", "No labels": "Aucune étiquette", - "Namespace defines the space within which each name must be unique.": "L'espace de noms définit l'espace dans lequel chaque nom doit être unique.", "Map of string keys and values that can be used to organize and categorize (scope and select) objects.": "Carte des clés et des valeurs de chaîne qui peuvent être utilisées pour organiser et catégoriser (portée et sélection) des objets.", "Edit": "Modifier", "Annotations": "Annotations", "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.": "Les annotations sont une table clé-valeur non structurée stockée avec une ressource, qui peut être configurée par des outils externes pour stocker et récupérer des métadonnées arbitraires. Elles ne sont pas interrogeables et doivent être conservées lors de la modification d'objets.", - "Created at": "Heure de création", - "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Le temps est un emballage autour du temps. Temps permettant une sérialisation correcte en YAML et JSON.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "Les références de propriétaire relient cette ressource à son objet parent. Par exemple, les applications générées par un ApplicationSet auront cet ApplicationSet comme propriétaire. Cette relation permet une gestion adéquate du cycle de vie des ressources et une collecte efficace des déchets.", "Extra": "Supplémentaire", "Manage columns": "Gérer les colonnes", @@ -481,7 +510,6 @@ "Stop": "Arrêter", "Refresh": "Actualiser", "Refresh (Hard)": "Actualiser (difficile)", - "Actions": "Actions", "You don't have permission to perform this action": "Vous n’êtes pas autorisé à effectuer cette action.", "annotations": "annotations", "annotation": "annotation", diff --git a/locales/ja/plugin__gitops-plugin.json b/locales/ja/plugin__gitops-plugin.json index 4e36c7258..20247a827 100644 --- a/locales/ja/plugin__gitops-plugin.json +++ b/locales/ja/plugin__gitops-plugin.json @@ -61,7 +61,6 @@ "Started At": "開始日時", "When the operation was started.": "操作を開始した時刻。", "Duration": "期間", - "Invalid duration": "Invalid duration", "How long the operation took to complete.": "操作完了までにかかった時刻。", "Finished At": "終了日時", "When the operation was finished.": "操作が完了した時間。", @@ -118,9 +117,48 @@ "Progressive Sync Flow View": "Progressive Sync フロービュー", "Expand or collapse all progressive sync step groups": "すべての Progressive Sync ステップグループを展開または折りたたむ", "No Applications In This Step": "このステップにはアプリケーションはありません", + "Error: Missing required route parameters": "エラー: 必須のルートパラメーターがありません", + "SSO degraded": "SSO degraded", + "Keycloak": "Keycloak", + "Dex / OpenShift OAuth": "Dex / OpenShift OAuth", + "Dex": "Dex", + "The health status of the {{component}} component.": "The health status of the {{component}} component.", + "Namespace defines the space within which each name must be unique.": "namespace は、各名前が一意である必要がある空間を定義します。", + "Server": "サーバー", + "The hostname of the Argo CD server, once provisioned.": "The hostname of the Argo CD server, once provisioned.", + "Version": "Version", + "The requested Argo CD version to install.": "The requested Argo CD version to install.", + "SSO": "SSO", + "The single sign-on provider configured for Argo CD.": "The single sign-on provider configured for Argo CD.", + "RBAC": "RBAC", + "The ConfigMap that defines the RBAC policy for Argo CD.": "The ConfigMap that defines the RBAC policy for Argo CD.", + "Notifications": "Notifications", + "The ConfigMap that defines the notification templates for Argo CD.": "The ConfigMap that defines the notification templates for Argo CD.", + "Created at": "作成日時", + "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time は time のラッパーです。YAML と JSON への正しいマーシャリングをサポートする時間。", + "Managed components": "Managed components", + "ArgoCD": "ArgoCD", + "No ArgoCD Instances match the search filter": "No ArgoCD Instances match the search filter", + "Try removing the filter or searching for a different term to see more ArgoCD Instances.": "Try removing the filter or searching for a different term to see more ArgoCD Instances.", + "There are no ArgoCD Instances in this namespace.": "There are no ArgoCD Instances in this namespace.", + "There are no ArgoCD Instances in all namespaces.": "There are no ArgoCD Instances in all namespaces.", + "No matching ArgoCD Instances": "No matching ArgoCD Instances", + "No ArgoCD Instances": "No ArgoCD Instances", + "Unable to load data": "データをロードできません", + "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.": "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.", + "ArgoCD Instances": "ArgoCD Instances", + "Create ArgoCD": "Create ArgoCD", + "Age": "経過時間", + "Actions": "アクション", + "Healthy": "正常", + "Degraded": "パフォーマンスの低下", + "Progressing": "進行中", + "Unknown": "不明", + "There was an error retrieving the ArgoCD. Check your connection and reload the page.": "There was an error retrieving the ArgoCD. Check your connection and reload the page.", + "Edit ArgoCD": "Edit ArgoCD", + "Delete ArgoCD": "Delete ArgoCD", "Edit ImageUpdater": "ImageUpdater の編集", "Delete ImageUpdater": "ImageUpdater の削除", - "Error: Missing required route parameters": "エラー: 必須のルートパラメーターがありません", "True": "True", "False": "False", "ImageUpdater details": "ImageUpdater の詳細", @@ -144,7 +182,6 @@ "There are no ImageUpdaters in all namespaces.": "すべての namespace に ImageUpdater はありません。", "No matching ImageUpdaters": "一致する ImageUpdater はありません", "No ImageUpdaters": "ImageUpdater なし", - "Unable to load data": "データをロードできません", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "ImageUpdaters の取得中にエラーが発生しました。接続状況を確認して、ページを再読み込みしてください。", "ImageUpdaters": "ImageUpdaters", "Create ImageUpdater": "ImageUpdater の作成", @@ -171,12 +208,8 @@ "Application Overview": "アプリケーションの概要", "Infrastructure": "Infrastructure", "GitOps Overview": "GitOps の概要", - "Healthy": "正常", - "Progressing": "進行中", - "Degraded": "パフォーマンスの低下", "Missing": "欠落", "Suspended": "一時停止中", - "Unknown": "不明", "Health status": "健全性のステータス", "Unable to retrieve applications": "アプリケーションを取得できません", "Error retrieving applications: {{x}}": "アプリケーションの取得エラー: {{x}}", @@ -255,13 +288,13 @@ "Recent Operations": "最近の操作", "(Last {{x}} operations)": "(直近 {{x}} 件の操作)", "No recent operations": "直近の操作はありません", + "Reconciliations (24h sliding window)": "リコンシリエーション (24 時間のスライディングウィンドウ)", "Application Reconciliation Performance (24 hours)": "アプリケーションリコンシリエーションのパフォーマンス (24 時間)", "Unable to retrieve metrics data": "メトリクスデータを取得できません", "Cannot retrieve data for the Argo CD reconciliation performance. Check that the cluster metrics monitoring is enabled.": "Argo CD リコンシリエーションパフォーマンスのデータを取得できません。クラスターメトリクスの監視が有効になっていることを確認してください。", "Application reconciliation performance over time": "アプリケーションリコンシリエーションのパフォーマンス推移", "View in Observe/Metrics": "オブザーブ/メトリクスで表示", "Syncs (24h sliding window)": "同期 (24 時間のスライディングウィンドウ)", - "Reconciliations (24h sliding window)": "リコンシリエーション (24 時間のスライディングウィンドウ)", "Synced": "同期済み", "Out of Sync": "未同期", "Application Sync Activity (24 hours)": "アプリケーション同期アクティビティー (24 時間)", @@ -271,7 +304,6 @@ "Application sync activity over time": "アプリケーション同期アクティビティーの推移", "Application model does not exist": "アプリケーションモデルが存在しません", "The Argo CD Application CRD does not exist. Check that the GitOps Operator is installed.": "Argo CD Application CRD が存在しません。GitOps Operator がインストールされていることを確認してください。", - "Server": "サーバー", "Deny": "拒否", "Allow": "許可", "No destinations configured": "宛先が設定されていません", @@ -360,6 +392,7 @@ "Clusters": "クラスター", "Manual Sync": "手動同期", "Time Zone": "タイムゾーン", + "Invalid duration": "Invalid duration", "All": "すべて", "Allowed": "許可", "Denied": "拒否", @@ -385,7 +418,6 @@ "Retry": "再試行", "Restart": "再起動", "Rollback": "ロールバック", - "Age": "経過時間", "Info": "情報", "Ready containers": "準備済みのコンテナー", "ready": "準備完了", @@ -448,13 +480,10 @@ "No Argo CD ApplicationSets": "Argo CD ApplicationSets なし", "There was an error retrieving applicationsets. Check your connection and reload the page.": "applicationsets の取得中にエラーが発生しました。接続状況を確認して、ページを再読み込みしてください。", "No labels": "ラベルなし", - "Namespace defines the space within which each name must be unique.": "namespace は、各名前が一意である必要がある空間を定義します。", "Map of string keys and values that can be used to organize and categorize (scope and select) objects.": "オブジェクトを整理および分類 (スコープ指定および選択) するために使用できる文字列のキー値のマップ", "Edit": "編集", "Annotations": "アノテーション", "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.": "アノテーションは、任意のメタデータを保存および取得するために外部ツールによって設定できるリソースとともに保存される、構造化されていないキー値マップです。これらはクエリーできないため、オブジェクトを変更するときに保持する必要があります。", - "Created at": "作成日時", - "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time は time のラッパーです。YAML と JSON への正しいマーシャリングをサポートする時間。", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "オーナーリファレンスは、このリソースをその親オブジェクトにリンクします。たとえば、ApplicationSet によって生成されたアプリケーションは、その ApplicationSet を所有者として持つことになります。この関係により、適切なリソースライフサイクル管理とガベージコレクションが可能になります。", "Extra": "追加", "Manage columns": "列の管理", @@ -481,7 +510,6 @@ "Stop": "停止", "Refresh": "更新", "Refresh (Hard)": "更新 (ハード)", - "Actions": "アクション", "You don't have permission to perform this action": "このアクションを実行する権限がありません", "annotations": "アノテーション", "annotation": "アノテーション", diff --git a/locales/ko/plugin__gitops-plugin.json b/locales/ko/plugin__gitops-plugin.json index 5b4af5fc5..00780d592 100644 --- a/locales/ko/plugin__gitops-plugin.json +++ b/locales/ko/plugin__gitops-plugin.json @@ -61,7 +61,6 @@ "Started At": "시작 시간", "When the operation was started.": "작업이 시작된 시간입니다.", "Duration": "소요 기간", - "Invalid duration": "Invalid duration", "How long the operation took to complete.": "작업을 완료하는 데 걸린 시간입니다.", "Finished At": "완료 시간", "When the operation was finished.": "작업이 완료된 시간입니다.", @@ -118,9 +117,48 @@ "Progressive Sync Flow View": "단계별 동기화 프로세스 보기", "Expand or collapse all progressive sync step groups": "모든 단계별 동기화 단계 그룹을 펼치기 또는 접기", "No Applications In This Step": "이 단계에 애플리케이션 없음", + "Error: Missing required route parameters": "오류: 필수 라우팅 매개변수가 누락되었습니다.", + "SSO degraded": "SSO degraded", + "Keycloak": "Keycloak", + "Dex / OpenShift OAuth": "Dex / OpenShift OAuth", + "Dex": "Dex", + "The health status of the {{component}} component.": "The health status of the {{component}} component.", + "Namespace defines the space within which each name must be unique.": "네임 스페이스는 각 이름을 고유해야 하는 공간을 정의합니다.", + "Server": "서버", + "The hostname of the Argo CD server, once provisioned.": "The hostname of the Argo CD server, once provisioned.", + "Version": "Version", + "The requested Argo CD version to install.": "The requested Argo CD version to install.", + "SSO": "SSO", + "The single sign-on provider configured for Argo CD.": "The single sign-on provider configured for Argo CD.", + "RBAC": "RBAC", + "The ConfigMap that defines the RBAC policy for Argo CD.": "The ConfigMap that defines the RBAC policy for Argo CD.", + "Notifications": "Notifications", + "The ConfigMap that defines the notification templates for Argo CD.": "The ConfigMap that defines the notification templates for Argo CD.", + "Created at": "생성 시간", + "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time은 시간을 나타내는 래퍼입니다. Time 타입은 올바른 YAML 및 JSON 마샬링을 지원합니다.", + "Managed components": "Managed components", + "ArgoCD": "ArgoCD", + "No ArgoCD Instances match the search filter": "No ArgoCD Instances match the search filter", + "Try removing the filter or searching for a different term to see more ArgoCD Instances.": "Try removing the filter or searching for a different term to see more ArgoCD Instances.", + "There are no ArgoCD Instances in this namespace.": "There are no ArgoCD Instances in this namespace.", + "There are no ArgoCD Instances in all namespaces.": "There are no ArgoCD Instances in all namespaces.", + "No matching ArgoCD Instances": "No matching ArgoCD Instances", + "No ArgoCD Instances": "No ArgoCD Instances", + "Unable to load data": "데이터를 불러올 수 없음", + "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.": "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.", + "ArgoCD Instances": "ArgoCD Instances", + "Create ArgoCD": "Create ArgoCD", + "Age": "수명", + "Actions": "작업", + "Healthy": "상태 양호", + "Degraded": "성능 저하", + "Progressing": "진행 중", + "Unknown": "알 수 없음", + "There was an error retrieving the ArgoCD. Check your connection and reload the page.": "There was an error retrieving the ArgoCD. Check your connection and reload the page.", + "Edit ArgoCD": "Edit ArgoCD", + "Delete ArgoCD": "Delete ArgoCD", "Edit ImageUpdater": "ImageUpdater 편집", "Delete ImageUpdater": "ImageUpdater 삭제", - "Error: Missing required route parameters": "오류: 필수 라우팅 매개변수가 누락되었습니다.", "True": "True", "False": "False", "ImageUpdater details": "ImageUpdater 세부 정보", @@ -144,7 +182,6 @@ "There are no ImageUpdaters in all namespaces.": "모든 네임스페이스에 ImageUpdaters가 없습니다.", "No matching ImageUpdaters": "일치하는 ImageUpdaters 없음", "No ImageUpdaters": "ImageUpdaters 없음", - "Unable to load data": "데이터를 불러올 수 없음", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "ImageUpdaters를 검색하는 동안 오류가 발생했습니다. 연결을 확인하고 페이지를 다시 로드합니다.", "ImageUpdaters": "ImageUpdaters", "Create ImageUpdater": "ImageUpdater 만들기", @@ -171,12 +208,8 @@ "Application Overview": "애플리케이션 개요", "Infrastructure": "Infrastructure", "GitOps Overview": "GitOps 개요", - "Healthy": "상태 양호", - "Progressing": "진행 중", - "Degraded": "성능 저하", "Missing": "누락됨", "Suspended": "일시 중단됨", - "Unknown": "알 수 없음", "Health status": "상태", "Unable to retrieve applications": "애플리케이션을 검색할 수 없음", "Error retrieving applications: {{x}}": "애플리케이션 검색 중 오류 발생: {{x}}", @@ -255,13 +288,13 @@ "Recent Operations": "최근 작업", "(Last {{x}} operations)": "(최근 {{x}}개 작업)", "No recent operations": "최근 작업이 없음", + "Reconciliations (24h sliding window)": "조정 (24시간 슬라이딩 윈도우)", "Application Reconciliation Performance (24 hours)": "애플리케이션 조정 성능 (24시간)", "Unable to retrieve metrics data": "메트릭 데이터를 검색할 수 없음", "Cannot retrieve data for the Argo CD reconciliation performance. Check that the cluster metrics monitoring is enabled.": "Argo CD 조정 성능에 대한 데이터를 검색할 수 없습니다. 클러스터 메트릭 모니터링이 활성화되어 있는지 확인합니다.", "Application reconciliation performance over time": "시간 경과에 따른 애플리케이션 조정 성능", "View in Observe/Metrics": "Observe/Metrics에서 보기", "Syncs (24h sliding window)": "동기화 (24시간 슬라이딩 윈도우)", - "Reconciliations (24h sliding window)": "조정 (24시간 슬라이딩 윈도우)", "Synced": "동기화됨", "Out of Sync": "동기화되지 않음", "Application Sync Activity (24 hours)": "애플리케이션 동기화 활동 (24시간)", @@ -271,7 +304,6 @@ "Application sync activity over time": "시간 경과에 따른 애플리케이션 동기화 활동", "Application model does not exist": "애플리케이션 모델이 존재하지 않음", "The Argo CD Application CRD does not exist. Check that the GitOps Operator is installed.": "Argo CD Application CRD가 존재하지 않습니다. GitOps Operator가 설치되었는지 확인합니다.", - "Server": "서버", "Deny": "거부", "Allow": "허용", "No destinations configured": "구성된 대상 없음", @@ -360,6 +392,7 @@ "Clusters": "클러스터", "Manual Sync": "수동 동기화", "Time Zone": "시간대", + "Invalid duration": "Invalid duration", "All": "모두", "Allowed": "허용됨", "Denied": "거부됨", @@ -385,7 +418,6 @@ "Retry": "다시 시도", "Restart": "재시작", "Rollback": "롤백", - "Age": "수명", "Info": "정보", "Ready containers": "준비된 컨테이너", "ready": "준비 완료", @@ -448,13 +480,10 @@ "No Argo CD ApplicationSets": "Argo CD ApplicationSets 없음", "There was an error retrieving applicationsets. Check your connection and reload the page.": "applicationsets를 검색하는 동안 오류가 발생했습니다. 연결을 확인하고 페이지를 다시 로드합니다.", "No labels": "레이블 없음", - "Namespace defines the space within which each name must be unique.": "네임 스페이스는 각 이름을 고유해야 하는 공간을 정의합니다.", "Map of string keys and values that can be used to organize and categorize (scope and select) objects.": "객체를 구성하고 분류(범위 지정 및 선택)하는 데 사용할 수 있는 문자열 키와 값의 맵입니다.", "Edit": "편집", "Annotations": "주석", "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.": "주석은 리소스와 함께 저장되는 비구조화된 키-값 맵으로, 외부 도구가 임의의 메타데이터를 저장하고 검색하는 데 사용할 수 있습니다. 이는 쿼리할 수 없으며 오브젝트를 수정할 때 보존되어야 합니다.", - "Created at": "생성 시간", - "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time은 시간을 나타내는 래퍼입니다. Time 타입은 올바른 YAML 및 JSON 마샬링을 지원합니다.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "소유자 참조는 이 리소스를 상위 객체에 연결합니다. 예를 들어 ApplicationSet에서 생성된 애플리케이션은 해당 ApplicationSet이 소유자로 지정됩니다. 이 관계를 통해 적절한 리소스 라이프사이클 관리 및 가비지 컬렉션이 가능합니다.", "Extra": "추가", "Manage columns": "열 관리", @@ -481,7 +510,6 @@ "Stop": "중지", "Refresh": "새로 고침", "Refresh (Hard)": "새로 고침(강제)", - "Actions": "작업", "You don't have permission to perform this action": "이 작업을 수행할 수 있는 권한이 없습니다", "annotations": "주석", "annotation": "주석", diff --git a/locales/zh/plugin__gitops-plugin.json b/locales/zh/plugin__gitops-plugin.json index 3055ad0d6..098530ce9 100644 --- a/locales/zh/plugin__gitops-plugin.json +++ b/locales/zh/plugin__gitops-plugin.json @@ -61,7 +61,6 @@ "Started At": "开始于", "When the operation was started.": "启动该操作的时间。", "Duration": "持续时间", - "Invalid duration": "Invalid duration", "How long the operation took to complete.": "操作完成所需的时间。", "Finished At": "完成时间", "When the operation was finished.": "操作完成后。", @@ -118,9 +117,48 @@ "Progressive Sync Flow View": "渐进式同步流程视图", "Expand or collapse all progressive sync step groups": "展开或折叠所有渐进式同步步骤组", "No Applications In This Step": "此步骤中没有应用程序", + "Error: Missing required route parameters": "错误:缺少必需的路由参数", + "SSO degraded": "SSO degraded", + "Keycloak": "Keycloak", + "Dex / OpenShift OAuth": "Dex / OpenShift OAuth", + "Dex": "Dex", + "The health status of the {{component}} component.": "The health status of the {{component}} component.", + "Namespace defines the space within which each name must be unique.": "命名空间定义了一个空间,其中的每个名称必须是唯一的。", + "Server": "服务器", + "The hostname of the Argo CD server, once provisioned.": "The hostname of the Argo CD server, once provisioned.", + "Version": "Version", + "The requested Argo CD version to install.": "The requested Argo CD version to install.", + "SSO": "SSO", + "The single sign-on provider configured for Argo CD.": "The single sign-on provider configured for Argo CD.", + "RBAC": "RBAC", + "The ConfigMap that defines the RBAC policy for Argo CD.": "The ConfigMap that defines the RBAC policy for Argo CD.", + "Notifications": "Notifications", + "The ConfigMap that defines the notification templates for Argo CD.": "The ConfigMap that defines the notification templates for Argo CD.", + "Created at": "创建于", + "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time 是对 time 的封装。支持正确进行 YAML 和 JSON 编组的 Time 类型。", + "Managed components": "Managed components", + "ArgoCD": "ArgoCD", + "No ArgoCD Instances match the search filter": "No ArgoCD Instances match the search filter", + "Try removing the filter or searching for a different term to see more ArgoCD Instances.": "Try removing the filter or searching for a different term to see more ArgoCD Instances.", + "There are no ArgoCD Instances in this namespace.": "There are no ArgoCD Instances in this namespace.", + "There are no ArgoCD Instances in all namespaces.": "There are no ArgoCD Instances in all namespaces.", + "No matching ArgoCD Instances": "No matching ArgoCD Instances", + "No ArgoCD Instances": "No ArgoCD Instances", + "Unable to load data": "无法加载数据", + "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.": "There was an error retrieving ArgoCD Instances. Check your connection and reload the page.", + "ArgoCD Instances": "ArgoCD Instances", + "Create ArgoCD": "Create ArgoCD", + "Age": "年龄", + "Actions": "行动", + "Healthy": "健康", + "Degraded": "降级", + "Progressing": "进行中", + "Unknown": "未知", + "There was an error retrieving the ArgoCD. Check your connection and reload the page.": "There was an error retrieving the ArgoCD. Check your connection and reload the page.", + "Edit ArgoCD": "Edit ArgoCD", + "Delete ArgoCD": "Delete ArgoCD", "Edit ImageUpdater": "编辑 ImageUpdater", "Delete ImageUpdater": "删除 ImageUpdater", - "Error: Missing required route parameters": "错误:缺少必需的路由参数", "True": "真", "False": "假", "ImageUpdater details": "ImageUpdater 详情", @@ -144,7 +182,6 @@ "There are no ImageUpdaters in all namespaces.": "所有命名空间中都没有 ImageUpdaters。", "No matching ImageUpdaters": "没有匹配的 ImageUpdaters", "No ImageUpdaters": "没有 ImageUpdaters", - "Unable to load data": "无法加载数据", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "获取 ImageUpdater 时出错。检查您的连接并重新载入页面。", "ImageUpdaters": "ImageUpdaters", "Create ImageUpdater": "创建 ImageUpdater", @@ -171,12 +208,8 @@ "Application Overview": "应用程序概述", "Infrastructure": "基础架构", "GitOps Overview": "GitOps 概述", - "Healthy": "健康", - "Progressing": "进行中", - "Degraded": "降级", "Missing": "缺少", "Suspended": "暂停", - "Unknown": "未知", "Health status": "健康状态", "Unable to retrieve applications": "无法检索应用程序", "Error retrieving applications: {{x}}": "检索应用程序时出错:{{x}}", @@ -255,13 +288,13 @@ "Recent Operations": "当前的操作", "(Last {{x}} operations)": "(最后 {{x}} 操作)", "No recent operations": "没有当前的操作", + "Reconciliations (24h sliding window)": "协调 (24h 滑动窗口)", "Application Reconciliation Performance (24 hours)": "应用程序协调性能 (24 小时)", "Unable to retrieve metrics data": "无法检索指标数据", "Cannot retrieve data for the Argo CD reconciliation performance. Check that the cluster metrics monitoring is enabled.": "无法检索 Argo CD 协调性能的数据。检查是否启用了集群指标监控。", "Application reconciliation performance over time": "应用程序会随时间协调性能", "View in Observe/Metrics": "Observe/Metrics 中的视图", "Syncs (24h sliding window)": "同步 (24h 滑动窗口)", - "Reconciliations (24h sliding window)": "协调 (24h 滑动窗口)", "Synced": "同步", "Out of Sync": "未同步", "Application Sync Activity (24 hours)": "应用程序同步活动 (24 小时)", @@ -271,7 +304,6 @@ "Application sync activity over time": "应用程序同步活动", "Application model does not exist": "应用程序模型不存在", "The Argo CD Application CRD does not exist. Check that the GitOps Operator is installed.": "Argo CD 应用程序 CRD 不存在。检查是否安装了 GitOps Operator。", - "Server": "服务器", "Deny": "拒绝", "Allow": "允许", "No destinations configured": "没有配置目的地", @@ -360,6 +392,7 @@ "Clusters": "集群", "Manual Sync": "手动同步", "Time Zone": "时区", + "Invalid duration": "Invalid duration", "All": "所有", "Allowed": "已允许", "Denied": "已拒绝", @@ -385,7 +418,6 @@ "Retry": "重试", "Restart": "重启", "Rollback": "回滚", - "Age": "年龄", "Info": "信息", "Ready containers": "就绪容器", "ready": "就绪", @@ -448,13 +480,10 @@ "No Argo CD ApplicationSets": "没有 Argo CD ApplicationSets", "There was an error retrieving applicationsets. Check your connection and reload the page.": "获取应用程序时出错。检查您的连接并重新载入页面。", "No labels": "没有标签", - "Namespace defines the space within which each name must be unique.": "命名空间定义了一个空间,其中的每个名称必须是唯一的。", "Map of string keys and values that can be used to organize and categorize (scope and select) objects.": "用于组织和分类(范围和选择)对象的字符串键和值映射。", "Edit": "编辑", "Annotations": "注解", "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.": "注解是一个无结构的键值映射,资源可由外部工具存储和检索任意元数据。它们不可查询,并在修改对象时被保留。", - "Created at": "创建于", - "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time 是对 time 的封装。支持正确进行 YAML 和 JSON 编组的 Time 类型。", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "所有者引用将此资源关联到其父对象。例如,一个 ApplicationSet 生成的应用程序会将 ApplicationSet 作为所有者。这种关联关系可实现正确的资源生命周期管理和垃圾回收。", "Extra": "额外", "Manage columns": "管理列", @@ -481,7 +510,6 @@ "Stop": "停止", "Refresh": "刷新", "Refresh (Hard)": "刷新(强制)", - "Actions": "行动", "You don't have permission to perform this action": "您没有执行此操作的权限", "annotations": "注解", "annotation": "注解", diff --git a/plugin-metadata.ts b/plugin-metadata.ts index bca7f99ec..d2ecb71ff 100644 --- a/plugin-metadata.ts +++ b/plugin-metadata.ts @@ -12,8 +12,10 @@ const metadata: ConsolePluginBuildMetadata = { "gitopsFlags": "./plugin/utils/flags", "topology": "./gitops/topology", ApplicationList: "./gitops/components/application/ApplicationListTab.tsx", + ArgoCDList: "./gitops/components/argocd/ArgoCDListTab.tsx", DashboardOverviewPage: "./gitops/components/overview/DashboardOverviewPage.tsx", ApplicationDetails: "./gitops/components/application/ApplicationNavPage.tsx", + ArgoCDDetails: "./gitops/components/argocd/ArgoCDNavPage.tsx", RolloutList: "./gitops/components/rollout/RolloutListTab.tsx", RolloutDetails: "./gitops/components/rollout/RolloutNavPage.tsx", ApplicationSetList: "./gitops/components/application/ApplicationSetListTab.tsx", diff --git a/src/gitops/components/argocd/ArgoCDDetailsPage.tsx b/src/gitops/components/argocd/ArgoCDDetailsPage.tsx new file mode 100644 index 000000000..bcc05362d --- /dev/null +++ b/src/gitops/components/argocd/ArgoCDDetailsPage.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; +import { useParams } from 'react-router-dom-v5-compat'; + +import { useGitOpsTranslation } from '../../utils/hooks/useGitOpsTranslation'; + +import ArgoCDNavPage from './ArgoCDNavPage'; + +const ArgoCDDetailsPage: React.FC = () => { + const { t } = useGitOpsTranslation(); + const { name, ns } = useParams<{ name?: string; ns?: string }>(); + + if (!name || !ns) { + return
{t('Error: Missing required route parameters')}
; + } + + return ; +}; + +export default ArgoCDDetailsPage; diff --git a/src/gitops/components/argocd/ArgoCDDetailsTab.test.tsx b/src/gitops/components/argocd/ArgoCDDetailsTab.test.tsx new file mode 100644 index 000000000..7a0ede02e --- /dev/null +++ b/src/gitops/components/argocd/ArgoCDDetailsTab.test.tsx @@ -0,0 +1,113 @@ +import { renderToStaticMarkup } from 'react-dom/server'; + +import { ArgoCDKind } from '../../models/ArgoCDModel'; + +import { getArgoCDSsoLabel, ManagedComponentsList } from './ArgoCDDetailsTab'; + +const t = (key: string) => key; + +const argocd = (spec?: ArgoCDKind['spec'], status?: ArgoCDKind['status']) => + ({ + metadata: { name: 'my-argocd' }, + spec, + status, + } as unknown as ArgoCDKind); + +describe('getArgoCDSsoLabel', () => { + it('reports SSO degraded when the sso controller status is Failed', () => { + expect( + getArgoCDSsoLabel(argocd({ sso: { provider: 'keycloak' } }, { sso: 'Failed' } as any), t), + ).toBe('SSO degraded'); + }); + + it('labels Keycloak regardless of case', () => { + expect(getArgoCDSsoLabel(argocd({ sso: { provider: 'Keycloak' } }), t)).toBe('Keycloak'); + }); + + it('labels Dex with OpenShift OAuth', () => { + expect( + getArgoCDSsoLabel(argocd({ sso: { provider: 'dex', dex: { openShiftOAuth: true } } }), t), + ).toBe('Dex / OpenShift OAuth'); + }); + + it('labels plain Dex without OpenShift OAuth', () => { + expect( + getArgoCDSsoLabel(argocd({ sso: { provider: 'dex', dex: { openShiftOAuth: false } } }), t), + ).toBe('Dex'); + }); + + it('falls back to "-" when no provider is configured', () => { + expect(getArgoCDSsoLabel(argocd(), t)).toBe('-'); + expect(getArgoCDSsoLabel(argocd({ sso: { provider: 'unknown-provider' } }), t)).toBe('-'); + }); +}); + +describe('ManagedComponentsList', () => { + it('renders nothing when no component statuses are reported', () => { + const markup = renderToStaticMarkup(); + expect(markup).not.toContain('applicationController'); + }); + + it('only lists components that report a status', () => { + const markup = renderToStaticMarkup( + , + ); + + expect(markup).toContain('applicationController'); + expect(markup).toContain('server'); + expect(markup).not.toContain('redis'); + expect(markup).not.toContain('sso'); + }); + + it('renders the mapped ArgoCD status for each component', () => { + const markup = renderToStaticMarkup( + , + ); + + expect(markup).toContain('Degraded'); + expect(markup).toContain('Progressing'); + }); + + it('picks up components the plugin does not know about ahead of time', () => { + const markup = renderToStaticMarkup( + , + ); + + expect(markup).toContain('imageUpdater'); + expect(markup).toContain('promoter'); + }); + + it('excludes status fields that are not per-component health', () => { + const markup = renderToStaticMarkup( + , + ); + + expect(markup).toContain('applicationController'); + expect(markup).not.toContain('host'); + expect(markup).not.toContain('phase'); + expect(markup).not.toContain('conditions'); + }); +}); diff --git a/src/gitops/components/argocd/ArgoCDDetailsTab.tsx b/src/gitops/components/argocd/ArgoCDDetailsTab.tsx new file mode 100644 index 000000000..acf7b65f6 --- /dev/null +++ b/src/gitops/components/argocd/ArgoCDDetailsTab.tsx @@ -0,0 +1,197 @@ +import * as React from 'react'; +import { RouteComponentProps } from 'react-router'; +import classNames from 'classnames'; + +import ExternalLink from '@gitops/utils/components/ExternalLink/ExternalLink'; +import { ResourceLink, Timestamp } from '@openshift-console/dynamic-plugin-sdk'; +import { + DescriptionList, + Flex, + FlexItem, + PageSection, + PageSectionVariants, + Title, +} from '@patternfly/react-core'; + +import { ArgoCDKind, ArgoCDStatus as ArgoCDStatusFields } from '../../models/ArgoCDModel'; +import { useGitOpsTranslation } from '../../utils/hooks/useGitOpsTranslation'; +import { DetailsDescriptionGroup } from '../shared/BaseDetailsSummary/BaseDetailsSummary'; + +import { ArgoCDStatus, toArgoCDStatus } from './argoCDListFilters'; + +// Fixed Argo CD core resource names, not templated per ArgoCD instance. +const ARGOCD_RBAC_CONFIGMAP_NAME = 'argocd-rbac-cm'; +const ARGOCD_NOTIFICATIONS_CONFIGMAP_NAME = 'argocd-notifications-cm'; + +export const getArgoCDSsoLabel = (obj: ArgoCDKind, t: (key: string) => string): string => { + if (toArgoCDStatus(obj.status?.sso) === ArgoCDStatus.DEGRADED) { + return t('SSO degraded'); + } + + const provider = obj.spec?.sso?.provider?.toLowerCase(); + if (provider === 'keycloak') { + return t('Keycloak'); + } + if (provider === 'dex') { + return obj.spec?.sso?.dex?.openShiftOAuth ? t('Dex / OpenShift OAuth') : t('Dex'); + } + return '-'; +}; + +// Fields on ArgoCDStatus that aren't per-component health, so they're excluded when +// listing managed components. Any other status field is treated as a controller, +// which keeps the list accurate as the operator adds components over time. +const NON_CONTROLLER_STATUS_FIELDS: ReadonlySet = new Set([ + 'host', + 'phase', + 'conditions', +]); + +export const ManagedComponentsList: React.FC<{ obj: ArgoCDKind }> = ({ obj }) => { + const { t } = useGitOpsTranslation(); + + const components = Object.entries(obj.status ?? {}) + .filter( + ([id, rawStatus]) => + !NON_CONTROLLER_STATUS_FIELDS.has(id as keyof ArgoCDStatusFields) && + typeof rawStatus === 'string' && + rawStatus, + ) + .map(([id, rawStatus]) => ({ id, rawStatus: rawStatus as string })); + + return ( + + {components.map((component) => ( + + {toArgoCDStatus(component.rawStatus)} + + ))} + + ); +}; + +type ArgoCDDetailsTabProps = RouteComponentProps<{ ns: string; name: string }> & { + obj?: ArgoCDKind; +}; + +const ArgoCDDetailsTab: React.FC = ({ obj }) => { + const { t } = useGitOpsTranslation(); + + if (!obj) return null; + + return ( + <> + + + + + + + {obj.metadata?.name} + + + + {obj.metadata?.namespace} + + + + {obj.status?.host ? ( + + ) : ( + '-' + )} + + + + {obj.spec?.version || '-'} + + + + {getArgoCDSsoLabel(obj, t)} + + + + + + + + {obj.spec?.notifications?.enabled ? ( + + ) : ( + '-' + )} + + + + + + + + + + + + + + {t('Managed components')} + + + + + + + + + ); +}; + +export default ArgoCDDetailsTab; diff --git a/src/gitops/components/argocd/ArgoCDList.tsx b/src/gitops/components/argocd/ArgoCDList.tsx new file mode 100644 index 000000000..c09c083fa --- /dev/null +++ b/src/gitops/components/argocd/ArgoCDList.tsx @@ -0,0 +1,434 @@ +import * as React from 'react'; +import { useTranslation } from 'react-i18next'; +import { useLocation } from 'react-router-dom-v5-compat'; + +import ActionsDropdown from '@gitops/utils/components/ActionDropDown/ActionDropDown'; +import { + HealthDegradedIcon, + HealthHealthyIcon, + HealthProgressingIcon, + HealthUnknownIcon, +} from '@gitops/utils/components/Icons/Icons'; +import { modelToGroupVersionKind } from '@gitops/utils/utils'; +import { + Action, + K8sResourceCommon, + ListPageBody, + ListPageCreate, + ListPageFilter, + ListPageHeader, + ResourceLink, + useK8sWatchResource, + useListPageFilter, +} from '@openshift-console/dynamic-plugin-sdk'; +import { ErrorState } from '@patternfly/react-component-groups'; +import { EmptyState, EmptyStateBody } from '@patternfly/react-core'; +import type { DataViewTd } from '@patternfly/react-data-view/dist/esm/DataViewTable'; +import { DataViewTh, DataViewTr } from '@patternfly/react-data-view/dist/esm/DataViewTable'; +import { CubesIcon } from '@patternfly/react-icons'; +import { Tbody, Td, ThProps, Tr } from '@patternfly/react-table'; + +import { ArgoCDKind, ArgoCDModel, argoCDModelRef } from '../../models/ArgoCDModel'; +import { + ShowOperandsInAllNamespacesRadioGroup, + useShowOperandsInAllNamespaces, +} from '../shared/AllNamespaces'; +import { + ARGOCD_LIST_COLUMN_MANAGEMENT_ID, + getArgoCDManagedColumns, +} from '../shared/argoCDListColumns'; +import { + type GitOpsManagedColumn, + NAMESPACE_COLUMN_ID, + useGitOpsColumnManagement, +} from '../shared/ColumnManagement'; +import { + GitOpsDataViewTable, + useGitOpsDataViewSort, + useGitOpsListPagePagination, +} from '../shared/DataView'; +import { AgeCell } from '../shared/dateUtils'; +import { GitOpsListPageToolbar } from '../shared/GitOpsListPageToolbar'; +import { filterByConsoleNameAndLabels, parseLabelFilterParam } from '../shared/listPageTextFilters'; + +import { useArgoCDActionsProvider } from './hooks/useArgoCDActionsProvider'; +import { + ARGOCD_STATUS_FILTER_PARAM, + ArgoCDStatus, + filterArgoCDsByStatus, + getArgoCDRowFilters, + getArgoCDStatus, +} from './argoCDListFilters'; + +import './argocd-list.scss'; + +type ArgoCDListTabProps = { + namespace?: string; + hideNameLabelFilters?: boolean; + showTitle?: boolean; +}; + +const ArgoCDList: React.FC = ({ + namespace, + hideNameLabelFilters, + showTitle, +}) => { + const location = useLocation(); + const [showOperandsInAllNamespaces] = useShowOperandsInAllNamespaces(); + const listAllNamespaces = + location.pathname?.includes('openshift-gitops-operator') && showOperandsInAllNamespaces; + const effectiveNamespace = listAllNamespaces ? null : namespace; + const [ArgoCDs, loaded, loadError] = useK8sWatchResource({ + isList: true, + groupVersionKind: modelToGroupVersionKind(ArgoCDModel), + namespaced: !listAllNamespaces, + namespace: effectiveNamespace, + }); + const { t } = useTranslation('plugin__gitops-plugin'); + const includeNamespaceColumn = !effectiveNamespace || effectiveNamespace === ''; + const managedColumns = React.useMemo(() => getArgoCDManagedColumns(true, t), [t]); + + const { activeColumnIds, columnManagement, filterDataView, tableID } = useGitOpsColumnManagement({ + columnManagementID: ARGOCD_LIST_COLUMN_MANAGEMENT_ID, + columns: managedColumns, + resourceType: t('ArgoCD'), + includeNamespaceColumn, + showNamespaceHelp: includeNamespaceColumn, + }); + + const columnSortConfig = React.useMemo( + () => + managedColumns.filter((column) => !column.alwaysShown).map((column) => ({ key: column.id })), + [managedColumns], + ); + + const { searchParams, sortBy, direction, getSortParams } = + useGitOpsDataViewSort(columnSortConfig); + + // Get search query from URL parameters + const searchQuery = searchParams.get('q') || ''; + const nameQuery = searchParams.get('name') || ''; + const labelsParam = searchParams.get('labels') || ''; + const statusFilterParam = searchParams.get(ARGOCD_STATUS_FILTER_PARAM); + + const columnsDV = useColumnsDV(managedColumns, getSortParams, columnSortConfig); + const sortedItems = React.useMemo(() => { + return sortData(ArgoCDs as ArgoCDKind[], sortBy, direction); + }, [ArgoCDs, sortBy, direction]); + + const filters = React.useMemo(() => getArgoCDRowFilters(t), [t]); + const [data, , onFilterChange] = useListPageFilter(sortedItems, filters); + + const filteredByStatus = React.useMemo( + () => filterArgoCDsByStatus(data as ArgoCDKind[], parseLabelFilterParam(statusFilterParam)), + [data, statusFilterParam], + ); + + const filteredByNameAndLabels = React.useMemo( + () => + filterByConsoleNameAndLabels(filteredByStatus, nameQuery, parseLabelFilterParam(labelsParam)), + [filteredByStatus, nameQuery, labelsParam], + ); + + const filteredBySearch = React.useMemo(() => { + if (!searchQuery) return filteredByNameAndLabels; + + const lowerQuery = searchQuery.toLowerCase(); + return filteredByNameAndLabels.filter((item) => { + const name = item.metadata?.name || ''; + const labels = item.metadata?.labels || {}; + return ( + name.toLowerCase().includes(lowerQuery) || + Object.entries(labels).some(([key, value]) => { + const labelSelector = `${key}=${value || ''}`; + return ( + labelSelector.toLowerCase().includes(lowerQuery) || + key.toLowerCase().includes(lowerQuery) + ); + }) + ); + }); + }, [filteredByNameAndLabels, searchQuery]); + + const { pagination, pagedItems, itemCount } = useGitOpsListPagePagination({ + items: filteredBySearch as ArgoCDKind[], + namespace: effectiveNamespace, + searchParams, + }); + const rows = useArgoCDRowsDV(pagedItems, managedColumns); + const columnIds = React.useMemo( + () => managedColumns.map((column) => column.id), + [managedColumns], + ); + const { columns: visibleColumnsDV, rows: visibleRows } = React.useMemo( + () => filterDataView(columnsDV, rows, columnIds, activeColumnIds), + [filterDataView, columnsDV, rows, columnIds, activeColumnIds], + ); + + const hasItems = React.useMemo(() => { + return sortedItems.length > 0; + }, [sortedItems]); + + const getEmptyStateBody = () => { + if (searchQuery) { + return ( + <> + {t('No ArgoCD Instances match the search filter')}{' '} + "{searchQuery}" + . +
+ {t( + 'Try removing the filter or searching for a different term to see more ArgoCD Instances.', + )} + + ); + } + return effectiveNamespace + ? t('There are no ArgoCD Instances in this namespace.') + : t('There are no ArgoCD Instances in all namespaces.'); + }; + + const empty = ( + + + + + {getEmptyStateBody()} + + + + + ); + const error = loadError && ( + + + + + + + + ); + const isEmptyState = !loadError && visibleRows.length === 0; + + const listPageFilter = !hideNameLabelFilters && hasItems && ( + + ); + + return ( +
+ {showTitle == undefined && ( + + ) : null + } + hideFavoriteButton={false} + > + {t('Create ArgoCD')} + + )} + + {hasItems && ( + + )} + + +
+ ); +}; + +export const sortData = ( + data: ArgoCDKind[], + sortBy: string | undefined, + direction: 'asc' | 'desc' | undefined, +) => { + if (!(sortBy && direction)) return data || []; + if (!data) return []; + + return [...data].sort((a, b) => { + let aValue: any, bValue: any; + + switch (sortBy) { + case 'name': + aValue = a.metadata?.name || ''; + bValue = b.metadata?.name || ''; + break; + case 'namespace': + aValue = a.metadata?.namespace || ''; + bValue = b.metadata?.namespace || ''; + break; + case 'age': + aValue = a.metadata?.creationTimestamp || ''; + bValue = b.metadata?.creationTimestamp || ''; + default: + return 0; + } + + if (direction === 'asc') { + // eslint-disable-next-line no-nested-ternary + return aValue < bValue ? -1 : aValue > bValue ? 1 : 0; + } else { + // eslint-disable-next-line no-nested-ternary + return aValue > bValue ? -1 : aValue < bValue ? 1 : 0; + } + }); +}; + +export const useColumnsDV = ( + managedColumns: GitOpsManagedColumn[], + getSortParams: (columnIndex: number) => ThProps['sort'], + columnSortConfig: { key: string }[], +): DataViewTh[] => { + const { t } = useTranslation('plugin__gitops-plugin'); + + const titleById: Record = { + name: t('Name'), + [NAMESPACE_COLUMN_ID]: t('Namespace'), + status: t('Status'), + version: t('Version'), + age: t('Age'), + actions: t('Actions'), + }; + + return managedColumns.map((column) => { + if (column.id === 'actions') { + return { + cell: titleById.actions, + }; + } + const sortIndex = columnSortConfig.findIndex((entry) => entry.key === column.id); + return { + cell: titleById[column.id] ?? column.title, + props: { + 'aria-label': column.id, + ...(sortIndex >= 0 ? { sort: getSortParams(sortIndex) } : {}), + }, + }; + }); +}; + +export const useArgoCDRowsDV = ( + argoCDList: ArgoCDKind[], + managedColumns: GitOpsManagedColumn[], +): DataViewTr[] => { + const rows: DataViewTr[] = []; + if (argoCDList === undefined || argoCDList.length === 0) { + return rows; + } + argoCDList.forEach((obj, index) => { + const cellsById: Record = { + name: { + cell: ( +
+ +
+ ), + id: 'name', + dataLabel: 'Name', + }, + [NAMESPACE_COLUMN_ID]: { + cell: , + id: obj.metadata.namespace, + dataLabel: 'Namespace', + }, + status: { + id: 'status', + cell: , + dataLabel: 'Status', + }, + version: { + id: 'version', + cell: obj.spec?.version || '-', + dataLabel: 'Version', + }, + age: { + id: 'age', + cell: , + dataLabel: 'Age', + }, + actions: { + id: 'actions-' + index, + cell: , + }, + }; + + rows.push(managedColumns.map((column) => cellsById[column.id])); + }); + return rows; +}; + +const ArgoCDStatusCell: React.FC<{ ArgoCD: ArgoCDKind }> = ({ ArgoCD }) => { + const { t } = useTranslation('plugin__gitops-plugin'); + + const status = getArgoCDStatus(ArgoCD); + + const iconByStatus: Record = { + [ArgoCDStatus.HEALTHY]: , + [ArgoCDStatus.DEGRADED]: , + [ArgoCDStatus.PROGRESSING]: , + [ArgoCDStatus.UNKNOWN]: , + }; + + const labelByStatus: Record = { + [ArgoCDStatus.HEALTHY]: t('Healthy'), + [ArgoCDStatus.DEGRADED]: t('Degraded'), + [ArgoCDStatus.PROGRESSING]: t('Progressing'), + [ArgoCDStatus.UNKNOWN]: t('Unknown'), + }; + + return ( +
+ {iconByStatus[status]} {labelByStatus[status]} +
+ ); +}; + +const ArgoCDActionsCell: React.FC<{ + ArgoCD: ArgoCDKind; + index: number; +}> = ({ ArgoCD, index }) => { + const actionList: Action[] = useArgoCDActionsProvider(ArgoCD); + return ( +
+ +
+ ); +}; + +export default ArgoCDList; diff --git a/src/gitops/components/argocd/ArgoCDListTab.tsx b/src/gitops/components/argocd/ArgoCDListTab.tsx new file mode 100644 index 000000000..d7b0e4b07 --- /dev/null +++ b/src/gitops/components/argocd/ArgoCDListTab.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; + +import ArgoCDList from './ArgoCDList'; + +type ArgoCDListTabProps = { + namespace?: string; + hideNameLabelFilters?: boolean; + showTitle?: boolean; +}; + +const ArgoCDListTab: React.FC = ({ + namespace, + hideNameLabelFilters, + showTitle, +}) => { + return ( + + ); +}; + +export default ArgoCDListTab; diff --git a/src/gitops/components/argocd/ArgoCDNavPage.tsx b/src/gitops/components/argocd/ArgoCDNavPage.tsx new file mode 100644 index 000000000..4395a4494 --- /dev/null +++ b/src/gitops/components/argocd/ArgoCDNavPage.tsx @@ -0,0 +1,81 @@ +import * as React from 'react'; + +import { modelToGroupVersionKind } from '@gitops/utils/utils'; +import { HorizontalNav, useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk'; +import { ErrorState } from '@patternfly/react-component-groups'; +import { Bullseye, Spinner } from '@patternfly/react-core'; + +import { ArgoCDKind, ArgoCDModel } from '../../models/ArgoCDModel'; +import { useGitOpsTranslation } from '../../utils/hooks/useGitOpsTranslation'; +import DetailsPageHeader from '../shared/DetailsPageHeader/DetailsPageHeader'; +import ResourceYAMLTab from '../shared/ResourceYAMLTab/ResourceYAMLTab'; + +import { useArgoCDActionsProvider } from './hooks/useArgoCDActionsProvider'; +import ArgoCDDetailsTab from './ArgoCDDetailsTab'; + +type ArgoCDPageProps = { + name: string; + namespace: string; + kind: string; +}; + +const ArgoCDNavPage: React.FC = ({ name, namespace, kind }) => { + const { t } = useGitOpsTranslation(); + const [ArgoCD, loaded, loadError] = useK8sWatchResource({ + groupVersionKind: modelToGroupVersionKind(ArgoCDModel), + kind, + name, + namespace, + }); + + const actions = useArgoCDActionsProvider(ArgoCD); + + const pages = React.useMemo( + () => [ + { + href: '', + name: t('Details'), + component: ArgoCDDetailsTab, + }, + { + href: 'yaml', + name: t('YAML'), + component: ResourceYAMLTab, + }, + ], + [t], + ); + + return ( + <> + + {/* eslint-disable-next-line no-nested-ternary */} + {loaded && !loadError ? ( +
+ +
+ ) : loadError ? ( + + ) : ( + + + + )} + + ); +}; + +export default ArgoCDNavPage; diff --git a/src/gitops/components/argocd/argoCDListFilters.test.ts b/src/gitops/components/argocd/argoCDListFilters.test.ts new file mode 100644 index 000000000..dbf0eae95 --- /dev/null +++ b/src/gitops/components/argocd/argoCDListFilters.test.ts @@ -0,0 +1,120 @@ +import { ArgoCDKind } from '../../models/ArgoCDModel'; + +import { + ARGOCD_STATUS_FILTER_PARAM, + ARGOCD_STATUS_FILTER_TYPE, + ArgoCDStatus, + filterArgoCDsByStatus, + getArgoCDRowFilters, + getArgoCDStatus, + matchesArgoCDStatusFilter, + toArgoCDStatus, +} from './argoCDListFilters'; + +const t = (key: string) => key; + +const argocd = (name: string, phase?: string) => + ({ + metadata: { name }, + status: phase ? { phase } : undefined, + } as unknown as ArgoCDKind); + +describe('ARGOCD_STATUS_FILTER_TYPE / ARGOCD_STATUS_FILTER_PARAM', () => { + it('uses stable filter identifiers', () => { + expect(ARGOCD_STATUS_FILTER_TYPE).toBe('argocd-status'); + expect(ARGOCD_STATUS_FILTER_PARAM).toBe('rowFilter-argocd-status'); + }); +}); + +describe('toArgoCDStatus', () => { + it('maps controller statuses to ArgoCD statuses', () => { + expect(toArgoCDStatus('Running')).toBe(ArgoCDStatus.HEALTHY); + expect(toArgoCDStatus('Failed')).toBe(ArgoCDStatus.DEGRADED); + expect(toArgoCDStatus('Pending')).toBe(ArgoCDStatus.PROGRESSING); + expect(toArgoCDStatus('Unknown')).toBe(ArgoCDStatus.UNKNOWN); + }); + + it('treats unrecognized or missing values as Unknown', () => { + expect(toArgoCDStatus('SomethingElse')).toBe(ArgoCDStatus.UNKNOWN); + expect(toArgoCDStatus(undefined)).toBe(ArgoCDStatus.UNKNOWN); + }); +}); + +describe('getArgoCDStatus', () => { + it('returns Unknown when status or phase is missing', () => { + expect(getArgoCDStatus(undefined)).toBe(ArgoCDStatus.UNKNOWN); + expect(getArgoCDStatus(argocd('none'))).toBe(ArgoCDStatus.UNKNOWN); + }); + + it('maps the operator-reported phase to an ArgoCD status', () => { + expect(getArgoCDStatus(argocd('ok', 'Available'))).toBe(ArgoCDStatus.HEALTHY); + expect(getArgoCDStatus(argocd('wait', 'Pending'))).toBe(ArgoCDStatus.PROGRESSING); + expect(getArgoCDStatus(argocd('bad', 'Failed'))).toBe(ArgoCDStatus.DEGRADED); + expect(getArgoCDStatus(argocd('unk', 'Unknown'))).toBe(ArgoCDStatus.UNKNOWN); + }); + + it('treats an unrecognized phase as Unknown', () => { + expect(getArgoCDStatus(argocd('odd', 'SomethingElse'))).toBe(ArgoCDStatus.UNKNOWN); + }); +}); + +describe('matchesArgoCDStatusFilter', () => { + it('passes everything when nothing is selected', () => { + expect(matchesArgoCDStatusFilter(undefined, argocd('none'))).toBe(true); + expect(matchesArgoCDStatusFilter([], argocd('none'))).toBe(true); + }); + + it('only keeps ArgoCDs matching one of the selected statuses', () => { + const healthy = argocd('ok', 'Available'); + const degraded = argocd('bad', 'Failed'); + + expect(matchesArgoCDStatusFilter([ArgoCDStatus.HEALTHY], healthy)).toBe(true); + expect(matchesArgoCDStatusFilter([ArgoCDStatus.HEALTHY], degraded)).toBe(false); + }); +}); + +describe('filterArgoCDsByStatus', () => { + const healthy = argocd('healthy-one', 'Available'); + const degraded = argocd('degraded-one', 'Failed'); + const progressing = argocd('progressing-one', 'Pending'); + + it('returns all items when no statuses are selected', () => { + expect(filterArgoCDsByStatus([healthy, degraded], [])).toEqual([healthy, degraded]); + }); + + it('returns an empty array when the input list is undefined', () => { + expect(filterArgoCDsByStatus(undefined, [ArgoCDStatus.HEALTHY])).toEqual([]); + }); + + it('filters to the selected statuses', () => { + const result = filterArgoCDsByStatus( + [healthy, degraded, progressing], + [ArgoCDStatus.HEALTHY, ArgoCDStatus.DEGRADED], + ); + expect(result.map((item) => item.metadata.name)).toEqual(['healthy-one', 'degraded-one']); + }); +}); + +describe('getArgoCDRowFilters', () => { + it('builds a single Status filter group covering all statuses', () => { + const [statusFilter] = getArgoCDRowFilters(t); + + expect(statusFilter.filterGroupName).toBe('Status'); + expect(statusFilter.type).toBe(ARGOCD_STATUS_FILTER_TYPE); + expect(statusFilter.items.map((item) => item.id)).toEqual([ + ArgoCDStatus.HEALTHY, + ArgoCDStatus.PROGRESSING, + ArgoCDStatus.DEGRADED, + ArgoCDStatus.UNKNOWN, + ]); + }); + + it('wires the reducer and filter to the shared status helpers', () => { + const [statusFilter] = getArgoCDRowFilters(t) as any[]; + const healthy = argocd('ok', 'Available'); + + expect(statusFilter.reducer(healthy)).toBe(ArgoCDStatus.HEALTHY); + expect(statusFilter.filter({ selected: [ArgoCDStatus.HEALTHY] }, healthy)).toBe(true); + expect(statusFilter.filter({ selected: [ArgoCDStatus.DEGRADED] }, healthy)).toBe(false); + }); +}); diff --git a/src/gitops/components/argocd/argoCDListFilters.ts b/src/gitops/components/argocd/argoCDListFilters.ts new file mode 100644 index 000000000..7dec03ac7 --- /dev/null +++ b/src/gitops/components/argocd/argoCDListFilters.ts @@ -0,0 +1,69 @@ +import { RowFilter } from '@openshift-console/dynamic-plugin-sdk'; + +import { ArgoCDKind } from '../../models/ArgoCDModel'; + +export const ARGOCD_STATUS_FILTER_TYPE = 'argocd-status'; +export const ARGOCD_STATUS_FILTER_PARAM = `rowFilter-${ARGOCD_STATUS_FILTER_TYPE}`; + +export enum ArgoCDStatus { + HEALTHY = 'Healthy', + DEGRADED = 'Degraded', + PROGRESSING = 'Progressing', + UNKNOWN = 'Unknown', +} + +const CONTROLLER_STATUS_TO_ARGOCD_STATUS: Record = { + Running: ArgoCDStatus.HEALTHY, + Failed: ArgoCDStatus.DEGRADED, + Pending: ArgoCDStatus.PROGRESSING, + Unknown: ArgoCDStatus.UNKNOWN, +}; + +export const toArgoCDStatus = (controllerStatus: string | undefined): ArgoCDStatus => + (controllerStatus && CONTROLLER_STATUS_TO_ARGOCD_STATUS[controllerStatus]) || + ArgoCDStatus.UNKNOWN; + +const PHASE_TO_ARGOCD_STATUS: Record = { + Available: ArgoCDStatus.HEALTHY, + Failed: ArgoCDStatus.DEGRADED, + Pending: ArgoCDStatus.PROGRESSING, + Unknown: ArgoCDStatus.UNKNOWN, +}; + +// Phase is the operator's own lifecycle summary, so it stays accurate even if new +// managed components are added without this plugin knowing about them. +export const getArgoCDStatus = (ArgoCD: Pick | undefined): ArgoCDStatus => { + const phase = ArgoCD?.status?.phase; + return (phase && PHASE_TO_ARGOCD_STATUS[phase]) || ArgoCDStatus.UNKNOWN; +}; + +export const matchesArgoCDStatusFilter = ( + selected: string[] | undefined, + ArgoCD: Pick | undefined, +): boolean => { + if (!selected?.length) { + return true; + } + return selected.includes(getArgoCDStatus(ArgoCD)); +}; + +export const filterArgoCDsByStatus = ( + ArgoCDs: ArgoCDKind[] | undefined, + statusSelected: string[], +): ArgoCDKind[] => + (ArgoCDs ?? []).filter((ArgoCD) => matchesArgoCDStatusFilter(statusSelected, ArgoCD)); + +export const getArgoCDRowFilters = (t: (key: string) => string): RowFilter[] => [ + { + filterGroupName: t('Status'), + type: ARGOCD_STATUS_FILTER_TYPE, + reducer: (ArgoCD) => getArgoCDStatus(ArgoCD), + filter: (input, ArgoCD) => matchesArgoCDStatusFilter(input.selected, ArgoCD), + items: [ + { id: ArgoCDStatus.HEALTHY, title: ArgoCDStatus.HEALTHY }, + { id: ArgoCDStatus.PROGRESSING, title: ArgoCDStatus.PROGRESSING }, + { id: ArgoCDStatus.DEGRADED, title: ArgoCDStatus.DEGRADED }, + { id: ArgoCDStatus.UNKNOWN, title: ArgoCDStatus.UNKNOWN }, + ], + }, +]; diff --git a/src/gitops/components/argocd/argocd-list.scss b/src/gitops/components/argocd/argocd-list.scss new file mode 100644 index 000000000..7bc2f82a2 --- /dev/null +++ b/src/gitops/components/argocd/argocd-list.scss @@ -0,0 +1,29 @@ +// Content wrapping only — column widths come from DataView resize handles. +.gitops-argocd-list .pf-v6-c-table tbody td[data-label='Name'], +.gitops-argocd-list .pf-v6-c-table tbody td[data-label='Namespace'] { + white-space: nowrap !important; + overflow: hidden; + text-overflow: ellipsis; + + a, + .co-resource-item { + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + max-width: 100%; + } +} + +.gitops-argocd-list .pf-v6-c-table tbody td[data-label='Description'] { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.gitops-argocd-list__timestamp { + white-space: nowrap; +} + +.gitops-argocd-list__actions { + text-align: right; +} diff --git a/src/gitops/components/argocd/hooks/useArgoCDActionsProvider.tsx b/src/gitops/components/argocd/hooks/useArgoCDActionsProvider.tsx new file mode 100644 index 000000000..77ada5045 --- /dev/null +++ b/src/gitops/components/argocd/hooks/useArgoCDActionsProvider.tsx @@ -0,0 +1,90 @@ +import * as React from 'react'; +import { useNavigate } from 'react-router-dom-v5-compat'; + +import { + Action, + K8sVerb, + useAnnotationsModal, + useDeleteModal, + useLabelsModal, +} from '@openshift-console/dynamic-plugin-sdk'; + +import { ArgoCDKind, ArgoCDModel, argoCDModelRef } from '../../../models/ArgoCDModel'; +import { useGitOpsTranslation } from '../../../utils/hooks/useGitOpsTranslation'; + +type UseArgoCDActionsProvider = (ArgoCD: ArgoCDKind) => Action[]; + +export const useArgoCDActionsProvider: UseArgoCDActionsProvider = (ArgoCD) => { + const { t } = useGitOpsTranslation(); + const navigate = useNavigate(); + const launchLabelsModal = useLabelsModal(ArgoCD); + const launchAnnotationsModal = useAnnotationsModal(ArgoCD); + const launchDeleteModal = useDeleteModal(ArgoCD); + + const actions = React.useMemo( + () => [ + { + id: 'gitops-action-edit-labels-ArgoCD', + disabled: false, + label: t('Edit labels'), + accessReview: { + group: ArgoCDModel.apiGroup, + verb: 'patch' as K8sVerb, + resource: ArgoCDModel.plural, + namespace: ArgoCD?.metadata?.namespace, + }, + cta: () => { + launchLabelsModal(); + }, + }, + { + id: 'gitops-action-edit-annotations-ArgoCD', + disabled: false, + label: t('Edit annotations'), + accessReview: { + group: ArgoCDModel.apiGroup, + verb: 'patch' as K8sVerb, + resource: ArgoCDModel.plural, + namespace: ArgoCD?.metadata?.namespace, + }, + cta: () => { + launchAnnotationsModal(); + }, + }, + { + id: 'gitops-action-edit-ArgoCD', + disabled: !ArgoCD?.metadata?.namespace || !ArgoCD?.metadata?.name, + label: t('Edit ArgoCD'), + accessReview: { + group: ArgoCDModel.apiGroup, + verb: 'update' as K8sVerb, + resource: ArgoCDModel.plural, + namespace: ArgoCD?.metadata?.namespace, + }, + cta: () => { + if (!ArgoCD?.metadata?.namespace || !ArgoCD?.metadata?.name) { + return; + } + navigate( + `/k8s/ns/${ArgoCD?.metadata?.namespace}/${argoCDModelRef}/${ArgoCD?.metadata?.name}/yaml`, + ); + }, + }, + { + id: 'gitops-action-delete-ArgoCD', + disabled: false, + label: t('Delete ArgoCD'), + accessReview: { + group: ArgoCDModel.apiGroup, + verb: 'delete' as K8sVerb, + resource: ArgoCDModel.plural, + namespace: ArgoCD?.metadata?.namespace, + }, + cta: () => launchDeleteModal(), + }, + ], + [ArgoCD, launchLabelsModal, launchAnnotationsModal, launchDeleteModal, navigate, t], + ); + + return actions; +}; diff --git a/src/gitops/components/shared/argoCDListColumns.test.ts b/src/gitops/components/shared/argoCDListColumns.test.ts new file mode 100644 index 000000000..27e8e6622 --- /dev/null +++ b/src/gitops/components/shared/argoCDListColumns.test.ts @@ -0,0 +1,55 @@ +import { getDefaultActiveColumnIds } from './ColumnManagement'; +import { ARGOCD_LIST_COLUMN_MANAGEMENT_ID, getArgoCDManagedColumns } from './argoCDListColumns'; + +const t = (key: string) => key; + +describe('ARGOCD_LIST_COLUMN_MANAGEMENT_ID', () => { + it('uses a stable user-settings key', () => { + expect(ARGOCD_LIST_COLUMN_MANAGEMENT_ID).toBe('gitops.argocd'); + }); +}); + +describe('getArgoCDManagedColumns', () => { + it('locks Name and always shows actions', () => { + const columns = getArgoCDManagedColumns(true, t); + const byId = Object.fromEntries(columns.map((column) => [column.id, column])); + + expect(byId.name.isUntoggleable).toBe(true); + expect(byId.actions.alwaysShown).toBe(true); + }); + + it('has no Additional columns', () => { + const columns = getArgoCDManagedColumns(true, t); + expect(columns.filter((column) => column.additional)).toEqual([]); + }); + + it('includes Namespace only for All projects', () => { + expect(getArgoCDManagedColumns(true, t).map((column) => column.id)).toEqual([ + 'name', + 'namespace', + 'status', + 'version', + 'age', + 'actions', + ]); + expect(getArgoCDManagedColumns(false, t).map((column) => column.id)).toEqual([ + 'name', + 'status', + 'version', + 'age', + 'actions', + ]); + }); + + it('defaults to all columns active', () => { + const columns = getArgoCDManagedColumns(true, t); + expect(getDefaultActiveColumnIds(columns)).toEqual([ + 'name', + 'namespace', + 'status', + 'version', + 'age', + 'actions', + ]); + }); +}); diff --git a/src/gitops/components/shared/argoCDListColumns.ts b/src/gitops/components/shared/argoCDListColumns.ts new file mode 100644 index 000000000..548166b6a --- /dev/null +++ b/src/gitops/components/shared/argoCDListColumns.ts @@ -0,0 +1,13 @@ +import { type GitOpsManagedColumn, buildGitOpsManagedColumns } from './ColumnManagement'; + +export const ARGOCD_LIST_COLUMN_MANAGEMENT_ID = 'gitops.argocd'; + +export const getArgoCDManagedColumns = ( + includeNamespaceColumn: boolean, + t: (key: string) => string, +): GitOpsManagedColumn[] => + buildGitOpsManagedColumns(includeNamespaceColumn, t, [ + { id: 'status', title: t('Status'), isShownByDefault: true }, + { id: 'version', title: t('Version'), isShownByDefault: true }, + { id: 'age', title: t('Age'), isShownByDefault: true }, + ]); diff --git a/src/gitops/components/shared/dateUtils.tsx b/src/gitops/components/shared/dateUtils.tsx new file mode 100644 index 000000000..f79b3b162 --- /dev/null +++ b/src/gitops/components/shared/dateUtils.tsx @@ -0,0 +1,27 @@ +import * as React from 'react'; + +import { Timestamp } from '@openshift-console/dynamic-plugin-sdk'; +import { Tooltip } from '@patternfly/react-core'; + +export const getAge = (creationTimestamp?: string): string => { + if (!creationTimestamp) return '-'; + const diffInSeconds = Math.floor((Date.now() - new Date(creationTimestamp).getTime()) / 1000); + if (diffInSeconds < 60) return `${diffInSeconds}s`; + const diffInMinutes = Math.floor(diffInSeconds / 60); + if (diffInMinutes < 60) return `${diffInMinutes}m`; + const diffInHours = Math.floor(diffInMinutes / 60); + if (diffInHours < 24) return `${diffInHours}h`; + const diffInDays = Math.floor(diffInHours / 24); + return `${diffInDays}d`; +}; + +export const AgeCell: React.FC<{ creationTimestamp?: string }> = ({ creationTimestamp }) => { + const age = getAge(creationTimestamp); + if (!creationTimestamp) return <>{age}; + + return ( + }> + {age} + + ); +}; diff --git a/src/gitops/models/ArgoCDModel.ts b/src/gitops/models/ArgoCDModel.ts index 4e666485b..b84797d71 100644 --- a/src/gitops/models/ArgoCDModel.ts +++ b/src/gitops/models/ArgoCDModel.ts @@ -1,3 +1,4 @@ +import { modelToRef } from '@gitops/utils/utils'; import type { K8sModel, K8sResourceCommon, @@ -27,6 +28,7 @@ export type ArgoCDKind = K8sResourceCommon & { }; export type ArgoCDSpec = { + version?: string; server?: { autoscale?: { enabled?: boolean; @@ -66,11 +68,20 @@ export type ArgoCDSpec = { }; }; }; + sso?: { + provider?: string; + dex?: { + openShiftOAuth?: boolean; + }; + }; + notifications?: { + enabled?: boolean; + }; }; export type ArgoCDStatus = { server: string; - host: string; + host?: string; applicationController: string; applicationSetController: string; sso: string; @@ -78,4 +89,8 @@ export type ArgoCDStatus = { conditions: K8sResourceCondition[]; phase: string; redis: string; + notificationsController?: string; + commitServer?: string; }; + +export const argoCDModelRef = modelToRef(ArgoCDModel); diff --git a/src/gitops/templates/argocd-yaml.ts b/src/gitops/templates/argocd-yaml.ts new file mode 100644 index 000000000..d2b75f38f --- /dev/null +++ b/src/gitops/templates/argocd-yaml.ts @@ -0,0 +1,10 @@ +export const defaultArgoCDYamlTemplate = ` +apiVersion: "argoproj.io/v1beta1" +kind: "ArgoCD" +metadata: + name: "argocd" +spec: + server: + route: + enabled: true +`; diff --git a/src/gitops/templates/index.ts b/src/gitops/templates/index.ts index 83c8aebca..ab201a56d 100644 --- a/src/gitops/templates/index.ts +++ b/src/gitops/templates/index.ts @@ -1,3 +1,4 @@ +export * from './argocd-yaml'; export * from './application-yaml'; export * from './applicationset-yaml'; export * from './appproject-yaml';