summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-06-05 08:56:35 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-06-05 08:56:35 +0000
commit85d1444977cf6dcb14c49a6b3267ae335cac00cc (patch)
tree4d7dd3aeb492addb301d2e0e5e6165fb992a72d4 /app
parentac1662e67929d0b7543977a2fb303c1751d2290d (diff)
parente02cd451b2d6a81f4847f26b29ed1eb6c74f8dab (diff)
downloadgitlab-ce-85d1444977cf6dcb14c49a6b3267ae335cac00cc.tar.gz
Merge branch 'jivanvl-add-single-stat-chart-component' into 'master'
Add single_stat chart component to the monitoring bundle See merge request gitlab-org/gitlab-ce!28948
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/monitoring/components/charts/single_stat.vue37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/assets/javascripts/monitoring/components/charts/single_stat.vue b/app/assets/javascripts/monitoring/components/charts/single_stat.vue
new file mode 100644
index 00000000000..b03a6ca1806
--- /dev/null
+++ b/app/assets/javascripts/monitoring/components/charts/single_stat.vue
@@ -0,0 +1,37 @@
+<script>
+import { GlSingleStat } from '@gitlab/ui/dist/charts';
+
+export default {
+ components: {
+ GlSingleStat,
+ },
+ inheritAttrs: false,
+ props: {
+ title: {
+ type: String,
+ required: true,
+ },
+ value: {
+ type: Number,
+ required: true,
+ },
+ unit: {
+ type: String,
+ required: true,
+ },
+ },
+ computed: {
+ valueWithUnit() {
+ return `${this.value}${this.unit}`;
+ },
+ },
+};
+</script>
+<template>
+ <div class="prometheus-graph col-12 col-lg-6">
+ <div class="prometheus-graph-header">
+ <h5 ref="graphTitle" class="prometheus-graph-title">{{ title }}</h5>
+ </div>
+ <gl-single-stat :value="valueWithUnit" :title="title" variant="success" />
+ </div>
+</template>