From 7f2f1e63826c0acb4514edfb1fbf7a884893f8c4 Mon Sep 17 00:00:00 2001
From: jdlugosz963 <jdlugosz963@gmail.com>
Date: Sun, 14 Nov 2021 03:36:10 +0100
Subject: Add command line

---
 src/views/Home.vue | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

(limited to 'src/views/Home.vue')

diff --git a/src/views/Home.vue b/src/views/Home.vue
index 5a2a903..2954857 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -1,25 +1,49 @@
 <template>
-  <div class="home">
+  <div class="home" v-hotkey="keymap">
     Hi {{get_username}}!
     <input type="button" value="Logout!" @click="logout">
+    <Searcher v-if="show" @close="hide" />
   </div>
 </template>
 
 <script>
+import Searcher from '@/components/Searcher.vue'
+
 export default {
+  data() {
+    return {
+      show: false,
+    }
+  },
+
   methods: {
     logout() {
       this.$store.dispatch('logout')
       this.$router.push('/login')
-    }
+    },
+    
+    toogleShow() { this.show = !this.show },
+    hide() { this.show = false }
   },
 
   computed: {
     get_username() {
       return this.$store.getters['get_user'].username
+    },
+
+    keymap() {
+      return { 
+        'ctrl+esc': this.toogleShow,
+        'ctrl+shift+p': this.toogleShow,
+        'esc': this.hide
+      }
     }
   },
 
+  components: {
+    Searcher
+  },
+
   created() {
     if(!this.$store.getters['is_logged_in']) {
       this.$router.push('/login')
-- 
cgit v1.2.3

