Users can add any website as a dashboard quick link from Settings → Site Links. The link is stored in the integrations namespace as a `custom` type so it flows through the existing sites/integrations/settings pipeline, and appears in a new "Links" group. Its icon is discovered with the existing favicon pipeline; an uploaded icon overrides it and stays pinned until the user chooses "Use site's icon" again. resolveIcons and refreshIcon skip pinned sites (and re-check the live list before writing back) so an in-flight discovery can never clobber a freshly uploaded icon. URLs are normalized to http(s) only, with embedded credentials stripped, so a value can never reach an anchor's href as javascript:/data:. Uploads are validated, size-capped and downscaled to 192px (SVGs kept as-is), and only ever rendered through an <img>. Adds app/utils/site-url.js and app/utils/image-file.js, a custom-link form, a `custom` registry entry/group and adapter, and tests.
35 lines
749 B
JavaScript
35 lines
749 B
JavaScript
export const SITE_GROUPS = [
|
|
{
|
|
id: 'code-forge',
|
|
label: 'Code Forges',
|
|
integrationTypes: ['github', 'gitea'],
|
|
},
|
|
{
|
|
id: 'discourse',
|
|
label: 'Discourse',
|
|
integrationTypes: ['discourse'],
|
|
},
|
|
{
|
|
id: 'feedbin',
|
|
label: 'Feedbin',
|
|
integrationTypes: ['feedbin'],
|
|
},
|
|
{
|
|
id: 'home-assistant',
|
|
label: 'Home Assistant',
|
|
integrationTypes: ['homeassistant'],
|
|
},
|
|
// User-defined quick links. Appended last so the columns of existing users
|
|
// keep their order.
|
|
{
|
|
id: 'links',
|
|
label: 'Links',
|
|
integrationTypes: ['custom'],
|
|
},
|
|
];
|
|
|
|
// The integration types that appear as dashboard quick links.
|
|
export const SITE_LINK_TYPES = SITE_GROUPS.flatMap(
|
|
(group) => group.integrationTypes
|
|
);
|