From 378a4c1dd6a1342861d8d1eebed4339adbbd0bf0 Mon Sep 17 00:00:00 2001 From: librelad Date: Fri, 29 May 2026 00:04:59 +0100 Subject: [PATCH] feat(system): official distro logos + Intel/AMD CPU logo with clean model text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the hand-drawn distro marks with the official artwork (Simple Icons, brand-coloured, bundled locally — no external calls) for Debian/Ubuntu/Fedora/Arch + a generic Linux fallback. Add Intel/AMD logos under /icons/cpu/ and show the vendor logo beside the CPU, with the model string stripped of trademark noise (Intel(R) Core(TM), ®/™, "CPU") since the logo conveys the vendor — e.g. "Core i5-8250U @ 1.60GHz". Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- containers/libreportal/frontend/css/admin.css | 2 +- .../libreportal/frontend/icons/cpu/amd.svg | 1 + .../libreportal/frontend/icons/cpu/intel.svg | 1 + .../libreportal/frontend/icons/os/arch.svg | 2 +- .../libreportal/frontend/icons/os/debian.svg | 2 +- .../libreportal/frontend/icons/os/fedora.svg | 2 +- .../libreportal/frontend/icons/os/linux.svg | 2 +- .../libreportal/frontend/icons/os/ubuntu.svg | 2 +- .../js/components/admin/admin-system.js | 25 ++++++++++++++++++- 9 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 containers/libreportal/frontend/icons/cpu/amd.svg create mode 100644 containers/libreportal/frontend/icons/cpu/intel.svg 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