update naming flock on frontend to lantai

This commit is contained in:
Alberto-Audrix committed 2026-09-22 13:26:17 +07:00
1 parent 0374a67335
commit 73bdb8c739
2 files changed
+12 -15

No files matched your search

+5 -5
View File
@@ -273,9 +273,9 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
setSelectedFlockId(event.target.value ? Number(event.target.value) : null) setSelectedFlockId(event.target.value ? Number(event.target.value) : null)
} }
className="rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-700" className="rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-700"
aria-label="Pilih flock" aria-label="Pilih lantai"
> >
{flocks.length === 0 && <option value="">Tidak ada flock</option>} {flocks.length === 0 && <option value="">Tidak ada lantai</option>}
{flocks.map((flock) => ( {flocks.map((flock) => (
<option key={flock.id} value={flock.id}> <option key={flock.id} value={flock.id}>
{flock.flock_name} {flock.flock_name}
@@ -289,7 +289,7 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
{selectedFlockId == null ? ( {selectedFlockId == null ? (
<div className={cardClass}> <div className={cardClass}>
<p className="py-8 text-center text-slate-400">Pilih flock untuk melihat data panel IoT.</p> <p className="py-8 text-center text-slate-400">Pilih lantai untuk melihat data panel IoT.</p>
</div> </div>
) : ( ) : (
<div className="flex flex-wrap items-center justify-between gap-2 rounded-xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm text-slate-600"> <div className="flex flex-wrap items-center justify-between gap-2 rounded-xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm text-slate-600">
@@ -436,7 +436,7 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
color: 'text-slate-500', color: 'text-slate-500',
}, },
{ {
label: 'Flock', label: 'Lantai',
value: value:
flocks.find((flock) => flock.id === selectedFlockId)?.flock_name ?? 'N/A', flocks.find((flock) => flock.id === selectedFlockId)?.flock_name ?? 'N/A',
icon: 'fa-warehouse', icon: 'fa-warehouse',
@@ -549,7 +549,7 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
<div className={cardClass}> <div className={cardClass}>
<p className="py-8 text-center text-slate-400"> <p className="py-8 text-center text-slate-400">
{dates.length === 0 {dates.length === 0
? 'Belum ada data panel IoT untuk flock ini. Tanggal tetap bisa dipilih dalam rentang siklus; generate ulang setelah data tersedia.' ? 'Belum ada data panel IoT untuk lantai ini. Refresh halaman setelah data tersedia.'
: `Belum ada data panel IoT untuk ${selectedDate ? formatDateId(selectedDate) : 'tanggal ini'}.`} : `Belum ada data panel IoT untuk ${selectedDate ? formatDateId(selectedDate) : 'tanggal ini'}.`}
</p> </p>
</div> </div>
+7 -10
View File
@@ -157,7 +157,7 @@ const SettingsPage: React.FC = () => {
<div> <div>
<PageHeader <PageHeader
title="Pengaturan" title="Pengaturan"
subtitle="Site, kandang, flock (IoT), dan siklus produksi" subtitle="Site, kandang, lantai (IoT), dan siklus produksi"
/> />
{error && ( {error && (
<div className="mb-4"> <div className="mb-4">
@@ -466,9 +466,9 @@ const SettingsPage: React.FC = () => {
)} )}
</section> </section>
<section className="bg-white rounded-xl shadow-sm p-5"> <section className="bg-white rounded-xl shadow-sm p-5">
<h2 className="font-semibold text-gray-800 mb-3">Flock</h2> <h2 className="font-semibold text-gray-800 mb-3">Lantai</h2>
<p className="mb-3 text-xs text-gray-500"> <p className="mb-3 text-xs text-gray-500">
Lantai tetap untuk kandang ini (dipakai Panel IoT). Tidak terikat ke siklus. Lantai tetap untuk kandang ini (dipakai Panel IoT).
</p> </p>
{isSuperAdmin ? ( {isSuperAdmin ? (
<form <form
@@ -482,13 +482,13 @@ const SettingsPage: React.FC = () => {
kandang: selectedKandangId, kandang: selectedKandangId,
}); });
setFlockName(''); setFlockName('');
flash(`Flock ${created.flock_name} dibuat.`); flash(`Lantai ${created.flock_name} dibuat.`);
}); });
}} }}
> >
<input <input
className={inputClass} className={inputClass}
placeholder="Nama flock" placeholder="Nama lantai"
value={flockName} value={flockName}
onChange={(e) => setFlockName(e.target.value)} onChange={(e) => setFlockName(e.target.value)}
required required
@@ -497,7 +497,7 @@ const SettingsPage: React.FC = () => {
className="bg-red-600 text-white px-3 py-2 rounded-lg text-sm font-semibold" className="bg-red-600 text-white px-3 py-2 rounded-lg text-sm font-semibold"
disabled={saving || !selectedKandangId} disabled={saving || !selectedKandangId}
> >
Tambah flock Tambah lantai
</button> </button>
</form> </form>
) : ( ) : (
@@ -520,7 +520,7 @@ const SettingsPage: React.FC = () => {
onClick={() => onClick={() =>
void wrap(async () => { void wrap(async () => {
await api.flocks.remove(flock.id); await api.flocks.remove(flock.id);
flash('Flock dihapus.'); flash('Lantai dihapus.');
}) })
} }
> >
@@ -543,9 +543,6 @@ const SettingsPage: React.FC = () => {
Salin Salin
</button> </button>
</div> </div>
<p className="text-[11px] text-gray-400">
Konfigurasikan URL ini sebagai tujuan push di Panel IoT.
</p>
</div> </div>
</li> </li>
); );