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

ml_candidates_show.vue « show « candidates « routes « experiment_tracking « ml « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ef73e7c8742abf2e0d9337e2e1d366eb5295055 (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
<script>
import ModelExperimentsHeader from '~/ml/experiment_tracking/components/model_experiments_header.vue';
import DeleteButton from '~/ml/experiment_tracking/components/delete_button.vue';
import DetailRow from './components/candidate_detail_row.vue';

import {
  TITLE_LABEL,
  INFO_LABEL,
  ID_LABEL,
  STATUS_LABEL,
  EXPERIMENT_LABEL,
  ARTIFACTS_LABEL,
  PARAMETERS_LABEL,
  METRICS_LABEL,
  METADATA_LABEL,
  DELETE_CANDIDATE_CONFIRMATION_MESSAGE,
  DELETE_CANDIDATE_PRIMARY_ACTION_LABEL,
  DELETE_CANDIDATE_MODAL_TITLE,
  MLFLOW_ID_LABEL,
} from './translations';

export default {
  name: 'MlCandidatesShow',
  components: {
    ModelExperimentsHeader,
    DeleteButton,
    DetailRow,
  },
  props: {
    candidate: {
      type: Object,
      required: true,
    },
  },
  i18n: {
    TITLE_LABEL,
    INFO_LABEL,
    ID_LABEL,
    STATUS_LABEL,
    EXPERIMENT_LABEL,
    ARTIFACTS_LABEL,
    DELETE_CANDIDATE_CONFIRMATION_MESSAGE,
    DELETE_CANDIDATE_PRIMARY_ACTION_LABEL,
    DELETE_CANDIDATE_MODAL_TITLE,
    MLFLOW_ID_LABEL,
  },
  computed: {
    info() {
      return Object.freeze(this.candidate.info);
    },
    sections() {
      return [
        {
          sectionName: PARAMETERS_LABEL,
          sectionValues: this.candidate.params,
        },
        {
          sectionName: METRICS_LABEL,
          sectionValues: this.candidate.metrics,
        },
        {
          sectionName: METADATA_LABEL,
          sectionValues: this.candidate.metadata,
        },
      ];
    },
  },
};
</script>

<template>
  <div>
    <model-experiments-header :page-title="$options.i18n.TITLE_LABEL">
      <delete-button
        :delete-path="info.path"
        :delete-confirmation-text="$options.i18n.DELETE_CANDIDATE_CONFIRMATION_MESSAGE"
        :action-primary-text="$options.i18n.DELETE_CANDIDATE_PRIMARY_ACTION_LABEL"
        :modal-title="$options.i18n.DELETE_CANDIDATE_MODAL_TITLE"
      />
    </model-experiments-header>

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

        <detail-row
          :label="$options.i18n.ID_LABEL"
          :section-label="$options.i18n.INFO_LABEL"
          :text="info.iid"
        />

        <detail-row :label="$options.i18n.MLFLOW_ID_LABEL" :text="info.eid" />

        <detail-row :label="$options.i18n.STATUS_LABEL" :text="info.status" />

        <detail-row
          :label="$options.i18n.EXPERIMENT_LABEL"
          :text="info.experiment_name"
          :href="info.path_to_experiment"
        />

        <detail-row
          v-if="info.path_to_artifact"
          :label="$options.i18n.ARTIFACTS_LABEL"
          :href="info.path_to_artifact"
          :text="$options.i18n.ARTIFACTS_LABEL"
        />

        <template v-for="{ sectionName, sectionValues } in sections">
          <tr v-if="sectionValues" :key="sectionName" class="divider"></tr>

          <detail-row
            v-for="(item, index) in sectionValues"
            :key="item.name"
            :label="item.name"
            :section-label="index === 0 ? sectionName : ''"
            :text="item.value"
          />
        </template>
      </tbody>
    </table>
  </div>
</template>