blob: 5dd71ee2c90c4d44acc66271227d17608cc414a2 [file] [log] [blame]
Dixsie Wolmers97d86b32019-12-02 05:07:57 -06001<template>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -05002 <div class="quicklinks">
3 <div>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -06004 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -08005 <dt>{{ $t('pageOverview.quicklinks.bmcTime') }}</dt>
Yoshie Muranakae45f54b2020-03-26 15:23:34 -07006 <dd v-if="bmcTime">
7 {{ bmcTime | formatDate }} {{ bmcTime | formatTime }}
8 </dd>
9 <dd v-else>--</dd>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060010 </dl>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050011 </div>
12 <div>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050013 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080014 <dt>{{ $t('pageOverview.quicklinks.serverLed') }}</dt>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050015 <dd>
16 <b-form-checkbox
17 v-model="serverLedChecked"
Dixsie Wolmers1e2d70a2020-07-01 12:56:10 -050018 data-test-id="overviewQuickLinks-checkbox-serverLed"
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050019 name="check-button"
20 switch
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070021 value="Lit"
22 unchecked-value="Off"
23 @change="onChangeServerLed"
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050024 >
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070025 <span v-if="serverLedChecked !== 'Off'">
26 {{ $t('global.status.on') }}
27 </span>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080028 <span v-else>{{ $t('global.status.off') }}</span>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050029 </b-form-checkbox>
30 </dd>
31 </dl>
32 </div>
33 <div>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050034 <b-button
Dixsie Wolmers1e2d70a2020-07-01 12:56:10 -050035 to="/configuration/network-settings"
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050036 variant="secondary"
Dixsie Wolmers1e2d70a2020-07-01 12:56:10 -050037 data-test-id="overviewQuickLinks-button-networkSettings"
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050038 class="d-flex justify-content-between align-items-center"
39 >
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080040 <span>{{ $t('pageOverview.quicklinks.editNetworkSettings') }}</span>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050041 <icon-arrow-right />
42 </b-button>
43 </div>
44 <div>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050045 <b-button
Dixsie Wolmers1e2d70a2020-07-01 12:56:10 -050046 to="/control/serial-over-lan"
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050047 variant="secondary"
Dixsie Wolmers1e2d70a2020-07-01 12:56:10 -050048 data-test-id="overviewQuickLinks-button-solConsole"
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050049 class="d-flex justify-content-between align-items-center"
50 >
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080051 <span>{{ $t('pageOverview.quicklinks.solConsole') }}</span>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050052 <icon-arrow-right />
53 </b-button>
54 </div>
55 </div>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060056</template>
57
58<script>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050059import ArrowRight16 from '@carbon/icons-vue/es/arrow--right/16';
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070060import BVToastMixin from '@/components/Mixins/BVToastMixin';
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050061
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060062export default {
Derick Montague09e45cd2020-01-23 15:45:57 -060063 name: 'QuickLinks',
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060064 components: {
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050065 IconArrowRight: ArrowRight16
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060066 },
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070067 mixins: [BVToastMixin],
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060068 computed: {
69 bmcTime() {
Derick Montaguee2fd1562019-12-20 13:26:53 -060070 return this.$store.getters['global/bmcTime'];
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070071 },
72 serverLedChecked: {
73 get() {
74 return this.$store.getters['serverLed/getIndicatorValue'];
75 },
76 set(value) {
77 return value;
78 }
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060079 }
80 },
Derick Montague09e45cd2020-01-23 15:45:57 -060081 created() {
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070082 Promise.all([
83 this.$store.dispatch('global/getBmcTime'),
84 this.$store.dispatch('serverLed/getIndicatorValue')
85 ]).finally(() => {
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -070086 this.$root.$emit('overview::quicklinks::complete');
87 });
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070088 },
89 methods: {
90 onChangeServerLed(value) {
91 this.$store
92 .dispatch('serverLed/saveIndicatorLedValue', value)
93 .then(message => this.successToast(message))
94 .catch(({ message }) => this.errorToast(message));
95 }
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060096 }
97};
98</script>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050099
100<style lang="scss" scoped>
Derick Montague40865722020-04-13 17:01:19 -0500101@import 'src/assets/styles/helpers';
102
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500103dd,
104dl {
105 margin: 0;
106}
107
108.quicklinks {
Derick Montague7f970a12020-03-02 17:56:09 -0600109 background: $container-bgd;
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500110 display: grid;
111 grid-gap: 1rem;
112 padding: 1rem;
113 white-space: nowrap;
114 align-items: center;
115}
116
117@include media-breakpoint-up(sm) {
118 .quicklinks {
119 grid-template-columns: repeat(2, 1fr);
120 }
121}
122
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800123@include media-breakpoint-up(xl) {
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500124 .quicklinks {
125 grid-template-columns: repeat(4, 1fr);
126 }
127}
128</style>