diff --git a/frontend/src/components/FormField.jsx b/frontend/src/components/FormField.jsx index 4ec2a80a..b36cab57 100644 --- a/frontend/src/components/FormField.jsx +++ b/frontend/src/components/FormField.jsx @@ -2,6 +2,7 @@ import { useId, useMemo } from 'react'; import { Label } from '@/components/ui/label'; import { FieldContext } from '@/components/ui/field-context'; import { cn } from '@/lib/utils'; +import InfoTip from './InfoTip'; /** * Standard form field wrapper: label, hint, error message, and input slot. @@ -22,6 +23,7 @@ export function FormField({ children, error, hint, + info, required = false, className, labelClassName, @@ -42,12 +44,17 @@ export function FormField({ return (
- {label && ( - - )} + {label && (() => { + const labelEl = ( + + ); + return info + ?
{labelEl}{info}
+ : labelEl; + })()}
{children} diff --git a/frontend/src/components/IconStepStrip.jsx b/frontend/src/components/IconStepStrip.jsx new file mode 100644 index 00000000..2a9bd481 --- /dev/null +++ b/frontend/src/components/IconStepStrip.jsx @@ -0,0 +1,36 @@ +import { Info, ChevronRight } from 'lucide-react'; +import InfoTip from './InfoTip'; + +// 2-4 steps as equal-width pills (icon + short label) joined by chevrons. +// A step with `info` makes its whole pill the tap/hover target for the detail. +// steps = [{ icon: ReactNode, label: string, info?: ReactNode }] +export default function IconStepStrip({ steps, className = '' }) { + return ( +
    + {steps.map((s, i) => { + const body = ( + <> + + {s.label} + + ); + return ( +
  1. + {i > 0 &&
  2. + ); + })} +
+ ); +} diff --git a/frontend/src/components/InfoTip.jsx b/frontend/src/components/InfoTip.jsx new file mode 100644 index 00000000..b91cff26 --- /dev/null +++ b/frontend/src/components/InfoTip.jsx @@ -0,0 +1,79 @@ +import { useRef, useState } from 'react'; +import { Info } from 'lucide-react'; +import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover'; +import { Sheet, SheetTrigger, SheetContent, SheetTitle } from '@/components/ui/sheet'; +import useMediaQuery from '../hooks/useMediaQuery'; +import { t } from '../i18n/t'; + +// An (i) button that holds the explanation a page used to print inline. +// Mouse: hover/focus previews it. Touch, click, Enter and Space: toggles a +// pinned popover that closes on outside tap or Escape. Narrow screens get a +// bottom sheet instead, so the text never sits on top of the content it +// explains. Both are portalled (no button-in-button) and above Modal/Sheet. +// `trigger` replaces the (i) glyph (e.g. a whole step pill); `title` heads the sheet. +export default function InfoTip({ children, label, title, trigger, side = 'top', size = 'sm', className = '' }) { + const [open, setOpen] = useState(false); + const narrow = useMediaQuery('(max-width: 640px)'); + const pinned = useRef(false); + const hoverable = (e) => e.pointerType === 'mouse'; + + const onOpenChange = (next) => { + pinned.current = next; + setOpen(next); + }; + const stop = (e) => e.stopPropagation(); + const noFocus = (e) => e.preventDefault(); + + const button = ( + // eslint-disable-next-line no-restricted-syntax -- bare 18px glyph button; Button/IconButton add control-sized chrome and a nested Tip + + ); + + if (narrow) { + return ( + + {button} + + {title || label || t('common.moreInfo', 'More info')} +
{children}
+
+
+ ); + } + + return ( + + {button} + + {children} + + + ); +} diff --git a/frontend/src/components/SectionIntro.jsx b/frontend/src/components/SectionIntro.jsx new file mode 100644 index 00000000..156359ee --- /dev/null +++ b/frontend/src/components/SectionIntro.jsx @@ -0,0 +1,26 @@ +import InfoTip from './InfoTip'; +import IconStepStrip from './IconStepStrip'; + +// One short line with the longer explanation tucked in an (i). With `icon` +// and/or `steps` it becomes a compact card banner: icon tile + title + (i), +// then the IconStepStrip (one row on desktop, two on mobile). +export default function SectionIntro({ children, info, icon, steps, className = '' }) { + if (!icon && !steps) { + return ( +

+ {children} + {info && {info}} +

+ ); + } + return ( +
+
+ {icon && } + {children} + {info && {info}} +
+ {steps && } +
+ ); +} diff --git a/frontend/src/components/backups/BackupsOverview.jsx b/frontend/src/components/backups/BackupsOverview.jsx index 90a282ff..4a24e119 100644 --- a/frontend/src/components/backups/BackupsOverview.jsx +++ b/frontend/src/components/backups/BackupsOverview.jsx @@ -9,6 +9,7 @@ import api from '../../services/api'; import { formatBytes } from '@/utils/formatBytes'; import { KpiBand, MetricCard, Pill, DataTable, DataTableFooter } from '@/components/ds'; import EmptyState from '../EmptyState'; +import InfoTip from '../InfoTip'; import { useTranslation } from 'react-i18next'; import { formatDuration, formatNumber } from '@/utils/intl'; @@ -407,9 +408,12 @@ export default function BackupsOverview({
))} {destinations.count === 1 && ( -

- - {t('app.backupsOverview.everythingIsOnOneDiskAdd', 'Everything is on one disk. Add a remote destination so a dead server doesn\'t take the backups with it.')} +

+ + + {t('app.backupsOverview.everythingIsOnOneDiskAdd', 'Everything is on one disk. Add a remote destination so a dead server doesn\'t take the backups with it.')}

)} diff --git a/frontend/src/components/ds/CatalogCard.jsx b/frontend/src/components/ds/CatalogCard.jsx index af4bc3fe..606d752c 100644 --- a/frontend/src/components/ds/CatalogCard.jsx +++ b/frontend/src/components/ds/CatalogCard.jsx @@ -2,6 +2,7 @@ import { Star } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { t } from '@/i18n/t'; +import InfoTip from '@/components/InfoTip'; /** * The one card for things you browse to install or deploy: extensions, @@ -21,6 +22,9 @@ import { t } from '@/i18n/t'; * /> * * + * `description` lives in an (i) beside the tag, not as a paragraph; `chips` + * (short strings) show as a tag row in its place. + * * One tag, one action. Version, author and counts go in `sub` / `facts` as * plain text rather than as more badges. * @@ -35,6 +39,7 @@ export function CatalogCard({ sub, tag, description, + chips, facts, action, featured = false, @@ -78,8 +83,13 @@ export function CatalogCard({ {sub && {sub}} {tag && {tag}} + {description && {description}}
- {description &&

{description}

} + {chips?.length > 0 && ( +
+ {chips.map((c) => {c})} +
+ )} {(facts || action) && (
{facts} diff --git a/frontend/src/components/illustrations/LockShieldIllustration.jsx b/frontend/src/components/illustrations/LockShieldIllustration.jsx new file mode 100644 index 00000000..c6b47b0e --- /dev/null +++ b/frontend/src/components/illustrations/LockShieldIllustration.jsx @@ -0,0 +1,8 @@ +// Decorative; the surrounding text carries the meaning. +export default function LockShieldIllustration() { + return ( + + ); +} diff --git a/frontend/src/components/proxy/ProxyLogoTiles.jsx b/frontend/src/components/proxy/ProxyLogoTiles.jsx new file mode 100644 index 00000000..6bc54071 --- /dev/null +++ b/frontend/src/components/proxy/ProxyLogoTiles.jsx @@ -0,0 +1,22 @@ +import { SiNginx, SiTraefikproxy, SiCaddy } from 'react-icons/si'; +import { t } from '../../i18n/t'; + +// The three proxy choices as logo tiles with a one-line caption each. +export default function ProxyLogoTiles() { + const items = [ + { Icon: SiNginx, name: 'Nginx', sub: t('app.proxyLogoTiles.hostDefault', 'Host default') }, + { Icon: SiTraefikproxy, name: 'Traefik', sub: t('app.proxyLogoTiles.dockerStack', 'Docker stack') }, + { Icon: SiCaddy, name: 'Caddy', sub: t('app.proxyLogoTiles.dockerStack', 'Docker stack') }, + ]; + return ( + + ); +} diff --git a/frontend/src/components/proxy/ProxyStackPanel.jsx b/frontend/src/components/proxy/ProxyStackPanel.jsx index b3e5ead0..65fd1d2a 100644 --- a/frontend/src/components/proxy/ProxyStackPanel.jsx +++ b/frontend/src/components/proxy/ProxyStackPanel.jsx @@ -6,6 +6,8 @@ import { Button } from '@/components/ui/button'; import { Textarea } from '@/components/ui/textarea'; import { Pill, SegControl, serviceStatusKind } from '../ds'; import EmptyState from '../EmptyState'; +import InfoTip from '../InfoTip'; +import ProxyLogoTiles from './ProxyLogoTiles'; import { AlertTriangle, CheckCircle2, Network } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { toastError } from '@/utils/errorMessage'; @@ -199,9 +201,10 @@ const ProxyStackPanel = ({ serverId }) => {
-

- {t('app.proxyStackPanel.hostNginxIsTheDefaultAnd', 'Host Nginx is the default and is recommended for PHP/WordPress. You can opt into a Dockerized Traefik or Caddy proxy deployed as a Compose stack.')} -

+
+ + {t('app.proxyStackPanel.hostNginxIsTheDefaultAnd', 'Host Nginx is the default and is recommended for PHP/WordPress. You can opt into a Dockerized Traefik or Caddy proxy deployed as a Compose stack.')} +
{audit && audit.mismatch_count > 0 && (
@@ -301,7 +304,7 @@ const ProxyStackPanel = ({ serverId }) => { {t('app.proxyStackPanel.theHostSNginxIsHandling', 'The host\'s Nginx is handling reverse proxying. Switch to Traefik or Caddy above to run a managed Docker proxy stack instead.')}} /> )}
diff --git a/frontend/src/components/security/IntegrityTab.jsx b/frontend/src/components/security/IntegrityTab.jsx index 75de07b1..a087c8e5 100644 --- a/frontend/src/components/security/IntegrityTab.jsx +++ b/frontend/src/components/security/IntegrityTab.jsx @@ -11,6 +11,9 @@ import { import { useTableSort } from '@/hooks/useTableSort'; import { useColumnVisibility } from '@/hooks/useColumnVisibility'; import { useTranslation } from 'react-i18next'; +import { Camera, Eye, FileCheck, GitCompare, ShieldOff } from 'lucide-react'; +import InfoTip from '@/components/InfoTip'; +import SectionIntro from '@/components/SectionIntro'; import { Card as SharedCard, CardHeader as SharedCardHeader, CardContent as SharedCardContent } from '@/components/ui/card'; // Scoped file-integrity monitoring: baseline-and-diff over the paths @@ -309,17 +312,26 @@ const IntegrityTab = () => { : clean)} -

- {baseline - ? t('app.integrityTab.baselineSummary', { + {baseline ? ( +

+ {t('app.integrityTab.baselineSummary', { count: baseline.file_count, age: formatAge(baseline.created_at) || t('app.integrityTab.unknownAge', 'unknown age'), defaultValue_one: 'Baseline: 1 file, {{age}}', defaultValue_other: 'Baseline: {{count}} files, {{age}}', - }) - : t('app.integrityTab.noBaselineYet', 'No baseline yet. Create one to start tracking changes.')} - {check && ` · ${t('app.integrityTab.lastCheck', 'Last check {{age}}', { age: formatAge(check.checked_at) || '' })}`} -

+ })} + {check && ` · ${t('app.integrityTab.lastCheck', 'Last check {{age}}', { age: formatAge(check.checked_at) || '' })}`} +

+ ) : ( +

+ + + {t('app.integrityTab.noBaselineYet', 'No baseline yet. Create one to start tracking changes.')} + {check && ` · ${t('app.integrityTab.lastCheck', 'Last check {{age}}', { age: formatAge(check.checked_at) || '' })}`} +

+ )} {/* These act on the SCOPE and are there whether or not the changes list is open, so they keep their own bar; the table's chrome rides the view line below. */} @@ -427,21 +439,28 @@ const IntegrityTab = () => { )} -

