summaryrefslogtreecommitdiffstats
path: root/test-scheduler/ui/src/App.vue
blob: 0b77aa63f4d26959b0f35cc3fec0b0595a1168e5 (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
<template>
  <div id="app">
    <div class="row border-bottom blue-bg my-page-header">
        <p id="title">OPNFV Bottlenecks Portal</p>
        <ul id="intr_table" class="nav navbar-nav">
          <li v-bind:class="{'router-link-active': cur_route == '/'}"><router-link to="/">Test Suites</router-link></li>
          <li v-bind:class="{'router-link-active': cur_route == 'result'}"><router-link to="/result">Test Results</router-link></li>
          <li v-bind:class="{'router-link-active': cur_route == 'report'}"><router-link to="/report">Reports</router-link></li>
          <li v-bind:class="{'router-link-active': cur_route == 'environment'}"><router-link to="/environment">Environments</router-link></li>
        </ul>
    </div>
    <router-view/>
  </div>
</template>
<script>
export default {
  name: 'App',
  data: function() {
    return {
      cur_route: ''
    }
  },
  watch: {
    '$route': function() {
      this.highlightLink();
    }
  },
  mounted: function() {
    this.highlightLink();
  },
  methods: {
    highlightLink: function() {
      var name = this.$route.name;
      if(name == 'result' || name == 'report' || name == 'environment') {
        this.cur_route = name;
      } else {
        this.cur_route = '/';
      }
    }
  }
}
</script>