From 7f2f1e63826c0acb4514edfb1fbf7a884893f8c4 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Sun, 14 Nov 2021 03:36:10 +0100 Subject: Add command line --- package-lock.json | 34 ++++++++++ package.json | 1 + src/components/HelloWorld.vue | 60 ----------------- src/components/Searcher.vue | 143 ++++++++++++++++++++++++++++++++++++++++ src/components/Sugestion.vue | 27 ++++++++ src/main.js | 2 + src/router/index.js | 6 +- src/services/AuthService.js | 2 +- src/services/CommandsService.js | 24 +++++++ src/views/Home.vue | 28 +++++++- tasks.todo | 2 +- 11 files changed, 262 insertions(+), 67 deletions(-) delete mode 100644 src/components/HelloWorld.vue create mode 100644 src/components/Searcher.vue create mode 100644 src/components/Sugestion.vue create mode 100644 src/services/CommandsService.js diff --git a/package-lock.json b/package-lock.json index e43eb2f..66d32bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "axios": "^0.24.0", "core-js": "^3.6.5", + "v-hotkey": "^0.9.0", "vue": "^2.6.11", "vue-notification": "^1.3.20", "vue-router": "^3.2.0", @@ -13787,6 +13788,24 @@ "uuid": "bin/uuid" } }, + "node_modules/v-hotkey": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/v-hotkey/-/v-hotkey-0.9.0.tgz", + "integrity": "sha512-PVbU9cw5oyoOr6y5q0nN9xmndzpCsLDhXRgVP80WRMvM1Eqkai3ViuJs/D+qFhRht6u5LyM10eBEZ5hq+3qLTg==", + "dependencies": { + "core-js": "^2.6.5" + }, + "peerDependencies": { + "vue": "^2.x" + } + }, + "node_modules/v-hotkey/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true + }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -26293,6 +26312,21 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, + "v-hotkey": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/v-hotkey/-/v-hotkey-0.9.0.tgz", + "integrity": "sha512-PVbU9cw5oyoOr6y5q0nN9xmndzpCsLDhXRgVP80WRMvM1Eqkai3ViuJs/D+qFhRht6u5LyM10eBEZ5hq+3qLTg==", + "requires": { + "core-js": "^2.6.5" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + } + } + }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", diff --git a/package.json b/package.json index 670f685..d1d42e8 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "axios": "^0.24.0", "core-js": "^3.6.5", + "v-hotkey": "^0.9.0", "vue": "^2.6.11", "vue-notification": "^1.3.20", "vue-router": "^3.2.0", diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 1c544cb..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - diff --git a/src/components/Searcher.vue b/src/components/Searcher.vue new file mode 100644 index 0000000..4a252a0 --- /dev/null +++ b/src/components/Searcher.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/src/components/Sugestion.vue b/src/components/Sugestion.vue new file mode 100644 index 0000000..cfbcd93 --- /dev/null +++ b/src/components/Sugestion.vue @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index 95d9800..fd31090 100644 --- a/src/main.js +++ b/src/main.js @@ -4,12 +4,14 @@ import router from './router' import store from './store' import Axios from 'axios' import Notifications from 'vue-notification' +import VueHotkey from 'v-hotkey' Vue.config.productionTip = false Axios.defaults.headers.common['Authorization'] = store.state.token !== "" && `Token ${store.state.token}`; Vue.use(Notifications) +Vue.use(VueHotkey) new Vue({ router, diff --git a/src/router/index.js b/src/router/index.js index c67b61d..25b8f3a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,8 +1,8 @@ import Vue from 'vue' import VueRouter from 'vue-router' -import Home from '../views/Home.vue' -import Register from '../views/Register.vue' -import Login from '../views/Login.vue' +import Home from '@/views/Home.vue' +import Register from '@/views/Register.vue' +import Login from '@/views/Login.vue' Vue.use(VueRouter) diff --git a/src/services/AuthService.js b/src/services/AuthService.js index 402d196..ff1e468 100644 --- a/src/services/AuthService.js +++ b/src/services/AuthService.js @@ -9,7 +9,7 @@ const error_notify = (error) => { Vue.notify({ type: 'error', title: value, - text: key + text: (key !== 'non_field_errors') ? key : '' }) }) } diff --git a/src/services/CommandsService.js b/src/services/CommandsService.js new file mode 100644 index 0000000..1248c6d --- /dev/null +++ b/src/services/CommandsService.js @@ -0,0 +1,24 @@ +export default { + logout() { + console.log("logout :)") + }, + last_message() { + console.log("last massege") + }, + chat() { + return { + search() {console.log("search")}, + add() {console.log("add friend")}, + next_tab() { + return { + hi_in_next_tab() { + console.log('Hello there! :)') + } + } + } + } + }, + notifications() {}, + users() {}, + groups() {} +} 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 @@