2021-11-18 22:05:49 +05:30
import { _ _ , s _ _ , sprintf } from '~/locale' ;
export const MAX _LIST _COUNT = 25 ;
export const INSTALL _AGENT _MODAL _ID = 'install-agent' ;
export const ACTIVE _CONNECTION _TIME = 480000 ;
export const TROUBLESHOOTING _LINK =
'https://docs.gitlab.com/ee/user/clusters/agent/#troubleshooting' ;
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
export const I18N _INSTALL _AGENT _MODAL = {
next : _ _ ( 'Next' ) ,
done : _ _ ( 'Done' ) ,
cancel : _ _ ( 'Cancel' ) ,
modalTitle : s _ _ ( 'ClusterAgents|Install new Agent' ) ,
selectAgentTitle : s _ _ ( 'ClusterAgents|Select which Agent you want to install' ) ,
selectAgentBody : s _ _ (
` ClusterAgents|Select the Agent you want to register with GitLab and install on your cluster. To learn more about the Kubernetes Agent registration process %{linkStart}go to the documentation%{linkEnd}. ` ,
) ,
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. To learn more about the registration tokens and how they are used %{linkStart}go to the documentation%{linkEnd}. ` ,
) ,
tokenSingleUseWarningTitle : s _ _ (
'ClusterAgents|The token value will not be shown again after you close this window.' ,
) ,
tokenSingleUseWarningBody : s _ _ (
` ClusterAgents|The recommended installation method provided below includes the token. If you want to follow the alternative installation method provided in the docs make sure you save the token value before you close the window. ` ,
) ,
basicInstallTitle : s _ _ ( 'ClusterAgents|Recommended installation method' ) ,
basicInstallBody : s _ _ (
` 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. ` ,
) ,
advancedInstallTitle : s _ _ ( 'ClusterAgents|Alternative installation methods' ) ,
advancedInstallBody : s _ _ (
'ClusterAgents|For alternative installation methods %{linkStart}go to the documentation%{linkEnd}.' ,
) ,
registrationErrorTitle : s _ _ ( 'Failed to register Agent' ) ,
unknownError : s _ _ ( 'ClusterAgents|An unknown error occurred. Please try again.' ) ,
} ;
export const I18N _AVAILABLE _AGENTS _DROPDOWN = {
selectAgent : s _ _ ( 'ClusterAgents|Select an Agent' ) ,
registeringAgent : s _ _ ( 'ClusterAgents|Registering Agent' ) ,
} ;
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 _ _ (
'ClusterAgents|The Agent has not been connected in a long time. There might be a connectivity issue. Last contact was %{timeAgo}.' ,
) ,
) ,
} ,
} ,
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.' ) ,
} ,
} ,
} ;