blob: 2860e5997ca8ed0fb5c11504d5fd15d05de1831c [file] [log] [blame]
<template>
<b-container fluid="xl">
<page-title />
<!-- System table -->
<table-system />
<!-- Power supplies table -->
<table-power-supplies />
</b-container>
</template>
<script>
import PageTitle from '@/components/Global/PageTitle';
import TableSystem from './HardwareStatusTableStystem';
import TablePowerSupplies from './HardwareStatusTablePowerSupplies';
import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
export default {
components: { PageTitle, TablePowerSupplies, TableSystem },
mixins: [LoadingBarMixin],
created() {
this.startLoader();
const systemTablePromise = new Promise(resolve => {
this.$root.$on('hardwareStatus::system::complete', () => resolve());
});
const powerSuppliesTablePromise = new Promise(resolve => {
this.$root.$on('hardwareStatus::powerSupplies::complete', () =>
resolve()
);
});
// Combine all child component Promises to indicate
// when page data load complete
Promise.all([systemTablePromise, powerSuppliesTablePromise]).finally(() =>
this.endLoader()
);
},
beforeRouteLeave(to, from, next) {
// Hide loader if user navigates away from page
// before requests complete
this.hideLoader();
next();
}
};
</script>