1<template>
2  <div class="quicklinks">
3    <div>
4      <dl>
5        <dt>{{ $t('pageOverview.quicklinks.bmcTime') }}</dt>
6        <dd v-if="bmcTime">
7          {{ bmcTime | formatDate }} {{ bmcTime | formatTime }}
8        </dd>
9        <dd v-else>--</dd>
10      </dl>
11    </div>
12    <div>
13      <!-- TODO: add toggle LED on/off funtionality -->
14      <dl>
15        <dt>{{ $t('pageOverview.quicklinks.serverLed') }}</dt>
16        <dd>
17          <b-form-checkbox
18            v-model="serverLedChecked"
19            data-test-id="overviewQuickLinks-checkbox-serverLed"
20            name="check-button"
21            switch
22          >
23            <span v-if="serverLedChecked">{{ $t('global.status.on') }}</span>
24            <span v-else>{{ $t('global.status.off') }}</span>
25          </b-form-checkbox>
26        </dd>
27      </dl>
28    </div>
29    <div>
30      <b-button
31        to="/configuration/network-settings"
32        variant="secondary"
33        data-test-id="overviewQuickLinks-button-networkSettings"
34        class="d-flex justify-content-between align-items-center"
35      >
36        <span>{{ $t('pageOverview.quicklinks.editNetworkSettings') }}</span>
37        <icon-arrow-right />
38      </b-button>
39    </div>
40    <div>
41      <b-button
42        to="/control/serial-over-lan"
43        variant="secondary"
44        data-test-id="overviewQuickLinks-button-solConsole"
45        class="d-flex justify-content-between align-items-center"
46      >
47        <span>{{ $t('pageOverview.quicklinks.solConsole') }}</span>
48        <icon-arrow-right />
49      </b-button>
50    </div>
51  </div>
52</template>
53
54<script>
55import ArrowRight16 from '@carbon/icons-vue/es/arrow--right/16';
56
57export default {
58  name: 'QuickLinks',
59  components: {
60    IconArrowRight: ArrowRight16
61  },
62  data() {
63    return {
64      serverLedChecked: false
65    };
66  },
67  computed: {
68    bmcTime() {
69      return this.$store.getters['global/bmcTime'];
70    }
71  },
72  created() {
73    this.$store.dispatch('global/getBmcTime').finally(() => {
74      this.$root.$emit('overview::quicklinks::complete');
75    });
76  }
77};
78</script>
79
80<style lang="scss" scoped>
81@import 'src/assets/styles/helpers';
82
83dd,
84dl {
85  margin: 0;
86}
87
88.quicklinks {
89  background: $container-bgd;
90  display: grid;
91  grid-gap: 1rem;
92  padding: 1rem;
93  white-space: nowrap;
94  align-items: center;
95}
96
97@include media-breakpoint-up(sm) {
98  .quicklinks {
99    grid-template-columns: repeat(2, 1fr);
100  }
101}
102
103@include media-breakpoint-up(xl) {
104  .quicklinks {
105    grid-template-columns: repeat(4, 1fr);
106  }
107}
108</style>
109