- added prettier config file
- improved sound state to remove pooling - increased size of naviagtion arrows and fixed navigation onClick - decreased width of nav bar - fixed button to reveal passwords in some password fields
This commit is contained in:
@@ -5,12 +5,9 @@ import { useEffect } from "react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
const getWiFiSettings = async () => {
|
||||
const response = await fetch(
|
||||
`${CAM_BASE}/api/fetch-config?id=ModemAndWifiManager-wifi`,
|
||||
{
|
||||
signal: AbortSignal.timeout(500),
|
||||
}
|
||||
);
|
||||
const response = await fetch(`${CAM_BASE}/api/fetch-config?id=ModemAndWifiManager-wifi`, {
|
||||
signal: AbortSignal.timeout(500),
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("Cannot fetch Wifi settings");
|
||||
}
|
||||
@@ -18,14 +15,11 @@ const getWiFiSettings = async () => {
|
||||
};
|
||||
|
||||
const updateWifiSettings = async (wifiConfig: WifiConfig) => {
|
||||
const response = await fetch(
|
||||
`${CAM_BASE}/api/update-config?id=ModemAndWifiManager-wifi`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(wifiConfig),
|
||||
}
|
||||
);
|
||||
const response = await fetch(`${CAM_BASE}/api/update-config?id=ModemAndWifiManager-wifi`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(wifiConfig),
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("Cannot update wifi settings");
|
||||
}
|
||||
@@ -33,12 +27,9 @@ const updateWifiSettings = async (wifiConfig: WifiConfig) => {
|
||||
};
|
||||
|
||||
const getModemSettings = async () => {
|
||||
const response = await fetch(
|
||||
`${CAM_BASE}/api/fetch-config?id=ModemAndWifiManager-modem`,
|
||||
{
|
||||
signal: AbortSignal.timeout(500),
|
||||
}
|
||||
);
|
||||
const response = await fetch(`${CAM_BASE}/api/fetch-config?id=ModemAndWifiManager-modem`, {
|
||||
signal: AbortSignal.timeout(500),
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("Cannot fetch modem settings");
|
||||
}
|
||||
@@ -46,14 +37,11 @@ const getModemSettings = async () => {
|
||||
};
|
||||
|
||||
const updateModemSettings = async (modemConfig: ModemConfig) => {
|
||||
const response = await fetch(
|
||||
`${CAM_BASE}/api/update-config?id=ModemAndWifiManager-modem`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(modemConfig),
|
||||
}
|
||||
);
|
||||
const response = await fetch(`${CAM_BASE}/api/update-config?id=ModemAndWifiManager-modem`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(modemConfig),
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("cannot update modem settings");
|
||||
}
|
||||
@@ -100,13 +88,11 @@ export const useWifiAndModem = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (wifiQuery.isError)
|
||||
toast.error("Cannot get WiFi settings", { id: "wiFiSettings" });
|
||||
if (wifiQuery.isError) toast.error("Cannot get WiFi settings", { id: "wiFiSettings" });
|
||||
}, [wifiQuery?.error?.message, wifiQuery.isError]);
|
||||
|
||||
useEffect(() => {
|
||||
if (modemQuery.isError)
|
||||
toast.error("Cannot get Modem settings", { id: "modemSettings" });
|
||||
if (modemQuery.isError) toast.error("Cannot get Modem settings", { id: "modemSettings" });
|
||||
}, [modemQuery?.error?.message, modemQuery.isError]);
|
||||
return {
|
||||
wifiQuery,
|
||||
|
||||
Reference in New Issue
Block a user