diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 69fb71a..e2f7652 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -4632,6 +4632,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typescript": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=12.20" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", diff --git a/frontend/src/pages/devices.js b/frontend/src/pages/devices.js index ce475d2..39509e6 100644 --- a/frontend/src/pages/devices.js +++ b/frontend/src/pages/devices.js @@ -1,3 +1,4 @@ +import React, { useState, useEffect } from 'react'; import Head from 'next/head'; import { subDays, subHours } from 'date-fns'; import { Box, Container, Unstable_Grid2 as Grid } from '@mui/material'; @@ -11,98 +12,46 @@ import { OverviewTotalCustomers } from 'src/sections/overview/overview-total-cus import { OverviewTotalProfit } from 'src/sections/overview/overview-total-profit'; import { OverviewTraffic } from 'src/sections/overview/overview-traffic'; -const now = new Date(); -const Page = () => ( + +const Page = () => { + const [devices, setDevices] = useState([]); + + useEffect(() => { + fetch('https://d9962fd9-2464-4a30-9a86-a15a04b57ad0.mock.pstmn.io/device') + .then(response => response.json()) + .then(json => setDevices(json)) + .catch(error => console.error('Error:', error)); + }, []); + return ( <> - - - Oktopus | TR-369 - - - - - - - - - + + + Oktopus | TR-369 + + + + + + + + + -); - + ); +} Page.getLayout = (page) => ( {page} diff --git a/frontend/src/sections/overview/overview-latest-orders.js b/frontend/src/sections/overview/overview-latest-orders.js index 91603bf..f42fc6b 100644 --- a/frontend/src/sections/overview/overview-latest-orders.js +++ b/frontend/src/sections/overview/overview-latest-orders.js @@ -40,53 +40,50 @@ export const OverviewLatestOrders = (props) => { - Model + SN - Customer + MODEL - Vendor + CUSTOMER - Status + VENDOR - Access + VERSION + + + STATUS {orders.map((order) => { - const createdAt = format(order.createdAt, 'dd/MM/yyyy'); return ( - {order.ref} + {order.SN} - {order.customer.name} + {order.Model} - {createdAt} + {order.Customer} - - {order.status} - + {order.Vendor} - router.push("devices/"+order.id)} - > - - + {order.Version} + + + {order.Status} );