SurenNeware | 090c2d4 | 2020-04-01 14:07:27 +0530 | [diff] [blame^] | 1 | <template> |
| 2 | <b-container fluid="xl"> |
| 3 | <page-title /> |
| 4 | <b-row> |
| 5 | <b-col md="12"> |
| 6 | <page-section :section-title="$t('pageServerLed.serverLedTitle')"> |
| 7 | <b-form-group :label="$t('pageServerLed.serverLedSubTitle')"> |
| 8 | <b-form-checkbox |
| 9 | v-model="indicatorLED" |
| 10 | name="check-button" |
| 11 | value="Lit" |
| 12 | unchecked-value="Off" |
| 13 | switch |
| 14 | > |
| 15 | <span v-if="indicatorLED !== 'Off' && indicatorLED"> |
| 16 | {{ $t('global.status.on') }} |
| 17 | </span> |
| 18 | <span v-else> |
| 19 | {{ $t('global.status.off') }} |
| 20 | </span> |
| 21 | </b-form-checkbox> |
| 22 | </b-form-group> |
| 23 | </page-section> |
| 24 | </b-col> |
| 25 | </b-row> |
| 26 | </b-container> |
| 27 | </template> |
| 28 | |
| 29 | <script> |
| 30 | import PageTitle from '../../../components/Global/PageTitle'; |
| 31 | import PageSection from '../../../components/Global/PageSection'; |
| 32 | |
| 33 | export default { |
| 34 | name: 'ServerLed', |
| 35 | components: { PageTitle, PageSection }, |
| 36 | computed: { |
| 37 | indicatorLED: { |
| 38 | get() { |
| 39 | return this.$store.getters['serverLed/getIndicatorValue']; |
| 40 | }, |
| 41 | set(newValue) { |
| 42 | if (newValue) { |
| 43 | this.$store.dispatch('serverLed/saveIndicatorLedValue', newValue); |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | }, |
| 48 | created() { |
| 49 | this.$store.dispatch('serverLed/getIndicatorValue'); |
| 50 | } |
| 51 | }; |
| 52 | </script> |