diff --git a/crop-x-new/next-env.d.ts b/crop-x-new/next-env.d.ts index c4b7818..9edff1c 100644 --- a/crop-x-new/next-env.d.ts +++ b/crop-x-new/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/crop-x-new/package-lock.json b/crop-x-new/package-lock.json index 5b49d96..c846cd7 100644 --- a/crop-x-new/package-lock.json +++ b/crop-x-new/package-lock.json @@ -39,6 +39,7 @@ "axios": "^1.13.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "date-fns": "^4.1.0", "dotenv": "^17.2.3", "lucide-react": "^0.553.0", "next": "16.0.1", @@ -46,7 +47,9 @@ "npx": "^10.2.2", "openapi-fetch": "^0.15.0", "react": "19.2.0", + "react-day-picker": "^9.11.1", "react-dom": "19.2.0", + "react-hook-form": "^7.66.0", "recharts": "^3.4.1", "sonner": "^2.0.7", "tailwind-merge": "^3.4.0", @@ -60,6 +63,7 @@ "@types/react-dom": "^19", "eslint": "^9", "eslint-config-next": "16.0.1", + "eslint-plugin-unused-imports": "^4.3.0", "tailwindcss": "^4", "tw-animate-css": "^1.4.0", "typescript": "^5" @@ -318,6 +322,12 @@ "node": ">=6.9.0" } }, + "node_modules/@date-fns/tz": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/@date-fns/tz/-/tz-1.4.1.tgz", + "integrity": "sha512-P5LUNhtbj6YfI3iJjw5EL9eUAG6OitD0W3fWQcpQjDRc/QIsL0tRNuO1PcDvPccWL1fSTXXdE1ds+l95DV/OFA==", + "license": "MIT" + }, "node_modules/@emnapi/core": { "version": "1.7.0", "resolved": "https://registry.npmmirror.com/@emnapi/core/-/core-1.7.0.tgz", @@ -4924,6 +4934,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/date-fns": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/date-fns/-/date-fns-4.1.0.tgz", + "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, + "node_modules/date-fns-jalali": { + "version": "4.1.0-0", + "resolved": "https://registry.npmmirror.com/date-fns-jalali/-/date-fns-jalali-4.1.0-0.tgz", + "integrity": "sha512-hTIP/z+t+qKwBDcmmsnmjWTduxCg+5KfdqWQvb2X/8C9+knYY6epN/pfxdDuyVlSVeFz0sM5eEfwIUQ70U4ckg==", + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", @@ -5671,6 +5697,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-plugin-unused-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.3.0.tgz", + "integrity": "sha512-ZFBmXMGBYfHttdRtOG9nFFpmUvMtbHSjsKrS20vdWdbfiVYsO3yA2SGYy9i9XmZJDfMGBflZGBCm70SEnFQtOA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0", + "eslint": "^9.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + } + } + }, "node_modules/eslint-scope": { "version": "8.4.0", "resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-8.4.0.tgz", @@ -12544,6 +12586,27 @@ "node": ">=0.10.0" } }, + "node_modules/react-day-picker": { + "version": "9.11.1", + "resolved": "https://registry.npmmirror.com/react-day-picker/-/react-day-picker-9.11.1.tgz", + "integrity": "sha512-l3ub6o8NlchqIjPKrRFUCkTUEq6KwemQlfv3XZzzwpUeGwmDJ+0u0Upmt38hJyd7D/vn2dQoOoLV/qAp0o3uUw==", + "license": "MIT", + "dependencies": { + "@date-fns/tz": "^1.4.1", + "date-fns": "^4.1.0", + "date-fns-jalali": "^4.1.0-0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/gpbl" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/react-dom": { "version": "19.2.0", "resolved": "https://registry.npmmirror.com/react-dom/-/react-dom-19.2.0.tgz", @@ -12556,6 +12619,22 @@ "react": "^19.2.0" } }, + "node_modules/react-hook-form": { + "version": "7.66.0", + "resolved": "https://registry.npmmirror.com/react-hook-form/-/react-hook-form-7.66.0.tgz", + "integrity": "sha512-xXBqsWGKrY46ZqaHDo+ZUYiMUgi8suYu5kdrS20EG8KiL7VRQitEbNjm+UcrDYrNi1YLyfpmAeGjCZYXLT9YBw==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18 || ^19" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmmirror.com/react-is/-/react-is-16.13.1.tgz", diff --git a/crop-x-new/package.json b/crop-x-new/package.json index 4b3fe96..3c181ce 100644 --- a/crop-x-new/package.json +++ b/crop-x-new/package.json @@ -42,6 +42,7 @@ "axios": "^1.13.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "date-fns": "^4.1.0", "dotenv": "^17.2.3", "lucide-react": "^0.553.0", "next": "16.0.1", @@ -49,7 +50,9 @@ "npx": "^10.2.2", "openapi-fetch": "^0.15.0", "react": "19.2.0", + "react-day-picker": "^9.11.1", "react-dom": "19.2.0", + "react-hook-form": "^7.66.0", "recharts": "^3.4.1", "sonner": "^2.0.7", "tailwind-merge": "^3.4.0", @@ -63,6 +66,7 @@ "@types/react-dom": "^19", "eslint": "^9", "eslint-config-next": "16.0.1", + "eslint-plugin-unused-imports": "^4.3.0", "tailwindcss": "^4", "tw-animate-css": "^1.4.0", "typescript": "^5" diff --git a/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/device-parameter/components/AddParameterDialog.tsx b/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/device-parameter/components/AddParameterDialog.tsx index 7cf085b..0d00078 100644 --- a/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/device-parameter/components/AddParameterDialog.tsx +++ b/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/device-parameter/components/AddParameterDialog.tsx @@ -147,7 +147,7 @@ export function AddParameterDialog({ open, onOpenChange, editingParam, selectedT if (paramForm.min) newParam.min = parseFloat(paramForm.min); if (paramForm.max) newParam.max = parseFloat(paramForm.max); } else if (paramForm.type === 'boolean') { - newParam.defaultValue = paramForm.defaultValue === 'true' || paramForm.defaultValue === true; + newParam.defaultValue = String(paramForm.defaultValue).toLowerCase() === 'true'; } else if (paramForm.type === 'select') { newParam.options = paramForm.options; newParam.defaultValue = paramForm.defaultValue || (paramForm.options[0]?.value || ''); diff --git a/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/iot/page.tsx b/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/iot/page.tsx index c0ba227..d2d640a 100644 --- a/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/iot/page.tsx +++ b/crop-x-new/src/app/(app)/ai-crop-model/data-sense-center/iot/page.tsx @@ -1082,11 +1082,10 @@ export default function IoTIoTPage() {
diff --git a/crop-x-new/src/app/(app)/ai-crop-model/model-application/generation/components/ApplicationList.tsx b/crop-x-new/src/app/(app)/ai-crop-model/model-application/generation/components/ApplicationList.tsx index e77866b..d92c764 100644 --- a/crop-x-new/src/app/(app)/ai-crop-model/model-application/generation/components/ApplicationList.tsx +++ b/crop-x-new/src/app/(app)/ai-crop-model/model-application/generation/components/ApplicationList.tsx @@ -33,6 +33,7 @@ import { Table as TableIcon, Type, Rocket, + AlertCircle } from 'lucide-react'; import { toast } from 'sonner'; @@ -271,7 +272,7 @@ export default function ApplicationList({ state, dispatch }: ApplicationListProp