Pass token into Usage tracker
This commit is contained in:
parent
868aa018a4
commit
0911c9a7e5
|
@ -120,7 +120,7 @@ function App() {
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route exact path='/usage/:name'>
|
<Route exact path='/usage/:name'>
|
||||||
<Usage />
|
<Usage token={token} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route path='/'>
|
<Route path='/'>
|
||||||
|
|
|
@ -10,6 +10,7 @@ const deviceNames = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Usage(props) {
|
export function Usage(props) {
|
||||||
|
const { token } = props;
|
||||||
const { name } = useParams();
|
const { name } = useParams();
|
||||||
const title = deviceNames[name].title;
|
const title = deviceNames[name].title;
|
||||||
const device = deviceNames[name].device;
|
const device = deviceNames[name].device;
|
||||||
|
@ -18,7 +19,7 @@ export function Usage(props) {
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
|
||||||
const getUsage = () => {
|
const getUsage = () => {
|
||||||
requester('/stats/usage_data/?device='+device, 'GET', '')
|
requester('/stats/usage_data/?device='+device, 'GET', token)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
setUsage(res);
|
setUsage(res);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user