Replace the separate Market Ticker and OpenRouter Stats settings sections with a single Tickers & Stats section. It lists every active ticker/stat with its settings and remove actions, and offers one Add integration button that opens the generic integration list filtered to tickers and stats. The add button is hidden once every single-instance integration is connected, matching the old sections' behavior.
102 lines
3.6 KiB
JavaScript
102 lines
3.6 KiB
JavaScript
// Global settings dialog navigation. Phase 1 renders placeholder content for
|
|
// each section; real forms will replace the placeholders one section at a time.
|
|
//
|
|
// `icon` is an array of SVG path `d` strings (24x24 viewBox, stroke based) so
|
|
// the nav can stay data driven without a separate icon component. Icons come
|
|
// from Feather (https://feathericons.com) where an equivalent exists; the
|
|
// globe is Heroicons and the chart and image icons are Lucide, because
|
|
// Feather has no match.
|
|
|
|
export const SETTINGS_GROUPS = [
|
|
{
|
|
label: 'Integrations',
|
|
items: [
|
|
{
|
|
id: 'photos',
|
|
label: 'Photos',
|
|
description: 'Choose the photos shown behind your dashboard.',
|
|
// Lucide image.
|
|
icon: [
|
|
'M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z',
|
|
'M11 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0z',
|
|
'm21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21',
|
|
],
|
|
},
|
|
{
|
|
id: 'site-links',
|
|
label: 'Site Links',
|
|
description: 'Manage the quick links shown in the top right corner.',
|
|
icon: [
|
|
'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71',
|
|
'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71',
|
|
],
|
|
},
|
|
{
|
|
id: 'events',
|
|
label: 'Calendar',
|
|
description: 'Control the upcoming events widget and its sources.',
|
|
icon: [
|
|
'M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z',
|
|
'M16 2v4',
|
|
'M8 2v4',
|
|
'M3 10h18',
|
|
],
|
|
},
|
|
{
|
|
id: 'tickers-stats',
|
|
label: 'Tickers & Stats',
|
|
description: 'Track asset prices and usage stats on your dashboard.',
|
|
// Lucide chart-no-axes-combined.
|
|
icon: [
|
|
'M12 16v5',
|
|
'M16 14.639V21',
|
|
'M20 10.656V21',
|
|
'm22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15',
|
|
'M4 18.463V21',
|
|
'M8 14.656V21',
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: 'Advanced',
|
|
items: [
|
|
{
|
|
id: 'protocol-gateway',
|
|
label: 'Protocol Gateway',
|
|
description:
|
|
'Configure the Sockethub server used by protocol integrations.',
|
|
// Heroicons globe-alt (no Feather equivalent).
|
|
icon: [
|
|
'M12 21C16.1926 21 19.7156 18.1332 20.7157 14.2529M12 21C7.80742 21 4.28442 18.1332 3.2843 14.2529M12 21C14.4853 21 16.5 16.9706 16.5 12C16.5 7.02944 14.4853 3 12 3M12 21C9.51472 21 7.5 16.9706 7.5 12C7.5 7.02944 9.51472 3 12 3M12 3C15.3652 3 18.299 4.84694 19.8431 7.58245M12 3C8.63481 3 5.70099 4.84694 4.15692 7.58245M19.8431 7.58245C17.7397 9.40039 14.9983 10.5 12 10.5C9.00172 10.5 6.26027 9.40039 4.15692 7.58245M19.8431 7.58245C20.5797 8.88743 21 10.3946 21 12C21 12.778 20.9013 13.5329 20.7157 14.2529M20.7157 14.2529C18.1334 15.6847 15.1619 16.5 12 16.5C8.8381 16.5 5.86662 15.6847 3.2843 14.2529M3.2843 14.2529C3.09871 13.5329 3 12.778 3 12C3 10.3946 3.42032 8.88743 4.15692 7.58245',
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: 'About',
|
|
items: [
|
|
{
|
|
id: 'about',
|
|
label: 'About Dashtab',
|
|
description: 'Version information and project links.',
|
|
icon: [
|
|
'M12 2a10 10 0 1 0 0 20a10 10 0 1 0 0-20z',
|
|
'M12 16v-4',
|
|
'M12 8h.01',
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
export const SETTINGS_SECTIONS = SETTINGS_GROUPS.flatMap(
|
|
(group) => group.items
|
|
);
|
|
|
|
export const DEFAULT_SETTINGS_SECTION_ID = SETTINGS_SECTIONS[0]?.id ?? null;
|
|
|
|
export function findSettingsSection(id) {
|
|
return SETTINGS_SECTIONS.find((section) => section.id === id) ?? null;
|
|
}
|