Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 1 | <template> |
| 2 | <b-container fluid="xl"> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 3 | <page-title /> |
| 4 | <b-row> |
| 5 | <b-col xl="10"> |
| 6 | <!-- Operation in progress alert --> |
| 7 | <alert v-if="isOperationInProgress" variant="info" class="mb-5"> |
| 8 | <p> |
| 9 | {{ $t('pageFirmware.singleFileUpload.alert.operationInProgress') }} |
| 10 | </p> |
| 11 | </alert> |
| 12 | <!-- Power off server warning alert --> |
| 13 | <alert v-else-if="!isHostOff" variant="warning" class="mb-5"> |
| 14 | <p class="mb-0"> |
| 15 | {{ |
| 16 | $t('pageFirmware.singleFileUpload.alert.serverMustBePoweredOffTo') |
| 17 | }} |
| 18 | </p> |
| 19 | <ul class="m-0"> |
| 20 | <li> |
| 21 | {{ |
| 22 | $t( |
| 23 | 'pageFirmware.singleFileUpload.alert.switchRunningAndBackupImages' |
| 24 | ) |
| 25 | }} |
| 26 | </li> |
| 27 | <li> |
| 28 | {{ $t('pageFirmware.singleFileUpload.alert.updateFirmware') }} |
| 29 | </li> |
| 30 | </ul> |
| 31 | <template #action> |
| 32 | <b-link to="/control/server-power-operations"> |
| 33 | {{ |
| 34 | $t( |
| 35 | 'pageFirmware.singleFileUpload.alert.viewServerPowerOperations' |
| 36 | ) |
| 37 | }} |
| 38 | </b-link> |
| 39 | </template> |
| 40 | </alert> |
| 41 | </b-col> |
| 42 | </b-row> |
| 43 | <b-row> |
| 44 | <b-col xl="10"> |
| 45 | <page-section> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 46 | <b-card-group deck> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 47 | <!-- Running image --> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 48 | <b-card> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 49 | <template #header> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 50 | <p class="font-weight-bold m-0"> |
| 51 | {{ $t('pageFirmware.singleFileUpload.runningImage') }} |
| 52 | </p> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 53 | </template> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 54 | <dl class="mb-0"> |
| 55 | <dt>{{ $t('pageFirmware.singleFileUpload.bmcAndServer') }}</dt> |
| 56 | <dd class="mb-0">{{ systemFirmwareVersion }}</dd> |
| 57 | </dl> |
| 58 | </b-card> |
| 59 | |
| 60 | <!-- Backup image --> |
| 61 | <b-card> |
| 62 | <template #header> |
| 63 | <p class="font-weight-bold m-0"> |
| 64 | {{ $t('pageFirmware.singleFileUpload.backupImage') }} |
| 65 | </p> |
| 66 | </template> |
| 67 | <dl> |
| 68 | <dt> |
| 69 | {{ $t('pageFirmware.singleFileUpload.bmcAndServer') }} |
| 70 | </dt> |
| 71 | <dd> |
| 72 | <status-icon v-if="showBackupImageStatus" status="danger" /> |
| 73 | <span v-if="showBackupImageStatus" class="sr-only"> |
| 74 | {{ backupFirmwareStatus }} |
| 75 | </span> |
| 76 | {{ backupFirmwareVersion }} |
| 77 | </dd> |
| 78 | </dl> |
| 79 | <b-btn |
| 80 | v-b-modal.modal-switch-to-running |
| 81 | data-test-id="firmware-button-switchToRunning" |
| 82 | variant="link" |
| 83 | size="sm" |
| 84 | class="py-0 px-1 mt-2" |
| 85 | :disabled="isPageDisabled || !isRebootFromBackupAvailable" |
| 86 | > |
| 87 | <icon-switch class="d-none d-sm-inline-block" /> |
| 88 | {{ $t('pageFirmware.singleFileUpload.switchToRunning') }} |
| 89 | </b-btn> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 90 | </b-card> |
| 91 | </b-card-group> |
| 92 | </page-section> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 93 | </b-col> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 94 | </b-row> |
| 95 | <b-row> |
| 96 | <!-- Update firmware --> |
| 97 | <b-col sm="8" md="6" xl="4"> |
| 98 | <page-section |
| 99 | :section-title="$t('pageFirmware.singleFileUpload.updateFirmware')" |
| 100 | > |
| 101 | <div class="form-background p-3"> |
| 102 | <b-form @submit.prevent="onSubmitUpload"> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 103 | <b-form-group |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 104 | :label="$t('pageFirmware.singleFileUpload.fileSource')" |
| 105 | :disabled="isPageDisabled" |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 106 | > |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 107 | <b-form-radio v-model="isWorkstationSelected" :value="true"> |
| 108 | {{ $t('pageFirmware.form.workstation') }} |
| 109 | </b-form-radio> |
| 110 | <b-form-radio v-model="isWorkstationSelected" :value="false"> |
| 111 | {{ $t('pageFirmware.form.tftpServer') }} |
| 112 | </b-form-radio> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 113 | </b-form-group> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 114 | |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 115 | <!-- Workstation Upload --> |
| 116 | <template v-if="isWorkstationSelected"> |
| 117 | <b-form-group |
| 118 | :label="$t('pageFirmware.form.imageFile')" |
| 119 | label-for="image-file" |
| 120 | > |
| 121 | <b-form-text id="image-file-help-block"> |
| 122 | {{ $t('pageFirmware.form.onlyTarFilesAccepted') }} |
| 123 | </b-form-text> |
| 124 | <form-file |
| 125 | id="image-file" |
| 126 | accept=".tar" |
| 127 | :disabled="isPageDisabled" |
| 128 | :state="getValidationState($v.file)" |
| 129 | aria-describedby="image-file-help-block" |
| 130 | @input="onFileUpload($event)" |
| 131 | > |
| 132 | <template #invalid> |
| 133 | <b-form-invalid-feedback role="alert"> |
| 134 | {{ $t('global.form.required') }} |
| 135 | </b-form-invalid-feedback> |
| 136 | </template> |
| 137 | </form-file> |
| 138 | </b-form-group> |
| 139 | </template> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 140 | |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 141 | <!-- TFTP Server Upload --> |
| 142 | <template v-else> |
| 143 | <b-form-group |
| 144 | :label="$t('pageFirmware.singleFileUpload.fileAddress')" |
| 145 | label-for="tftp-address" |
| 146 | > |
| 147 | <b-form-input |
| 148 | id="tftp-address" |
| 149 | v-model="tftpFileAddress" |
| 150 | type="text" |
| 151 | :state="getValidationState($v.tftpFileAddress)" |
| 152 | :disabled="isPageDisabled" |
| 153 | @input="$v.tftpFileAddress.$touch()" |
| 154 | /> |
| 155 | <b-form-invalid-feedback role="alert"> |
| 156 | {{ $t('global.form.fieldRequired') }} |
| 157 | </b-form-invalid-feedback> |
| 158 | </b-form-group> |
| 159 | </template> |
| 160 | <b-btn |
| 161 | data-test-id="firmware-button-startUpdate" |
| 162 | type="submit" |
| 163 | variant="primary" |
| 164 | :disabled="isPageDisabled" |
| 165 | > |
| 166 | {{ $t('pageFirmware.singleFileUpload.startUpdate') }} |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 167 | </b-btn> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 168 | <alert |
| 169 | v-if="!isHostOff" |
| 170 | variant="warning" |
| 171 | :small="true" |
| 172 | class="mt-4" |
| 173 | > |
| 174 | <p class="col-form-label"> |
| 175 | {{ |
| 176 | $t( |
| 177 | 'pageFirmware.singleFileUpload.alert.serverMustBePoweredOffToUpdateFirmware' |
| 178 | ) |
| 179 | }} |
| 180 | </p> |
| 181 | </alert> |
| 182 | </b-form> |
| 183 | </div> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 184 | </page-section> |
| 185 | </b-col> |
| 186 | </b-row> |
| 187 | |
| 188 | <!-- Modals --> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 189 | <modal-update-firmware |
| 190 | :running="systemFirmwareVersion" |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 191 | :backup="backupFirmwareVersion" |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 192 | @ok="updateFirmware" |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 193 | /> |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 194 | <modal-switch-to-running |
| 195 | :backup="backupFirmwareVersion" |
| 196 | @ok="switchToRunning" |
| 197 | /> |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 198 | </b-container> |
| 199 | </template> |
| 200 | |
| 201 | <script> |
| 202 | import { requiredIf } from 'vuelidate/lib/validators'; |
| 203 | import { mapGetters } from 'vuex'; |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 204 | import IconSwitch from '@carbon/icons-vue/es/arrows--horizontal/20'; |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 205 | |
| 206 | import PageSection from '@/components/Global/PageSection'; |
| 207 | import PageTitle from '@/components/Global/PageTitle'; |
| 208 | import Alert from '@/components/Global/Alert'; |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 209 | import FormFile from '@/components/Global/FormFile'; |
| 210 | import StatusIcon from '@/components/Global/StatusIcon'; |
| 211 | import ModalUpdateFirmware from './FirmwareSingleImageModalUpdateFirmware'; |
| 212 | import ModalSwitchToRunning from './FirmwareSingleImageModalSwitchToRunning'; |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 213 | |
| 214 | import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js'; |
Yoshie Muranaka | d73f496 | 2020-12-09 08:52:23 -0800 | [diff] [blame] | 215 | import LoadingBarMixin, { loading } from '@/components/Mixins/LoadingBarMixin'; |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 216 | import BVToastMixin from '@/components/Mixins/BVToastMixin'; |
| 217 | |
| 218 | export default { |
| 219 | name: 'FirmwareSingleImage', |
| 220 | components: { |
| 221 | Alert, |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 222 | FormFile, |
| 223 | IconSwitch, |
| 224 | ModalSwitchToRunning, |
| 225 | ModalUpdateFirmware, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 226 | PageSection, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 227 | PageTitle, |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 228 | StatusIcon, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 229 | }, |
| 230 | mixins: [BVToastMixin, LoadingBarMixin, VuelidateMixin], |
Derick Montague | efbd401 | 2020-11-03 14:10:45 -0600 | [diff] [blame] | 231 | beforeRouteLeave(to, from, next) { |
| 232 | this.hideLoader(); |
Derick Montague | efbd401 | 2020-11-03 14:10:45 -0600 | [diff] [blame] | 233 | next(); |
| 234 | }, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 235 | data() { |
| 236 | return { |
| 237 | isWorkstationSelected: true, |
| 238 | file: null, |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 239 | tftpFileAddress: null, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 240 | timeoutId: null, |
Yoshie Muranaka | d73f496 | 2020-12-09 08:52:23 -0800 | [diff] [blame] | 241 | loading, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 242 | }; |
| 243 | }, |
| 244 | computed: { |
| 245 | hostStatus() { |
| 246 | return this.$store.getters['global/hostStatus']; |
| 247 | }, |
| 248 | isHostOff() { |
| 249 | return this.hostStatus === 'off' ? true : false; |
| 250 | }, |
| 251 | isOperationInProgress() { |
| 252 | return this.$store.getters['controls/isOperationInProgress']; |
| 253 | }, |
| 254 | ...mapGetters('firmwareSingleImage', [ |
| 255 | 'backupFirmwareStatus', |
| 256 | 'backupFirmwareVersion', |
| 257 | 'isRebootFromBackupAvailable', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 258 | 'systemFirmwareVersion', |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 259 | ]), |
| 260 | isPageDisabled() { |
| 261 | return !this.isHostOff || this.loading || this.isOperationInProgress; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 262 | }, |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 263 | showBackupImageStatus() { |
| 264 | return ( |
| 265 | this.backupFirmwareStatus === 'Critical' || |
| 266 | this.backupFirmwareStatus === 'Warning' |
| 267 | ); |
| 268 | }, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 269 | }, |
| 270 | watch: { |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 271 | isWorkstationSelected: function () { |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 272 | this.$v.$reset(); |
| 273 | this.file = null; |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 274 | this.tftpFileAddress = null; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 275 | }, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 276 | }, |
| 277 | created() { |
| 278 | this.startLoader(); |
| 279 | this.$store.dispatch('firmwareSingleImage/getUpdateServiceApplyTime'); |
| 280 | Promise.all([ |
| 281 | this.$store.dispatch('global/getHostStatus'), |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 282 | this.$store.dispatch('firmwareSingleImage/getFirmwareInformation'), |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 283 | ]).finally(() => this.endLoader()); |
| 284 | }, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 285 | validations() { |
| 286 | return { |
| 287 | file: { |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 288 | required: requiredIf(function () { |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 289 | return this.isWorkstationSelected; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 290 | }), |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 291 | }, |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 292 | tftpFileAddress: { |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 293 | required: requiredIf(function () { |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 294 | return !this.isWorkstationSelected; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 295 | }), |
| 296 | }, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 297 | }; |
| 298 | }, |
| 299 | methods: { |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 300 | updateFirmware() { |
Yoshie Muranaka | f92e296 | 2021-02-09 12:41:53 -0800 | [diff] [blame^] | 301 | this.setRebootTimeout(360000, () => { |
| 302 | this.infoToast( |
| 303 | this.$t('pageFirmware.singleFileUpload.toast.verifyUpdateMessage'), |
| 304 | { |
| 305 | title: this.$t('pageFirmware.singleFileUpload.toast.verifyUpdate'), |
| 306 | refreshAction: true, |
| 307 | } |
| 308 | ); |
| 309 | }); |
| 310 | this.infoToast( |
| 311 | this.$t('pageFirmware.singleFileUpload.toast.updateStartedMessage'), |
| 312 | { |
| 313 | title: this.$t('pageFirmware.singleFileUpload.toast.updateStarted'), |
| 314 | timestamp: true, |
| 315 | } |
| 316 | ); |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 317 | if (this.isWorkstationSelected) { |
| 318 | this.dispatchWorkstationUpload(); |
| 319 | } else { |
| 320 | this.dispatchTftpUpload(); |
| 321 | } |
| 322 | }, |
| 323 | dispatchWorkstationUpload() { |
| 324 | this.$store |
| 325 | .dispatch('firmwareSingleImage/uploadFirmware', this.file) |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 326 | .catch(({ message }) => { |
| 327 | this.errorToast(message); |
| 328 | this.clearRebootTimeout(); |
| 329 | }); |
| 330 | }, |
| 331 | dispatchTftpUpload() { |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 332 | this.$store |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 333 | .dispatch( |
| 334 | 'firmwareSingleImage/uploadFirmwareTFTP', |
| 335 | this.tftpFileAddress |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 336 | ) |
| 337 | .catch(({ message }) => { |
| 338 | this.errorToast(message); |
| 339 | this.clearRebootTimeout(); |
| 340 | }); |
| 341 | }, |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 342 | switchToRunning() { |
Yoshie Muranaka | f92e296 | 2021-02-09 12:41:53 -0800 | [diff] [blame^] | 343 | this.setRebootTimeout(60000, () => { |
| 344 | this.infoToast( |
| 345 | this.$t('pageFirmware.singleFileUpload.toast.verifySwitchMessage'), |
| 346 | { |
| 347 | title: this.$t('pageFirmware.singleFileUpload.toast.verifySwitch'), |
| 348 | refreshAction: true, |
| 349 | } |
| 350 | ); |
| 351 | }); |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 352 | this.$store |
| 353 | .dispatch('firmwareSingleImage/switchFirmwareAndReboot') |
Yoshie Muranaka | f92e296 | 2021-02-09 12:41:53 -0800 | [diff] [blame^] | 354 | .then(() => |
| 355 | this.infoToast( |
| 356 | this.$t('pageFirmware.singleFileUpload.toast.rebootStartedMessage'), |
| 357 | { |
| 358 | title: this.$t( |
| 359 | 'pageFirmware.singleFileUpload.toast.rebootStarted' |
| 360 | ), |
| 361 | } |
| 362 | ) |
| 363 | ) |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 364 | .catch(({ message }) => { |
| 365 | this.errorToast(message); |
| 366 | this.clearRebootTimeout(); |
| 367 | }); |
| 368 | }, |
Yoshie Muranaka | f92e296 | 2021-02-09 12:41:53 -0800 | [diff] [blame^] | 369 | setRebootTimeout(timeoutMs = 60000, callback) { |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 370 | // Set a timeout to disable page interactions |
| 371 | // during a BMC reboot |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 372 | this.startLoader(); |
| 373 | this.timeoutId = setTimeout(() => { |
| 374 | this.endLoader(); |
Yoshie Muranaka | f92e296 | 2021-02-09 12:41:53 -0800 | [diff] [blame^] | 375 | if (callback) callback(); |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 376 | }, timeoutMs); |
| 377 | }, |
| 378 | clearRebootTimeout() { |
| 379 | if (this.timeoutId) { |
| 380 | clearTimeout(this.timeoutId); |
| 381 | this.endLoader(); |
| 382 | } |
| 383 | }, |
| 384 | onSubmitUpload() { |
| 385 | this.$v.$touch(); |
| 386 | if (this.$v.$invalid) return; |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 387 | this.$bvModal.show('modal-update-firmware'); |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 388 | }, |
Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 389 | onFileUpload(file) { |
| 390 | this.file = file; |
| 391 | this.$v.file.$touch(); |
| 392 | }, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 393 | }, |
Yoshie Muranaka | 0b980db | 2020-10-06 09:24:14 -0700 | [diff] [blame] | 394 | }; |
| 395 | </script> |