- {t('app.integrityTab.baselineAndDiffMonitoringOverThe', 'Baseline-and-diff monitoring over the paths ServerKit manages. Baseline a scope, then check it (or let the scheduled sweep do it). Any added, removed or modified files are flagged and admins are notified. Accepting changes re-baselines the scope.')} -

+ } + info={t('app.integrityTab.baselineAndDiffMonitoringOverThe', 'Baseline-and-diff monitoring over the paths ServerKit manages. Baseline a scope, then check it (or let the scheduled sweep do it). Any added, removed or modified files are flagged and admins are notified. Accepting changes re-baselines the scope.')} + steps={[ + { icon: , label: t('app.integrityTab.stepBaseline', 'Baseline'), info: t('app.integrityTab.stepBaselineInfo', 'Snapshot the current files of a scope.') }, + { icon: , label: t('app.integrityTab.stepWatch', 'Watch'), info: t('app.integrityTab.stepWatchInfo', 'Check manually or let the scheduled sweep run.') }, + { icon: , label: t('app.integrityTab.stepDiff', 'Diff'), info: t('app.integrityTab.stepDiffInfo', 'Added, removed or modified files are flagged and admins are notified. Accepting re-baselines.') }, + ]} + > + {t('app.integrityTab.headerLine', 'Detect changed config files')} + {managedScopes.map(renderScopeCard)} {appScopes.map(renderScopeCard)} -

