Spaces:
Running
Running
Add 3 files
Browse files- README.md +6 -4
- index.html +591 -19
- prompts.txt +2 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: vxzfc
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: pink
|
5 |
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,591 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>Commissioning Management Dashboard</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
9 |
+
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
|
10 |
+
<style>
|
11 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
12 |
+
|
13 |
+
body {
|
14 |
+
font-family: 'Inter', sans-serif;
|
15 |
+
background-color: #f8fafc;
|
16 |
+
}
|
17 |
+
|
18 |
+
.card-hover {
|
19 |
+
transition: all 0.3s ease;
|
20 |
+
}
|
21 |
+
|
22 |
+
.card-hover:hover {
|
23 |
+
transform: translateY(-5px);
|
24 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
25 |
+
}
|
26 |
+
|
27 |
+
.animate-fadeIn {
|
28 |
+
animation: fadeIn 0.5s ease-in;
|
29 |
+
}
|
30 |
+
|
31 |
+
@keyframes fadeIn {
|
32 |
+
from { opacity: 0; }
|
33 |
+
to { opacity: 1; }
|
34 |
+
}
|
35 |
+
|
36 |
+
.progress-bar {
|
37 |
+
height: 6px;
|
38 |
+
border-radius: 3px;
|
39 |
+
background-color: #e2e8f0;
|
40 |
+
}
|
41 |
+
|
42 |
+
.progress-bar-fill {
|
43 |
+
height: 100%;
|
44 |
+
border-radius: 3px;
|
45 |
+
transition: width 0.6s ease;
|
46 |
+
}
|
47 |
+
</style>
|
48 |
+
</head>
|
49 |
+
<body class="bg-gray-50">
|
50 |
+
<div class="container mx-auto px-4 py-8">
|
51 |
+
<header class="mb-8">
|
52 |
+
<h1 class="text-3xl font-bold text-gray-800">Commissioning Management Dashboard</h1>
|
53 |
+
<p class="text-gray-600">Real-time tracking of form status, item progress, and punch list clearance</p>
|
54 |
+
</header>
|
55 |
+
|
56 |
+
<!-- Section 1: Summary Cards -->
|
57 |
+
<section class="mb-12 animate-fadeIn">
|
58 |
+
<h2 class="text-xl font-semibold mb-6 text-gray-700">Key Performance Indicators</h2>
|
59 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6" id="kpiCards">
|
60 |
+
<!-- Cards will be dynamically inserted here -->
|
61 |
+
<div class="bg-white rounded-xl shadow-sm p-6 card-hover flex items-center">
|
62 |
+
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div>
|
63 |
+
<span class="ml-4 text-gray-500">Loading KPIs...</span>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
</section>
|
67 |
+
|
68 |
+
<!-- Section 2: Item Progress by Discipline -->
|
69 |
+
<section class="mb-12 animate-fadeIn">
|
70 |
+
<div class="flex justify-between items-center mb-6">
|
71 |
+
<h2 class="text-xl font-semibold text-gray-700">Item Progress by Discipline</h2>
|
72 |
+
<div class="flex space-x-2">
|
73 |
+
<button class="px-3 py-1 bg-blue-50 text-blue-600 rounded-md text-sm font-medium">Export</button>
|
74 |
+
<button class="px-3 py-1 bg-blue-50 text-blue-600 rounded-md text-sm font-medium">Filter</button>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<div class="bg-white rounded-xl shadow-sm overflow-hidden mb-8">
|
79 |
+
<div class="overflow-x-auto">
|
80 |
+
<table class="min-w-full divide-y divide-gray-200" id="itemProgressTable">
|
81 |
+
<thead class="bg-gray-50">
|
82 |
+
<tr>
|
83 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Discipline</th>
|
84 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Items</th>
|
85 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Done</th>
|
86 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">In Progress</th>
|
87 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Hold</th>
|
88 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Remain</th>
|
89 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Progress</th>
|
90 |
+
</tr>
|
91 |
+
</thead>
|
92 |
+
<tbody class="bg-white divide-y divide-gray-200" id="itemProgressBody">
|
93 |
+
<!-- Data will be dynamically inserted here -->
|
94 |
+
<tr>
|
95 |
+
<td colspan="7" class="px-6 py-4 text-center text-gray-500">
|
96 |
+
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto"></div>
|
97 |
+
<span class="ml-2">Loading item progress data...</span>
|
98 |
+
</td>
|
99 |
+
</tr>
|
100 |
+
</tbody>
|
101 |
+
</table>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<div class="bg-white rounded-xl shadow-sm p-6">
|
106 |
+
<canvas id="itemProgressChart"></canvas>
|
107 |
+
</div>
|
108 |
+
</section>
|
109 |
+
|
110 |
+
<!-- Section 3: Punch List Status by Discipline -->
|
111 |
+
<section class="animate-fadeIn">
|
112 |
+
<div class="flex justify-between items-center mb-6">
|
113 |
+
<h2 class="text-xl font-semibold text-gray-700">Punch List Status by Discipline</h2>
|
114 |
+
<div class="flex space-x-2">
|
115 |
+
<button class="px-3 py-1 bg-blue-50 text-blue-600 rounded-md text-sm font-medium">Export</button>
|
116 |
+
<button class="px-3 py-1 bg-blue-50 text-blue-600 rounded-md text-sm font-medium">Filter</button>
|
117 |
+
</div>
|
118 |
+
</div>
|
119 |
+
|
120 |
+
<div class="bg-white rounded-xl shadow-sm overflow-hidden mb-8">
|
121 |
+
<div class="overflow-x-auto">
|
122 |
+
<table class="min-w-full divide-y divide-gray-200" id="punchStatusTable">
|
123 |
+
<thead class="bg-gray-50">
|
124 |
+
<tr>
|
125 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Discipline</th>
|
126 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Punch</th>
|
127 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Cleared</th>
|
128 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">In Progress</th>
|
129 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ready For Approve</th>
|
130 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Remain</th>
|
131 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Progress</th>
|
132 |
+
</tr>
|
133 |
+
</thead>
|
134 |
+
<tbody class="bg-white divide-y divide-gray-200" id="punchStatusBody">
|
135 |
+
<!-- Data will be dynamically inserted here -->
|
136 |
+
<tr>
|
137 |
+
<td colspan="7" class="px-6 py-4 text-center text-gray-500">
|
138 |
+
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto"></div>
|
139 |
+
<span class="ml-2">Loading punch status data...</span>
|
140 |
+
</td>
|
141 |
+
</tr>
|
142 |
+
</tbody>
|
143 |
+
</table>
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
|
147 |
+
<div class="bg-white rounded-xl shadow-sm p-6">
|
148 |
+
<canvas id="punchStatusChart"></canvas>
|
149 |
+
</div>
|
150 |
+
</section>
|
151 |
+
</div>
|
152 |
+
|
153 |
+
<script>
|
154 |
+
// Global variables to store chart instances
|
155 |
+
let itemProgressChart;
|
156 |
+
let punchStatusChart;
|
157 |
+
|
158 |
+
// Sample data (as fallback)
|
159 |
+
const sampleDisciplineData = `Total Subsystems: 45
|
160 |
+
Form A: 12
|
161 |
+
Form B: 8
|
162 |
+
Form C: 15
|
163 |
+
Form D: 10
|
164 |
+
Mechanical|120|80|20|10|10
|
165 |
+
Electrical|95|60|15|10|10
|
166 |
+
Civil|80|50|15|5|10
|
167 |
+
Instrumentation|65|40|10|5|10
|
168 |
+
Piping|110|70|20|10|10`;
|
169 |
+
|
170 |
+
const samplePunchData = `Mechanical|45|20|10|5|10
|
171 |
+
Electrical|35|15|8|5|7
|
172 |
+
Civil|25|10|5|3|7
|
173 |
+
Instrumentation|20|8|4|3|5
|
174 |
+
Piping|40|18|10|5|7`;
|
175 |
+
|
176 |
+
// Fetch data with CORS proxy
|
177 |
+
async function fetchWithProxy(url) {
|
178 |
+
try {
|
179 |
+
const proxyUrl = 'https://cors-anywhere.herokuapp.com/';
|
180 |
+
const response = await fetch(proxyUrl + url);
|
181 |
+
return await response.text();
|
182 |
+
} catch (error) {
|
183 |
+
console.error('Error using proxy:', error);
|
184 |
+
// Return sample data if proxy fails
|
185 |
+
if (url.includes('discipline')) return sampleDisciplineData;
|
186 |
+
if (url.includes('punch')) return samplePunchData;
|
187 |
+
return '';
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
// Fetch data from GitHub
|
192 |
+
async function fetchData() {
|
193 |
+
try {
|
194 |
+
// Fetch discipline data
|
195 |
+
const disciplineText = await fetchWithProxy('https://raw.githubusercontent.com/akarimvand/hos/refs/heads/main/discipline.txt');
|
196 |
+
const disciplineData = parseDisciplineData(disciplineText);
|
197 |
+
|
198 |
+
// Fetch punch data
|
199 |
+
const punchText = await fetchWithProxy('https://raw.githubusercontent.com/akarimvand/hos/refs/heads/main/punch.txt');
|
200 |
+
const punchData = parsePunchData(punchText);
|
201 |
+
|
202 |
+
// Update the UI with the fetched data
|
203 |
+
updateKPICards(disciplineData.kpi);
|
204 |
+
updateItemProgressTable(disciplineData.items);
|
205 |
+
updatePunchStatusTable(punchData);
|
206 |
+
createItemProgressChart(disciplineData.items);
|
207 |
+
createPunchStatusChart(punchData);
|
208 |
+
|
209 |
+
} catch (error) {
|
210 |
+
console.error('Error fetching data:', error);
|
211 |
+
showError('Failed to load data. Using sample data instead.');
|
212 |
+
|
213 |
+
// Use sample data as fallback
|
214 |
+
const disciplineData = parseDisciplineData(sampleDisciplineData);
|
215 |
+
const punchData = parsePunchData(samplePunchData);
|
216 |
+
|
217 |
+
updateKPICards(disciplineData.kpi);
|
218 |
+
updateItemProgressTable(disciplineData.items);
|
219 |
+
updatePunchStatusTable(punchData);
|
220 |
+
createItemProgressChart(disciplineData.items);
|
221 |
+
createPunchStatusChart(punchData);
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
// Parse discipline data from text
|
226 |
+
function parseDisciplineData(text) {
|
227 |
+
const lines = text.split('\n');
|
228 |
+
const data = {
|
229 |
+
kpi: {},
|
230 |
+
items: []
|
231 |
+
};
|
232 |
+
|
233 |
+
// Parse KPI data (first few lines)
|
234 |
+
for (let i = 0; i < 5; i++) {
|
235 |
+
if (lines[i]) {
|
236 |
+
const [key, value] = lines[i].split(':').map(item => item.trim());
|
237 |
+
data.kpi[key] = parseInt(value);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
// Parse item progress data (remaining lines)
|
242 |
+
for (let i = 5; i < lines.length; i++) {
|
243 |
+
if (lines[i].trim()) {
|
244 |
+
const parts = lines[i].split('|').map(item => item.trim());
|
245 |
+
if (parts.length >= 6) {
|
246 |
+
data.items.push({
|
247 |
+
discipline: parts[0],
|
248 |
+
total: parseInt(parts[1]),
|
249 |
+
done: parseInt(parts[2]),
|
250 |
+
inProgress: parseInt(parts[3]),
|
251 |
+
hold: parseInt(parts[4]),
|
252 |
+
remain: parseInt(parts[5])
|
253 |
+
});
|
254 |
+
}
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
return data;
|
259 |
+
}
|
260 |
+
|
261 |
+
// Parse punch data from text
|
262 |
+
function parsePunchData(text) {
|
263 |
+
const lines = text.split('\n');
|
264 |
+
const data = [];
|
265 |
+
|
266 |
+
for (let i = 0; i < lines.length; i++) {
|
267 |
+
if (lines[i].trim()) {
|
268 |
+
const parts = lines[i].split('|').map(item => item.trim());
|
269 |
+
if (parts.length >= 6) {
|
270 |
+
data.push({
|
271 |
+
discipline: parts[0],
|
272 |
+
total: parseInt(parts[1]),
|
273 |
+
cleared: parseInt(parts[2]),
|
274 |
+
inProgress: parseInt(parts[3]),
|
275 |
+
readyForApprove: parseInt(parts[4]),
|
276 |
+
remain: parseInt(parts[5])
|
277 |
+
});
|
278 |
+
}
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
+
return data;
|
283 |
+
}
|
284 |
+
|
285 |
+
// Update KPI cards
|
286 |
+
function updateKPICards(kpiData) {
|
287 |
+
const kpiCards = document.getElementById('kpiCards');
|
288 |
+
|
289 |
+
const cards = [
|
290 |
+
{
|
291 |
+
title: 'Total Subsystems',
|
292 |
+
value: kpiData['Total Subsystems'] || 0,
|
293 |
+
icon: 'fas fa-layer-group',
|
294 |
+
color: 'bg-blue-100',
|
295 |
+
textColor: 'text-blue-600'
|
296 |
+
},
|
297 |
+
{
|
298 |
+
title: 'Completed Form A',
|
299 |
+
value: kpiData['Form A'] || 0,
|
300 |
+
icon: 'fas fa-file-alt',
|
301 |
+
color: 'bg-green-100',
|
302 |
+
textColor: 'text-green-600'
|
303 |
+
},
|
304 |
+
{
|
305 |
+
title: 'Completed Form B',
|
306 |
+
value: kpiData['Form B'] || 0,
|
307 |
+
icon: 'fas fa-file-invoice',
|
308 |
+
color: 'bg-orange-100',
|
309 |
+
textColor: 'text-orange-600'
|
310 |
+
},
|
311 |
+
{
|
312 |
+
title: 'Completed Form C',
|
313 |
+
value: kpiData['Form C'] || 0,
|
314 |
+
icon: 'fas fa-file-signature',
|
315 |
+
color: 'bg-purple-100',
|
316 |
+
textColor: 'text-purple-600'
|
317 |
+
}
|
318 |
+
];
|
319 |
+
|
320 |
+
kpiCards.innerHTML = cards.map(card => `
|
321 |
+
<div class="bg-white rounded-xl shadow-sm p-6 card-hover">
|
322 |
+
<div class="flex items-center">
|
323 |
+
<div class="p-3 rounded-lg ${card.color} ${card.textColor} mr-4">
|
324 |
+
<i class="${card.icon} text-xl"></i>
|
325 |
+
</div>
|
326 |
+
<div>
|
327 |
+
<p class="text-sm font-medium text-gray-500">${card.title}</p>
|
328 |
+
<h3 class="text-2xl font-bold text-gray-800">${card.value}</h3>
|
329 |
+
</div>
|
330 |
+
</div>
|
331 |
+
</div>
|
332 |
+
`).join('');
|
333 |
+
}
|
334 |
+
|
335 |
+
// Update item progress table
|
336 |
+
function updateItemProgressTable(items) {
|
337 |
+
const tableBody = document.getElementById('itemProgressBody');
|
338 |
+
|
339 |
+
tableBody.innerHTML = items.map(item => {
|
340 |
+
const progress = ((item.done / item.total) * 100).toFixed(1);
|
341 |
+
|
342 |
+
return `
|
343 |
+
<tr class="hover:bg-gray-50">
|
344 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${item.discipline}</td>
|
345 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.total}</td>
|
346 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.done}</td>
|
347 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.inProgress}</td>
|
348 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.hold}</td>
|
349 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.remain}</td>
|
350 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
351 |
+
<div class="flex items-center">
|
352 |
+
<div class="w-16 mr-2">
|
353 |
+
<div class="progress-bar">
|
354 |
+
<div class="progress-bar-fill bg-blue-500" style="width: ${progress}%"></div>
|
355 |
+
</div>
|
356 |
+
</div>
|
357 |
+
<span class="text-xs text-gray-500">${progress}%</span>
|
358 |
+
</div>
|
359 |
+
</td>
|
360 |
+
</tr>
|
361 |
+
`;
|
362 |
+
}).join('');
|
363 |
+
}
|
364 |
+
|
365 |
+
// Update punch status table
|
366 |
+
function updatePunchStatusTable(punchData) {
|
367 |
+
const tableBody = document.getElementById('punchStatusBody');
|
368 |
+
|
369 |
+
tableBody.innerHTML = punchData.map(item => {
|
370 |
+
const progress = ((item.cleared / item.total) * 100).toFixed(1);
|
371 |
+
|
372 |
+
return `
|
373 |
+
<tr class="hover:bg-gray-50">
|
374 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${item.discipline}</td>
|
375 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.total}</td>
|
376 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.cleared}</td>
|
377 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.inProgress}</td>
|
378 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.readyForApprove}</td>
|
379 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.remain}</td>
|
380 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
381 |
+
<div class="flex items-center">
|
382 |
+
<div class="w-16 mr-2">
|
383 |
+
<div class="progress-bar">
|
384 |
+
<div class="progress-bar-fill bg-green-500" style="width: ${progress}%"></div>
|
385 |
+
</div>
|
386 |
+
</div>
|
387 |
+
<span class="text-xs text-gray-500">${progress}%</span>
|
388 |
+
</div>
|
389 |
+
</td>
|
390 |
+
</tr>
|
391 |
+
`;
|
392 |
+
}).join('');
|
393 |
+
}
|
394 |
+
|
395 |
+
// Create item progress chart
|
396 |
+
function createItemProgressChart(items) {
|
397 |
+
const ctx = document.getElementById('itemProgressChart').getContext('2d');
|
398 |
+
|
399 |
+
// Destroy previous chart if it exists
|
400 |
+
if (itemProgressChart) {
|
401 |
+
itemProgressChart.destroy();
|
402 |
+
}
|
403 |
+
|
404 |
+
const labels = items.map(item => item.discipline);
|
405 |
+
const doneData = items.map(item => item.done);
|
406 |
+
const inProgressData = items.map(item => item.inProgress);
|
407 |
+
const holdData = items.map(item => item.hold);
|
408 |
+
const remainData = items.map(item => item.remain);
|
409 |
+
|
410 |
+
itemProgressChart = new Chart(ctx, {
|
411 |
+
type: 'bar',
|
412 |
+
data: {
|
413 |
+
labels: labels,
|
414 |
+
datasets: [
|
415 |
+
{
|
416 |
+
label: 'Done',
|
417 |
+
data: doneData,
|
418 |
+
backgroundColor: '#10B981',
|
419 |
+
stack: 'Stack 0'
|
420 |
+
},
|
421 |
+
{
|
422 |
+
label: 'In Progress',
|
423 |
+
data: inProgressData,
|
424 |
+
backgroundColor: '#3B82F6',
|
425 |
+
stack: 'Stack 0'
|
426 |
+
},
|
427 |
+
{
|
428 |
+
label: 'Hold',
|
429 |
+
data: holdData,
|
430 |
+
backgroundColor: '#F59E0B',
|
431 |
+
stack: 'Stack 0'
|
432 |
+
},
|
433 |
+
{
|
434 |
+
label: 'Remain',
|
435 |
+
data: remainData,
|
436 |
+
backgroundColor: '#EF4444',
|
437 |
+
stack: 'Stack 0'
|
438 |
+
}
|
439 |
+
]
|
440 |
+
},
|
441 |
+
options: {
|
442 |
+
responsive: true,
|
443 |
+
plugins: {
|
444 |
+
title: {
|
445 |
+
display: true,
|
446 |
+
text: 'Item Progress Breakdown by Discipline',
|
447 |
+
font: {
|
448 |
+
size: 16
|
449 |
+
}
|
450 |
+
},
|
451 |
+
legend: {
|
452 |
+
position: 'bottom',
|
453 |
+
},
|
454 |
+
tooltip: {
|
455 |
+
mode: 'index',
|
456 |
+
intersect: false
|
457 |
+
}
|
458 |
+
},
|
459 |
+
scales: {
|
460 |
+
x: {
|
461 |
+
stacked: true,
|
462 |
+
grid: {
|
463 |
+
display: false
|
464 |
+
}
|
465 |
+
},
|
466 |
+
y: {
|
467 |
+
stacked: true,
|
468 |
+
beginAtZero: true,
|
469 |
+
ticks: {
|
470 |
+
precision: 0
|
471 |
+
}
|
472 |
+
}
|
473 |
+
},
|
474 |
+
animation: {
|
475 |
+
duration: 1000
|
476 |
+
}
|
477 |
+
}
|
478 |
+
});
|
479 |
+
}
|
480 |
+
|
481 |
+
// Create punch status chart
|
482 |
+
function createPunchStatusChart(punchData) {
|
483 |
+
const ctx = document.getElementById('punchStatusChart').getContext('2d');
|
484 |
+
|
485 |
+
// Destroy previous chart if it exists
|
486 |
+
if (punchStatusChart) {
|
487 |
+
punchStatusChart.destroy();
|
488 |
+
}
|
489 |
+
|
490 |
+
const labels = punchData.map(item => item.discipline);
|
491 |
+
const clearedData = punchData.map(item => item.cleared);
|
492 |
+
const inProgressData = punchData.map(item => item.inProgress);
|
493 |
+
const readyData = punchData.map(item => item.readyForApprove);
|
494 |
+
const remainData = punchData.map(item => item.remain);
|
495 |
+
|
496 |
+
punchStatusChart = new Chart(ctx, {
|
497 |
+
type: 'bar',
|
498 |
+
data: {
|
499 |
+
labels: labels,
|
500 |
+
datasets: [
|
501 |
+
{
|
502 |
+
label: 'Cleared',
|
503 |
+
data: clearedData,
|
504 |
+
backgroundColor: '#10B981',
|
505 |
+
stack: 'Stack 0'
|
506 |
+
},
|
507 |
+
{
|
508 |
+
label: 'In Progress',
|
509 |
+
data: inProgressData,
|
510 |
+
backgroundColor: '#3B82F6',
|
511 |
+
stack: 'Stack 0'
|
512 |
+
},
|
513 |
+
{
|
514 |
+
label: 'Ready For Approve',
|
515 |
+
data: readyData,
|
516 |
+
backgroundColor: '#8B5CF6',
|
517 |
+
stack: 'Stack 0'
|
518 |
+
},
|
519 |
+
{
|
520 |
+
label: 'Remain',
|
521 |
+
data: remainData,
|
522 |
+
backgroundColor: '#EF4444',
|
523 |
+
stack: 'Stack 0'
|
524 |
+
}
|
525 |
+
]
|
526 |
+
},
|
527 |
+
options: {
|
528 |
+
indexAxis: 'y',
|
529 |
+
responsive: true,
|
530 |
+
plugins: {
|
531 |
+
title: {
|
532 |
+
display: true,
|
533 |
+
text: 'Punch List Status by Discipline',
|
534 |
+
font: {
|
535 |
+
size: 16
|
536 |
+
}
|
537 |
+
},
|
538 |
+
legend: {
|
539 |
+
position: 'bottom',
|
540 |
+
},
|
541 |
+
tooltip: {
|
542 |
+
mode: 'index',
|
543 |
+
intersect: false
|
544 |
+
}
|
545 |
+
},
|
546 |
+
scales: {
|
547 |
+
x: {
|
548 |
+
stacked: true,
|
549 |
+
grid: {
|
550 |
+
display: false
|
551 |
+
}
|
552 |
+
},
|
553 |
+
y: {
|
554 |
+
stacked: true,
|
555 |
+
beginAtZero: true,
|
556 |
+
grid: {
|
557 |
+
display: false
|
558 |
+
}
|
559 |
+
}
|
560 |
+
},
|
561 |
+
animation: {
|
562 |
+
duration: 1000
|
563 |
+
}
|
564 |
+
}
|
565 |
+
});
|
566 |
+
}
|
567 |
+
|
568 |
+
// Show error message
|
569 |
+
function showError(message) {
|
570 |
+
const kpiCards = document.getElementById('kpiCards');
|
571 |
+
kpiCards.innerHTML = `
|
572 |
+
<div class="col-span-4 bg-red-50 border-l-4 border-red-500 p-4">
|
573 |
+
<div class="flex">
|
574 |
+
<div class="flex-shrink-0">
|
575 |
+
<svg class="h-5 w-5 text-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
|
576 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
577 |
+
</svg>
|
578 |
+
</div>
|
579 |
+
<div class="ml-3">
|
580 |
+
<p class="text-sm text-red-700">${message}</p>
|
581 |
+
</div>
|
582 |
+
</div>
|
583 |
+
</div>
|
584 |
+
`;
|
585 |
+
}
|
586 |
+
|
587 |
+
// Initialize the dashboard when the page loads
|
588 |
+
document.addEventListener('DOMContentLoaded', fetchData);
|
589 |
+
</script>
|
590 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Akarimvand/vxzfc" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
591 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
🎯 Professional Prompt for Dashboard Design (HTML + Bootstrap + Charts) Objective: Design a modern, responsive, and visually rich dashboard canvas using HTML, Bootstrap 5, and Chart.js or amCharts, based on external data sources. It will be used in a commissioning management system to track form status, item progress by discipline, and punch list clearance. 🟦 Section 1: Summary Cards (Top KPIs) Create colorful Bootstrap cards with appropriate icons (FontAwesome or Bootstrap Icons) to show big numbers for: Fetch the following numbers from this URL: 🔗 https://raw.githubusercontent.com/akarimvand/hos/refs/heads/main/discipline.txt Expected fields: Total Subsystems Form A Form B Form C Form D Each card should: Have a unique background color (e.g., blue, green, orange, red) Contain a large icon aligned to the left or top Display number prominently with bold text Include a subtitle describing the metric (e.g., "Completed Form A") Be placed in a responsive row grid 🟩 Section 2: Item Progress by Discipline (Table + Chart) Load item discipline data from this file: 🔗 https://raw.githubusercontent.com/akarimvand/hos/refs/heads/main/discipline.txt Display a responsive, striped Bootstrap table showing progress breakdown per discipline with columns: | Discipline | Total Item | Done | In Progress | Hold | Remain | Below the table, generate a stacked bar chart (with Chart.js or amCharts) to visualize these columns (Done, In Progress, Hold, Remain) for each discipline. 🟥 Section 3: Punch List Status by Discipline (Table + Chart) Load punch status data from this file: 🔗 https://raw.githubusercontent.com/akarimvand/hos/refs/heads/main/punch.txt Display a Bootstrap table with this structure: | Discipline | Total Punch | Cleared | In Progress | Ready For Approve | Remain | Add a second horizontal bar chart to show status (Cleared, In Progress, Ready, Remain) per discipline. 📌 Notes: Use modern fonts and soft shadows Make all components mobile-responsive Include Bootstrap tooltips if possible on data cells Use card animations (fadeIn, zoomIn) if supported Deliver as a complete HTML file that loads and parses the external .txt files dynamically (e.g., via fetch API).
|
2 |
+
اطلاعات رو نمیخونه !!!!!
|