2021-10-08 14:13:02 -04:00
import { _ _ , s _ _ , sprintf } from '~/locale' ;
2021-11-15 13:12:21 -05:00
import { helpPagePath } from '~/helpers/help_page_helper' ;
2021-10-08 14:13:02 -04:00
export const MAX _LIST _COUNT = 25 ;
export const INSTALL _AGENT _MODAL _ID = 'install-agent' ;
export const ACTIVE _CONNECTION _TIME = 480000 ;
2020-09-18 17:10:11 -04:00
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-03-04 01:08:23 -05:00
export const CLUSTER _TYPES = {
project _type : _ _ ( 'Project' ) ,
group _type : _ _ ( 'Group' ) ,
instance _type : _ _ ( 'Instance' ) ,
} ;
2020-05-27 11:08:11 -04:00
export const MAX _REQUESTS = 3 ;
2020-03-09 05:07:45 -04:00
export const STATUSES = {
2020-05-12 05:09:31 -04:00
default : { className : 'bg-white' , title : _ _ ( 'Unknown' ) } ,
2020-03-09 05:07:45 -04:00
disabled : { className : 'disabled' , title : _ _ ( 'Disabled' ) } ,
2020-05-12 05:09:31 -04:00
created : { className : 'bg-success' , title : _ _ ( 'Connected' ) } ,
2020-03-09 05:07:45 -04:00
unreachable : { className : 'bg-danger' , title : _ _ ( 'Unreachable' ) } ,
authentication _failure : { className : 'bg-warning' , title : _ _ ( 'Authentication Failure' ) } ,
deleting : { title : _ _ ( 'Deleting' ) } ,
2020-06-08 20:08:47 -04:00
creating : { title : _ _ ( 'Creating' ) } ,
2020-03-04 01:08:23 -05:00
} ;
2021-10-08 14:13:02 -04:00
2022-02-04 04:14:46 -05:00
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-02-28 01:16:06 -05:00
"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-02-04 04:14:46 -05:00
) ,
versionOutdatedTitle : s _ _ ( 'ClusterAgents|Agent version update required' ) ,
versionOutdatedText : s _ _ (
2022-02-28 01:16:06 -05:00
'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-02-04 04:14:46 -05:00
) ,
versionMismatchOutdatedTitle : s _ _ ( 'ClusterAgents|Agent version mismatch and update' ) ,
2022-02-28 01:16:06 -05:00
viewDocsText : s _ _ ( 'ClusterAgents|How to update an agent?' ) ,
2022-03-16 08:07:24 -04:00
defaultConfigText : s _ _ ( 'ClusterAgents|Default configuration' ) ,
defaultConfigTooltip : s _ _ ( 'ClusterAgents|What is default configuration?' ) ,
2022-02-04 04:14:46 -05:00
} ;
2022-03-16 20:07:59 -04:00
export const I18N _AGENT _TOKEN = {
2022-03-16 08:07:24 -04:00
copyToken : s _ _ ( 'ClusterAgents|Copy token' ) ,
2022-03-16 20:07:59 -04:00
copyCommand : s _ _ ( 'ClusterAgents|Copy command' ) ,
2022-03-29 20:09:03 -04:00
tokenLabel : s _ _ ( 'ClusterAgents|Agent access token:' ) ,
2022-03-16 08:07:24 -04:00
tokenSingleUseWarningTitle : s _ _ (
'ClusterAgents|You cannot see this token again after you close this window.' ,
) ,
2022-03-29 20:09:03 -04:00
tokenSubtitle : s _ _ ( 'ClusterAgents|The agent uses the token to connect with GitLab.' ) ,
2021-10-08 14:13:02 -04:00
2022-04-13 14:08:33 -04:00
basicInstallTitle : s _ _ ( 'ClusterAgents|Install using Helm (recommended)' ) ,
2022-03-29 20:09:03 -04:00
basicInstallBody : s _ _ (
2022-04-13 14:08:33 -04:00
'ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included in the command.' ,
2022-03-16 08:07:24 -04:00
) ,
2021-10-08 14:13:02 -04:00
2022-03-16 08:07:24 -04:00
advancedInstallTitle : s _ _ ( 'ClusterAgents|Advanced installation methods' ) ,
advancedInstallBody : s _ _ (
2022-03-29 20:09:03 -04:00
'ClusterAgents|%{linkStart}View the documentation%{linkEnd} for advanced installation. Ensure you have your access token available.' ,
2022-03-16 08:07:24 -04:00
) ,
2022-03-16 20:07:59 -04:00
} ;
export const I18N _AGENT _MODAL = {
registerAgentButton : s _ _ ( 'ClusterAgents|Register' ) ,
close : _ _ ( 'Close' ) ,
cancel : _ _ ( 'Cancel' ) ,
2021-10-08 14:13:02 -04:00
2022-03-29 20:09:03 -04:00
modalTitle : s _ _ ( 'ClusterAgents|Connect a Kubernetes cluster' ) ,
2022-03-16 20:07:59 -04:00
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-04-06 05:09:15 -04:00
altText : s _ _ ( 'ClusterAgents|GitLab agent for Kubernetes' ) ,
2022-03-16 20:07:59 -04:00
learnMoreLink : s _ _ ( 'ClusterAgents|How do I register an agent?' ) ,
2022-03-16 08:07:24 -04:00
registrationErrorTitle : s _ _ ( 'ClusterAgents|Failed to register an agent' ) ,
unknownError : s _ _ ( 'ClusterAgents|An unknown error occurred. Please try again.' ) ,
2021-10-08 14:13:02 -04:00
} ;
2021-11-19 07:12:41 -05:00
export const KAS _DISABLED _ERROR = 'Gitlab::Kas::Client::ConfigurationError' ;
2021-10-08 14:13:02 -04:00
export const I18N _AVAILABLE _AGENTS _DROPDOWN = {
2022-03-16 08:07:24 -04:00
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-10-08 14:13:02 -04:00
} ;
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' ) ,
2022-06-30 08:09:03 -04:00
icon : 'status-alert' ,
class : 'text-danger-500' ,
2021-10-08 14:13:02 -04:00
tooltip : {
title : s _ _ ( 'ClusterAgents|Agent might not be connected to GitLab' ) ,
body : sprintf (
s _ _ (
2021-12-02 16:10:16 -05:00
'ClusterAgents|The agent has not been connected in a long time. There might be a connectivity issue. Last contact was %{timeAgo}.' ,
2021-10-08 14:13:02 -04:00
) ,
) ,
} ,
} ,
unused : {
name : s _ _ ( 'ClusterAgents|Never connected' ) ,
icon : 'status-neutral' ,
2022-06-30 08:09:03 -04:00
class : 'text-secondary-500' ,
2021-10-08 14:13:02 -04:00
tooltip : {
title : s _ _ ( 'ClusterAgents|Agent never connected to GitLab' ) ,
body : s _ _ ( 'ClusterAgents|Make sure you are using a valid token.' ) ,
} ,
} ,
} ;
2021-11-08 22:42:22 -05:00
export const I18N _AGENTS _EMPTY _STATE = {
introText : s _ _ (
2022-04-06 05:09:15 -04:00
'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-11-08 22:42:22 -05:00
) ,
} ;
export const I18N _CLUSTERS _EMPTY _STATE = {
2021-12-02 16:10:16 -05:00
introText : s _ _ (
'ClusterIntegration|Connect your cluster to GitLab through %{linkStart}cluster certificates%{linkEnd}.' ,
2021-11-08 22:42:22 -05:00
) ,
2021-12-02 16:10:16 -05:00
alertText : s _ _ (
'ClusterIntegration|The certificate-based method to connect clusters to GitLab was %{linkStart}deprecated%{linkEnd} in GitLab 14.5.' ,
) ,
2021-11-08 22:42:22 -05:00
} ;
2021-11-15 10:10:57 -05:00
2021-11-15 13:12:21 -05:00
export const AGENT _CARD _INFO = {
tabName : 'agent' ,
2022-02-28 01:16:06 -05:00
title : sprintf ( s _ _ ( 'ClusterAgents|%{number} of %{total} agents' ) ) ,
emptyTitle : s _ _ ( 'ClusterAgents|No agents' ) ,
2021-11-15 13:12:21 -05:00
tooltip : {
label : s _ _ ( 'ClusterAgents|Recommended' ) ,
2022-04-06 05:09:15 -04:00
title : s _ _ ( 'ClusterAgents|GitLab agent' ) ,
2021-11-15 13:12:21 -05:00
text : sprintf (
s _ _ (
2022-04-06 05:09:15 -04:00
'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-11-15 13:12:21 -05:00
) ,
) ,
link : helpPagePath ( 'user/clusters/agent/index' ) ,
} ,
2021-12-02 16:10:16 -05:00
footerText : sprintf ( s _ _ ( 'ClusterAgents|View all %{number} agents' ) ) ,
2021-11-15 13:12:21 -05:00
} ;
export const CERTIFICATE _BASED _CARD _INFO = {
tabName : 'certificate_based' ,
2021-12-02 16:10:16 -05:00
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-11-15 13:12:21 -05:00
} ;
export const MAX _CLUSTERS _LIST = 6 ;
2022-03-14 14:07:46 -04:00
export const ALL _TAB = {
title : s _ _ ( 'ClusterAgents|All' ) ,
component : 'ClustersViewAll' ,
queryParamValue : 'all' ,
} ;
export const AGENT _TAB = {
title : s _ _ ( 'ClusterAgents|Agent' ) ,
component : 'agents' ,
queryParamValue : 'agent' ,
} ;
2022-03-09 22:08:56 -05:00
export const CERTIFICATE _TAB = {
title : s _ _ ( 'ClusterAgents|Certificate' ) ,
component : 'clusters' ,
queryParamValue : 'certificate_based' ,
} ;
2022-03-14 14:07:46 -04:00
export const CLUSTERS _TABS = [ ALL _TAB , AGENT _TAB , CERTIFICATE _TAB ] ;
2021-11-15 10:10:57 -05:00
export const CLUSTERS _ACTIONS = {
2022-03-28 05:07:06 -04:00
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-05-05 08:08:03 -04:00
actionsDisabledHint : s _ _ (
2022-01-27 19:14:06 -05:00
'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-11-15 10:10:57 -05:00
} ;
2021-11-15 13:12:21 -05:00
export const AGENT = 'agent' ;
export const CERTIFICATE _BASED = 'certificate_based' ;
2021-12-01 22:13:01 -05:00
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' ;
2021-12-29 13:13:42 -05:00
export const DELETE _AGENT _MODAL _ID = 'delete-agent-modal-%{agentName}' ;
2022-01-31 13:18:10 -05:00
export const AGENT _FEEDBACK _ISSUE = 'https://gitlab.com/gitlab-org/gitlab/-/issues/342696' ;
export const AGENT _FEEDBACK _KEY = 'agent_feedback_banner' ;