29 Mei 2026

This commit is contained in:
[Valentino Heman Budiarto]
2026-05-29 18:55:54 +07:00
parent d2c6fb0d69
commit 5e005e8524
12 changed files with 29 additions and 23 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ export default function ApprovalsPage() {
try {
const token = localStorage.getItem("token");
// Mengambil dari fungsi GetAllBookings di backend
const res = await axios.get("http://localhost:8080/api/bookings", {
const res = await axios.get("http://172.17.110.6:8080/api/bookings", {
headers: { Authorization: `Bearer ${token}` }
});
setBookings(res.data.data);
@@ -32,7 +32,7 @@ export default function ApprovalsPage() {
const token = localStorage.getItem("token");
// Mengirim UUID booking_id ke backend Golang
await axios.put(
`http://localhost:8080/api/bookings/${bookingId}/status`,
`http://172.17.110.6:8080/api/bookings/${bookingId}/status`,
{ status: newStatus },
{ headers: { Authorization: `Bearer ${token}` } }
);
+2 -2
View File
@@ -8,7 +8,7 @@ export default function PowerMonitoringPage() {
const fetchPowerStatus = async () => {
try {
const response = await fetch("http://localhost:8080/api/hardware/power-status");
const response = await fetch("http://172.17.110.6:8080/api/hardware/power-status");
const data = await response.json();
// Asumsikan data dari HA berupa string angka, kita update ke room D101
@@ -74,7 +74,7 @@ useEffect(() => {
try {
// Tembak API Golang (Ganti dengan endpoint aslimu jika berbeda)
const response = await fetch("http://localhost:8080/api/hardware/control", {
const response = await fetch("http://172.17.110.6:8080/api/hardware/control", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ device: backendDevice, action: actionType }),
+3 -3
View File
@@ -21,7 +21,7 @@ export default function AdminDashboard() {
const token = localStorage.getItem("token");
// 1. Ambil SEMUA booking pakai endpoint yang sudah ada, lalu filter di Frontend
const bookRes = await axios.get("http://localhost:8080/api/bookings", {
const bookRes = await axios.get("http://172.17.110.6:8080/api/bookings", {
headers: { Authorization: `Bearer ${token}` }
});
@@ -31,7 +31,7 @@ export default function AdminDashboard() {
setPendingBookings(pendingOnly);
// 2. Ambil daftar ruangan biasa, lalu kita sisipkan "Dummy Power" untuk UI
const roomRes = await axios.get("http://localhost:8080/api/rooms", {
const roomRes = await axios.get("http://172.17.110.6:8080/api/rooms", {
headers: { Authorization: `Bearer ${token}` }
});
@@ -54,7 +54,7 @@ export default function AdminDashboard() {
try {
const token = localStorage.getItem("token");
// Mengirim status 'Approved' atau 'Rejected' ke backend
await axios.put(`http://localhost:8080/api/bookings/${id}/status`,
await axios.put(`http://172.17.110.6:8080/api/bookings/${id}/status`,
{ status: status },
{ headers: { Authorization: `Bearer ${token}` } }
);
+2 -2
View File
@@ -11,7 +11,7 @@ export default function ManageRoomsPage() {
const fetchRooms = async () => {
try {
const token = localStorage.getItem("token");
const res = await axios.get("http://localhost:8080/api/rooms", {
const res = await axios.get("http://172.17.110.6:8080/api/rooms", {
headers: { Authorization: `Bearer ${token}` }
});
setRooms(res.data.data);
@@ -33,7 +33,7 @@ export default function ManageRoomsPage() {
try {
const token = localStorage.getItem("token");
await axios.put(`http://localhost:8080/api/admin/rooms/${roomId}/status`,
await axios.put(`http://172.17.110.6:8080/api/admin/rooms/${roomId}/status`,
{ status: newStatus },
{ headers: { Authorization: `Bearer ${token}` } }
);
+1 -1
View File
@@ -19,7 +19,7 @@ export default function SchedulesPage() {
const fetchSchedules = async () => {
try {
const token = localStorage.getItem("token");
const res = await axios.get("http://localhost:8080/api/schedules", {
const res = await axios.get("http://172.17.110.6:8080/api/schedules", {
headers: { Authorization: `Bearer ${token}` }
});
setSchedules(res.data.data || []);