diff --git a/package-lock.json b/package-lock.json index 756709b..6ef4b61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11665,6 +11665,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 425b952..3b628df 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "bootstrap": "^4.5.2", "bootstrap-vue": "^2.16.0", "core-js": "^3.6.5", + "v-hotkey": "^0.9.0", "vue": "^2.6.11", "vue-router": "^3.2.0", "vuex": "^3.4.0" diff --git a/src/components/SingleDeviceBuzgerator.vue b/src/components/SingleDeviceBuzgerator.vue index 43e74dd..6d3ec9a 100644 --- a/src/components/SingleDeviceBuzgerator.vue +++ b/src/components/SingleDeviceBuzgerator.vue @@ -3,6 +3,7 @@ Could not read device data! @@ -31,6 +32,13 @@ export default { computed: { cardTitle() { return `Device: ${this.device_id}` + }, + keymap() { + return { + "up": this.bringOnline, + "down": this.bringOffline, + "right": this.doManualAlert + } } }, methods: { diff --git a/src/main.js b/src/main.js index 2235c48..d8b40a9 100644 --- a/src/main.js +++ b/src/main.js @@ -7,9 +7,12 @@ import axios from 'axios' import { BootstrapVue, IconsPlugin } from 'bootstrap-vue' +import VueHotkey from 'v-hotkey' + import 'bootstrap/dist/css/bootstrap.css' import 'bootstrap-vue/dist/bootstrap-vue.css' +Vue.use(VueHotkey) Vue.use(BootstrapVue) Vue.use(IconsPlugin)