- Core infrastructure: Zustand store, API client with mock fallback - Mode detection: Port 8080 (kiosk) / 9090 (remote) - Dashboard components: RainfallCard, ClockDisplay, CommStatus - Header components: VoltageDisplay, BatteryStatus, LoginIndicator - Data polling with visibility awareness - Bundle size: ~100KB gzipped Also adds README.md and WIKI.md documentation
70 lines
2.4 KiB
TypeScript
70 lines
2.4 KiB
TypeScript
import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
|
|
import { Input } from "../ui/input";
|
|
import { Button } from "../ui/button";
|
|
import { Label } from "../ui/label";
|
|
import { Switch } from "../ui/switch";
|
|
import { CloudRain } from "lucide-react";
|
|
|
|
export function RainfallSettingView() {
|
|
return (
|
|
<div className="space-y-4">
|
|
<div className="flex items-center gap-3">
|
|
<CloudRain className="w-6 h-6 text-blue-400" />
|
|
<h1 className="text-2xl font-bold text-white">Rainfall Setting</h1>
|
|
</div>
|
|
|
|
<Card className="bg-gray-900 border-gray-700">
|
|
<CardHeader>
|
|
<CardTitle className="text-white">Rainfall Configuration</CardTitle>
|
|
</CardHeader>
|
|
<CardContent className="space-y-4">
|
|
<div className="flex items-center justify-between p-3 bg-gray-800 rounded">
|
|
<Label htmlFor="rain-enable" className="text-gray-300">Enable Rainfall Sensor</Label>
|
|
<Switch id="rain-enable" defaultChecked />
|
|
</div>
|
|
|
|
<div className="space-y-2">
|
|
<Label htmlFor="bucket-size" className="text-gray-300">Bucket Size (mm)</Label>
|
|
<Input
|
|
id="bucket-size"
|
|
type="number"
|
|
defaultValue="0.2"
|
|
step="0.1"
|
|
className="bg-gray-800 border-gray-700 text-white"
|
|
/>
|
|
</div>
|
|
|
|
<div className="space-y-2">
|
|
<Label htmlFor="sample-interval" className="text-gray-300">Sample Interval (minutes)</Label>
|
|
<Input
|
|
id="sample-interval"
|
|
type="number"
|
|
defaultValue="5"
|
|
className="bg-gray-800 border-gray-700 text-white"
|
|
/>
|
|
</div>
|
|
|
|
<div className="space-y-2">
|
|
<Label htmlFor="alarm-threshold" className="text-gray-300">Alarm Threshold (mm/hr)</Label>
|
|
<Input
|
|
id="alarm-threshold"
|
|
type="number"
|
|
defaultValue="50"
|
|
className="bg-gray-800 border-gray-700 text-white"
|
|
/>
|
|
</div>
|
|
|
|
<div className="flex gap-3 pt-2">
|
|
<Button className="flex-1 bg-blue-600 hover:bg-blue-700">
|
|
Save Settings
|
|
</Button>
|
|
<Button variant="outline" className="flex-1 border-gray-700 text-gray-300 hover:bg-gray-800">
|
|
Reset to Default
|
|
</Button>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|