update app
Browse files- index.html +34 -28
index.html
CHANGED
|
@@ -1363,41 +1363,47 @@
|
|
| 1363 |
}
|
| 1364 |
}
|
| 1365 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1366 |
// Header
|
| 1367 |
if (avatarBase64) {
|
| 1368 |
-
doc.addImage(avatarBase64, 'JPEG', 14, 12,
|
| 1369 |
doc.setFontSize(22);
|
| 1370 |
-
doc.text(`HuggingFace Activity Report
|
|
|
|
|
|
|
| 1371 |
} else {
|
| 1372 |
doc.setFontSize(22);
|
| 1373 |
-
doc.text(`HuggingFace Activity Report
|
|
|
|
|
|
|
| 1374 |
}
|
| 1375 |
|
| 1376 |
-
|
| 1377 |
-
|
| 1378 |
-
doc.
|
| 1379 |
-
|
| 1380 |
-
|
| 1381 |
-
|
| 1382 |
-
|
| 1383 |
-
|
| 1384 |
-
|
| 1385 |
-
|
| 1386 |
-
|
| 1387 |
-
|
| 1388 |
-
|
| 1389 |
-
|
| 1390 |
-
|
| 1391 |
-
|
| 1392 |
-
|
| 1393 |
-
let startY = 80;
|
| 1394 |
-
|
| 1395 |
-
const totalDlMonthly = state.models.reduce((s, m) => s + getMonthlyDownloads(m), 0) + state.datasets.reduce((s, d) => s + getMonthlyDownloads(d), 0);
|
| 1396 |
-
doc.text(`Downloads Last 30 Days: ${formatNumFull(totalDlMonthly)}`, 14, 78);
|
| 1397 |
-
|
| 1398 |
-
const totalPrivate = [...state.models, ...state.datasets, ...state.spaces].filter(i => i.private).length;
|
| 1399 |
-
doc.text(`Total Private Repositories: ${totalPrivate}`, 14, 86);
|
| 1400 |
-
startY = 96;
|
| 1401 |
|
| 1402 |
const pipelineCounts = {};
|
| 1403 |
state.models.forEach(m => {
|
|
|
|
| 1363 |
}
|
| 1364 |
}
|
| 1365 |
|
| 1366 |
+
const totalModels = state.models.length;
|
| 1367 |
+
const totalDatasets = state.datasets.length;
|
| 1368 |
+
const totalSpaces = state.spaces.length;
|
| 1369 |
+
|
| 1370 |
+
const totalModelDl = state.models.reduce((s, m) => s + getLifetimeDownloads(m), 0);
|
| 1371 |
+
const totalDatasetDl = state.datasets.reduce((s, d) => s + getLifetimeDownloads(d), 0);
|
| 1372 |
+
const totalLikes = [...state.models, ...state.datasets, ...state.spaces].reduce((s, i) => s + getItemLikes(i), 0);
|
| 1373 |
+
const totalDlMonthly = state.models.reduce((s, m) => s + getMonthlyDownloads(m), 0) + state.datasets.reduce((s, d) => s + getMonthlyDownloads(d), 0);
|
| 1374 |
+
const totalPrivate = [...state.models, ...state.datasets, ...state.spaces].filter(i => i.private).length;
|
| 1375 |
+
|
| 1376 |
// Header
|
| 1377 |
if (avatarBase64) {
|
| 1378 |
+
doc.addImage(avatarBase64, 'JPEG', 14, 12, 18, 18);
|
| 1379 |
doc.setFontSize(22);
|
| 1380 |
+
doc.text(`HuggingFace Activity Report`, 36, 20);
|
| 1381 |
+
doc.setFontSize(14);
|
| 1382 |
+
doc.text(fullname, 36, 28);
|
| 1383 |
} else {
|
| 1384 |
doc.setFontSize(22);
|
| 1385 |
+
doc.text(`HuggingFace Activity Report`, 14, 20);
|
| 1386 |
+
doc.setFontSize(14);
|
| 1387 |
+
doc.text(fullname, 14, 28);
|
| 1388 |
}
|
| 1389 |
|
| 1390 |
+
let startY = 36;
|
| 1391 |
+
|
| 1392 |
+
doc.autoTable({
|
| 1393 |
+
startY: startY,
|
| 1394 |
+
head: [['Profile Summary', 'Value', 'Statistics', 'Value']],
|
| 1395 |
+
body: [
|
| 1396 |
+
['Username', `@${u}`, 'Total Likes', formatNumFull(totalLikes)],
|
| 1397 |
+
['Followers', formatNumFull(p?.numFollowers ?? 0), 'Total Downloads', formatNumFull(totalModelDl + totalDatasetDl)],
|
| 1398 |
+
['Organizations', Array.isArray(p?.orgs) ? p.orgs.length.toString() : '0', 'Downloads (Last 30 Days)', formatNumFull(totalDlMonthly)],
|
| 1399 |
+
['Total Models', totalModels.toString(), 'Total Datasets', totalDatasets.toString()],
|
| 1400 |
+
['Total Spaces', totalSpaces.toString(), 'Private Repositories', totalPrivate.toString()]
|
| 1401 |
+
],
|
| 1402 |
+
theme: 'grid',
|
| 1403 |
+
headStyles: { fillColor: [51, 51, 51] },
|
| 1404 |
+
styles: { fontSize: 11, cellPadding: 4 }
|
| 1405 |
+
});
|
| 1406 |
+
startY = doc.lastAutoTable.finalY + 10;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1407 |
|
| 1408 |
const pipelineCounts = {};
|
| 1409 |
state.models.forEach(m => {
|