From d1f38703f8cdcedf5242d1ac89afd1839975afc0 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 6 Nov 2019 18:45:01 -0500 Subject: [PATCH] add sequential logger table --- src/App.js | 24 +++++++++--------------- src/ConsoleSection.js | 1 - src/LogsSection.js | 19 +++++++++++++------ src/ObjectSection.js | 1 - 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/App.js b/src/App.js index d183de0..607f12c 100644 --- a/src/App.js +++ b/src/App.js @@ -25,6 +25,7 @@ class App extends React.PureComponent { modalTitle: "", modalContent: {}, rows: logManager.data, + data: logManager.data, cols: [ { name: 'session', title: 'Session', hidden: true }, { name: 'parent_id', title: 'Parent', hidden: true }, @@ -39,10 +40,11 @@ class App extends React.PureComponent { ] }; - this.update = (currentStep, nextRows) => { + this.update = (nextRows) => { + let currentStep = logManager.getCurrentStep(); this.setState({ rows: nextRows, - data: logManager.data, + data: logManager.data.slice(), current_index: logManager.currentStep, current_id: currentStep.id, logs: logManager.logs, @@ -52,31 +54,22 @@ class App extends React.PureComponent { this.previousLog = () => { const nextRows = this.state.rows.slice(); - logManager.previousStep(); - let currentStep = logManager.getCurrentStep(); - - this.update(currentStep, nextRows); + this.update(nextRows); } this.nextLog = () => { const nextRows = this.state.rows.slice(); - logManager.nextStep(); - let currentStep = logManager.getCurrentStep(); - - this.update(currentStep, nextRows); + this.update(nextRows); } this.getChildRows = logManager.getChildRows.bind(logManager); this.goToStep = (value) => { const nextRows = this.state.rows.slice(); - logManager.goToStep(value); - let currentStep = logManager.getCurrentStep(); - - this.update(currentStep, nextRows); + this.update(nextRows); } this.changeValue = ({target}) => { @@ -117,7 +110,8 @@ class App extends React.PureComponent {
- + +
); diff --git a/src/ConsoleSection.js b/src/ConsoleSection.js index 1af59dc..23620e1 100644 --- a/src/ConsoleSection.js +++ b/src/ConsoleSection.js @@ -22,4 +22,3 @@ function ConsoleSection({logs, open}) { } export default ConsoleSection; - diff --git a/src/LogsSection.js b/src/LogsSection.js index 5384338..43b02ae 100644 --- a/src/LogsSection.js +++ b/src/LogsSection.js @@ -16,23 +16,27 @@ let numberFilterOperations = [ let tableColumnExtensions = [{ columnName: 'name', width: 300, align: 'left' }]; -function LogsSection({open, cols, rows, viewRow, getChildRows}) { +function LogsSection({title, open, isStructured, defaultSorting, cols, rows, viewRow, getChildRows}) { let columns = cols; let defaultColumnWidths = cols.map((x) => { return {columnName: x.name, width: (x.width || 200)} }) let defaultHiddenColumnNames = cols.filter((x) => x.hidden).map((x) => x.name) let defaultOrder = cols.map((x) => x.name) return ( -
+
- + {isStructured && + <> + + + } - + @@ -43,7 +47,11 @@ function LogsSection({open, cols, rows, viewRow, getChildRows}) { - + {isStructured && + <> + + + } @@ -51,4 +59,3 @@ function LogsSection({open, cols, rows, viewRow, getChildRows}) { } export default LogsSection; - diff --git a/src/ObjectSection.js b/src/ObjectSection.js index 470c9c8..c58b3d2 100644 --- a/src/ObjectSection.js +++ b/src/ObjectSection.js @@ -11,4 +11,3 @@ function ObjectSection({log, open}) { } export default ObjectSection; -