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

Progressbar.vue « Progressbar « src « vue « CoreHome « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 985c44dc92902bc616b526227ddbb3a787fc9730 (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
<!--
  Matomo - free/libre analytics platform
  @link https://matomo.org
  @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
-->

<template>
  <div class="progressbar">
    <div class="progress">
      <div
        class="determinate"
        style="width: 0"
        :style="{ width: `${actualProgress}%` }"
      />
    </div>
    <span v-show="!!label">
      <img src="plugins/Morpheus/images/loading-blue.gif" style="margin-right: 3.5px" />
      <span class="label" v-html="$sanitize(label)" />
    </span>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
  props: {
    progress: {
      type: Number,
      required: true,
    },
    label: String,
  },
  computed: {
    actualProgress() {
      if (this.progress > 100) {
        return 100;
      }

      if (this.progress < 0) {
        return 0;
      }

      return this.progress;
    },
  },
});
</script>