mirror of
https://github.com/Lissy93/web-check.git
synced 2025-06-18 19:06:42 +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 { Card } from 'components/Form/Card';
|
||||||
import Button from 'components/Form/Button';
|
import Button from 'components/Form/Button';
|
||||||
import { ExpandableRow } from 'components/Form/Row';
|
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 [cipherSuites, setCipherSuites] = useState(makeCipherSuites(props.data));
|
||||||
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
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) => {
|
const updateData = (id: number) => {
|
||||||
setCipherSuites([]);
|
setCipherSuites([]);
|
||||||
setLoadState('loading');
|
setLoadState('loading');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { useState } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Card } from 'components/Form/Card';
|
import { Card } from 'components/Form/Card';
|
||||||
import Button from 'components/Form/Button';
|
import Button from 'components/Form/Button';
|
||||||
import { ExpandableRow } from 'components/Form/Row';
|
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 [clientSupport, setClientSupport] = useState(makeClientSupport(props.data));
|
||||||
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setClientSupport(makeClientSupport(props.data));
|
||||||
|
}, [props.data]);
|
||||||
|
|
||||||
const updateData = (id: number) => {
|
const updateData = (id: number) => {
|
||||||
setClientSupport([]);
|
setClientSupport([]);
|
||||||
setLoadState('loading');
|
setLoadState('loading');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { useState } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import colors from 'styles/colors';
|
import colors from 'styles/colors';
|
||||||
import { Card } from 'components/Form/Card';
|
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 [tlsResults, setTlsResults] = useState(makeResults(props.data));
|
||||||
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
const [loadState, setLoadState] = useState<undefined | 'loading' | 'success' | 'error'>(undefined);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setTlsRowWata(makeExpandableData(props.data));
|
||||||
|
setTlsResults(makeResults(props.data));
|
||||||
|
}, [props.data]);
|
||||||
|
|
||||||
const updateData = (id: number) => {
|
const updateData = (id: number) => {
|
||||||
setTlsRowWata([]);
|
setTlsRowWata([]);
|
||||||
setLoadState('loading');
|
setLoadState('loading');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user