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

service_accounts.vue « components « google_cloud « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b70b25a5dc36301f4922f65387dd6e250e1b9369 (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
<script>
import { GlButton, GlEmptyState, GlTable } from '@gitlab/ui';
import { __ } from '~/locale';

export default {
  components: { GlButton, GlEmptyState, GlTable },
  props: {
    list: {
      type: Array,
      required: true,
    },
    createUrl: {
      type: String,
      required: true,
    },
    emptyIllustrationUrl: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      tableFields: [
        { key: 'environment', label: __('Environment'), sortable: true },
        { key: 'gcp_project', label: __('Google Cloud Project'), sortable: true },
        { key: 'service_account_exists', label: __('Service Account'), sortable: true },
        { key: 'service_account_key_exists', label: __('Service Account Key'), sortable: true },
      ],
    };
  },
};
</script>

<template>
  <div>
    <gl-empty-state
      v-if="list.length === 0"
      :title="__('No service accounts')"
      :description="
        __('Service Accounts keys authorize GitLab to deploy your Google Cloud project')
      "
      :primary-button-link="createUrl"
      :primary-button-text="__('Create service account')"
      :svg-path="emptyIllustrationUrl"
    />

    <div v-else>
      <h2 class="gl-font-size-h2">{{ __('Service Accounts') }}</h2>
      <p>{{ __('Service Accounts keys authorize GitLab to deploy your Google Cloud project') }}</p>

      <gl-table :items="list" :fields="tableFields">
        <template #cell(service_account_exists)="{ value }">
          {{ value ? '✔' : __('Not found') }}
        </template>
        <template #cell(service_account_key_exists)="{ value }">
          {{ value ? '✔' : __('Not found') }}
        </template>
      </gl-table>

      <gl-button :href="createUrl" category="primary" variant="info">
        {{ __('Create service account') }}
      </gl-button>
    </div>
  </div>
</template>