ensure metadata exists on events

This commit is contained in:
Scott Bell 2024-12-17 10:21:48 +01:00
parent aaa2e43796
commit 2ba6bc9c73
3 changed files with 5 additions and 8 deletions

View File

@ -41,7 +41,10 @@ class EventMetadataProvider {
{
key: 'message',
name: 'Message',
format: 'string'
format: 'string',
hints: {
label: 0
}
}
]
}

View File

@ -33,7 +33,7 @@ class EventTelemetryProvider {
generateData(firstObservedTime, count, startTime, duration, name) {
const millisecondsSinceStart = startTime - firstObservedTime;
const randomFewSeconds = Math.floor(Math.random() * 10000);
const randomFewSeconds = Math.floor(Math.random() * 1000);
const utc = startTime + count + randomFewSeconds * duration;
const ind = count % messages.length;
const message = messages[ind] + ' - [' + millisecondsSinceStart + ']';

View File

@ -283,14 +283,11 @@ export default {
return evenObj.time <= this.viewBounds.end && evenObj.time >= this.viewBounds.start;
},
getEventsContainer() {
const containerHeight = 100;
const containerWidth = this.eventHistory.length ? this.width : 200;
let eventContainer;
let existingContainer = this.$el.querySelector(`.${CONTAINER_CLASS}`);
if (existingContainer) {
eventContainer = existingContainer;
// eventContainer.style.maxWidth = `${containerWidth}px`;
} else {
if (this.destroyEventsContainer) {
this.destroyEventsContainer();
@ -324,8 +321,6 @@ export default {
this.$refs.events.appendChild(component.$el);
eventContainer = component.$el.querySelector(`.${CONTAINER_CLASS}`);
// eventContainer.style.maxWidth = `${containerWidth}px`;
// eventContainer.style.height = `${containerHeight}px`;
}
return eventContainer;
@ -485,7 +480,6 @@ export default {
}
},
toggleEventSelection(clickedEvent) {
console.log(clickedEvent);
this.selectedEvent?.classList.remove(EVENT_SELECTED_CLASS);
clickedEvent.classList.add(EVENT_SELECTED_CLASS);
this.selectedEvent = clickedEvent;