diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-03-28 00:47:25 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-04-06 22:37:46 +0300 |
commit | f4ff62fa64c4d161b2265094022e699084a2dbbd (patch) | |
tree | cfc5754f2ac2eb68fe2f7b4f193ae78f6b522d52 /app/assets/javascripts | |
parent | 657fea868834ef239ab312381ac0956f3a84a07c (diff) |
formatting fixes
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/monitoring/components/graph/legend.vue | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/app/assets/javascripts/monitoring/components/graph/legend.vue b/app/assets/javascripts/monitoring/components/graph/legend.vue index ac1c6e34cc4..ca3081a6306 100644 --- a/app/assets/javascripts/monitoring/components/graph/legend.vue +++ b/app/assets/javascripts/monitoring/components/graph/legend.vue @@ -23,26 +23,15 @@ export default { methods: { formatMetricUsage(series) { const value = - series.values[this.currentDataIndex] && - series.values[this.currentDataIndex].value; + series.values[this.currentDataIndex] && series.values[this.currentDataIndex].value; if (isNaN(value)) { return '-'; } return `${formatRelevantDigits(value)} ${this.unitOfDisplay}`; }, - createSeriesString(index, series) { - if (series.metricTag) { - return `${series.metricTag} ${this.formatMetricUsage(series)}`; - } - return `${this.legendTitle} series ${index + 1} ${this.formatMetricUsage( - series, - )}`; - }, - summaryMetrics(series) { - return `Avg: ${formatRelevantDigits(series.average)} ${this.unitOfDisplay}, - Max: ${formatRelevantDigits(series.max)} ${this.unitOfDisplay}`; + return `Avg: ${formatRelevantDigits(series.average)} ยท Max: ${formatRelevantDigits(series.max)}`; }, strokeDashArray(type) { @@ -80,10 +69,18 @@ export default { class="legend-metric-title" v-if="timeSeries.length > 1" > - {{ createSeriesString(index, series) }}, {{ summaryMetrics(series) }} + <template v-if="series.metricTag"> + <strong>{{ series.metricTag }}</strong> + {{ formatMetricUsage(series) }} {{ summaryMetrics(series) }} + </template> + <template v-else> + <strong>{{ legendTitle }}</strong> + series {{ index + 1 }} {{ formatMetricUsage(series) }} {{ summaryMetrics(series) }} + </template> </td> <td v-else> - {{ legendTitle }} {{ formatMetricUsage(series) }}, {{ summaryMetrics(series) }} + <strong>{{ legendTitle }}</strong> + {{ formatMetricUsage(series) }} {{ summaryMetrics(series) }} </td> </tr> </table> |