debian-mirror-gitlab/spec/frontend/clusters/services/mock_data.js

137 lines
4.2 KiB
JavaScript
Raw Normal View History

2018-11-18 11:00:15 +05:30
import { APPLICATION_STATUS } from '~/clusters/constants';
2018-03-17 18:26:18 +05:30
const CLUSTERS_MOCK_DATA = {
GET: {
'/gitlab-org/gitlab-shell/clusters/1/status.json': {
data: {
status: 'errored',
status_reason: 'Failed to request to CloudPlatform.',
2018-12-13 13:39:08 +05:30
applications: [
{
name: 'helm',
status: APPLICATION_STATUS.INSTALLABLE,
status_reason: null,
2019-07-31 22:56:46 +05:30
can_uninstall: false,
2018-12-13 13:39:08 +05:30
},
{
name: 'ingress',
status: APPLICATION_STATUS.ERROR,
status_reason: 'Cannot connect',
external_ip: null,
2019-07-07 11:18:12 +05:30
external_hostname: null,
2019-07-31 22:56:46 +05:30
can_uninstall: false,
2018-12-13 13:39:08 +05:30
},
{
name: 'runner',
status: APPLICATION_STATUS.INSTALLING,
status_reason: null,
2019-07-31 22:56:46 +05:30
can_uninstall: false,
2018-12-13 13:39:08 +05:30
},
{
name: 'prometheus',
status: APPLICATION_STATUS.ERROR,
status_reason: 'Cannot connect',
2019-07-31 22:56:46 +05:30
can_uninstall: false,
2018-12-13 13:39:08 +05:30
},
{
name: 'jupyter',
status: APPLICATION_STATUS.INSTALLING,
status_reason: 'Cannot connect',
2019-07-31 22:56:46 +05:30
can_uninstall: false,
2018-12-13 13:39:08 +05:30
},
{
name: 'knative',
status: APPLICATION_STATUS.INSTALLING,
status_reason: 'Cannot connect',
2019-07-31 22:56:46 +05:30
can_uninstall: false,
2018-12-13 13:39:08 +05:30
},
2019-02-15 15:39:39 +05:30
{
name: 'cert_manager',
status: APPLICATION_STATUS.ERROR,
status_reason: 'Cannot connect',
email: 'test@example.com',
2019-07-31 22:56:46 +05:30
can_uninstall: false,
2019-02-15 15:39:39 +05:30
},
2018-12-13 13:39:08 +05:30
],
2018-11-08 19:23:39 +05:30
},
},
'/gitlab-org/gitlab-shell/clusters/2/status.json': {
data: {
status: 'errored',
status_reason: 'Failed to request to CloudPlatform.',
2018-12-13 13:39:08 +05:30
applications: [
{
name: 'helm',
status: APPLICATION_STATUS.INSTALLED,
status_reason: null,
},
{
name: 'ingress',
status: APPLICATION_STATUS.INSTALLED,
status_reason: 'Cannot connect',
external_ip: '1.1.1.1',
2019-07-07 11:18:12 +05:30
external_hostname: null,
2018-12-13 13:39:08 +05:30
},
{
name: 'runner',
status: APPLICATION_STATUS.INSTALLING,
status_reason: null,
},
{
name: 'prometheus',
status: APPLICATION_STATUS.ERROR,
status_reason: 'Cannot connect',
},
{
name: 'jupyter',
status: APPLICATION_STATUS.INSTALLABLE,
status_reason: 'Cannot connect',
},
{
name: 'knative',
status: APPLICATION_STATUS.INSTALLABLE,
status_reason: 'Cannot connect',
},
2019-02-15 15:39:39 +05:30
{
name: 'cert_manager',
status: APPLICATION_STATUS.ERROR,
status_reason: 'Cannot connect',
email: 'test@example.com',
},
2018-12-13 13:39:08 +05:30
],
2018-03-17 18:26:18 +05:30
},
},
},
POST: {
2018-12-13 13:39:08 +05:30
'/gitlab-org/gitlab-shell/clusters/1/applications/helm': {},
'/gitlab-org/gitlab-shell/clusters/1/applications/ingress': {},
2019-02-15 15:39:39 +05:30
'/gitlab-org/gitlab-shell/clusters/1/applications/cert_manager': {},
2018-12-13 13:39:08 +05:30
'/gitlab-org/gitlab-shell/clusters/1/applications/runner': {},
'/gitlab-org/gitlab-shell/clusters/1/applications/prometheus': {},
'/gitlab-org/gitlab-shell/clusters/1/applications/jupyter': {},
'/gitlab-org/gitlab-shell/clusters/1/applications/knative': {},
2018-03-17 18:26:18 +05:30
},
};
const DEFAULT_APPLICATION_STATE = {
id: 'some-app',
title: 'My App',
titleLink: 'https://about.gitlab.com/',
description: 'Some description about this interesting application!',
status: null,
statusReason: null,
requestReason: null,
};
2019-07-07 11:18:12 +05:30
const APPLICATIONS_MOCK_STATE = {
helm: { title: 'Helm Tiller', status: 'installable' },
ingress: { title: 'Ingress', status: 'installable' },
cert_manager: { title: 'Cert-Manager', status: 'installable' },
runner: { title: 'GitLab Runner' },
prometheus: { title: 'Prometheus' },
jupyter: { title: 'JupyterHub', status: 'installable', hostname: '' },
knative: { title: 'Knative ', status: 'installable', hostname: '' },
};
export { CLUSTERS_MOCK_DATA, DEFAULT_APPLICATION_STATE, APPLICATIONS_MOCK_STATE };