aboutsummaryrefslogtreecommitdiff
path: root/kamon-status-page/src/main/vue/src/components/StatusCard.vue
blob: c402842f1ea0ede5fa6e9aeb7783465ef9f9c266 (plain) (blame)
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
<template>
  <card>
    <div class="row status-card no-gutters">
      <div class="col-auto">
        <div class="status-indicator-wrap text-center text-uppercase" :style="indicatorStyle">
          <slot name="status-indicator">
            <div class="status-indicator h-100 pt-3">
              <i class="fas fa-fw" :class="indicatorIcon"></i>
              <div>
                {{ indicatorText }}
              </div>
            </div>
          </slot>
        </div>
      </div>
      <div class="col">
        <slot name="default">

        </slot>
      </div>
    </div>
  </card>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import Card from './Card.vue'

@Component({
  components: {
    card: Card
  }
})
export default class StatusCard extends Vue {
  @Prop({ default: 'white' }) private indicatorColor!: string
  @Prop({ default: '#989898' }) private indicatorBackgroundColor!: string
  @Prop({ default: 'fa-question' }) private indicatorIcon!: string
  @Prop({ default: 'Unknown' }) private indicatorText!: string

  get indicatorStyle() {
    return {
      color: this.indicatorColor,
      backgroundColor: this.indicatorBackgroundColor
    }
  }
}

</script>

<style lang="scss">

$indicator-size: 6rem;
.status-card {
  min-height: $indicator-size;

  .status-indicator-wrap {
    height: 100%;
    min-width: $indicator-size;
    max-width: $indicator-size;
    min-height: $indicator-size;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .status-indicator {
    line-height: 2rem;

  i {
      font-size: 2.5rem;
    }
  }

  .critical {
    background-color: #dadada;
  }

  .healthy {
    background-color: #7ade94;
  }

  .suggested {
    background-color: #5fd7cc;
  }
}
</style>