mirror of
https://github.com/Lissy93/web-check.git
synced 2025-06-18 02:47:00 +02:00
Updated TLS components, to refresh when new data comes in
This commit is contained in:
parent
5297b2ffe7
commit
d8bb822a4e
@ -1,5 +1,5 @@
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Card } from 'components/Form/Card';
|
||||
import Button from 'components/Form/Button';
|
||||
import { ExpandableRow } from 'components/Form/Row';
|
||||
@ -29,6 +29,10 @@ const TlsCard = (props: {data: any, title: string, actionButtons: any }): JSX.El
|
||||
const [cipherSuites, setCipherSuites] = useState(makeCipherSuites(props.data));
|
||||
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
||||
|
||||
useEffect(() => { // Update cipher suites when data changes
|
||||
setCipherSuites(makeCipherSuites(props.data));
|
||||
}, [props.data]);
|
||||
|
||||
const updateData = (id: number) => {
|
||||
setCipherSuites([]);
|
||||
setLoadState('loading');
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Card } from 'components/Form/Card';
|
||||
import Button from 'components/Form/Button';
|
||||
import { ExpandableRow } from 'components/Form/Row';
|
||||
@ -38,6 +38,10 @@ const TlsCard = (props: {data: any, title: string, actionButtons: any }): JSX.El
|
||||
const [clientSupport, setClientSupport] = useState(makeClientSupport(props.data));
|
||||
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
setClientSupport(makeClientSupport(props.data));
|
||||
}, [props.data]);
|
||||
|
||||
const updateData = (id: number) => {
|
||||
setClientSupport([]);
|
||||
setLoadState('loading');
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import colors from 'styles/colors';
|
||||
import { Card } from 'components/Form/Card';
|
||||
@ -74,6 +74,11 @@ const TlsCard = (props: {data: any, title: string, actionButtons: any }): JSX.El
|
||||
const [tlsResults, setTlsResults] = useState(makeResults(props.data));
|
||||
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
setTlsRowWata(makeExpandableData(props.data));
|
||||
setTlsResults(makeResults(props.data));
|
||||
}, [props.data]);
|
||||
|
||||
const updateData = (id: number) => {
|
||||
setTlsRowWata([]);
|
||||
setLoadState('loading');
|
||||
|
Loading…
x
Reference in New Issue
Block a user