<template>
  <v-container>
    <v-row justify-center>
      <v-col cols="12">
        <div class="text-center">
          <v-icon color="red" size="100">fa-dragon</v-icon>
          <div class="headline mt-8">
            {{ msg }}
          </div>
        </div>
      </v-col>
    </v-row>
  </v-container>
</template>

<script>
export default {
  data() {
    return {
      msg: "-"
    };
  },
  created() {
    // debugger;
    var badPath = this.$router.history.current.path;
    //If this happens too early then it might not have all the setup stuf available which would trigger an infinite loop
    if (
      !window ||
      !window.$gz ||
      !window.$gz.eventBus ||
      !window.$gz.locale ||
      !window.$gz.store
    ) {
      this.msg = '404 - NOT FOUND: "' + badPath + '"';
    } else {
      var notFoundLocalized = window.$gz.locale.get("ErrorAPI2010");
      //format the message
      this.msg = "404 - " + notFoundLocalized + ': "' + badPath + '"';
      //log it in case we need to see it in tech support
      window.$gz.store.commit("logItem", this.msg);
      //set the title of the window
      window.$gz.eventBus.$emit("menu-change", {
        isMain: true,
        icon: "fa-dragon",
        title: "404 - " + notFoundLocalized
      });
    }
  }
};
</script>
