From 8f68fd5c6afa73fa86b8257c675614825ff17c5d Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Mon, 25 Apr 2022 16:34:27 +0200 Subject: Format --- src/components/ScanView.js | 193 +++++++++++++++++++++++---------------------- 1 file changed, 100 insertions(+), 93 deletions(-) (limited to 'src') diff --git a/src/components/ScanView.js b/src/components/ScanView.js index ce4901b..a6d5bb0 100644 --- a/src/components/ScanView.js +++ b/src/components/ScanView.js @@ -70,105 +70,112 @@ class ScanView extends React.Component { } render() { - return this.state.loaded && ( - -
- #{this.state._id} -
-

General info

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Domain{this.state.domain}
Endpoint{`${this.state.ip}:${this.props.port}`}
Hostname{this.state.ptr}
Owner{this.state.whois_description}
ASN{`${this.state.asn} (${this.props.asn_country_code})`}
Abuse mail{this.state.abuse_mail}
- - {this.state.description && ( - <> -
- {this.state.description} - - )} - -

Custom info

- - -

-
- Latest scan:     - {dateFormat( - this.state.timestamp_in_utc, - "isoUtcDateTime" - )} + return ( + this.state.loaded && ( + + -
General info

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Domain{this.state.domain}
Endpoint{`${this.state.ip}:${this.props.port}`}
Hostname{this.state.ptr}
Owner{this.state.whois_description}
ASN{`${this.state.asn} (${this.props.asn_country_code})`}
Abuse mail{this.state.abuse_mail}
+ + {this.state.description && ( + <> +
+ + {this.state.description} + + + )} + +

Custom info

+ + +

- {this.state.rescanInProgress ? ( - - ) : ( - - )} +
+ Latest scan:     + {dateFormat( + this.state.timestamp_in_utc, + "isoUtcDateTime" + )} +
+
+ {this.state.rescanInProgress ? ( + + ) : ( + + )} +
+

+ +
+ {Object.entries(this.state.result) + // Sort by vulnerable, investigation_needed, reliability, name + .sort((a, b) => + a[1].display_name > b[1].display_name ? -1 : 1 + ) + .sort((a, b) => + a[1].reliability < b[1].reliability ? -1 : 1 + ) + .sort((a, b) => + a[1].vulnerable || a[1].investigation_needed + ? -1 + : 1 + ) + .sort((a, b) => (a[1].vulnerable ? -1 : 1)) + .map(([id, res]) => ( + + ))}
- - -
- {Object.entries(this.state.result) - // Sort by vulnerable, investigation_needed, reliability, name - .sort((a, b) => - a[1].display_name > b[1].display_name ? -1 : 1 - ) - .sort((a, b) => - a[1].reliability < b[1].reliability ? -1 : 1 - ) - .sort((a, b) => - a[1].vulnerable || a[1].investigation_needed - ? -1 - : 1 - ) - .sort((a, b) => (a[1].vulnerable ? -1 : 1)) - .map(([id, res]) => ( - - ))} -
-
+ + ) ); } } -- cgit v1.1