Skip to content
App.vue 1.65 KiB
Newer Older
<template>
Sonia Zorba's avatar
Sonia Zorba committed
<div id="app" v-if="model">
  <TopMenu v-bind:user="model.user" />
  <div class="container">
Sonia Zorba's avatar
Sonia Zorba committed
  </div>
  <div id="loading" v-if="loading">
    <div id="spinner-wrapper">
      <b-spinner variant="primary" style="width: 3rem; height: 3rem;" label="Loading"></b-spinner>
  </div>
Sonia Zorba's avatar
Sonia Zorba committed
</div>
</template>

<script>
import TopMenu from './components/TopMenu.vue';

export default {
  name: 'app',
  components: {
    model: state => state.model,
    input: state => state.input,
Sonia Zorba's avatar
Sonia Zorba committed
    loading: state => state.loading,
    page: state => state.page
  mounted: function() {
Sonia Zorba's avatar
Sonia Zorba committed
    document.addEventListener('apiError', function(event) {
Sonia Zorba's avatar
Sonia Zorba committed
      self.$bvToast.toast(event.message.body, {
        title: event.message.title,
Sonia Zorba's avatar
Sonia Zorba committed
    document.addEventListener('loading', function(event) {
      self.$store.commit('setLoading', event.value);
    });

    // retrieve the initial model

    setInterval(client.keepAlive, 60000);
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
Sonia Zorba's avatar
Sonia Zorba committed
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 1000;
}

#spinner-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
}
</style>