added new order
This commit is contained in:
@@ -38,9 +38,36 @@ function transformPlatform(raw: RawOsEntry[]): OsEntry[] {
|
||||
count: Number(item.total), // Convierte string a número
|
||||
}));
|
||||
|
||||
rows.sort((a, b) =>
|
||||
b.os.localeCompare(a.os, undefined, { numeric: true, sensitivity: "base" })
|
||||
);
|
||||
const order = {
|
||||
"Windows 11": 1,
|
||||
"Windows 10": 2,
|
||||
"Windows 7/8": 3,
|
||||
"Windows XP/Vista": 4,
|
||||
Linux: 5,
|
||||
|
||||
"Mac OS (13 - Ventura, 14 - Sonoma)": 6,
|
||||
"MAC OS (SEQUOIA)": 7,
|
||||
"Mac OS X (Mojave, Catalina, 11 - Big Sur, 12 - Monterrey)": 8,
|
||||
"Mac OS X (Snow Leopard, Lion, Mountain Lion, Mavericks)": 9,
|
||||
"Mac OS X (Yosemite, El Capitan, Sierra, High Sierra)": 10,
|
||||
|
||||
"Chrome OS": 11,
|
||||
|
||||
"Linux (CentOS, Fedora, Ubuntu, Red Hat Enterprise, entre otros)": 12,
|
||||
"UNIX (AIX, MAC OS SERVER, SOLARIS, ENTRE OTROS)": 13,
|
||||
|
||||
"Windows Server 2022/2023": 14,
|
||||
"Windows Server 2016/2019": 15,
|
||||
"Windows Server 2008/2012": 16,
|
||||
"Windows Server 2000/2003": 17,
|
||||
} as const;
|
||||
|
||||
rows.sort((a, b) => {
|
||||
const orderA = (order as Record<string, number>)[a.os] ?? 999;
|
||||
const orderB = (order as Record<string, number>)[b.os] ?? 999;
|
||||
return orderA - orderB;
|
||||
});
|
||||
|
||||
const total = rows.reduce((acc, r) => acc + r.count, 0);
|
||||
|
||||
rows.push({
|
||||
|
||||
@@ -110,6 +110,7 @@
|
||||
}
|
||||
|
||||
.data-row_P1 {
|
||||
text-align: end;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -126,6 +127,7 @@
|
||||
flex: 1;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.count-box_P1 {
|
||||
|
||||
Reference in New Issue
Block a user