diff --git a/.env b/.env index 345a9b1..2e4ecf3 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ -VITE_API_URL = http://localhost:3000 \ No newline at end of file +VITE_API_URL = http://localhost:3000 +VITE_API_TEST_URL = http://localhost:3001 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 01f6a05..885f5d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "cors": "^2.8.5", "dotenv": "^16.4.7", "express-validator": "^7.2.1", + "idb": "^8.0.2", "jsonwebtoken": "^9.0.2", "react": "^19.0.0", "react-bootstrap": "^2.10.9", @@ -3038,6 +3039,12 @@ "node": ">= 0.4" } }, + "node_modules/idb": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/idb/-/idb-8.0.2.tgz", + "integrity": "sha512-CX70rYhx7GDDQzwwQMDwF6kDRQi5vVs6khHUumDrMecBylKkwvZ8HWvKV08AGb7VbpoGCWUQ4aHzNDgoUiOIUg==", + "license": "ISC" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -7088,6 +7095,11 @@ "function-bind": "^1.1.2" } }, + "idb": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/idb/-/idb-8.0.2.tgz", + "integrity": "sha512-CX70rYhx7GDDQzwwQMDwF6kDRQi5vVs6khHUumDrMecBylKkwvZ8HWvKV08AGb7VbpoGCWUQ4aHzNDgoUiOIUg==" + }, "ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", diff --git a/package.json b/package.json index d9f8607..cb5297d 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "cors": "^2.8.5", "dotenv": "^16.4.7", "express-validator": "^7.2.1", + "idb": "^8.0.2", "jsonwebtoken": "^9.0.2", "react": "^19.0.0", "react-bootstrap": "^2.10.9", diff --git a/queueapp.zip b/queueapp.zip new file mode 100644 index 0000000..51ad225 Binary files /dev/null and b/queueapp.zip differ diff --git a/src/api/queueApi.js b/src/api/queueApi.js index 2ba5fac..3e7def6 100644 --- a/src/api/queueApi.js +++ b/src/api/queueApi.js @@ -24,7 +24,7 @@ export const updateQueueStatus = async (queueId, status) => { } }; -export const createQueue = async (customerData) => { +export const createTicketApi = async (customerData) => { try { const response = await axios.post(`${API_URL}/queues`, customerData); return response.data; diff --git a/src/components/Admin/AdminSidebar.jsx b/src/components/Admin/AdminSidebar.jsx index 2def27b..a818629 100644 --- a/src/components/Admin/AdminSidebar.jsx +++ b/src/components/Admin/AdminSidebar.jsx @@ -34,12 +34,12 @@ const AdminSidebar = () => { {/* Laporan Antrian */} - + {/* Pengaturan Layar Pengaturan Menu - + */} )} diff --git a/src/components/Admin/TestQueueActions.jsx b/src/components/Admin/TestQueueActions.jsx index bdafbc7..d23b295 100644 --- a/src/components/Admin/TestQueueActions.jsx +++ b/src/components/Admin/TestQueueActions.jsx @@ -1,7 +1,6 @@ - // FILE INI UNTUK TEST TAMPILAN DATA DENGAN API -import { fetchQueues, updateQueueStatus } from "../../api/queueApi"; +import { fetchQueues, updateQueueStatus, createTicketApi } from "../../api/queueApi"; export const getProcessedQueues = async () => { const data = await fetchQueues(); @@ -28,3 +27,7 @@ export const getProcessedQueues = async () => { export const changeQueueStatus = async (queueId, newStatus) => { return await updateQueueStatus(queueId, newStatus); }; + +export const createTicket = async (ticketData) => { + return await createTicketApi(ticketData); +}; diff --git a/src/components/Admin/TestQueueTable.jsx b/src/components/Admin/TestQueueTable.jsx index 2f71cc6..786c31a 100644 --- a/src/components/Admin/TestQueueTable.jsx +++ b/src/components/Admin/TestQueueTable.jsx @@ -45,7 +45,7 @@ const TestQueueTable = () => { }; return ( - +
List Antrian
@@ -85,7 +85,7 @@ const TestQueueTable = () => { {new Date(queue.createdAt).toLocaleString()} - + {queue.status !== "In Progress" && queue.status !== "Completed" && ( + + +
+
+ + {["c1.png", "c2.jpg", "c3.jpg"].map((image, index) => ( + + {`Slide + + ))} + +
+ + + ) : ( + + + + Tiket Antrian +
+ {ticket.number} + Layanan : {ticket.service} + Nama : {ticket.name} + No Telepon : {ticket.phone} + +
+
+
+ )}
); }; export default ServiceSelection; - diff --git a/src/pages/Admin/QueueListPage.jsx b/src/pages/Admin/QueueListPage.jsx index 7360d7a..2cd9e5f 100644 --- a/src/pages/Admin/QueueListPage.jsx +++ b/src/pages/Admin/QueueListPage.jsx @@ -1,14 +1,16 @@ import TestQueueTable from "../../components/Admin/TestQueueTable"; -import QueueTable from "../../components/Admin/QueueTable"; +// import QueueTable from "../../components/Admin/QueueTable"; +// import TestComponent from "../../components/test"; const QueueListPage = () => { return (
- {/* INI ADALAH UNTUK TEST DATA DENGAN API */} - - + + {/* Atas Data dengan API bawah Data Static */} + {/* + */}
); }; diff --git a/src/pages/Display/QueueDisplayPage.jsx b/src/pages/Display/QueueDisplayPage.jsx index 1d485fc..34ecc90 100644 --- a/src/pages/Display/QueueDisplayPage.jsx +++ b/src/pages/Display/QueueDisplayPage.jsx @@ -1,11 +1,12 @@ import TestQueueDisplay from "../../components/Display/TestQueueDisplay" -import QueueDisplay from "../../components/Display/QueueDisplay" +// import QueueDisplay from "../../components/Display/QueueDisplay" const QueueDisplayPage = () => { return ( <> - {/* INI ADALAH UNTUK TEST DATA DENGAN API */} - + + {/* Atas Data dengan API bawah Data Static */} + {/* */} ) } diff --git a/src/pages/Display/QueueMenuPage.jsx b/src/pages/Display/QueueMenuPage.jsx index c4b7385..3535c59 100644 --- a/src/pages/Display/QueueMenuPage.jsx +++ b/src/pages/Display/QueueMenuPage.jsx @@ -1,11 +1,12 @@ import TestServiceSelection from "../../components/Display/TestServiceSelection" -import ServiceSelection from "../../components/Display/ServiceSelection" +// import ServiceSelection from "../../components/Display/ServiceSelection" const QueueMenuPage = () => { return ( <> - {/* INI ADALAH UNTUK TEST DATA DENGAN API */} - + + {/* Atas Data dengan API bawah Data Static */} + {/* */} ) } diff --git a/src/routes/AppRoutes.jsx b/src/routes/AppRoutes.jsx index 4bc503b..cd00bb7 100644 --- a/src/routes/AppRoutes.jsx +++ b/src/routes/AppRoutes.jsx @@ -13,7 +13,7 @@ const AppRoutes = () => { {/* Redirect default ke queue-list */} - } /> + } /> {/* Rute untuk Admin */} }>