Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 1 | <template> |
Dixsie Wolmers | 5a90942 | 2020-07-21 11:24:05 -0500 | [diff] [blame] | 2 | <div class="quicklinks form-background"> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 3 | <div> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 4 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 5 | <dt>{{ $t('pageOverview.quicklinks.bmcTime') }}</dt> |
Yoshie Muranaka | e45f54b | 2020-03-26 15:23:34 -0700 | [diff] [blame] | 6 | <dd v-if="bmcTime"> |
| 7 | {{ bmcTime | formatDate }} {{ bmcTime | formatTime }} |
| 8 | </dd> |
| 9 | <dd v-else>--</dd> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 10 | </dl> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 11 | </div> |
| 12 | <div> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 13 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 14 | <dt>{{ $t('pageOverview.quicklinks.serverLed') }}</dt> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 15 | <dd> |
| 16 | <b-form-checkbox |
| 17 | v-model="serverLedChecked" |
Dixsie Wolmers | 1e2d70a | 2020-07-01 12:56:10 -0500 | [diff] [blame] | 18 | data-test-id="overviewQuickLinks-checkbox-serverLed" |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 19 | name="check-button" |
| 20 | switch |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 21 | value="Lit" |
| 22 | unchecked-value="Off" |
| 23 | @change="onChangeServerLed" |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 24 | > |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 25 | <span v-if="serverLedChecked !== 'Off'"> |
| 26 | {{ $t('global.status.on') }} |
| 27 | </span> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 28 | <span v-else>{{ $t('global.status.off') }}</span> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 29 | </b-form-checkbox> |
| 30 | </dd> |
| 31 | </dl> |
| 32 | </div> |
| 33 | <div> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 34 | <b-button |
Dixsie Wolmers | 1e2d70a | 2020-07-01 12:56:10 -0500 | [diff] [blame] | 35 | to="/configuration/network-settings" |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 36 | variant="secondary" |
Dixsie Wolmers | 1e2d70a | 2020-07-01 12:56:10 -0500 | [diff] [blame] | 37 | data-test-id="overviewQuickLinks-button-networkSettings" |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 38 | class="d-flex justify-content-between align-items-center" |
| 39 | > |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 40 | <span>{{ $t('pageOverview.quicklinks.editNetworkSettings') }}</span> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 41 | <icon-arrow-right /> |
| 42 | </b-button> |
| 43 | </div> |
| 44 | <div> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 45 | <b-button |
Dixsie Wolmers | 1e2d70a | 2020-07-01 12:56:10 -0500 | [diff] [blame] | 46 | to="/control/serial-over-lan" |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 47 | variant="secondary" |
Dixsie Wolmers | 1e2d70a | 2020-07-01 12:56:10 -0500 | [diff] [blame] | 48 | data-test-id="overviewQuickLinks-button-solConsole" |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 49 | class="d-flex justify-content-between align-items-center" |
| 50 | > |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 51 | <span>{{ $t('pageOverview.quicklinks.solConsole') }}</span> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 52 | <icon-arrow-right /> |
| 53 | </b-button> |
| 54 | </div> |
| 55 | </div> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 56 | </template> |
| 57 | |
| 58 | <script> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 59 | import ArrowRight16 from '@carbon/icons-vue/es/arrow--right/16'; |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 60 | import BVToastMixin from '@/components/Mixins/BVToastMixin'; |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 61 | |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 62 | export default { |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 63 | name: 'QuickLinks', |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 64 | components: { |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 65 | IconArrowRight: ArrowRight16, |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 66 | }, |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 67 | mixins: [BVToastMixin], |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 68 | computed: { |
| 69 | bmcTime() { |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 70 | return this.$store.getters['global/bmcTime']; |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 71 | }, |
| 72 | serverLedChecked: { |
| 73 | get() { |
| 74 | return this.$store.getters['serverLed/getIndicatorValue']; |
| 75 | }, |
| 76 | set(value) { |
| 77 | return value; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 78 | }, |
| 79 | }, |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 80 | }, |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 81 | created() { |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 82 | Promise.all([ |
| 83 | this.$store.dispatch('global/getBmcTime'), |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 84 | this.$store.dispatch('serverLed/getIndicatorValue'), |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 85 | ]).finally(() => { |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame^] | 86 | this.$root.$emit('overview-quicklinks-complete'); |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 87 | }); |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 88 | }, |
| 89 | methods: { |
| 90 | onChangeServerLed(value) { |
| 91 | this.$store |
| 92 | .dispatch('serverLed/saveIndicatorLedValue', value) |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 93 | .then((message) => this.successToast(message)) |
Yoshie Muranaka | 2f8bbbf | 2020-07-02 10:58:21 -0700 | [diff] [blame] | 94 | .catch(({ message }) => this.errorToast(message)); |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 95 | }, |
| 96 | }, |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 97 | }; |
| 98 | </script> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 99 | |
| 100 | <style lang="scss" scoped> |
| 101 | dd, |
| 102 | dl { |
| 103 | margin: 0; |
| 104 | } |
| 105 | |
| 106 | .quicklinks { |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 107 | 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 Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 120 | @include media-breakpoint-up(xl) { |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 121 | .quicklinks { |
| 122 | grid-template-columns: repeat(4, 1fr); |
| 123 | } |
| 124 | } |
| 125 | </style> |