Fix kvm session and add event bus

Bug description:
    Before this commit KVM window wasn't being closed
    after logging out

Test: Step1. Launch webui on browser and see KVM page on /#/operations/kvm.
    Step2. Open additional window using 'Open in new tab'.
    Step3. Navigate to another page. For example, /#/operations/key-clear.
    Step4. Logout. Window is still open.

Change-Id: Ife79ebca41eb4d588c0b8f4fae06135420eda155
Signed-off-by: Konstantin Maskov <sulwirld@gmail.com>
diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue
index a198495..859a47f 100644
--- a/src/components/AppHeader/AppHeader.vue
+++ b/src/components/AppHeader/AppHeader.vue
@@ -115,6 +115,7 @@
 import IconRenew from '@carbon/icons-vue/es/renew/20';
 import StatusIcon from '@/components/Global/StatusIcon';
 import LoadingBar from '@/components/Global/LoadingBar';
+import { mapState } from 'vuex';
 
 export default {
   name: 'AppHeader',
@@ -140,6 +141,7 @@
     };
   },
   computed: {
+    ...mapState('authentication', ['consoleWindow']),
     isNavTagPresent() {
       return this.assetTag || this.modelType || this.serialNumber;
     },
@@ -194,6 +196,9 @@
     },
   },
   watch: {
+    consoleWindow() {
+      if (this.consoleWindow === false) this.$eventBus.$consoleWindow.close();
+    },
     isAuthorized(value) {
       if (value === false) {
         this.errorToast(this.$t('global.toast.unAuthDescription'), {