Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +644 -639
templates/index.html
CHANGED
@@ -1,640 +1,645 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="en">
|
3 |
-
<head>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
</
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
</
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
}
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
}
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
}
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
|
|
|
|
|
|
|
|
|
|
640 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>कृषी बाजार विश्लेषण | Crop Market Analysis</title>
|
7 |
+
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
8 |
+
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
9 |
+
<style>
|
10 |
+
:root {
|
11 |
+
--primary-color: #4CAF50;
|
12 |
+
--secondary-color: #45a049;
|
13 |
+
--background-color: #f9f9f9;
|
14 |
+
--text-color: #333;
|
15 |
+
--card-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
16 |
+
--border-radius: 8px;
|
17 |
+
}
|
18 |
+
|
19 |
+
body {
|
20 |
+
background-color: var(--background-color);
|
21 |
+
color: var(--text-color);
|
22 |
+
font-family: 'Arial', sans-serif;
|
23 |
+
line-height: 1.6;
|
24 |
+
}
|
25 |
+
|
26 |
+
.container {
|
27 |
+
max-width: 1200px;
|
28 |
+
margin: 0 auto;
|
29 |
+
padding: 20px;
|
30 |
+
}
|
31 |
+
|
32 |
+
.header {
|
33 |
+
text-align: center;
|
34 |
+
margin-bottom: 30px;
|
35 |
+
padding: 20px 0;
|
36 |
+
}
|
37 |
+
|
38 |
+
.header h1 {
|
39 |
+
color: var(--primary-color);
|
40 |
+
font-weight: bold;
|
41 |
+
margin: 0;
|
42 |
+
font-size: 2.5rem;
|
43 |
+
}
|
44 |
+
|
45 |
+
.language-toggle {
|
46 |
+
position: fixed;
|
47 |
+
top: 20px;
|
48 |
+
right: 20px;
|
49 |
+
z-index: 1000;
|
50 |
+
}
|
51 |
+
|
52 |
+
.form-section {
|
53 |
+
background: white;
|
54 |
+
padding: 25px;
|
55 |
+
border-radius: var(--border-radius);
|
56 |
+
box-shadow: var(--card-shadow);
|
57 |
+
margin-bottom: 30px;
|
58 |
+
}
|
59 |
+
|
60 |
+
.chart-container {
|
61 |
+
background: white;
|
62 |
+
padding: 25px;
|
63 |
+
border-radius: var(--border-radius);
|
64 |
+
box-shadow: var(--card-shadow);
|
65 |
+
margin-bottom: 30px;
|
66 |
+
}
|
67 |
+
|
68 |
+
.insights-container {
|
69 |
+
background: white;
|
70 |
+
padding: 25px;
|
71 |
+
border-radius: var(--border-radius);
|
72 |
+
box-shadow: var(--card-shadow);
|
73 |
+
margin-bottom: 30px;
|
74 |
+
border-left: 5px solid var(--primary-color);
|
75 |
+
}
|
76 |
+
|
77 |
+
.insights-container h3 {
|
78 |
+
color: var(--primary-color);
|
79 |
+
margin-bottom: 20px;
|
80 |
+
}
|
81 |
+
|
82 |
+
.loading {
|
83 |
+
display: none;
|
84 |
+
text-align: center;
|
85 |
+
padding: 20px;
|
86 |
+
background: rgba(255, 255, 255, 0.9);
|
87 |
+
position: fixed;
|
88 |
+
top: 50%;
|
89 |
+
left: 50%;
|
90 |
+
transform: translate(-50%, -50%);
|
91 |
+
border-radius: var(--border-radius);
|
92 |
+
box-shadow: var(--card-shadow);
|
93 |
+
z-index: 1000;
|
94 |
+
}
|
95 |
+
|
96 |
+
.btn-custom {
|
97 |
+
background-color: var(--primary-color);
|
98 |
+
color: white;
|
99 |
+
border: none;
|
100 |
+
padding: 8px 16px;
|
101 |
+
border-radius: 4px;
|
102 |
+
transition: background-color 0.3s ease;
|
103 |
+
}
|
104 |
+
|
105 |
+
.btn-custom:hover {
|
106 |
+
background-color: var(--secondary-color);
|
107 |
+
color: white;
|
108 |
+
}
|
109 |
+
|
110 |
+
.form-control {
|
111 |
+
border-radius: 4px;
|
112 |
+
border: 1px solid #ddd;
|
113 |
+
padding: 8px 12px;
|
114 |
+
height: auto;
|
115 |
+
}
|
116 |
+
|
117 |
+
.form-control:focus {
|
118 |
+
border-color: var(--primary-color);
|
119 |
+
box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
|
120 |
+
}
|
121 |
+
|
122 |
+
label {
|
123 |
+
font-weight: 500;
|
124 |
+
margin-bottom: 8px;
|
125 |
+
color: var(--text-color);
|
126 |
+
}
|
127 |
+
|
128 |
+
#barChart, #lineChart, #boxChart {
|
129 |
+
width: 100%;
|
130 |
+
margin-bottom: 20px;
|
131 |
+
}
|
132 |
+
|
133 |
+
#aiInsights {
|
134 |
+
line-height: 1.8;
|
135 |
+
font-size: 1.1rem;
|
136 |
+
}
|
137 |
+
|
138 |
+
.alert {
|
139 |
+
border-radius: var(--border-radius);
|
140 |
+
padding: 15px 20px;
|
141 |
+
margin-bottom: 20px;
|
142 |
+
}
|
143 |
+
|
144 |
+
.spinner-border {
|
145 |
+
width: 3rem;
|
146 |
+
height: 3rem;
|
147 |
+
color: var(--primary-color);
|
148 |
+
}
|
149 |
+
|
150 |
+
#marketData {
|
151 |
+
height: 100px; /* Set the height to a fixed value */
|
152 |
+
overflow-y: scroll; /* Add vertical scrolling */
|
153 |
+
}
|
154 |
+
|
155 |
+
.insights-container {
|
156 |
+
background: white;
|
157 |
+
padding: 25px;
|
158 |
+
border-radius: 8px;
|
159 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
160 |
+
margin-bottom: 30px;
|
161 |
+
}
|
162 |
+
|
163 |
+
.insights-header {
|
164 |
+
background: #4CAF50;
|
165 |
+
color: white;
|
166 |
+
padding: 15px 20px;
|
167 |
+
border-radius: 8px 8px 0 0;
|
168 |
+
margin: -25px -25px 20px -25px;
|
169 |
+
}
|
170 |
+
|
171 |
+
.insights-header h3 {
|
172 |
+
margin: 0;
|
173 |
+
color: white;
|
174 |
+
}
|
175 |
+
|
176 |
+
.insight-section {
|
177 |
+
background: #f8f9fa;
|
178 |
+
border-radius: 8px;
|
179 |
+
padding: 20px;
|
180 |
+
margin-bottom: 20px;
|
181 |
+
border-left: 4px solid #4CAF50;
|
182 |
+
}
|
183 |
+
|
184 |
+
.insight-section h4 {
|
185 |
+
color: #2E7D32;
|
186 |
+
margin-bottom: 15px;
|
187 |
+
font-size: 1.2rem;
|
188 |
+
font-weight: bold;
|
189 |
+
}
|
190 |
+
|
191 |
+
.insight-card {
|
192 |
+
background: white;
|
193 |
+
border-radius: 6px;
|
194 |
+
padding: 15px;
|
195 |
+
margin-bottom: 15px;
|
196 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
197 |
+
}
|
198 |
+
|
199 |
+
.insight-card h5 {
|
200 |
+
color: #1B5E20;
|
201 |
+
margin-bottom: 10px;
|
202 |
+
font-size: 1.1rem;
|
203 |
+
}
|
204 |
+
|
205 |
+
.insight-list {
|
206 |
+
list-style: none;
|
207 |
+
padding-left: 0;
|
208 |
+
margin-bottom: 0;
|
209 |
+
}
|
210 |
+
|
211 |
+
.insight-list li {
|
212 |
+
position: relative;
|
213 |
+
padding-left: 20px;
|
214 |
+
margin-bottom: 8px;
|
215 |
+
line-height: 1.5;
|
216 |
+
}
|
217 |
+
|
218 |
+
.insight-list li:before {
|
219 |
+
content: "•";
|
220 |
+
color: #4CAF50;
|
221 |
+
font-size: 1.2em;
|
222 |
+
position: absolute;
|
223 |
+
left: 0;
|
224 |
+
top: -2px;
|
225 |
+
}
|
226 |
+
|
227 |
+
.price-highlight {
|
228 |
+
color: #2E7D32;
|
229 |
+
font-weight: bold;
|
230 |
+
}
|
231 |
+
|
232 |
+
.percentage-up {
|
233 |
+
color: #2E7D32;
|
234 |
+
font-weight: bold;
|
235 |
+
}
|
236 |
+
|
237 |
+
.percentage-down {
|
238 |
+
color: #c62828;
|
239 |
+
font-weight: bold;
|
240 |
+
}
|
241 |
+
|
242 |
+
.action-box {
|
243 |
+
background: #E8F5E9;
|
244 |
+
border-radius: 6px;
|
245 |
+
padding: 15px;
|
246 |
+
margin-top: 20px;
|
247 |
+
border: 1px dashed #4CAF50;
|
248 |
+
}
|
249 |
+
|
250 |
+
.action-box h5 {
|
251 |
+
color: #2E7D32;
|
252 |
+
margin-bottom: 10px;
|
253 |
+
font-size: 1.1rem;
|
254 |
+
}
|
255 |
+
|
256 |
+
.action-list {
|
257 |
+
list-style: none;
|
258 |
+
padding-left: 0;
|
259 |
+
margin-bottom: 0;
|
260 |
+
}
|
261 |
+
|
262 |
+
.action-list li {
|
263 |
+
position: relative;
|
264 |
+
padding-left: 25px;
|
265 |
+
margin-bottom: 8px;
|
266 |
+
line-height: 1.5;
|
267 |
+
}
|
268 |
+
|
269 |
+
.action-list li:before {
|
270 |
+
content: "✓";
|
271 |
+
color: #4CAF50;
|
272 |
+
position: absolute;
|
273 |
+
left: 0;
|
274 |
+
font-weight: bold;
|
275 |
+
}
|
276 |
+
|
277 |
+
/* Responsive adjustments */
|
278 |
+
@media (max-width: 768px) {
|
279 |
+
.insights-container {
|
280 |
+
padding: 15px;
|
281 |
+
}
|
282 |
+
|
283 |
+
.insights-header {
|
284 |
+
padding: 12px 15px;
|
285 |
+
margin: -15px -15px 15px -15px;
|
286 |
+
}
|
287 |
+
|
288 |
+
.insight-section {
|
289 |
+
padding: 15px;
|
290 |
+
}
|
291 |
+
}
|
292 |
+
@media (max-width: 768px) {
|
293 |
+
.container {
|
294 |
+
padding: 10px;
|
295 |
+
}
|
296 |
+
|
297 |
+
.header h1 {
|
298 |
+
font-size: 2rem;
|
299 |
+
}
|
300 |
+
|
301 |
+
.form-row {
|
302 |
+
flex-direction: column;
|
303 |
+
}
|
304 |
+
|
305 |
+
.form-group {
|
306 |
+
margin-bottom: 15px;
|
307 |
+
}
|
308 |
+
|
309 |
+
.language-toggle {
|
310 |
+
position: static;
|
311 |
+
text-align: center;
|
312 |
+
margin-bottom: 20px;
|
313 |
+
}
|
314 |
+
|
315 |
+
.btn-custom {
|
316 |
+
width: 100%;
|
317 |
+
}
|
318 |
+
|
319 |
+
.insights-container {
|
320 |
+
padding: 15px;
|
321 |
+
}
|
322 |
+
|
323 |
+
#aiInsights {
|
324 |
+
font-size: 1rem;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
select {
|
328 |
+
max-height: 200px; /* Adjust height as needed */
|
329 |
+
overflow-y: auto;
|
330 |
+
}
|
331 |
+
</style>
|
332 |
+
</head>
|
333 |
+
<body>
|
334 |
+
<div class="language-toggle">
|
335 |
+
<button class="btn btn-custom" onclick="toggleLanguage()" id="langToggle">
|
336 |
+
भाषा बदला | Change Language
|
337 |
+
</button>
|
338 |
+
</div>
|
339 |
+
|
340 |
+
<div class="container">
|
341 |
+
<div class="header">
|
342 |
+
<h1 class="en">Crop Market Analysis</h1>
|
343 |
+
<h1 class="mr" style="display:none;">कृषी बाजार विश्लेषण</h1>
|
344 |
+
</div>
|
345 |
+
|
346 |
+
<div class="form-section">
|
347 |
+
<form id="filterForm">
|
348 |
+
<div class="form-row">
|
349 |
+
<div class="form-group col-md-3">
|
350 |
+
<label for="state" class="label-state">State</label>
|
351 |
+
<select class="form-control" id="state" name="state">
|
352 |
+
<option value="">Select State</option>
|
353 |
+
{% for state in states %}
|
354 |
+
<option value="{{ state }}">{{ state }}</option>
|
355 |
+
{% endfor %}
|
356 |
+
</select>
|
357 |
+
</div>
|
358 |
+
<div class="form-group col-md-3">
|
359 |
+
<label for="district" class="label-district">District</label>
|
360 |
+
<select class="form-control" id="district" name="district" disabled>
|
361 |
+
<option value="">Select District</option>
|
362 |
+
</select>
|
363 |
+
</div>
|
364 |
+
<div class="form-group col-md-3">
|
365 |
+
<label for="market" class="label-market">Market</label>
|
366 |
+
<select class="form-control" id="market" name="market" disabled>
|
367 |
+
<option value="">Select Market</option>
|
368 |
+
</select>
|
369 |
+
</div>
|
370 |
+
<div class="form-group col-md-3">
|
371 |
+
<label for="commodity" class="label-commodity">Commodity</label>
|
372 |
+
<select class="form-control" id="commodity" name="commodity" disabled>
|
373 |
+
<option value="">Select Commodity</option>
|
374 |
+
</select>
|
375 |
+
</div>
|
376 |
+
</div>
|
377 |
+
</form>
|
378 |
+
</div>
|
379 |
+
|
380 |
+
<div class="loading" id="loadingIndicator">
|
381 |
+
<div class="spinner-border" role="status">
|
382 |
+
<span class="sr-only">Loading...</span>
|
383 |
+
</div>
|
384 |
+
</div>
|
385 |
+
|
386 |
+
<div class="chart-container">
|
387 |
+
<div id="barChart"></div>
|
388 |
+
<div id="lineChart"></div>
|
389 |
+
<div id="boxChart"></div>
|
390 |
+
</div>
|
391 |
+
|
392 |
+
<div class="market-data-container">
|
393 |
+
<div class="row">
|
394 |
+
<div class="col-md-12 mb-4">
|
395 |
+
<div class="card">
|
396 |
+
<div class="card-header">
|
397 |
+
<h4 class="en">Market Statistics</h4>
|
398 |
+
<h4 class="mr" style="display:none;">बाजार आकडेवारी</h4>
|
399 |
+
</div>
|
400 |
+
<div class="card-body">
|
401 |
+
<div class="row">
|
402 |
+
<div class="col-md-3">
|
403 |
+
<div class="stat-item">
|
404 |
+
<h6 class="en">Total Commodities</h6>
|
405 |
+
<h6 class="mr" style="display:none;">एकूण पिके</h6>
|
406 |
+
<span id="totalCommodities"></span>
|
407 |
+
</div>
|
408 |
+
</div>
|
409 |
+
<div class="col-md-3">
|
410 |
+
<div class="stat-item">
|
411 |
+
<h6 class="en">Average Price</h6>
|
412 |
+
<h6 class="mr" style="display:none;">सरासरी किंमत</h6>
|
413 |
+
<span id="avgPrice"></span>
|
414 |
+
</div>
|
415 |
+
</div>
|
416 |
+
<div class="col-md-3">
|
417 |
+
<div class="stat-item">
|
418 |
+
<h6 class="en">Price Range</h6>
|
419 |
+
<h6 class="mr" style="display:none;">किंमत श्रेणी</h6>
|
420 |
+
<span id="priceRange"></span>
|
421 |
+
</div>
|
422 |
+
</div>
|
423 |
+
<div class="col-md-3">
|
424 |
+
<div class="stat-item">
|
425 |
+
<h6 class="en">Total Markets</h6>
|
426 |
+
<h6 class="mr" style="display:none;">एकूण बाजार</h6>
|
427 |
+
<span id="totalMarkets"></span>
|
428 |
+
</div>
|
429 |
+
</div>
|
430 |
+
</div>
|
431 |
+
</div>
|
432 |
+
</div>
|
433 |
+
</div>
|
434 |
+
</div>
|
435 |
+
|
436 |
+
<div class="row">
|
437 |
+
<div class="col-md-6 mb-4">
|
438 |
+
<div class="card">
|
439 |
+
<div class="card-header">
|
440 |
+
<h4 class="en">Top 5 Cheapest Crops</h4>
|
441 |
+
<h4 class="mr" style="display:none;">सर्वात स्वस्त 5 पिके</h4>
|
442 |
+
</div>
|
443 |
+
<div class="card-body" id="cheapestCrops">
|
444 |
+
</div>
|
445 |
+
</div>
|
446 |
+
</div>
|
447 |
+
<div class="col-md-6 mb-4">
|
448 |
+
<div class="card">
|
449 |
+
<div class="card-header">
|
450 |
+
<h4 class="en">Top 5 Costliest Crops</h4>
|
451 |
+
<h4 class="mr" style="display:none;">सर्वात महाग 5 पिके</h4>
|
452 |
+
</div>
|
453 |
+
<div class="card-body" id="costliestCrops">
|
454 |
+
</div>
|
455 |
+
</div>
|
456 |
+
</div>
|
457 |
+
</div>
|
458 |
+
|
459 |
+
<div class="card mb-4">
|
460 |
+
<div class="card-header">
|
461 |
+
<h4 class="en">Market Data</h4>
|
462 |
+
<h4 class="mr" style="display:none;">बाजार माहिती</h4>
|
463 |
+
</div>
|
464 |
+
<div class="card-body" id="marketData">
|
465 |
+
</div>
|
466 |
+
</div>
|
467 |
+
</div>
|
468 |
+
|
469 |
+
<div class="insights-container">
|
470 |
+
<div id="aiInsights"></div>
|
471 |
+
</div>
|
472 |
+
</div>
|
473 |
+
|
474 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
475 |
+
<script>
|
476 |
+
let currentLang = 'en';
|
477 |
+
|
478 |
+
// Update label texts based on translations from the server
|
479 |
+
function updateLabels(translations) {
|
480 |
+
if (currentLang === 'mr') {
|
481 |
+
Object.keys(translations).forEach(key => {
|
482 |
+
$(.label-${key}).text(translations[key]);
|
483 |
+
});
|
484 |
+
$('.en').hide();
|
485 |
+
$('.mr').show();
|
486 |
+
} else {
|
487 |
+
$('.label-state').text('State');
|
488 |
+
$('.label-district').text('District');
|
489 |
+
$('.label-market').text('Market');
|
490 |
+
$('.label-commodity').text('Commodity');
|
491 |
+
$('.en').show();
|
492 |
+
$('.mr').hide();
|
493 |
+
}
|
494 |
+
}
|
495 |
+
|
496 |
+
// Toggle the language and update content
|
497 |
+
function toggleLanguage() {
|
498 |
+
currentLang = currentLang === 'en' ? 'mr' : 'en';
|
499 |
+
$('#langToggle').text(currentLang === 'en' ? 'भाषा बदला | Change Language' : 'भाषा बदला | Change Language');
|
500 |
+
updateContent();
|
501 |
+
}
|
502 |
+
|
503 |
+
// Show and hide the loading indicator
|
504 |
+
function showLoading() {
|
505 |
+
$('#loadingIndicator').show();
|
506 |
+
}
|
507 |
+
function hideLoading() {
|
508 |
+
$('#loadingIndicator').hide();
|
509 |
+
}
|
510 |
+
|
511 |
+
// Enable/disable a select element by its id
|
512 |
+
function enableSelect(selectId) {
|
513 |
+
$(#${selectId}).prop('disabled', false);
|
514 |
+
}
|
515 |
+
function disableSelect(selectId) {
|
516 |
+
$(#${selectId}).prop('disabled', true);
|
517 |
+
}
|
518 |
+
|
519 |
+
// Update content by sending the form data (with language info) to the backend
|
520 |
+
function updateContent() {
|
521 |
+
showLoading();
|
522 |
+
const formData = new FormData($('#filterForm')[0]);
|
523 |
+
formData.append('language', currentLang);
|
524 |
+
|
525 |
+
$.ajax({
|
526 |
+
url: '/filter_data',
|
527 |
+
method: 'POST',
|
528 |
+
data: formData,
|
529 |
+
processData: false,
|
530 |
+
contentType: false,
|
531 |
+
success: function(response) {
|
532 |
+
if (response.success) {
|
533 |
+
// Update plots
|
534 |
+
if (response.plots.bar) $('#barChart').html(response.plots.bar);
|
535 |
+
if (response.plots.line) $('#lineChart').html(response.plots.line);
|
536 |
+
if (response.plots.box) $('#boxChart').html(response.plots.box);
|
537 |
+
|
538 |
+
// Update market statistics
|
539 |
+
$('#totalCommodities').text(response.market_stats.total_commodities);
|
540 |
+
$('#avgPrice').text(response.market_stats.avg_modal_price);
|
541 |
+
$('#priceRange').text(response.market_stats.price_range);
|
542 |
+
$('#totalMarkets').text(response.market_stats.total_markets);
|
543 |
+
|
544 |
+
// Update tables
|
545 |
+
$('#marketData').html(response.market_html);
|
546 |
+
$('#cheapestCrops').html(response.cheapest_html);
|
547 |
+
$('#costliestCrops').html(response.costliest_html);
|
548 |
+
|
549 |
+
// Show insights only if state and district are selected
|
550 |
+
if (response.hasStateDistrict) {
|
551 |
+
$('.insights-container').show();
|
552 |
+
$('#aiInsights').html(response.insights);
|
553 |
+
} else {
|
554 |
+
$('.insights-container').hide();
|
555 |
+
$('#aiInsights').html('');
|
556 |
+
}
|
557 |
+
|
558 |
+
// Update translations for labels
|
559 |
+
updateLabels(response.translations);
|
560 |
+
console.log(response.translations);
|
561 |
+
} else {
|
562 |
+
const message = currentLang === 'en' ?
|
563 |
+
'Please select both state and district to view analysis' :
|
564 |
+
'कृपया विश्लेषण पाहण्यासाठी राज्य आणि जिल्हा निवडा';
|
565 |
+
alert(message);
|
566 |
+
}
|
567 |
+
hideLoading();
|
568 |
+
},
|
569 |
+
error: function() {
|
570 |
+
alert(currentLang === 'en' ? 'Error loading data' : 'माहिती लोड करताना त्रुटी');
|
571 |
+
hideLoading();
|
572 |
+
}
|
573 |
+
});
|
574 |
+
}
|
575 |
+
|
576 |
+
// Cascade dropdowns
|
577 |
+
$('#state').change(function() {
|
578 |
+
const state = $(this).val();
|
579 |
+
// Reset and disable dependent dropdowns
|
580 |
+
$('#district, #market, #commodity').html('<option value="">Select</option>').prop('disabled', true);
|
581 |
+
|
582 |
+
if (state) {
|
583 |
+
showLoading();
|
584 |
+
$.post('/get_districts', { state: state }, function(districts) {
|
585 |
+
$('#district').html('<option value="">Select District</option>');
|
586 |
+
districts.forEach(district => {
|
587 |
+
$('#district').append(<option value="${district}">${district}</option>);
|
588 |
+
});
|
589 |
+
enableSelect('district');
|
590 |
+
hideLoading();
|
591 |
+
});
|
592 |
+
}
|
593 |
+
updateContent();
|
594 |
+
});
|
595 |
+
|
596 |
+
$('#district').change(function() {
|
597 |
+
const district = $(this).val();
|
598 |
+
// Reset and disable dependent dropdowns
|
599 |
+
$('#market, #commodity').html('<option value="">Select</option>').prop('disabled', true);
|
600 |
+
|
601 |
+
if (district) {
|
602 |
+
showLoading();
|
603 |
+
$.post('/get_markets', { district: district }, function(markets) {
|
604 |
+
$('#market').html('<option value="">Select Market</option>');
|
605 |
+
markets.forEach(market => {
|
606 |
+
$('#market').append(<option value="${market}">${market}</option>);
|
607 |
+
});
|
608 |
+
enableSelect('market');
|
609 |
+
hideLoading();
|
610 |
+
});
|
611 |
+
}
|
612 |
+
updateContent();
|
613 |
+
});
|
614 |
+
|
615 |
+
$('#market').change(function() {
|
616 |
+
const market = $(this).val();
|
617 |
+
// Reset commodity dropdown
|
618 |
+
$('#commodity').html('<option value="">Select</option>').prop('disabled', true);
|
619 |
+
|
620 |
+
if (market) {
|
621 |
+
showLoading();
|
622 |
+
$.post('/get_commodities', { market: market }, function(commodities) {
|
623 |
+
$('#commodity').html('<option value="">Select Commodity</option>');
|
624 |
+
commodities.forEach(commodity => {
|
625 |
+
$('#commodity').append(<option value="${commodity}">${commodity}</option>);
|
626 |
+
});
|
627 |
+
enableSelect('commodity');
|
628 |
+
hideLoading();
|
629 |
+
});
|
630 |
+
}
|
631 |
+
updateContent();
|
632 |
+
});
|
633 |
+
|
634 |
+
$('#commodity').change(function() {
|
635 |
+
updateContent();
|
636 |
+
});
|
637 |
+
|
638 |
+
// Initial setup
|
639 |
+
$(document).ready(function() {
|
640 |
+
$('.insights-container').hide();
|
641 |
+
updateContent();
|
642 |
+
});
|
643 |
+
</script>
|
644 |
+
</body>
|
645 |
</html>
|