2025-09-08 15:21:17 +01:00
|
|
|
import Card from "../../UI/Card";
|
|
|
|
|
import CardHeader from "../../UI/CardHeader";
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
import FormGroup from "../components/FormGroup";
|
|
|
|
|
|
|
|
|
|
const ModemCard = () => {
|
|
|
|
|
const [apn, setApn] = useState("");
|
|
|
|
|
const [username, setUsername] = useState("");
|
|
|
|
|
const [password, setPassword] = useState("");
|
|
|
|
|
const [authType, setAuthType] = useState("PAP");
|
|
|
|
|
|
|
|
|
|
return (
|
2025-09-16 11:07:35 +01:00
|
|
|
// TODO: Add switch for Auto vs Manual settings
|
2025-09-08 15:21:17 +01:00
|
|
|
<Card>
|
|
|
|
|
<CardHeader title={"Modem"} />
|
|
|
|
|
<div className="flex flex-col gap-4">
|
|
|
|
|
<FormGroup>
|
2025-09-16 11:07:35 +01:00
|
|
|
<label
|
|
|
|
|
htmlFor="apn"
|
|
|
|
|
className="font-medium whitespace-nowrap md:w-2/3"
|
|
|
|
|
>
|
|
|
|
|
APN
|
|
|
|
|
</label>
|
2025-09-08 15:21:17 +01:00
|
|
|
<input
|
|
|
|
|
id="apn"
|
|
|
|
|
name="apn"
|
|
|
|
|
type="text"
|
|
|
|
|
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
|
|
|
|
|
placeholder="Enter APN"
|
|
|
|
|
value={apn}
|
2025-09-16 11:07:35 +01:00
|
|
|
onChange={(e) => setApn(e.target.value)}
|
2025-09-08 15:21:17 +01:00
|
|
|
/>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
<FormGroup>
|
2025-09-16 11:07:35 +01:00
|
|
|
<label
|
|
|
|
|
htmlFor="modemUsername"
|
|
|
|
|
className="font-medium whitespace-nowrap md:w-2/3"
|
|
|
|
|
>
|
|
|
|
|
Username
|
|
|
|
|
</label>
|
2025-09-08 15:21:17 +01:00
|
|
|
<input
|
|
|
|
|
id="modemUsername"
|
|
|
|
|
name="modemUsername"
|
|
|
|
|
type="text"
|
|
|
|
|
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
|
|
|
|
|
placeholder="Enter Username"
|
|
|
|
|
value={username}
|
2025-09-16 11:07:35 +01:00
|
|
|
onChange={(e) => setUsername(e.target.value)}
|
2025-09-08 15:21:17 +01:00
|
|
|
/>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
<FormGroup>
|
2025-09-16 11:07:35 +01:00
|
|
|
<label
|
|
|
|
|
htmlFor="modemPassword"
|
|
|
|
|
className="font-medium whitespace-nowrap md:w-2/3"
|
|
|
|
|
>
|
|
|
|
|
Password
|
|
|
|
|
</label>
|
2025-09-08 15:21:17 +01:00
|
|
|
<input
|
|
|
|
|
id="modemPassword"
|
|
|
|
|
name="modemPassword"
|
|
|
|
|
type="password"
|
|
|
|
|
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
|
|
|
|
|
placeholder="Enter Password"
|
|
|
|
|
value={password}
|
2025-09-16 11:07:35 +01:00
|
|
|
onChange={(e) => setPassword(e.target.value)}
|
2025-09-08 15:21:17 +01:00
|
|
|
/>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
<FormGroup>
|
2025-09-16 11:07:35 +01:00
|
|
|
<label
|
|
|
|
|
htmlFor="authType"
|
|
|
|
|
className="font-medium whitespace-nowrap md:w-2/3"
|
|
|
|
|
>
|
|
|
|
|
Authentication Type
|
|
|
|
|
</label>
|
2025-09-08 15:21:17 +01:00
|
|
|
<select
|
|
|
|
|
id="authType"
|
|
|
|
|
name="authType"
|
|
|
|
|
className="p-2 border border-gray-400 rounded-lg text-white bg-[#253445] flex-1 md:w-2/3"
|
|
|
|
|
value={authType}
|
2025-09-16 11:07:35 +01:00
|
|
|
onChange={(e) => setAuthType(e.target.value)}
|
2025-09-08 15:21:17 +01:00
|
|
|
>
|
|
|
|
|
<option value="PAP">PAP</option>
|
|
|
|
|
<option value="CHAP">CHAP</option>
|
|
|
|
|
<option value="None">None</option>
|
|
|
|
|
</select>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
<button
|
2025-09-23 16:02:14 +01:00
|
|
|
className="bg-[#26B170] text-white px-4 py-2 rounded hover:bg-green-700 transition w-full md:w-[50%]"
|
2025-09-08 15:21:17 +01:00
|
|
|
//onClick={() => handleModemSave(apn, username, password, authType)}
|
|
|
|
|
>
|
|
|
|
|
Save Modem Settings
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default ModemCard;
|