Welcome to mirror list, hosted at ThFree Co, Russian Federation.

service_table.vue « databases « google_cloud « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 80bd6ef28fb28ed437b5e8d4b27c8de9faf5fe47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<script>
import { GlAlert, GlButton, GlLink, GlSprintf, GlTable } from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper';
import { s__ } from '~/locale';

const KEY_CLOUDSQL_POSTGRES = 'cloudsql-postgres';
const KEY_CLOUDSQL_MYSQL = 'cloudsql-mysql';
const KEY_CLOUDSQL_SQLSERVER = 'cloudsql-sqlserver';
const KEY_ALLOYDB_POSTGRES = 'alloydb-postgres';
const KEY_MEMORYSTORE_REDIS = 'memorystore-redis';
const KEY_FIRESTORE = 'firestore';

const i18n = {
  columnService: s__('CloudSeed|Service'),
  columnDescription: s__('CloudSeed|Description'),
  cloudsqlPostgresTitle: s__('CloudSeed|Cloud SQL for Postgres'),
  cloudsqlPostgresDescription: s__(
    'CloudSeed|Fully managed relational database service for PostgreSQL',
  ),
  cloudsqlMysqlTitle: s__('CloudSeed|Cloud SQL for MySQL'),
  cloudsqlMysqlDescription: s__('CloudSeed|Fully managed relational database service for MySQL'),
  cloudsqlSqlserverTitle: s__('CloudSeed|Cloud SQL for SQL Server'),
  cloudsqlSqlserverDescription: s__(
    'CloudSeed|Fully managed relational database service for SQL Server',
  ),
  alloydbPostgresTitle: s__('CloudSeed|AlloyDB for Postgres'),
  alloydbPostgresDescription: s__(
    'CloudSeed|Fully managed PostgreSQL-compatible service for high-demand workloads',
  ),
  memorystoreRedisTitle: s__('CloudSeed|Memorystore for Redis'),
  memorystoreRedisDescription: s__(
    'CloudSeed|Scalable, secure, and highly available in-memory service for Redis',
  ),
  firestoreTitle: s__('CloudSeed|Cloud Firestore'),
  firestoreDescription: s__(
    'CloudSeed|Flexible, scalable NoSQL cloud database for client- and server-side development',
  ),
  createInstance: s__('CloudSeed|Create instance'),
  createCluster: s__('CloudSeed|Create cluster'),
  createDatabase: s__('CloudSeed|Create database'),
  title: s__('CloudSeed|Services'),
  description: s__('CloudSeed|Available database services through which instances may be created'),
  pricingAlert: s__(
    'CloudSeed|Learn more about pricing for %{cloudsqlPricingStart}Cloud SQL%{cloudsqlPricingEnd}, %{alloydbPricingStart}Alloy DB%{alloydbPricingEnd}, %{memorystorePricingStart}Memorystore%{memorystorePricingEnd} and %{firestorePricingStart}Firestore%{firestorePricingEnd}.',
  ),
  secretManagersDescription: s__(
    'CloudSeed|Enhance security by storing database variables in secret managers - learn more about %{docLinkStart}secret management with GitLab%{docLinkEnd}',
  ),
};

const helpUrlSecrets = helpPagePath('ee/ci/secrets');

