From d0c4272f512fbab6f62bd08754c9c95243b3ee9d Mon Sep 17 00:00:00 2001 From: Erki Aas Date: Tue, 11 Oct 2022 19:43:46 +0300 Subject: [PATCH] Flash added rows --- frontend/src/assets/main.css | 4 ++++ frontend/src/components/LogViewer.vue | 17 ++++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 47957cd..39e269c 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -9,3 +9,7 @@ div#app { display: flex; flex-direction: column; } + +.ag-theme-material { + --ag-value-change-value-highlight-background-color: #f9ff99; +} \ No newline at end of file diff --git a/frontend/src/components/LogViewer.vue b/frontend/src/components/LogViewer.vue index 0a85cdf..22d1937 100644 --- a/frontend/src/components/LogViewer.vue +++ b/frontend/src/components/LogViewer.vue @@ -83,7 +83,8 @@ export default { defaultColDef: { width: 50, initialPinned: true, - resizable: true + resizable: true, + enableCellChangeFlash: true }, currentRowCount: 0, viewRowCount: 20, @@ -140,18 +141,12 @@ export default { }, handleReceiveMessage (event) { const eventData = this.parseEventData(event.data); - this.gridApi.updateRowData({add: [eventData]}); - this.gridApi.sizeColumnsToFit() - }, - refreshRowData () { - const itemsToUpdate = []; - this.rowData.slice(0 - this.viewRowCount).forEach((row, index) => { - row.index = index - itemsToUpdate.push(row) + const res = this.gridApi.applyTransaction({ + add: [eventData] }); - this.gridApi.applyTransactionAsync({ update: itemsToUpdate }); + const rowNode = res.add[0] + this.gridApi.flashCells({ rowNodes: [rowNode]}); this.gridApi.sizeColumnsToFit() - this.getComboBoxOptions() }, parseEventData (eventData) { try {