22 lines
545 B
JavaScript
22 lines
545 B
JavaScript
'use strict';
|
|
|
|
function Nodes({criteria}) {
|
|
const [nodes, setNodes] = React.useState([]);
|
|
|
|
React.useEffect(() => {
|
|
let query = new URL("/api/v1/nodes", window.location.origin);
|
|
query.searchParams.append("criteria", criteria)
|
|
|
|
fetch(query)
|
|
.then(response => response.json())
|
|
.then(value => setNodes(value));
|
|
}, [criteria]);
|
|
|
|
return (
|
|
<MaterialUI.Card variant="outlined">
|
|
<div>nodes</div>
|
|
<ListData datas={nodes}/>
|
|
</MaterialUI.Card>
|
|
);
|
|
}
|