export default {
  components: { GlAlert, GlButton, GlLink, GlSprintf, GlTable },
  props: {
    cloudsqlPostgresUrl: {
      type: String,
      required: true,
    },
    cloudsqlMysqlUrl: {
      type: String,
      required: true,
    },
    cloudsqlSqlserverUrl: {
      type: String,
      required: true,
    },
    alloydbPostgresUrl: {
      type: String,
      required: true,
    },
    memorystoreRedisUrl: {
      type: String,
      required: true,
    },
    firestoreUrl: {
      type: String,
      required: true,
    },
  },
  methods: {
    actionUrl(key) {
      switch (key) {
        case KEY_CLOUDSQL_POSTGRES:
          return this.cloudsqlPostgresUrl;
        case KEY_CLOUDSQL_MYSQL:
          return this.cloudsqlMysqlUrl;
        case KEY_CLOUDSQL_SQLSERVER:
          return this.cloudsqlSqlserverUrl;
        case KEY_ALLOYDB_POSTGRES:
          return this.alloydbPostgresUrl;
        case KEY_MEMORYSTORE_REDIS:
          return this.memorystoreRedisUrl;
        case KEY_FIRESTORE:
          return this.firestoreUrl;
        default:
          return '#';
      }
    },
  },
  fields: [
    { key: 'title', label: i18n.columnService },
    { key: 'description', label: i18n.columnDescription },
    { key: 'action', label: '' },
  ],
  items: [
    {
      title: i18n.cloudsqlPostgresTitle,
      description: i18n.cloudsqlPostgresDescription,
      action: {
        key: KEY_CLOUDSQL_POSTGRES,
        title: i18n.createInstance,
        testId: 'button-cloudsql-postgres',
      },
    },
    {
      title: i18n.cloudsqlMysqlTitle,
      description: i18n.cloudsqlMysqlDescription,
      action: {
        disabled: false,
        key: KEY_CLOUDSQL_MYSQL,
        title: i18n.createInstance,
        testId: 'button-cloudsql-mysql',
      },
    },
    {
      title: i18n.cloudsqlSqlserverTitle,
      description: i18n.cloudsqlSqlserverDescription,
      action: {
        disabled: false,
        key: KEY_CLOUDSQL_SQLSERVER,
        title: i18n.createInstance,
        testId: 'button-cloudsql-sqlserver',
      },
    },
    {
      title: i18n.alloydbPostgresTitle,
      description: i18n.alloydbPostgresDescription,
      action: {
        disabled: true,
        key: KEY_ALLOYDB_POSTGRES,
        title: i18n.createCluster,
        testId: 'button-alloydb-postgres',
      },
    },
    {
      title: i18n.memorystoreRedisTitle,
      description: i18n.memorystoreRedisDescription,
      action: {
        disabled: true,
        key: KEY_MEMORYSTORE_REDIS,
        title: i18n.createInstance,
        testId: 'button-memorystore-redis',
      },
    },
    {
      title: i18n.firestoreTitle,
      description: i18n.firestoreDescription,
      action: {
        disabled: true,
        key: KEY_FIRESTORE,
        title: i18n.createDatabase,
        testId: 'button-firestore',
      },
    },
  ],
  helpUrlSecrets,
  i18n,
};
</script>

<template>
  <div class="gl-mx-3">
    <h2 class="gl-font-size-h2">{{ $options.i18n.title }}</h2>
    <p>{{ $options.i18n.description }}</p>

    <gl-table :fields="$options.fields" :items="$options.items">
      <template #cell(action)="{ value }">
        <gl-button
          block
          :disabled="value.disabled"
          :href="actionUrl(value.key)"
          :data-testid="value.testId"
          category="secondary"
          variant="confirm"
        >
          {{ value.title }}
        </gl-button>
      </template>
    </gl-table>

    <gl-alert class="gl-mt-5" :dismissible="false" variant="tip">
      <gl-sprintf :message="$options.i18n.pricingAlert">
        <template #cloudsqlPricing="{ content }">
          <gl-link href="https://cloud.google.com/sql/pricing">{{ content }}</gl-link>
        </template>
        <template #alloydbPricing="{ content }">
          <gl-link href="https://cloud.google.com/alloydb/pricing">{{ content }}</gl-link>
        </template>
        <template #memorystorePricing="{ content }">
          <gl-link href="https://cloud.google.com/memorystore/docs/redis/pricing">{{
            content
          }}</gl-link>
        </template>
        <template #firestorePricing="{ content }">
          <gl-link href="https://cloud.google.com/firestore/pricing">{{ content }}</gl-link>
        </template>
      </gl-sprintf>
    </gl-alert>

    <gl-alert class="gl-mt-5" :dismissible="false" variant="tip">
      <gl-sprintf :message="$options.i18n.secretManagersDescription">
        <template #docLink="{ content }">
          <gl-link :href="$options.helpUrlSecrets">
            {{ content }}
          </gl-link>
        </template>
      </gl-sprintf>
    </gl-alert>
  </div>
</template>