From db9db523bc426961efdbdc6c9297763b5c740e2f Mon Sep 17 00:00:00 2001 From: GitButler Date: Thu, 11 Apr 2024 13:05:35 +0200 Subject: [PATCH 1/2] GitButler Integration Commit This is an integration commit for the virtual branches that GitButler is tracking. Due to GitButler managing multiple virtual branches, you cannot switch back and forth between git branches and virtual branches easily. If you switch to another branch, GitButler will need to be reinitialized. If you commit on this branch, GitButler will throw it away. Here are the branches that are currently applied: - notifications-feature (refs/gitbutler/notifications-feature) branch head: 6f8601c6f5f3720991d4c0a3691b8777e2d72ecb - src/views/MqttViewer.vue - src/models/TreeNode.js - src/main.js Your previous branch was: refs/heads/master The sha for that commit was: d41693b547994f8f634021818adf025cabc3e33e For more information about what we're doing here, check out our docs: https://docs.gitbutler.com/features/virtual-branches/integration-branch --- src/main.js | 3 + src/models/TreeNode.js | 7 ++ src/views/MqttViewer.vue | 144 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 152 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index ef4acde..7f5fba4 100644 --- a/src/main.js +++ b/src/main.js @@ -114,6 +114,9 @@ Vue.mixin({ document.head.appendChild(scrollTheme); }, + sendNotification(title, body, onClick = () => {}) { + new window.Notification(title, { body }).onclick = onClick; + }, }, }); diff --git a/src/models/TreeNode.js b/src/models/TreeNode.js index 1dcd248..ace558b 100644 --- a/src/models/TreeNode.js +++ b/src/models/TreeNode.js @@ -68,6 +68,13 @@ class TreeNode { ); } + deepSearch(searchTerm, mode) { + return [ + this.search(searchTerm, mode) ? this : undefined, + ...(this.child?.deepSearch(searchTerm, mode) ?? []), + ]; + } + #idFun = () => {}; #blink = () => { diff --git a/src/views/MqttViewer.vue b/src/views/MqttViewer.vue index 84b42b1..42e3da7 100644 --- a/src/views/MqttViewer.vue +++ b/src/views/MqttViewer.vue @@ -116,7 +116,22 @@ -
+
+ + + Enable notifications + +
+