blob: 9c549da4b6596ee0955df5faf96b82fcb925a03d [file] [log] [blame]
Dixsie Wolmers97d86b32019-12-02 05:07:57 -06001<template>
Dixsie Wolmers5a909422020-07-21 11:24:05 -05002 <div class="quicklinks form-background">
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -05003 <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: {
Derick Montague602e98a2020-10-21 16:20:00 -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;
Derick Montague602e98a2020-10-21 16:20:00 -050078 },
79 },
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060080 },
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'),
Derick Montague602e98a2020-10-21 16:20:00 -050084 this.$store.dispatch('serverLed/getIndicatorValue'),
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070085 ]).finally(() => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +053086 this.$root.$emit('overview-quicklinks-complete');
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -070087 });
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070088 },
89 methods: {
90 onChangeServerLed(value) {
91 this.$store
92 .dispatch('serverLed/saveIndicatorLedValue', value)
Derick Montague602e98a2020-10-21 16:20:00 -050093 .then((message) => this.successToast(message))
Yoshie Muranaka2f8bbbf2020-07-02 10:58:21 -070094 .catch(({ message }) => this.errorToast(message));
Derick Montague602e98a2020-10-21 16:20:00 -050095 },
96 },
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060097};
98</script>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -050099
100<style lang="scss" scoped>
101dd,
102dl {
103 margin: 0;
104}
105
106.quicklinks {
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500107 display: grid;
108 grid-gap: 1rem;
109 padding: 1rem;
110 white-space: nowrap;
111 align-items: center;
112}
113
114@include media-breakpoint-up(sm) {
115 .quicklinks {
116 grid-template-columns: repeat(2, 1fr);
117 }
118}
119
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800120@include media-breakpoint-up(xl) {
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500121 .quicklinks {
122 grid-template-columns: repeat(4, 1fr);
123 }
124}
125</style>