-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathProgressBar.vue
More file actions
53 lines (48 loc) · 1.38 KB
/
ProgressBar.vue
File metadata and controls
53 lines (48 loc) · 1.38 KB
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 setup lang="ts">
// Not really a very generic ProgressBar - consider renaming to StateProgressBar.
import { BProgress, BProgressBar } from "bootstrap-vue";
interface Props {
total?: number;
note: string;
loading?: boolean;
okCount?: number;
runningCount?: number;
newCount?: number;
errorCount?: number;
}
const props = withDefaults(defineProps<Props>(), {
total: 1,
note: undefined,
loading: false,
okCount: 0,
runningCount: 0,
newCount: 0,
errorCount: 0,
});
</script>
<template>
<div class="my-1 progress-container">
<small v-if="props.note" v-g-tooltip.onoverflow class="progress-note" :title="props.note">
{{ props.note }}<span v-if="props.loading">.<span class="blinking">..</span></span>
</small>
<BProgress :max="props.total">
<BProgressBar variant="success" :value="props.okCount" />
<BProgressBar variant="danger" :value="props.errorCount" />
<BProgressBar variant="warning" :value="props.runningCount" />
<BProgressBar variant="warning" :value="props.newCount" />
</BProgress>
</div>
</template>
<style scoped>
.progress-note {
position: absolute;
text-align: center;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.progress-container {
position: relative;
}
</style>