update naming flock on frontend to lantai
This commit is contained in:
1 parent
0374a67335
commit
73bdb8c739
2 files changed
+12
-15
No files matched your search
@@ -273,9 +273,9 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
|
||||
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"
|
||||
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) => (
|
||||
<option key={flock.id} value={flock.id}>
|
||||
{flock.flock_name}
|
||||
@@ -289,7 +289,7 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
|
||||
|
||||
{selectedFlockId == null ? (
|
||||
<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 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',
|
||||
},
|
||||
{
|
||||
label: 'Flock',
|
||||
label: 'Lantai',
|
||||
value:
|
||||
flocks.find((flock) => flock.id === selectedFlockId)?.flock_name ?? 'N/A',
|
||||
icon: 'fa-warehouse',
|
||||
@@ -549,7 +549,7 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => {
|
||||
<div className={cardClass}>
|
||||
<p className="py-8 text-center text-slate-400">
|
||||
{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'}.`}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -157,7 +157,7 @@ const SettingsPage: React.FC = () => {
|
||||
<div>
|
||||
<PageHeader
|
||||
title="Pengaturan"
|
||||
subtitle="Site, kandang, flock (IoT), dan siklus produksi"
|
||||
subtitle="Site, kandang, lantai (IoT), dan siklus produksi"
|
||||
/>
|
||||
{error && (
|
||||
<div className="mb-4">
|
||||
@@ -466,9 +466,9 @@ const SettingsPage: React.FC = () => {
|
||||
)}
|
||||
</section>
|
||||
<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">
|
||||
Lantai tetap untuk kandang ini (dipakai Panel IoT). Tidak terikat ke siklus.
|
||||
Lantai tetap untuk kandang ini (dipakai Panel IoT).
|
||||
</p>
|
||||
{isSuperAdmin ? (
|
||||
<form
|
||||
@@ -482,13 +482,13 @@ const SettingsPage: React.FC = () => {
|
||||
kandang: selectedKandangId,
|
||||
});
|
||||
setFlockName('');
|
||||
flash(`Flock ${created.flock_name} dibuat.`);
|
||||
flash(`Lantai ${created.flock_name} dibuat.`);
|
||||
});
|
||||
}}
|
||||
>
|
||||
<input
|
||||
className={inputClass}
|
||||
placeholder="Nama flock"
|
||||
placeholder="Nama lantai"
|
||||
value={flockName}
|
||||
onChange={(e) => setFlockName(e.target.value)}
|
||||
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"
|
||||
disabled={saving || !selectedKandangId}
|
||||
>
|
||||
Tambah flock
|
||||
Tambah lantai
|
||||
</button>
|
||||
</form>
|
||||
) : (
|
||||
@@ -520,7 +520,7 @@ const SettingsPage: React.FC = () => {
|
||||
onClick={() =>
|
||||
void wrap(async () => {
|
||||
await api.flocks.remove(flock.id);
|
||||
flash('Flock dihapus.');
|
||||
flash('Lantai dihapus.');
|
||||
})
|
||||
}
|
||||
>
|
||||
@@ -543,9 +543,6 @@ const SettingsPage: React.FC = () => {
|
||||
Salin
|
||||
</button>
|
||||
</div>
|
||||
<p className="text-[11px] text-gray-400">
|
||||
Konfigurasikan URL ini sebagai tujuan push di Panel IoT.
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user