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 ;
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' ) ,
tokenTitle : s _ _ ( 'ClusterAgents|Registration token' ) ,
2021-11-18 22:05:49 +05:30
2022-05-07 20:08:51 +05:30
tokenBody : s _ _ (
` ClusterAgents|The registration token will be used to connect the agent on your cluster to GitLab. %{linkStart}What are registration tokens?%{linkEnd} ` ,
) ,
tokenSingleUseWarningTitle : s _ _ (
'ClusterAgents|You cannot see this token again after you close this window.' ,
) ,
tokenSingleUseWarningBody : s _ _ (
` ClusterAgents|The recommended installation method includes the token. If you want to follow the advanced installation method provided in the docs, make sure you save the token value before you close this window. ` ,
) ,
2021-11-18 22:05:49 +05:30
2022-05-07 20:08:51 +05:30
basicInstallTitle : s _ _ ( 'ClusterAgents|Recommended installation method' ) ,
basicInstallBody : _ _ (
` Open a CLI and connect to the cluster you want to install the agent in. Use this installation method to minimize any manual steps. The token is already included in the command. ` ,
) ,
2021-11-18 22:05:49 +05:30
2022-05-07 20:08:51 +05:30
advancedInstallTitle : s _ _ ( 'ClusterAgents|Advanced installation methods' ) ,
advancedInstallBody : s _ _ (
'ClusterAgents|For the advanced installation method %{linkStart}see the documentation%{linkEnd}.' ,
) ,
} ;
2021-11-18 22:05:49 +05:30
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-05-07 20:08:51 +05:30
modalTitle : s _ _ ( 'ClusterAgents|Connect a cluster through an agent' ) ,
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." ,
) ,
altText : s _ _ ( 'ClusterAgents|GitLab Agent for Kubernetes' ) ,
learnMoreLink : s _ _ ( 'ClusterAgents|How do I register an agent?' ) ,
copyToken : s _ _ ( 'ClusterAgents|Copy token' ) ,
tokenTitle : s _ _ ( 'ClusterAgents|Registration token' ) ,
tokenBody : s _ _ (
` ClusterAgents|The registration token will be used to connect the agent on your cluster to GitLab. %{linkStart}What are registration tokens?%{linkEnd} ` ,
) ,
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' ,
class : 'text-success-500' ,
tooltip : {
title : sprintf ( s _ _ ( 'ClusterAgents|Last connected %{timeAgo}.' ) ) ,
} ,
} ,
inactive : {
name : s _ _ ( 'ClusterAgents|Not connected' ) ,
icon : 'severity-critical' ,
class : 'text-danger-800' ,
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' ,
class : 'text-secondary-400' ,
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-01-26 12:08:38 +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
) ,
2022-01-26 12:08:38 +05:30
buttonText : s _ _ ( 'ClusterAgents|Connect with the GitLab Agent' ) ,
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
) ,
buttonText : s _ _ ( 'ClusterIntegration|Connect with a certificate' ) ,
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-01-26 12:08:38 +05:30
title : s _ _ ( 'ClusterAgents|GitLab Agent' ) ,
2021-12-11 22:18:48 +05:30
text : sprintf (
s _ _ (
2022-01-26 12:08:38 +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-05-07 20:08:51 +05:30
actionText : s _ _ ( 'ClusterAgents|Install a new agent' ) ,
2022-01-26 12:08:38 +05:30
footerText : sprintf ( s _ _ ( 'ClusterAgents|View all %{number} agents' ) ) ,
2022-04-04 11:22:00 +05:30
installAgentDisabledHint : s _ _ (
'ClusterAgents|Requires a Maintainer or greater role to install new 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' ) ,
2021-12-11 22:18:48 +05:30
actionText : s _ _ ( 'ClusterAgents|Connect existing cluster' ) ,
2022-01-26 12:08:38 +05:30
footerText : sprintf ( s _ _ ( 'ClusterAgents|View all %{number} clusters' ) ) ,
badgeText : s _ _ ( 'ClusterAgents|Deprecated' ) ,
2022-04-04 11:22:00 +05:30
connectExistingClusterDisabledHint : s _ _ (
'ClusterAgents|Requires a maintainer or greater role to connect existing clusters' ,
) ,
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 = {
actionsButton : s _ _ ( 'ClusterAgents|Actions' ) ,
2022-01-26 12:08:38 +05:30
createNewCluster : s _ _ ( 'ClusterAgents|Create a new cluster' ) ,
2022-05-07 20:08:51 +05:30
connectWithAgent : s _ _ ( 'ClusterAgents|Connect with an agent' ) ,
2022-01-26 12:08:38 +05:30
connectExistingCluster : s _ _ ( 'ClusterAgents|Connect with a certificate' ) ,
2022-04-04 11:22:00 +05:30
agent : s _ _ ( 'ClusterAgents|Agent' ) ,
certificate : s _ _ ( 'ClusterAgents|Certificate' ) ,
dropdownDisabledHint : s _ _ (
'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' ;