{t('app.integrityTab.applicationDocroots', 'Service docroots')} {t('app.integrityTab.optIn', '· opt-in')}

+

{t('app.integrityTab.applicationDocroots', 'Service docroots')} {t('app.integrityTab.optIn', '· opt-in')}{' '} + {t('app.integrityTab.watchingADocrootHashesEveryFile', 'Watching a docroot hashes every file outside upload/cache directories, so it is opt-in per service.')} +

-

- {t('app.integrityTab.watchingADocrootHashesEveryFile', 'Watching a docroot hashes every file outside upload/cache directories, so it is opt-in per service.')} -

{appsError ? ( ) : apps.length === 0 ? ( diff --git a/frontend/src/components/security/OverviewTab.jsx b/frontend/src/components/security/OverviewTab.jsx index ea30c7ff..9c413c8d 100644 --- a/frontend/src/components/security/OverviewTab.jsx +++ b/frontend/src/components/security/OverviewTab.jsx @@ -15,7 +15,10 @@ import { Siren, Bug, Radar, + Puzzle, + Bell, } from 'lucide-react'; +import InfoTip from '@/components/InfoTip'; import { Card as SharedCard, CardHeader as SharedCardHeader, CardContent as SharedCardContent } from '@/components/ui/card'; // Status glyph per check state — paired with the label so state never relies on @@ -196,17 +199,22 @@ const OverviewTab = ({ status, onRefresh, onNavigateTab }) => { })} -

+

{!hasSecurityExtensions && ( <> - {t('app.overviewTab.moreSecurityTools', 'More security tools (malware scanning, brute-force protection, vulnerability scans, auto-updates) are available as extensions in the')} - {' '} - {t('app.overviewTab.marketplaceLink', 'Extensions')} - {'. '} + +
diff --git a/frontend/src/components/serverdetail/ServerSettingsTab.jsx b/frontend/src/components/serverdetail/ServerSettingsTab.jsx index 8627202c..d36fcce8 100644 --- a/frontend/src/components/serverdetail/ServerSettingsTab.jsx +++ b/frontend/src/components/serverdetail/ServerSettingsTab.jsx @@ -5,6 +5,7 @@ import { useToast } from '../../contexts/useToast.js'; import { useConfirm } from '../../hooks/useConfirm'; import CopyField from '@/components/CopyField'; import { InfoList, InfoItem } from '../InfoList'; +import InfoTip from '../InfoTip'; import { DangerZone } from '../DangerZone'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; @@ -45,12 +46,13 @@ const AgentRegistrationSection = ({ server, onRegenerateToken }) => {
-

{t('app.serverSettingsTab.connectionString', 'Connection string')}

-

+

{t('app.serverSettingsTab.connectionString', 'Connection string')} + {t('app.serverSettingsTab.generateAFreshConnectionStringTo', 'Generate a fresh connection string to pair (or re-pair) this server. Useful after reinstalling the agent: old credentials are gone, but a new string brings the agent right back to this row.')} {isOnline && ` ${t('app.serverSettingsTab.onlineRegenerateNote', 'This server is online now; a new string only affects re-pairing.')}`} {isExpired && ` ${t('app.serverSettingsTab.previousTokenExpired', 'The previous token has expired.')}`} -

+

+

{t('app.serverSettingsTab.pairOrRepair', 'Pair or re-pair this server.')}

{preview &&
{connections.find((item) => item.id === preview.connection_id)?.name} · {preview.model}

{preview.reason}

} {toggle('fallback_enabled', t('ai.management.enableFallback', 'Enable fallback before output starts'))} -

{t('ai.management.fallbackHint', 'Candidates are tried in order using their own saved credentials. Delivered output and tool actions are never replayed. Degradation chooses a lower-priced candidate before a turn at 80% of the conversation allowance; unknown prices cannot be compared.')}

+ {t('ai.management.fallbackHint', 'Candidates are tried in order using their own saved credentials. Delivered output and tool actions are never replayed. Degradation chooses a lower-priced candidate before a turn at 80% of the conversation allowance; unknown prices cannot be compared.')} {candidates('fallbacks')}
@@ -132,10 +131,10 @@ export default function AIManagementSettings({ connections, defaultId }) { {numberField('max_tool_rounds', t('ai.management.toolRounds', 'Maximum tool rounds'), 1, 20)} {numberField('max_tool_result_length', t('ai.management.toolLength', 'Maximum tool result characters'), 256, 32000)} {numberField('max_history_messages', t('ai.management.history', 'Messages kept in model context'), 4, 200)} - + change('temperature', e.target.value === '' ? null : e.target.value)} /> - + setSettings((s) => ({ ...s, max_cost_usd: e.target.value }))} /> -

{t('ai.settings.costHint', 'Used by the budget behavior in Task models and behavior. A call can exceed the remaining amount; models with unknown pricing need a provider-side limit. Set 0 for no limit.')}

diff --git a/frontend/src/components/settings/AppearanceTab.jsx b/frontend/src/components/settings/AppearanceTab.jsx index 721fa0f8..e9d4923a 100644 --- a/frontend/src/components/settings/AppearanceTab.jsx +++ b/frontend/src/components/settings/AppearanceTab.jsx @@ -13,6 +13,7 @@ import ThemeBrowseModal from './ThemeBrowseModal'; import ThemeStudioModal from './ThemeStudioModal'; import api from '../../services/api'; import { useTranslation } from 'react-i18next'; +import InfoTip from '../InfoTip'; import { toastError } from '@/utils/errorMessage'; const ACCENT_PRESETS = [ @@ -64,8 +65,7 @@ const AppearanceTab = () => {
-

{t('app.appearanceTab.theme', 'Theme')}

-

{t('app.appearanceTab.selectYourPreferredColorScheme', 'Select your preferred color scheme')}

+

{t('app.appearanceTab.theme', 'Theme')} {t('app.appearanceTab.selectYourPreferredColorScheme', 'Select your preferred color scheme')}

-

{t('app.appearanceTab.accentColor', 'Accent color')}

-

{t('app.appearanceTab.chooseThePrimaryAccentColorUsed', 'Choose the primary accent color used across the interface.')}

+

{t('app.appearanceTab.accentColor', 'Accent color')} {t('app.appearanceTab.chooseThePrimaryAccentColorUsed', 'Choose the primary accent color used across the interface.')}

{ACCENT_PRESETS.map(({ label, color }) => (
-

{t('app.appearanceTab.dashboardWidgets', 'Dashboard widgets')}

-

- {t('app.appearanceTab.widgetsAreArrangedOnTheDashboard', 'Widgets are arranged on the dashboard itself now. Add, move, resize and configure them in place, across as many boards as you need.')} -

+

{t('app.appearanceTab.dashboardWidgets', 'Dashboard widgets')} {t('app.appearanceTab.widgetsAreArrangedOnTheDashboard', 'Widgets are arranged on the dashboard itself now. Add, move, resize and configure them in place, across as many boards as you need.')}

- - {t('app.siteSettingsTab.newAppsGetTheFirstFree', 'New services get the first free port at or above this number. Set to')} 0 {t('app.siteSettingsTab.toUseEachTemplateSOwn', 'to use each template\'s own default (WordPress starts at 8300). Ports already in use are always skipped, so collisions can\'t happen.')} -
-

{t('app.siteSettingsTab.managedSitesBaseDomains', 'Managed services: base domains')}

-

{t('app.siteSettingsTab.publishManagedSitesAt', 'Publish managed services at')} <name>.<base-domain>. {t('app.siteSettingsTab.registerBaseDomains', 'Register one or more base domains; a new service can be created under any of them, defaulting to the one marked')} {t('common.labels.default', 'Default')}. {t('app.siteSettingsTab.pointAWildcardRecord', 'Point a wildcard record')} *.<base> {t('app.siteSettingsTab.orPerSiteARecordsAt', '(or per-service A records) at this server.')}

+

{t('app.siteSettingsTab.managedSitesBaseDomains', 'Managed services: base domains')} {t('app.siteSettingsTab.publishManagedSitesAt', 'Publish managed services at')} <name>.<base-domain>. {t('app.siteSettingsTab.registerBaseDomains', 'Register one or more base domains; a new service can be created under any of them, defaulting to the one marked')} {t('common.labels.default', 'Default')}. {t('app.siteSettingsTab.pointAWildcardRecord', 'Point a wildcard record')} *.<base> {t('app.siteSettingsTab.orPerSiteARecordsAt', '(or per-service A records) at this server.')}

{httpsError ? ( {
- + {t('app.siteSettingsTab.sharedByEveryBaseDomainUsed', 'Shared by every base domain. Used to auto-create their DNS A records.')}
{
- {t('app.siteSettingsTab.sharedByEveryBaseDomainUsed', 'Shared by every base domain. Used to auto-create their DNS A records.')}
{https.providers?.length > 0 ? (
-
+
{t('app.siteSettingsTab.usedToIssueEachBaseS', 'Used to issue each base\'s wildcard certificate (DNS-01). Each base can use a different connected provider.')}
- {t('app.siteSettingsTab.usedToIssueEachBaseS', 'Used to issue each base\'s wildcard certificate (DNS-01). Each base can use a different connected provider.')}
) : ( {t('app.siteSettingsTab.connectADnsProviderUnderEmail', 'Connect a DNS provider under Email → DNS providers to enable per-domain wildcard HTTPS.')} @@ -524,6 +510,10 @@ const SiteSettingsTab = ({ onDevModeChange }) => { )} + {t('app.siteSettingsTab.sitesPublishAt', 'Services publish at')} <name>.{b.domain || 'base-domain'}.{' '} + {(b.dns_mode || 'wildcard') === 'wildcard' + ? <>{t('app.siteSettingsTab.point', 'Point')} *.{b.domain || 'base-domain'} {t('app.siteSettingsTab.atThisServer', 'at this server.')} + : <>{t('app.siteSettingsTab.eachNewSiteGetsItsOwn', 'Each new service gets its own A record, auto-created via the provider.')}}