summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/runner/runner_details/runner_details_app.vue
blob: 5d5fa81b85113b421573355994f498c57827a5b5 (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
<script>
import { convertToGraphQLId } from '~/graphql_shared/utils';
import RunnerTypeAlert from '../components/runner_type_alert.vue';
import RunnerTypeBadge from '../components/runner_type_badge.vue';
import RunnerUpdateForm from '../components/runner_update_form.vue';
import { I18N_DETAILS_TITLE, RUNNER_ENTITY_TYPE } from '../constants';
import getRunnerQuery from '../graphql/get_runner.query.graphql';

export default {
  components: {
    RunnerTypeAlert,
    RunnerTypeBadge,
    RunnerUpdateForm,
  },
  i18n: {
    I18N_DETAILS_TITLE,
  },
  props: {
    runnerId: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      runner: null,
    };
  },
  apollo: {
    runner: {
      query: getRunnerQuery,
      variables() {
        return {
          id: convertToGraphQLId(RUNNER_ENTITY_TYPE, this.runnerId),
        };
      },
    },
  },
};
</script>
<template>
  <div>
    <h2 class="page-title">
      {{ sprintf($options.i18n.I18N_DETAILS_TITLE, { runner_id: runnerId }) }}

      <runner-type-badge v-if="runner" :type="runner.runnerType" />
    </h2>

    <runner-type-alert v-if="runner" :type="runner.runnerType" />

    <runner-update-form :runner="runner" class="gl-my-5" />
  </div>
</template>