aboutsummaryrefslogtreecommitdiff
path: root/kamon-status-page/src/main/vue/src/components/InstrumentationModuleList.vue
blob: 224f6716b3456620b871dbb488ffbe4c59a71525 (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
<template>
  <div class="row">
    <div class="col-12 pt-4 pb-2" v-if="modules.length > 0">
      <h2>Instrumentation Modules</h2>
    </div>
    <div class="col-12 py-1" v-for="module in sortedModules" :key="module.name">
      <instrumentation-module-status-card :module="module"/>
    </div>
  </div>
</template>

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


@Component({
  components: {
    'instrumentation-module-status-card': InstrumentationModuleStatusCard
  }
})
export default class ModuleList extends Vue {
  @Prop() private modules!: InstrumentationModule[]

  get sortedModules(): InstrumentationModule[] {
    return this.modules.sort((left, right) => {
      if (left.active === right.active) {
        return left.name.localeCompare(right.name)
      } else {
        return left.active ? -1 : 1
      }
    })
  }
}
</script>

<style lang="scss">
.apm-suggestion {
  .kind-label {
    background-color: #d0f3f0;
  }
}
</style>