Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 1 | <template> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 2 | <div class="quicklinks"> |
| 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: { |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -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; |
| 78 | } |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 79 | } |
| 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'), |
| 84 | this.$store.dispatch('serverLed/getIndicatorValue') |
| 85 | ]).finally(() => { |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 86 | this.$root.$emit('overview::quicklinks::complete'); |
| 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) |
| 93 | .then(message => this.successToast(message)) |
| 94 | .catch(({ message }) => this.errorToast(message)); |
| 95 | } |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 96 | } |
| 97 | }; |
| 98 | </script> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 99 | |
| 100 | <style lang="scss" scoped> |
Derick Montague | 4086572 | 2020-04-13 17:01:19 -0500 | [diff] [blame] | 101 | @import 'src/assets/styles/helpers'; |
| 102 | |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 103 | dd, |
| 104 | dl { |
| 105 | margin: 0; |
| 106 | } |
| 107 | |
| 108 | .quicklinks { |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 109 | background: $container-bgd; |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 110 | 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 Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 123 | @include media-breakpoint-up(xl) { |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 124 | .quicklinks { |
| 125 | grid-template-columns: repeat(4, 1fr); |
| 126 | } |
| 127 | } |
| 128 | </style> |