New concentrators fields
This commit is contained in:
@@ -19,6 +19,11 @@ export interface ConcentratorRecord {
|
||||
"Installed Time": string;
|
||||
"Communication Time": string;
|
||||
"Instruction Manual": string;
|
||||
"Gateway ID": number;
|
||||
"Gateway EUI": string;
|
||||
"Gateway Name": string;
|
||||
"Gateway Description": string;
|
||||
"Antenna Placement": string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,6 +46,11 @@ export interface Concentrator {
|
||||
"Installed Time": string;
|
||||
"Communication Time": string;
|
||||
"Instruction Manual": string;
|
||||
"Gateway ID": number;
|
||||
"Gateway EUI": string;
|
||||
"Gateway Name": string;
|
||||
"Gateway Description": string;
|
||||
"Antenna Placement": string;
|
||||
}
|
||||
|
||||
export const fetchConcentrators = async (): Promise<Concentrator[]> => {
|
||||
@@ -67,6 +77,11 @@ export const fetchConcentrators = async (): Promise<Concentrator[]> => {
|
||||
"Installed Time": r.fields["Installed Time"] || "",
|
||||
"Communication Time": r.fields["Communication Time"] || "",
|
||||
"Instruction Manual": r.fields["Instruction Manual"] || "",
|
||||
"Gateway ID": r.fields["Gateway ID"] || 0,
|
||||
"Gateway EUI": r.fields["Gateway EUI"] || "",
|
||||
"Gateway Name": r.fields["Gateway Name"] || "",
|
||||
"Gateway Description": r.fields["Gateway Description"] || "",
|
||||
"Antenna Placement": r.fields["Antenna Placement"] || "Indoor",
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error("Error fetching concentrators:", error);
|
||||
@@ -92,6 +107,11 @@ export const createConcentrator = async (
|
||||
"Installed Time": concentratorData["Installed Time"],
|
||||
"Communication Time": concentratorData["Communication Time"],
|
||||
"Instruction Manual": concentratorData["Instruction Manual"],
|
||||
"Gateway ID": concentratorData["Gateway ID"],
|
||||
"Gateway EUI": concentratorData["Gateway EUI"],
|
||||
"Gateway Name": concentratorData["Gateway Name"],
|
||||
"Gateway Description": concentratorData["Gateway Description"],
|
||||
"Antenna Placement": concentratorData["Antenna Placement"],
|
||||
},
|
||||
}),
|
||||
});
|
||||
@@ -118,6 +138,11 @@ export const createConcentrator = async (
|
||||
"Installed Time": createdRecord.fields["Installed Time"] || concentratorData["Installed Time"],
|
||||
"Communication Time": createdRecord.fields["Communication Time"] || concentratorData["Communication Time"],
|
||||
"Instruction Manual": createdRecord.fields["Instruction Manual"] || concentratorData["Instruction Manual"],
|
||||
"Gateway ID": createdRecord.fields["Gateway ID"] || concentratorData["Gateway ID"],
|
||||
"Gateway EUI": createdRecord.fields["Gateway EUI"] || concentratorData["Gateway EUI"],
|
||||
"Gateway Name": createdRecord.fields["Gateway Name"] || concentratorData["Gateway Name"],
|
||||
"Gateway Description": createdRecord.fields["Gateway Description"] || concentratorData["Gateway Description"],
|
||||
"Antenna Placement": createdRecord.fields["Antenna Placement"] || concentratorData["Antenna Placement"],
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error creating concentrator:", error);
|
||||
@@ -145,6 +170,11 @@ export const updateConcentrator = async (
|
||||
"Installed Time": concentratorData["Installed Time"],
|
||||
"Communication Time": concentratorData["Communication Time"],
|
||||
"Instruction Manual": concentratorData["Instruction Manual"],
|
||||
"Gateway ID": concentratorData["Gateway ID"],
|
||||
"Gateway EUI": concentratorData["Gateway EUI"],
|
||||
"Gateway Name": concentratorData["Gateway Name"],
|
||||
"Gateway Description": concentratorData["Gateway Description"],
|
||||
"Antenna Placement": concentratorData["Antenna Placement"],
|
||||
},
|
||||
}),
|
||||
});
|
||||
@@ -175,6 +205,11 @@ export const updateConcentrator = async (
|
||||
"Installed Time": updatedRecord.fields["Installed Time"] || concentratorData["Installed Time"],
|
||||
"Communication Time": updatedRecord.fields["Communication Time"] || concentratorData["Communication Time"],
|
||||
"Instruction Manual": updatedRecord.fields["Instruction Manual"] || concentratorData["Instruction Manual"],
|
||||
"Gateway ID": updatedRecord.fields["Gateway ID"] || concentratorData["Gateway ID"],
|
||||
"Gateway EUI": updatedRecord.fields["Gateway EUI"] || concentratorData["Gateway EUI"],
|
||||
"Gateway Name": updatedRecord.fields["Gateway Name"] || concentratorData["Gateway Name"],
|
||||
"Gateway Description": updatedRecord.fields["Gateway Description"] || concentratorData["Gateway Description"],
|
||||
"Antenna Placement": updatedRecord.fields["Antenna Placement"] || concentratorData["Antenna Placement"],
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error updating concentrator:", error);
|
||||
|
||||
@@ -99,6 +99,11 @@ export default function ConcentratorsPage() {
|
||||
"Installed Time": new Date().toISOString().slice(0, 10),
|
||||
"Communication Time": new Date().toISOString(),
|
||||
"Instruction Manual": "",
|
||||
"Gateway ID": 0,
|
||||
"Gateway EUI": "",
|
||||
"Gateway Name": "",
|
||||
"Gateway Description": "",
|
||||
"Antenna Placement": "Indoor",
|
||||
});
|
||||
|
||||
const [form, setForm] = useState<Omit<Concentrator, "id">>(getEmptyConcentrator());
|
||||
@@ -241,6 +246,11 @@ export default function ConcentratorsPage() {
|
||||
"Installed Time": activeConcentrator["Installed Time"],
|
||||
"Communication Time": activeConcentrator["Communication Time"],
|
||||
"Instruction Manual": activeConcentrator["Instruction Manual"],
|
||||
"Gateway ID": activeConcentrator["Gateway ID"],
|
||||
"Gateway EUI": activeConcentrator["Gateway EUI"],
|
||||
"Gateway Name": activeConcentrator["Gateway Name"],
|
||||
"Gateway Description": activeConcentrator["Gateway Description"],
|
||||
"Antenna Placement": activeConcentrator["Antenna Placement"],
|
||||
});
|
||||
setShowModal(true);
|
||||
}}
|
||||
@@ -415,6 +425,55 @@ export default function ConcentratorsPage() {
|
||||
})
|
||||
}
|
||||
/>
|
||||
|
||||
<input
|
||||
type="number"
|
||||
className="w-full border px-3 py-2 rounded"
|
||||
placeholder="Gateway ID"
|
||||
value={form["Gateway ID"]}
|
||||
onChange={(e) =>
|
||||
setForm({ ...form, "Gateway ID": parseInt(e.target.value) || 0 })
|
||||
}
|
||||
/>
|
||||
|
||||
<input
|
||||
className="w-full border px-3 py-2 rounded"
|
||||
placeholder="Gateway EUI"
|
||||
value={form["Gateway EUI"]}
|
||||
onChange={(e) =>
|
||||
setForm({ ...form, "Gateway EUI": e.target.value })
|
||||
}
|
||||
/>
|
||||
|
||||
<input
|
||||
className="w-full border px-3 py-2 rounded"
|
||||
placeholder="Gateway Name"
|
||||
value={form["Gateway Name"]}
|
||||
onChange={(e) =>
|
||||
setForm({ ...form, "Gateway Name": e.target.value })
|
||||
}
|
||||
/>
|
||||
|
||||
<textarea
|
||||
className="w-full border px-3 py-2 rounded"
|
||||
placeholder="Gateway Description"
|
||||
value={form["Gateway Description"]}
|
||||
onChange={(e) =>
|
||||
setForm({ ...form, "Gateway Description": e.target.value })
|
||||
}
|
||||
rows={3}
|
||||
/>
|
||||
|
||||
<select
|
||||
className="w-full border px-3 py-2 rounded"
|
||||
value={form["Antenna Placement"]}
|
||||
onChange={(e) =>
|
||||
setForm({ ...form, "Antenna Placement": e.target.value })
|
||||
}
|
||||
>
|
||||
<option value="Indoor">Indoor</option>
|
||||
<option value="Outdoor">Outdoor</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user