lokesh341 commited on
Commit
39f07c1
·
verified ·
1 Parent(s): b915064

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +80 -22
templates/index.html CHANGED
@@ -1,27 +1,85 @@
1
  <!DOCTYPE html>
2
- <html>
3
  <head>
4
- <title>Flask Frontend</title>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  </head>
6
  <body>
7
- <h1>Flask App</h1>
8
- <input id="userInput" type="text" placeholder="Enter something">
9
- <button onclick="sendData()">Submit</button>
10
- <p id="responseText"></p>
11
-
12
- <script>
13
- async function sendData() {
14
- const userInput = document.getElementById("userInput").value;
15
-
16
- const response = await fetch('/api/process', {
17
- method: 'POST',
18
- headers: {'Content-Type': 'application/json'},
19
- body: JSON.stringify({input: userInput})
20
- });
21
-
22
- const result = await response.json();
23
- document.getElementById("responseText").innerText = result.result;
24
- }
25
- </script>
 
 
 
 
 
26
  </body>
27
- </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>AI Estimator Dashboard</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ margin: 0;
11
+ padding: 20px;
12
+ background-color: #f4f4f4;
13
+ }
14
+ .container {
15
+ max-width: 800px;
16
+ margin: auto;
17
+ }
18
+ .forecast-card {
19
+ background: white;
20
+ border-radius: 8px;
21
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
22
+ padding: 20px;
23
+ margin-bottom: 20px;
24
+ }
25
+ .forecast-card h3 {
26
+ margin: 0 0 10px;
27
+ color: #333;
28
+ }
29
+ .forecast-card p {
30
+ margin: 5px 0;
31
+ }
32
+ .alert {
33
+ color: red;
34
+ font-weight: bold;
35
+ }
36
+ .download-btn {
37
+ display: inline-block;
38
+ padding: 10px 20px;
39
+ background-color: #007bff;
40
+ color: white;
41
+ text-decoration: none;
42
+ border-radius: 4px;
43
+ margin-top: 10px;
44
+ }
45
+ .download-btn:hover {
46
+ background-color: #0056b3;
47
+ }
48
+ @media (max-width: 600px) {
49
+ .forecast-card {
50
+ padding: 15px;
51
+ }
52
+ .download-btn {
53
+ width: 100%;
54
+ text-align: center;
55
+ }
56
+ }
57
+ </style>
58
  </head>
59
  <body>
60
+ <div class="container">
61
+ <h1>Daily Resource Forecast</h1>
62
+ {% if forecasts %}
63
+ {% for forecast in forecasts %}
64
+ <div class="forecast-card">
65
+ <h3>Project: {{ forecast.project_id }}</h3>
66
+ <p><strong>Date:</strong> {{ forecast.date }}</p>
67
+ <p><strong>Task Type:</strong> {{ forecast.task_type }}</p>
68
+ <p><strong>Materials:</strong>
69
+ Cement: {{ forecast.forecast.material_cement }} tons,
70
+ Steel: {{ forecast.forecast.material_steel }} tons
71
+ </p>
72
+ <p><strong>Labour:</strong> {{ forecast.forecast.labour_count }} workers</p>
73
+ <p><strong>Confidence:</strong> {{ forecast.forecast.confidence * 100 }}%</p>
74
+ {% if forecast.alert_flag %}
75
+ <p class="alert">⚠️ Resource Alert: High material demand</p>
76
+ {% endif %}
77
+ <a href="{{ forecast.pdf_link }}" class="downloadFix button">Download PDF</a>
78
+ </div>
79
+ {% endfor %}
80
+ {% else %}
81
+ <p>No forecasts available.</p>
82
+ {% endif %}
83
+ </div>
84
  </body>
85
+ </html>