Files
dashtab/app/config/integration-forms.js
raucao b057e3edca Add custom site links with icon discovery and upload
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.
2026-11-13 15:57:57 +04:00

28 lines
1.2 KiB
JavaScript

import DiscourseForm from '../components/settings/integrations/discourse-form.gjs';
import BitcoinForm from '../components/settings/integrations/bitcoin-form.gjs';
import FeedbinForm from '../components/settings/integrations/feedbin-form.gjs';
import GithubForm from '../components/settings/integrations/github-form.gjs';
import GiteaForm from '../components/settings/integrations/gitea-form.gjs';
import HomeAssistantForm from '../components/settings/integrations/home-assistant-form.gjs';
import CalendarCaldavForm from '../components/settings/integrations/calendar-caldav-form.gjs';
import CalendarIcsForm from '../components/settings/integrations/calendar-ics-form.gjs';
import OpenRouterForm from '../components/settings/integrations/openrouter-form.gjs';
import CustomLinkForm from '../components/settings/integrations/custom-link-form.gjs';
const FORMS = {
discourse: DiscourseForm,
bitcoin: BitcoinForm,
feedbin: FeedbinForm,
github: GithubForm,
gitea: GiteaForm,
homeassistant: HomeAssistantForm,
'calendar-caldav': CalendarCaldavForm,
'calendar-ics': CalendarIcsForm,
openrouter: OpenRouterForm,
custom: CustomLinkForm,
};
export function formFor(type) {
return FORMS[type] ?? null;
}