display resource data from backend
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import Overview from "./overview/overview";
|
import Overview from "./overview/overview";
|
||||||
|
import SelectResource from './selectResource'
|
||||||
import {
|
import {
|
||||||
Route,
|
Route,
|
||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
@@ -19,7 +20,7 @@ export default function Content() {
|
|||||||
return (
|
return (
|
||||||
|
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<Route exact path="/" component={Overview} />
|
<Route exact path="/" component={SelectResource} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
26
frontend/src/components/selectResource/index.js
Normal file
26
frontend/src/components/selectResource/index.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
|
||||||
|
const useStyles = makeStyles(theme => ({
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
export default function SelectResource() {
|
||||||
|
//const classes = useStyles();
|
||||||
|
const [resources, setResources] = React.useState(false);
|
||||||
|
|
||||||
|
const loadResources = async () => {
|
||||||
|
var resourceJSON = await fetch("/API/resourcelist");
|
||||||
|
setResources(await resourceJSON.text())
|
||||||
|
}
|
||||||
|
|
||||||
|
loadResources();
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{resources}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user