From 8b9252514e7006c983d9d3da728ef717916ebabb Mon Sep 17 00:00:00 2001 From: Johannes Baum <4518664+Annoraaq@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:22:46 +0000 Subject: [PATCH 1/3] Remove duplicate import --- timesketch/frontend-v3/src/main.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/timesketch/frontend-v3/src/main.js b/timesketch/frontend-v3/src/main.js index 75e15c65b7..dddd4b051f 100644 --- a/timesketch/frontend-v3/src/main.js +++ b/timesketch/frontend-v3/src/main.js @@ -11,8 +11,6 @@ import { registerPlugins } from "@/plugins"; import App from "./App.vue"; import {initialLetter, shortDateTime, timeSince} from "./filters.js"; -import {initialLetter, shortDateTime, timeSince} from "./filters.js"; - // Composables import { createApp } from "vue"; From ed305aedde241d8e4c12685415c28da0fa68a9a2 Mon Sep 17 00:00:00 2001 From: Johannes Baum <4518664+Annoraaq@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:03:47 +0000 Subject: [PATCH 2/3] Add v3 ui to tsdev.sh --- utils/tsdev.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/tsdev.sh b/utils/tsdev.sh index c9871cb725..b5e1df1379 100755 --- a/utils/tsdev.sh +++ b/utils/tsdev.sh @@ -83,6 +83,12 @@ case "$1" in web) $s docker exec --interactive --tty $CONTAINER_ID gunicorn --reload --bind 0.0.0.0:5000 --log-level debug --capture-output --timeout 600 timesketch.wsgi:application ;; + v3-dev) + $s docker exec --interactive --tty $CONTAINER_ID yarn run --cwd=/usr/local/src/timesketch/timesketch/frontend-v3 dev + ;; + v3-install-deps) + $s docker exec --interactive --tty $CONTAINER_ID yarn install --cwd=/usr/local/src/timesketch/timesketch/frontend-v3 + ;; *) echo \""$1"\" is not a valid command.; help esac From 1c4dc59cb7840d5eb63f91bf27d8ca3ee1749584 Mon Sep 17 00:00:00 2001 From: Johannes Baum <4518664+Annoraaq@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:50:07 +0000 Subject: [PATCH 3/3] Add event bus --- timesketch/frontend-v3/package.json | 3 +- timesketch/frontend-v3/src/event-bus.js | 23 ++++++++ timesketch/frontend-v3/src/views/Sketch.vue | 5 +- timesketch/frontend-v3/yarn.lock | 62 +++++++++++++++++++++ 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 timesketch/frontend-v3/src/event-bus.js diff --git a/timesketch/frontend-v3/package.json b/timesketch/frontend-v3/package.json index 078620c10b..930256b878 100644 --- a/timesketch/frontend-v3/package.json +++ b/timesketch/frontend-v3/package.json @@ -14,7 +14,8 @@ "roboto-fontface": "*", "vue": "^3.4.31", "vuetify": "^3.6.11", - "axios": "^1.7.7" + "axios": "^1.7.7", + "tiny-emitter": "^2.1.0" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.5", diff --git a/timesketch/frontend-v3/src/event-bus.js b/timesketch/frontend-v3/src/event-bus.js new file mode 100644 index 0000000000..66ca6c8ba8 --- /dev/null +++ b/timesketch/frontend-v3/src/event-bus.js @@ -0,0 +1,23 @@ +/* +Copyright 2024 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +import emitter from 'tiny-emitter/instance' + +export default { + $on: (...args) => emitter.on(...args), + $once: (...args) => emitter.once(...args), + $off: (...args) => emitter.off(...args), + $emit: (...args) => emitter.emit(...args) +} diff --git a/timesketch/frontend-v3/src/views/Sketch.vue b/timesketch/frontend-v3/src/views/Sketch.vue index ac80c4c6af..7d0d60cc2b 100644 --- a/timesketch/frontend-v3/src/views/Sketch.vue +++ b/timesketch/frontend-v3/src/views/Sketch.vue @@ -20,6 +20,7 @@ limitations under the License.