2021-11-18 22:05:49 +05:30
import { _ _ , s _ _ , sprintf } from '~/locale' ;
2021-12-11 22:18:48 +05:30
import { helpPagePath } from '~/helpers/help_page_helper' ;
2021-11-18 22:05:49 +05:30
export const MAX _LIST _COUNT = 25 ;
export const INSTALL _AGENT _MODAL _ID = 'install-agent' ;
export const ACTIVE _CONNECTION _TIME = 480000 ;
2023-03-04 22:38:38 +05:30
export const NAME _MAX _LENGTH = 50 ;
2021-01-03 14:25:43 +05:30
export const CLUSTER _ERRORS = {
default : {
tableText : s _ _ ( 'ClusterIntegration|Unknown Error' ) ,
title : s _ _ ( 'ClusterIntegration|Unknown Error' ) ,
description : s _ _ (
'ClusterIntegration|An unknown error occurred while attempting to connect to Kubernetes.' ,
) ,
troubleshootingTips : [
s _ _ ( 'ClusterIntegration|Check your cluster status' ) ,
s _ _ ( 'ClusterIntegration|Make sure your API endpoint is correct' ) ,
s _ _ (
'ClusterIntegration|Node calculations use the Kubernetes Metrics API. Make sure your cluster has metrics installed' ,
) ,
] ,
} ,
authentication _error : {
tableText : s _ _ ( 'ClusterIntegration|Unable to Authenticate' ) ,
title : s _ _ ( 'ClusterIntegration|Authentication Error' ) ,
description : s _ _ ( 'ClusterIntegration|GitLab failed to authenticate.' ) ,
troubleshootingTips : [
s _ _ ( 'ClusterIntegration|Check your token' ) ,
s _ _ ( 'ClusterIntegration|Check your CA certificate' ) ,
] ,
} ,
connection _error : {
tableText : s _ _ ( 'ClusterIntegration|Unable to Connect' ) ,
title : s _ _ ( 'ClusterIntegration|Connection Error' ) ,
description : s _ _ ( 'ClusterIntegration|GitLab failed to connect to the cluster.' ) ,
troubleshootingTips : [
s _ _ ( 'ClusterIntegration|Check your cluster status' ) ,
s _ _ ( 'ClusterIntegration|Make sure your API endpoint is correct' ) ,
] ,
} ,
http _error : {
tableText : s _ _ ( 'ClusterIntegration|Unable to Connect' ) ,
title : s _ _ ( 'ClusterIntegration|HTTP Error' ) ,
description : s _ _ ( 'ClusterIntegration|There was an HTTP error when connecting to your cluster.' ) ,
troubleshootingTips : [ s _ _ ( 'ClusterIntegration|Check your cluster status' ) ] ,
} ,
} ;
2020-04-08 14:13:33 +05:30
export const CLUSTER _TYPES = {
project _type : _ _ ( 'Project' ) ,
group _type : _ _ ( 'Group' ) ,
instance _type : _ _ ( 'Instance' ) ,
} ;
2020-06-23 00:09:42 +05:30
export const MAX _REQUESTS = 3 ;
2020-04-08 14:13:33 +05:30
export const STATUSES = {
2020-05-24 23:13:21 +05:30
default : { className : 'bg-white' , title : _ _ ( 'Unknown' ) } ,
2020-04-08 14:13:33 +05:30
disabled : { className : 'disabled' , title : _ _ ( 'Disabled' ) } ,
2020-05-24 23:13:21 +05:30
created : { className : 'bg-success' , title : _ _ ( 'Connected' ) } ,
2020-04-08 14:13:33 +05:30
unreachable : { className : 'bg-danger' , title : _ _ ( 'Unreachable' ) } ,
authentication _failure : { className : 'bg-warning' , title : _ _ ( 'Authentication Failure' ) } ,
deleting : { title : _ _ ( 'Deleting' ) } ,
2020-06-23 00:09:42 +05:30
creating : { title : _ _ ( 'Creating' ) } ,
2020-04-08 14:13:33 +05:30
} ;
2021-11-18 22:05:49 +05:30
2022-04-04 11:22:00 +05:30
export const I18N _AGENT _TABLE = {
nameLabel : s _ _ ( 'ClusterAgents|Name' ) ,
statusLabel : s _ _ ( 'ClusterAgents|Connection status' ) ,
lastContactLabel : s _ _ ( 'ClusterAgents|Last contact' ) ,
versionLabel : _ _ ( 'Version' ) ,
configurationLabel : s _ _ ( 'ClusterAgents|Configuration' ) ,
optionsLabel : _ _ ( 'Options' ) ,
troubleshootingText : s _ _ ( 'ClusterAgents|Learn how to troubleshoot' ) ,
neverConnectedText : s _ _ ( 'ClusterAgents|Never' ) ,
versionMismatchTitle : s _ _ ( 'ClusterAgents|Agent version mismatch' ) ,
versionMismatchText : s _ _ (
2022-05-07 20:08:51 +05:30
"ClusterAgents|The agent version do not match each other across your cluster's pods. This can happen when a new agent version was just deployed and Kubernetes is shutting down the old pods." ,
2022-04-04 11:22:00 +05:30
) ,
versionOutdatedTitle : s _ _ ( 'ClusterAgents|Agent version update required' ) ,
versionOutdatedText : s _ _ (
2022-05-07 20:08:51 +05:30
'ClusterAgents|Your agent version is out of sync with your GitLab version (v%{version}), which might cause compatibility problems. Update the agent installed on your cluster to the most recent version.' ,
2022-04-04 11:22:00 +05:30
) ,
versionMismatchOutdatedTitle : s _ _ ( 'ClusterAgents|Agent version mismatch and update' ) ,
2022-05-07 20:08:51 +05:30
viewDocsText : s _ _ ( 'ClusterAgents|How to update an agent?' ) ,
defaultConfigText : s _ _ ( 'ClusterAgents|Default configuration' ) ,
defaultConfigTooltip : s _ _ ( 'ClusterAgents|What is default configuration?' ) ,
2022-04-04 11:22:00 +05:30
} ;
2022-05-07 20:08:51 +05:30
export const I18N _AGENT _TOKEN = {
copyToken : s _ _ ( 'ClusterAgents|Copy token' ) ,
copyCommand : s _ _ ( 'ClusterAgents|Copy command' ) ,
2022-06-21 17:19:12 +05:30
tokenLabel : s _ _ ( 'ClusterAgents|Agent access token:' ) ,
2022-05-07 20:08:51 +05:30
tokenSingleUseWarningTitle : s _ _ (
'ClusterAgents|You cannot see this token again after you close this window.' ,
) ,
2022-06-21 17:19:12 +05:30
tokenSubtitle : s _ _ ( 'ClusterAgents|The agent uses the token to connect with GitLab.' ) ,
2021-11-18 22:05:49 +05:30
2022-06-21 17:19:12 +05:30
basicInstallTitle : s _ _ ( 'ClusterAgents|Install using Helm (recommended)' ) ,
basicInstallBody : s _ _ (
'ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included in the command.' ,
2022-05-07 20:08:51 +05:30
) ,
2023-03-04 22:38:38 +05:30
helmVersionText : s _ _ (
'ClusterAgents|Use a Helm version compatible with your Kubernetes version (see %{linkStart}Helm version support policy%{linkEnd}).' ,
) ,
2021-11-18 22:05:49 +05:30
2022-05-07 20:08:51 +05:30
advancedInstallTitle : s _ _ ( 'ClusterAgents|Advanced installation methods' ) ,
advancedInstallBody : s _ _ (
2022-06-21 17:19:12 +05:30
'ClusterAgents|%{linkStart}View the documentation%{linkEnd} for advanced installation. Ensure you have your access token available.' ,
2022-05-07 20:08:51 +05:30
) ,
} ;
2021-11-18 22:05:49 +05:30
2023-03-04 22:38:38 +05:30
export const HELM _VERSION _POLICY _URL = 'https://helm.sh/docs/topics/version_skew/' ;
2022-05-07 20:08:51 +05:30
export const I18N _AGENT _MODAL = {
registerAgentButton : s _ _ ( 'ClusterAgents|Register' ) ,
close : _ _ ( 'Close' ) ,
cancel : _ _ ( 'Cancel' ) ,
2021-11-18 22:05:49 +05:30
2022-06-21 17:19:12 +05:30
modalTitle : s _ _ ( 'ClusterAgents|Connect a Kubernetes cluster' ) ,
2022-05-07 20:08:51 +05:30
modalBody : s _ _ (
'ClusterAgents|Add an agent configuration file to %{linkStart}this repository%{linkEnd} and select it, or create a new one to register with GitLab:' ,
) ,
enableKasText : s _ _ (
"ClusterAgents|Your instance doesn't have the %{linkStart}GitLab Agent Server (KAS)%{linkEnd} set up. Ask a GitLab Administrator to install it." ,
) ,
2022-06-21 17:19:12 +05:30
altText : s _ _ ( 'ClusterAgents|GitLab agent for Kubernetes' ) ,
2022-05-07 20:08:51 +05:30
learnMoreLink : s _ _ ( 'ClusterAgents|How do I register an agent?' ) ,
registrationErrorTitle : s _ _ ( 'ClusterAgents|Failed to register an agent' ) ,
unknownError : s _ _ ( 'ClusterAgents|An unknown error occurred. Please try again.' ) ,
2021-11-18 22:05:49 +05:30
} ;
2022-01-26 12:08:38 +05:30
export const KAS _DISABLED _ERROR = 'Gitlab::Kas::Client::ConfigurationError' ;
2021-11-18 22:05:49 +05:30
export const I18N _AVAILABLE _AGENTS _DROPDOWN = {
2022-05-07 20:08:51 +05:30
selectAgent : s _ _ ( 'ClusterAgents|Select an agent or enter a name to create new' ) ,
registeringAgent : s _ _ ( 'ClusterAgents|Registering agent' ) ,
noResults : _ _ ( 'No matching results' ) ,
createButton : s _ _ ( 'ClusterAgents|Create agent: %{searchTerm}' ) ,
2021-11-18 22:05:49 +05:30
} ;
export const AGENT _STATUSES = {
active : {
name : s _ _ ( 'ClusterAgents|Connected' ) ,
icon : 'status-success' ,
2023-04-23 21:23:45 +05:30
class : 'gl-text-green-500' ,
2021-11-18 22:05:49 +05:30
tooltip : {
title : sprintf ( s _ _ ( 'ClusterAgents|Last connected %{timeAgo}.' ) ) ,
} ,
} ,
inactive : {
name : s _ _ ( 'ClusterAgents|Not connected' ) ,
2022-08-13 15:12:31 +05:30
icon : 'status-alert' ,
2023-04-23 21:23:45 +05:30
class : 'gl-text-red-500' ,
2021-11-18 22:05:49 +05:30
tooltip : {
title : s _ _ ( 'ClusterAgents|Agent might not be connected to GitLab' ) ,
body : sprintf (
s _ _ (
2022-01-26 12:08:38 +05:30
'ClusterAgents|The agent has not been connected in a long time. There might be a connectivity issue. Last contact was %{timeAgo}.' ,
2021-11-18 22:05:49 +05:30
) ,
) ,
} ,
} ,
unused : {
name : s _ _ ( 'ClusterAgents|Never connected' ) ,
icon : 'status-neutral' ,
2023-04-23 21:23:45 +05:30
class : 'gl-text-gray-500' ,
2021-11-18 22:05:49 +05:30
tooltip : {
title : s _ _ ( 'ClusterAgents|Agent never connected to GitLab' ) ,
body : s _ _ ( 'ClusterAgents|Make sure you are using a valid token.' ) ,
} ,
} ,
} ;
2021-12-11 22:18:48 +05:30
export const I18N _AGENTS _EMPTY _STATE = {
introText : s _ _ (
2022-06-21 17:19:12 +05:30
'ClusterIntegration|Use the %{linkStart}GitLab agent%{linkEnd} to safely connect your Kubernetes clusters to GitLab. You can deploy your applications, run your pipelines, use Review Apps, and much more.' ,
2021-12-11 22:18:48 +05:30
) ,
} ;
export const I18N _CLUSTERS _EMPTY _STATE = {
2022-01-26 12:08:38 +05:30
introText : s _ _ (
'ClusterIntegration|Connect your cluster to GitLab through %{linkStart}cluster certificates%{linkEnd}.' ,
2021-12-11 22:18:48 +05:30
) ,
2022-01-26 12:08:38 +05:30
alertText : s _ _ (
'ClusterIntegration|The certificate-based method to connect clusters to GitLab was %{linkStart}deprecated%{linkEnd} in GitLab 14.5.' ,
) ,
2021-12-11 22:18:48 +05:30
} ;
export const AGENT _CARD _INFO = {
tabName : 'agent' ,
2022-05-07 20:08:51 +05:30
title : sprintf ( s _ _ ( 'ClusterAgents|%{number} of %{total} agents' ) ) ,
emptyTitle : s _ _ ( 'ClusterAgents|No agents' ) ,
2021-12-11 22:18:48 +05:30
tooltip : {
label : s _ _ ( 'ClusterAgents|Recommended' ) ,
2022-06-21 17:19:12 +05:30
title : s _ _ ( 'ClusterAgents|GitLab agent' ) ,
2021-12-11 22:18:48 +05:30
text : sprintf (
s _ _ (
2022-06-21 17:19:12 +05:30
'ClusterAgents|The GitLab agent provides an increased level of security when connecting Kubernetes clusters to GitLab. %{linkStart}Learn more about the GitLab agent.%{linkEnd}' ,
2021-12-11 22:18:48 +05:30
) ,
) ,
link : helpPagePath ( 'user/clusters/agent/index' ) ,
} ,
2022-01-26 12:08:38 +05:30
footerText : sprintf ( s _ _ ( 'ClusterAgents|View all %{number} agents' ) ) ,
2021-12-11 22:18:48 +05:30
} ;
export const CERTIFICATE _BASED _CARD _INFO = {
tabName : 'certificate_based' ,
2022-01-26 12:08:38 +05:30
title : sprintf (
s _ _ ( 'ClusterAgents|%{number} of %{total} clusters connected through cluster certificates' ) ,
) ,
emptyTitle : s _ _ ( 'ClusterAgents|No clusters connected through cluster certificates' ) ,
footerText : sprintf ( s _ _ ( 'ClusterAgents|View all %{number} clusters' ) ) ,
badgeText : s _ _ ( 'ClusterAgents|Deprecated' ) ,
2021-12-11 22:18:48 +05:30
} ;
export const MAX _CLUSTERS _LIST = 6 ;
2022-05-07 20:08:51 +05:30
export const ALL _TAB = {
title : s _ _ ( 'ClusterAgents|All' ) ,
component : 'ClustersViewAll' ,
queryParamValue : 'all' ,
} ;
export const AGENT _TAB = {
title : s _ _ ( 'ClusterAgents|Agent' ) ,
component : 'agents' ,
queryParamValue : 'agent' ,
} ;
export const CERTIFICATE _TAB = {
title : s _ _ ( 'ClusterAgents|Certificate' ) ,
component : 'clusters' ,
queryParamValue : 'certificate_based' ,
} ;
export const CLUSTERS _TABS = [ ALL _TAB , AGENT _TAB , CERTIFICATE _TAB ] ;
2021-12-11 22:18:48 +05:30
export const CLUSTERS _ACTIONS = {
2022-06-21 17:19:12 +05:30
connectCluster : s _ _ ( 'ClusterAgents|Connect a cluster' ) ,
connectWithAgent : s _ _ ( 'ClusterAgents|Connect a cluster (agent)' ) ,
connectClusterDeprecated : s _ _ ( 'ClusterAgents|Connect a cluster (deprecated)' ) ,
createCluster : s _ _ ( 'ClusterAgents|Create a cluster' ) ,
connectClusterCertificate : s _ _ ( 'ClusterAgents|Connect a cluster (certificate - deprecated)' ) ,
2022-07-16 23:28:13 +05:30
actionsDisabledHint : s _ _ (
2022-04-04 11:22:00 +05:30
'ClusterAgents|Requires a Maintainer or greater role to perform these actions' ,
) ,
} ;
export const DELETE _AGENT _BUTTON = {
deleteButton : s _ _ ( 'ClusterAgents|Delete agent' ) ,
disabledHint : s _ _ ( 'ClusterAgents|Requires a Maintainer or greater role to delete agents' ) ,
modalTitle : _ _ ( 'Are you sure?' ) ,
modalBody : s _ _ ( 'ClusterAgents|Are you sure you want to delete this agent? You cannot undo this.' ) ,
modalInputLabel : s _ _ ( 'ClusterAgents|To delete the agent, type %{name} to confirm:' ) ,
modalAction : s _ _ ( 'ClusterAgents|Delete' ) ,
modalCancel : _ _ ( 'Cancel' ) ,
successMessage : s _ _ ( 'ClusterAgents|%{name} successfully deleted' ) ,
defaultError : _ _ ( 'An error occurred. Please try again.' ) ,
2021-12-11 22:18:48 +05:30
} ;
export const AGENT = 'agent' ;
export const CERTIFICATE _BASED = 'certificate_based' ;
2022-01-26 12:08:38 +05:30
export const EVENT _LABEL _MODAL = 'agent_registration_modal' ;
export const EVENT _LABEL _TABS = 'kubernetes_section_tabs' ;
export const EVENT _ACTIONS _OPEN = 'open_modal' ;
export const EVENT _ACTIONS _SELECT = 'select_agent' ;
export const EVENT _ACTIONS _CLICK = 'click_button' ;
export const EVENT _ACTIONS _CHANGE = 'change_tab' ;
export const MODAL _TYPE _EMPTY = 'empty_state' ;
export const MODAL _TYPE _REGISTER = 'agent_registration' ;
2022-03-02 08:16:31 +05:30
export const DELETE _AGENT _MODAL _ID = 'delete-agent-modal-%{agentName}' ;
2022-04-04 11:22:00 +05:30
export const AGENT _FEEDBACK _ISSUE = 'https://gitlab.com/gitlab-org/gitlab/-/issues/342696' ;
export const AGENT _FEEDBACK _KEY = 'agent_feedback_banner' ;