diff --git a/containers/libreportal/frontend/css/admin.css b/containers/libreportal/frontend/css/admin.css index 28ba9a8..82510d3 100644 --- a/containers/libreportal/frontend/css/admin.css +++ b/containers/libreportal/frontend/css/admin.css @@ -318,7 +318,7 @@ word-break: break-word; } .sys-os-value { display: inline-flex; align-items: center; gap: 8px; } -.sys-os-icon { width: 18px; height: 18px; flex-shrink: 0; object-fit: contain; } +.sys-os-icon, .sys-cpu-icon { width: 18px; height: 18px; flex-shrink: 0; object-fit: contain; } /* Per-app table */ .sys-apps-wrap { diff --git a/containers/libreportal/frontend/icons/cpu/amd.svg b/containers/libreportal/frontend/icons/cpu/amd.svg new file mode 100644 index 0000000..ae3de07 --- /dev/null +++ b/containers/libreportal/frontend/icons/cpu/amd.svg @@ -0,0 +1 @@ +AMD \ No newline at end of file diff --git a/containers/libreportal/frontend/icons/cpu/intel.svg b/containers/libreportal/frontend/icons/cpu/intel.svg new file mode 100644 index 0000000..09c4d63 --- /dev/null +++ b/containers/libreportal/frontend/icons/cpu/intel.svg @@ -0,0 +1 @@ +Intel \ No newline at end of file diff --git a/containers/libreportal/frontend/icons/os/arch.svg b/containers/libreportal/frontend/icons/os/arch.svg index 921980f..763843e 100644 --- a/containers/libreportal/frontend/icons/os/arch.svg +++ b/containers/libreportal/frontend/icons/os/arch.svg @@ -1 +1 @@ - +Arch Linux \ No newline at end of file diff --git a/containers/libreportal/frontend/icons/os/debian.svg b/containers/libreportal/frontend/icons/os/debian.svg index a9192d1..37ee028 100644 --- a/containers/libreportal/frontend/icons/os/debian.svg +++ b/containers/libreportal/frontend/icons/os/debian.svg @@ -1 +1 @@ - +Debian \ No newline at end of file diff --git a/containers/libreportal/frontend/icons/os/fedora.svg b/containers/libreportal/frontend/icons/os/fedora.svg index 00b9e51..ba68d2a 100644 --- a/containers/libreportal/frontend/icons/os/fedora.svg +++ b/containers/libreportal/frontend/icons/os/fedora.svg @@ -1 +1 @@ - +Fedora \ No newline at end of file diff --git a/containers/libreportal/frontend/icons/os/linux.svg b/containers/libreportal/frontend/icons/os/linux.svg index 2da49ae..671db79 100644 --- a/containers/libreportal/frontend/icons/os/linux.svg +++ b/containers/libreportal/frontend/icons/os/linux.svg @@ -1 +1 @@ - +Linux \ No newline at end of file diff --git a/containers/libreportal/frontend/icons/os/ubuntu.svg b/containers/libreportal/frontend/icons/os/ubuntu.svg index cadec4e..4a2e21e 100644 --- a/containers/libreportal/frontend/icons/os/ubuntu.svg +++ b/containers/libreportal/frontend/icons/os/ubuntu.svg @@ -1 +1 @@ - +Ubuntu \ No newline at end of file diff --git a/containers/libreportal/frontend/js/components/admin/admin-system.js b/containers/libreportal/frontend/js/components/admin/admin-system.js index d3d732c..5e735e1 100644 --- a/containers/libreportal/frontend/js/components/admin/admin-system.js +++ b/containers/libreportal/frontend/js/components/admin/admin-system.js @@ -290,7 +290,7 @@ class AdminSystem { ${this._osStat(info.os)} ${this.stat('Kernel', info.kernel || '—')} ${this.stat('Uptime', (info.uptime || '—').replace(/^up /, ''))} - ${this.stat('CPU', info.cpu || '—')} + ${this._cpuStat(info.cpu)} ${this.stat('Swap', mem.swap_total ? `${this.bytes(mem.swap_used)} / ${this.bytes(mem.swap_total)}` : 'none')} `; @@ -412,6 +412,29 @@ class AdminSystem { `; } + + // Strip the trademark noise (®, ™, "Intel", "AMD", "CPU") from a CPU model + // string — the vendor is shown as a logo, so the words are redundant clutter. + _cleanCpu(cpu) { + return String(cpu || '') + .replace(/\((?:R|TM|r|tm)\)|®|™/g, '') + .replace(/\b(?:Intel|AMD)\b/gi, '') + .replace(/\bCPU\b/gi, '') + .replace(/\s*@\s*/g, ' @ ') + .replace(/\s{2,}/g, ' ') + .trim() || '—'; + } + + // CPU stat: vendor logo (Intel/AMD) + the cleaned model string. + _cpuStat(cpu) { + const raw = String(cpu || ''); + const vendor = /amd/i.test(raw) ? 'amd' : /intel/i.test(raw) ? 'intel' : null; + const icon = vendor ? `${vendor}` : ''; + return `
+ CPU + ${icon}${this.escape(this._cleanCpu(raw))} +
`; + } } // Lightweight formatter helpers shared with sub-pages so they don't each