summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ml/experiment_tracking/components/ml_candidate.vue
blob: 5f54f24e24c299e99330c90b892587a0204ba952 (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
<script>
import { GlLink } from '@gitlab/ui';
import { __ } from '~/locale';
import IncubationAlert from './incubation_alert.vue';

export default {
  name: 'MlCandidate',
  components: {
    IncubationAlert,
    GlLink,
  },
  inject: ['candidate'],
  i18n: {
    titleLabel: __('Model candidate details'),
    infoLabel: __('Info'),
    idLabel: __('ID'),
    statusLabel: __('Status'),
    experimentLabel: __('Experiment'),
    artifactsLabel: __('Artifacts'),
    parametersLabel: __('Parameters'),
    metricsLabel: __('Metrics'),
  },
};
</script>

<template>
  <div>
    <incubation-alert />

    <h3>
      {{ $options.i18n.titleLabel }}
    </h3>

    <table class="candidate-details">
      <tbody>
        <tr class="divider"></tr>

        <tr>
          <td class="gl-text-secondary gl-font-weight-bold">{{ $options.i18n.infoLabel }}</td>
          <td class="gl-font-weight-bold">{{ $options.i18n.idLabel }}</td>
          <td>{{ candidate.info.iid }}</td>
        </tr>

        <tr>
          <td></td>
          <td class="gl-font-weight-bold">{{ $options.i18n.statusLabel }}</td>
          <td>{{ candidate.info.status }}</td>
        </tr>

        <tr>
          <td></td>
          <td class="gl-font-weight-bold">{{ $options.i18n.experimentLabel }}</td>
          <td>
            <gl-link :href="candidate.info.path_to_experiment">{{
              candidate.info.experiment_name
            }}</gl-link>
          </td>
        </tr>

        <tr v-if="candidate.info.path_to_artifact">
          <td></td>
          <td class="gl-font-weight-bold">{{ $options.i18n.artifactsLabel }}</td>
          <td>
            <gl-link :href="candidate.info.path_to_artifact">{{
              $options.i18n.artifactsLabel
            }}</gl-link>
          </td>
        </tr>

        <tr class="divider"></tr>

        <tr v-for="(param, index) in candidate.params" :key="param.name">
          <td v-if="index == 0" class="gl-text-secondary gl-font-weight-bold">
            {{ $options.i18n.parametersLabel }}
          </td>
          <td v-else></td>
          <td class="gl-font-weight-bold">{{ param.name }}</td>
          <td>{{ param.value }}</td>
        </tr>

        <tr class="divider"></tr>

        <tr v-for="(metric, index) in candidate.metrics" :key="metric.name">
          <td v-if="index == 0" class="gl-text-secondary gl-font-weight-bold">
            {{ $options.i18n.metricsLabel }}
          </td>
          <td v-else></td>
          <td class="gl-font-weight-bold">{{ metric.name }}</td>
          <td>{{ metric.value }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>