update app
Browse files- index.html +38 -30
index.html
CHANGED
|
@@ -1376,31 +1376,35 @@
|
|
| 1376 |
const totalModels = state.models.length;
|
| 1377 |
const totalDatasets = state.datasets.length;
|
| 1378 |
const totalSpaces = state.spaces.length;
|
|
|
|
| 1379 |
const totalModelDl = state.models.reduce((s, m) => s + getLifetimeDownloads(m), 0);
|
| 1380 |
const totalDatasetDl = state.datasets.reduce((s, d) => s + getLifetimeDownloads(d), 0);
|
| 1381 |
const totalLikes = [...state.models, ...state.datasets, ...state.spaces].reduce((s, i) => s + getItemLikes(i), 0);
|
|
|
|
| 1382 |
const totalDlMonthly = state.models.reduce((s, m) => s + getMonthlyDownloads(m), 0) + state.datasets.reduce((s, d) => s + getMonthlyDownloads(d), 0);
|
| 1383 |
const totalPrivate = [...state.models, ...state.datasets, ...state.spaces].filter(i => i.private).length;
|
| 1384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1385 |
doc.autoTable({
|
| 1386 |
-
startY:
|
| 1387 |
-
|
| 1388 |
-
body:
|
| 1389 |
-
|
| 1390 |
-
|
| 1391 |
-
|
| 1392 |
-
|
| 1393 |
-
['Total Datasets', `${totalDatasets} (Downloads: ${formatNumFull(totalDatasetDl)})`],
|
| 1394 |
-
['Total Spaces', `${totalSpaces}`],
|
| 1395 |
-
['Total Likes Received', `${formatNumFull(totalLikes)}`],
|
| 1396 |
-
['Downloads Last 30 Days', `${formatNumFull(totalDlMonthly)}`],
|
| 1397 |
-
['Total Private Repositories', `${totalPrivate}`]
|
| 1398 |
-
],
|
| 1399 |
-
styles: { fontSize: 11, cellPadding: 2, textColor: [60, 60, 60] },
|
| 1400 |
-
columnStyles: { 0: { fontStyle: 'bold', cellWidth: 55, textColor: [20, 20, 20] } }
|
| 1401 |
});
|
| 1402 |
-
|
| 1403 |
-
let startY = doc.lastAutoTable.finalY + 10;
|
| 1404 |
|
| 1405 |
const pipelineCounts = {};
|
| 1406 |
state.models.forEach(m => {
|
|
@@ -1415,9 +1419,10 @@
|
|
| 1415 |
startY: startY,
|
| 1416 |
head: [['Model Pipeline Tasks', 'Count']],
|
| 1417 |
body: sortedPipelines,
|
| 1418 |
-
theme: '
|
| 1419 |
-
|
| 1420 |
-
|
|
|
|
| 1421 |
tableWidth: 'wrap'
|
| 1422 |
});
|
| 1423 |
startY = doc.lastAutoTable.finalY + 10;
|
|
@@ -1436,9 +1441,10 @@
|
|
| 1436 |
m.createdAt ? new Date(m.createdAt).toLocaleDateString() : '-',
|
| 1437 |
m.lastModified ? new Date(m.lastModified).toLocaleDateString() : '-'
|
| 1438 |
]),
|
| 1439 |
-
theme: '
|
| 1440 |
-
|
| 1441 |
-
|
|
|
|
| 1442 |
});
|
| 1443 |
startY = doc.lastAutoTable.finalY + 10;
|
| 1444 |
}
|
|
@@ -1455,9 +1461,10 @@
|
|
| 1455 |
d.createdAt ? new Date(d.createdAt).toLocaleDateString() : '-',
|
| 1456 |
d.lastModified ? new Date(d.lastModified).toLocaleDateString() : '-'
|
| 1457 |
]),
|
| 1458 |
-
theme: '
|
| 1459 |
-
|
| 1460 |
-
|
|
|
|
| 1461 |
});
|
| 1462 |
startY = doc.lastAutoTable.finalY + 10;
|
| 1463 |
}
|
|
@@ -1474,9 +1481,10 @@
|
|
| 1474 |
s.createdAt ? new Date(s.createdAt).toLocaleDateString() : '-',
|
| 1475 |
s.lastModified ? new Date(s.lastModified).toLocaleDateString() : '-'
|
| 1476 |
]),
|
| 1477 |
-
theme: '
|
| 1478 |
-
|
| 1479 |
-
|
|
|
|
| 1480 |
});
|
| 1481 |
}
|
| 1482 |
|
|
|
|
| 1376 |
const totalModels = state.models.length;
|
| 1377 |
const totalDatasets = state.datasets.length;
|
| 1378 |
const totalSpaces = state.spaces.length;
|
| 1379 |
+
|
| 1380 |
const totalModelDl = state.models.reduce((s, m) => s + getLifetimeDownloads(m), 0);
|
| 1381 |
const totalDatasetDl = state.datasets.reduce((s, d) => s + getLifetimeDownloads(d), 0);
|
| 1382 |
const totalLikes = [...state.models, ...state.datasets, ...state.spaces].reduce((s, i) => s + getItemLikes(i), 0);
|
| 1383 |
+
|
| 1384 |
const totalDlMonthly = state.models.reduce((s, m) => s + getMonthlyDownloads(m), 0) + state.datasets.reduce((s, d) => s + getMonthlyDownloads(d), 0);
|
| 1385 |
const totalPrivate = [...state.models, ...state.datasets, ...state.spaces].filter(i => i.private).length;
|
| 1386 |
+
|
| 1387 |
+
let startY = 35;
|
| 1388 |
+
|
| 1389 |
+
// Overview Table
|
| 1390 |
+
const overviewBody = [
|
| 1391 |
+
['Username', `@${u}`, 'Followers', `${formatNumFull(p?.numFollowers ?? 0)}`],
|
| 1392 |
+
['Organizations', `${Array.isArray(p?.orgs) ? p.orgs.length : 0}`, 'Total Likes', `${formatNumFull(totalLikes)}`],
|
| 1393 |
+
['Total Models', `${totalModels} (Dl: ${formatNumFull(totalModelDl)})`, 'Total Datasets', `${totalDatasets} (Dl: ${formatNumFull(totalDatasetDl)})`],
|
| 1394 |
+
['Total Spaces', `${totalSpaces}`, 'Private Repos', `${totalPrivate}`],
|
| 1395 |
+
['Downloads (Last 30 Days)', `${formatNumFull(totalDlMonthly)}`, '', '']
|
| 1396 |
+
];
|
| 1397 |
+
|
| 1398 |
doc.autoTable({
|
| 1399 |
+
startY: startY,
|
| 1400 |
+
head: [['Overview Metric', 'Value', 'Overview Metric', 'Value']],
|
| 1401 |
+
body: overviewBody,
|
| 1402 |
+
theme: 'grid',
|
| 1403 |
+
styles: { fontSize: 10, cellPadding: 3 },
|
| 1404 |
+
headStyles: { fillColor: [31, 41, 55], textColor: [255, 255, 255], fontStyle: 'bold' },
|
| 1405 |
+
alternateRowStyles: { fillColor: [249, 250, 251] }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1406 |
});
|
| 1407 |
+
startY = doc.lastAutoTable.finalY + 10;
|
|
|
|
| 1408 |
|
| 1409 |
const pipelineCounts = {};
|
| 1410 |
state.models.forEach(m => {
|
|
|
|
| 1419 |
startY: startY,
|
| 1420 |
head: [['Model Pipeline Tasks', 'Count']],
|
| 1421 |
body: sortedPipelines,
|
| 1422 |
+
theme: 'grid',
|
| 1423 |
+
styles: { fontSize: 9 },
|
| 1424 |
+
headStyles: { fillColor: [59, 130, 246], textColor: [255, 255, 255], fontStyle: 'bold' },
|
| 1425 |
+
alternateRowStyles: { fillColor: [243, 244, 246] },
|
| 1426 |
tableWidth: 'wrap'
|
| 1427 |
});
|
| 1428 |
startY = doc.lastAutoTable.finalY + 10;
|
|
|
|
| 1441 |
m.createdAt ? new Date(m.createdAt).toLocaleDateString() : '-',
|
| 1442 |
m.lastModified ? new Date(m.lastModified).toLocaleDateString() : '-'
|
| 1443 |
]),
|
| 1444 |
+
theme: 'striped',
|
| 1445 |
+
styles: { fontSize: 9 },
|
| 1446 |
+
headStyles: { fillColor: [255, 157, 0], textColor: [255, 255, 255], fontStyle: 'bold' },
|
| 1447 |
+
alternateRowStyles: { fillColor: [255, 247, 237] }
|
| 1448 |
});
|
| 1449 |
startY = doc.lastAutoTable.finalY + 10;
|
| 1450 |
}
|
|
|
|
| 1461 |
d.createdAt ? new Date(d.createdAt).toLocaleDateString() : '-',
|
| 1462 |
d.lastModified ? new Date(d.lastModified).toLocaleDateString() : '-'
|
| 1463 |
]),
|
| 1464 |
+
theme: 'striped',
|
| 1465 |
+
styles: { fontSize: 9 },
|
| 1466 |
+
headStyles: { fillColor: [16, 185, 129], textColor: [255, 255, 255], fontStyle: 'bold' },
|
| 1467 |
+
alternateRowStyles: { fillColor: [236, 253, 245] }
|
| 1468 |
});
|
| 1469 |
startY = doc.lastAutoTable.finalY + 10;
|
| 1470 |
}
|
|
|
|
| 1481 |
s.createdAt ? new Date(s.createdAt).toLocaleDateString() : '-',
|
| 1482 |
s.lastModified ? new Date(s.lastModified).toLocaleDateString() : '-'
|
| 1483 |
]),
|
| 1484 |
+
theme: 'striped',
|
| 1485 |
+
styles: { fontSize: 9 },
|
| 1486 |
+
headStyles: { fillColor: [139, 92, 246], textColor: [255, 255, 255], fontStyle: 'bold' },
|
| 1487 |
+
alternateRowStyles: { fillColor: [245, 243, 255] }
|
| 1488 |
});
|
| 1489 |
}
|
| 1490 |
|