From 7bec1623537672d09e2a6861ec5345b49e3dde34 Mon Sep 17 00:00:00 2001
From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
Date: Wed, 20 Dec 2023 18:37:35 -0600
Subject: [PATCH] Scrubber UI component (#9036)
* add scrubber and ui playground when running dev
* fix mobile dropdown menu width
* timeline scrubber and revamp for all event handlers
---
web/package-lock.json | 144 ++++
web/package.json | 1 +
web/src/App.tsx | 7 +-
web/src/components/Header.tsx | 2 +-
web/src/components/Sidebar.tsx | 48 +-
.../playground/TimelineScrubber.tsx | 46 ++
.../components/scrubber/ActivityScrubber.tsx | 180 +++++
web/src/components/scrubber/scrubber.css | 670 ++++++++++++++++++
web/src/env.ts | 1 +
web/src/pages/UIPlayground.tsx | 138 ++++
10 files changed, 1221 insertions(+), 16 deletions(-)
create mode 100644 web/src/components/playground/TimelineScrubber.tsx
create mode 100644 web/src/components/scrubber/ActivityScrubber.tsx
create mode 100644 web/src/components/scrubber/scrubber.css
create mode 100644 web/src/env.ts
create mode 100644 web/src/pages/UIPlayground.tsx
diff --git a/web/package-lock.json b/web/package-lock.json
index d33cf0e54..7df832b3a 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -48,6 +48,7 @@
"tailwindcss-animate": "^1.0.7",
"video.js": "^8.6.1",
"videojs-playlist": "^5.1.0",
+ "vis-timeline": "^7.7.3",
"vite-plugin-monaco-editor": "^1.1.0",
"zod": "^3.22.4"
},
@@ -215,6 +216,18 @@
"resolved": "https://registry.npmjs.org/@cycjimmy/jsmpeg-player/-/jsmpeg-player-6.0.5.tgz",
"integrity": "sha512-bVNHQ7VN9ecKT5AI/6RC7zpW/y4ca68a9txeR5Wiin+jKpUn/7buMe+5NPub89A8NNeNnKPQfrD2+c76ch36mA=="
},
+ "node_modules/@egjs/hammerjs": {
+ "version": "2.0.17",
+ "resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz",
+ "integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==",
+ "peer": true,
+ "dependencies": {
+ "@types/hammerjs": "^2.0.36"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
"node_modules/@esbuild/android-arm": {
"version": "0.19.8",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.8.tgz",
@@ -2253,6 +2266,12 @@
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==",
"dev": true
},
+ "node_modules/@types/hammerjs": {
+ "version": "2.0.45",
+ "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.45.tgz",
+ "integrity": "sha512-qkcUlZmX6c4J8q45taBKTL3p+LbITgyx7qhlPYOdOHZB7B31K0mXbP5YA7i7SgDeEGuI9MnumiKPEMrxg8j3KQ==",
+ "peer": true
+ },
"node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",
@@ -3439,6 +3458,15 @@
"node": ">= 6"
}
},
+ "node_modules/component-emitter": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz",
+ "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==",
+ "peer": true,
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -3498,6 +3526,12 @@
"node": ">=4"
}
},
+ "node_modules/cssfilter": {
+ "version": "0.0.10",
+ "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz",
+ "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==",
+ "peer": true
+ },
"node_modules/cssstyle": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz",
@@ -5184,6 +5218,12 @@
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w=="
},
+ "node_modules/keycharm": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/keycharm/-/keycharm-0.4.0.tgz",
+ "integrity": "sha512-TyQTtsabOVv3MeOpR92sIKk/br9wxS+zGj4BG7CR8YbK4jM3tyIBaF0zhzeBUMx36/Q/iQLOKKOT+3jOQtemRQ==",
+ "peer": true
+ },
"node_modules/keycode": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.0.tgz",
@@ -5500,6 +5540,15 @@
"node": ">= 8"
}
},
+ "node_modules/moment": {
+ "version": "2.29.4",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
+ "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
+ "peer": true,
+ "engines": {
+ "node": "*"
+ }
+ },
"node_modules/monaco-editor": {
"version": "0.44.0",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.44.0.tgz",
@@ -6291,6 +6340,15 @@
"node": ">= 0.6.0"
}
},
+ "node_modules/propagating-hammerjs": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/propagating-hammerjs/-/propagating-hammerjs-2.0.1.tgz",
+ "integrity": "sha512-PH3zG5whbSxMocphXJzVtvKr+vWAgfkqVvtuwjSJ/apmEACUoiw6auBAT5HYXpZOR0eGcTAfYG5Yl8h91O5Elg==",
+ "peer": true,
+ "peerDependencies": {
+ "@egjs/hammerjs": "^2.0.17"
+ }
+ },
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
@@ -7673,6 +7731,19 @@
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
+ "node_modules/uuid": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
+ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "peer": true,
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
"node_modules/v8-to-istanbul": {
"version": "9.2.0",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz",
@@ -7748,6 +7819,57 @@
"global": "^4.3.1"
}
},
+ "node_modules/vis-data": {
+ "version": "7.1.9",
+ "resolved": "https://registry.npmjs.org/vis-data/-/vis-data-7.1.9.tgz",
+ "integrity": "sha512-COQsxlVrmcRIbZMMTYwD+C2bxYCFDNQ2EHESklPiInbD/Pk3JZ6qNL84Bp9wWjYjAzXfSlsNaFtRk+hO9yBPWA==",
+ "peer": true,
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/visjs"
+ },
+ "peerDependencies": {
+ "uuid": "^3.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
+ "vis-util": "^5.0.1"
+ }
+ },
+ "node_modules/vis-timeline": {
+ "version": "7.7.3",
+ "resolved": "https://registry.npmjs.org/vis-timeline/-/vis-timeline-7.7.3.tgz",
+ "integrity": "sha512-hGMzTttdOFWaw1PPlJuCXU2/4UjnsIxT684Thg9fV6YU1JuKZJs3s3BrJgZ4hO3gu5i1hsMe1YIi96o+eNT0jg==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/visjs"
+ },
+ "peerDependencies": {
+ "@egjs/hammerjs": "^2.0.0",
+ "component-emitter": "^1.3.0",
+ "keycharm": "^0.2.0 || ^0.3.0 || ^0.4.0",
+ "moment": "^2.24.0",
+ "propagating-hammerjs": "^1.4.0 || ^2.0.0",
+ "uuid": "^3.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
+ "vis-data": "^6.3.0 || ^7.0.0",
+ "vis-util": "^5.0.1",
+ "xss": "^1.0.0"
+ }
+ },
+ "node_modules/vis-util": {
+ "version": "5.0.7",
+ "resolved": "https://registry.npmjs.org/vis-util/-/vis-util-5.0.7.tgz",
+ "integrity": "sha512-E3L03G3+trvc/X4LXvBfih3YIHcKS2WrP0XTdZefr6W6Qi/2nNCqZfe4JFfJU6DcQLm6Gxqj2Pfl+02859oL5A==",
+ "peer": true,
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/visjs"
+ },
+ "peerDependencies": {
+ "@egjs/hammerjs": "^2.0.0",
+ "component-emitter": "^1.3.0 || ^2.0.0"
+ }
+ },
"node_modules/vite": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.5.tgz",
@@ -8093,6 +8215,28 @@
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
"dev": true
},
+ "node_modules/xss": {
+ "version": "1.0.14",
+ "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz",
+ "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==",
+ "peer": true,
+ "dependencies": {
+ "commander": "^2.20.3",
+ "cssfilter": "0.0.10"
+ },
+ "bin": {
+ "xss": "bin/xss"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
+ "node_modules/xss/node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "peer": true
+ },
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
diff --git a/web/package.json b/web/package.json
index 753bf7776..b1512b431 100644
--- a/web/package.json
+++ b/web/package.json
@@ -53,6 +53,7 @@
"tailwindcss-animate": "^1.0.7",
"video.js": "^8.6.1",
"videojs-playlist": "^5.1.0",
+ "vis-timeline": "^7.7.3",
"vite-plugin-monaco-editor": "^1.1.0",
"zod": "^3.22.4"
},
diff --git a/web/src/App.tsx b/web/src/App.tsx
index 294b4cd75..46fcc5b64 100644
--- a/web/src/App.tsx
+++ b/web/src/App.tsx
@@ -14,6 +14,7 @@ import ConfigEditor from "@/pages/ConfigEditor";
import Logs from "@/pages/Logs";
import NoMatch from "@/pages/NoMatch";
import Settings from "@/pages/Settings";
+import UIPlayground from "./pages/UIPlayground";
function App() {
const [sheetOpen, setSheetOpen] = useState(false);
@@ -29,7 +30,10 @@ function App() {
+ Shows the 10 most recent events within the last 4 hours +
+ + {!config &&+ Colors as set by the current theme. See the{" "} + + shadcn theming docs + {" "} + for usage. +
+ +