feat(health): Little Blue health band — avatar, grouped service tiles, local icons
This commit is contained in:
11
public/components/service_tile.js
Normal file
11
public/components/service_tile.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { el, safeHref } from '../dom.js';
|
||||
export function serviceTile(s) {
|
||||
const img = el('img', { class: 'tile-icon', loading: 'lazy', src: `/api/icons/${s.icon}.png`, alt: s.name });
|
||||
img.onerror = () => img.replaceWith(el('div', { class: 'tile-icon-fb' }, (s.name[0] || '?').toUpperCase()));
|
||||
return el('a', { class: `tile status-${s.status}`, href: safeHref(s.url), target: '_blank', rel: 'noreferrer' },
|
||||
img,
|
||||
el('div', { class: 'tile-main' },
|
||||
el('div', { class: 'tile-nm' }, el('span', { class: 'dot' }), s.name),
|
||||
el('div', { class: 'tile-host' }, s.host || '')),
|
||||
el('span', { class: 'tile-go' }, 'open ↗'));
|
||||
}
|
||||
Reference in New Issue
Block a user