summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnst Widerberg <ernst@sunet.se>2022-04-26 09:30:16 +0200
committerErnst Widerberg <ernst@sunet.se>2022-04-26 09:30:16 +0200
commitdc37413149a3a2e92c1686e56464efd9497e8dd6 (patch)
treee927feae62c830d7cce0389d72820ec4f32373d2
parent8f68fd5c6afa73fa86b8257c675614825ff17c5d (diff)
Update for timestamp change
m---------soc_collector0
-rw-r--r--src/components/ListItem.js4
-rw-r--r--src/components/ListView.js6
-rw-r--r--src/components/ScanView.js11
4 files changed, 6 insertions, 15 deletions
diff --git a/soc_collector b/soc_collector
-Subproject 2aebcdeca17f9b46d90f5255dd4d03caa358701
+Subproject 1b836e78db2737ba5d1ae43da9828601a5a5c11
diff --git a/src/components/ListItem.js b/src/components/ListItem.js
index 292d093..65c9019 100644
--- a/src/components/ListItem.js
+++ b/src/components/ListItem.js
@@ -22,9 +22,7 @@ class ListItem extends React.Component {
}}
onClick={() => (window.location = `/${this.props._id}`)}
>
- <td>
- {dateFormat(this.props.timestamp_in_utc, "isoUtcDateTime")}
- </td>
+ <td>{dateFormat(this.props.timestamp, "isoUtcDateTime")}</td>
<td>
{this.props.ip}:{this.props.port}
</td>
diff --git a/src/components/ListView.js b/src/components/ListView.js
index 3f1911c..0046ef8 100644
--- a/src/components/ListView.js
+++ b/src/components/ListView.js
@@ -76,9 +76,7 @@ class ListView extends React.Component {
this.setState({
scans: json.docs.map(d => ({
...d,
- timestamp_in_utc: new Date(
- d.timestamp_in_utc.replace(/ UTC$/, "Z")
- )
+ timestamp: new Date(d.timestamp)
}))
});
})
@@ -119,7 +117,7 @@ class ListView extends React.Component {
<tbody>
{this.state.scans
.sort((a, b) =>
- a.timestamp_in_utc > b.timestamp_in_utc ? 1 : -1
+ a.timestamp > b.timestamp ? 1 : -1
)
.map(scan =>
Object.entries(scan.result)
diff --git a/src/components/ScanView.js b/src/components/ScanView.js
index a6d5bb0..00c6ddb 100644
--- a/src/components/ScanView.js
+++ b/src/components/ScanView.js
@@ -48,9 +48,7 @@ class ScanView extends React.Component {
this.setState({
loaded: true,
...json.docs,
- timestamp_in_utc: new Date(
- json.docs.timestamp_in_utc.replace(/ UTC$/, "Z")
- )
+ timestamp: new Date(json.docs.timestamp)
});
})
.catch(e => this.props.setError(e));
@@ -63,7 +61,7 @@ class ScanView extends React.Component {
() =>
this.setState(prevState => ({
rescanInProgress: false,
- timestamp_in_utc: Date.now()
+ timestamp: Date.now()
})),
2000
);
@@ -127,10 +125,7 @@ class ScanView extends React.Component {
>
<div>
Latest scan: &nbsp;&nbsp;&nbsp;
- {dateFormat(
- this.state.timestamp_in_utc,
- "isoUtcDateTime"
- )}
+ {dateFormat(this.state.timestamp, "isoUtcDateTime")}
</div>
<div
style={{