Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Tie form labels to their fields

Juan Denis0adb6bf7526f
diff --git a/frontend/scripts/file-manager-browser.mjs b/frontend/scripts/file-manager-browser.mjs
index 74c5857d..f1039b94 100644
--- a/frontend/scripts/file-manager-browser.mjs
+++ b/frontend/scripts/file-manager-browser.mjs
@@ -126,7 +126,8 @@ try {
assert.deepEqual(await lastOp(), ['rename', '/home/projects', 'work']);
await dlg.getByTitle('Permissions').first().click();
- const modeInput = dlg.getByPlaceholder('755');
+ // Found by its label: the label is associated with the field.
+ const modeInput = dlg.getByLabel('Permissions (octal)');
assert.equal(await modeInput.inputValue(), '750');
await modeInput.fill('700');
await dlg.getByRole('button', { name: 'Apply' }).click();
diff --git a/frontend/src/components/ConfirmDialog.jsx b/frontend/src/components/ConfirmDialog.jsx
index 54228fe8..8ee697ee 100644
--- a/frontend/src/components/ConfirmDialog.jsx
+++ b/frontend/src/components/ConfirmDialog.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { AlertTriangle, Info, AlertCircle } from 'lucide-react';
import {
@@ -31,6 +31,7 @@ export function ConfirmDialog({
onCancel,
}) {
const { t } = useTranslation();
+ const fieldId = useId();
const [inputValue, setInputValue] = useState('');
useEffect(() => { if (isOpen) setInputValue(''); }, [isOpen]);
@@ -54,7 +55,7 @@ export function ConfirmDialog({
</div>
{requireConfirmation && (
<div className="sk-confirm__confirm-field">
- <Label>
+ <Label htmlFor={`${fieldId}-confirm`}>
{/* One key, not a prefix/suffix pair: word order around the
typed value differs by language, and split sentences cannot
be reordered by a translator. */}
@@ -66,6 +67,7 @@ export function ConfirmDialog({
/>
</Label>
<Input
+ id={`${fieldId}-confirm`}
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onKeyDown={(e) => e.key === 'Enter' && !isConfirmDisabled && onConfirm()}
diff --git a/frontend/src/components/EnvironmentVariables.jsx b/frontend/src/components/EnvironmentVariables.jsx
index b8e903a7..a452e3a4 100644
--- a/frontend/src/components/EnvironmentVariables.jsx
+++ b/frontend/src/components/EnvironmentVariables.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useCallback, useEffect, useMemo, useRef, useState, useId } from 'react';
import {
Copy, Download, Eye, EyeOff, History, Pencil, Plus, Trash2, Upload, Variable,
} from 'lucide-react';
@@ -74,6 +74,7 @@ const EVERY_SERVICE = '__all';
const EnvironmentVariables = ({ appId }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const showError = toast.error;
const { confirm } = useConfirm();
@@ -635,8 +636,9 @@ const EnvironmentVariables = ({ appId }) => {
<Modal open={showAddModal} onClose={() => setShowAddModal(false)} title={t('app.environmentVariables.addEnvironmentVariable', 'Add environment variable')}>
<form onSubmit={handleAdd}>
<div className="form-group">
- <Label>{t('common.labels.key', 'Key')}</Label>
+ <Label htmlFor={`${fieldId}-key`}>{t('common.labels.key', 'Key')}</Label>
<Input
+ id={`${fieldId}-key`}
type="text"
value={newKey}
onChange={(e) => setNewKey(e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, ''))}
@@ -646,8 +648,9 @@ const EnvironmentVariables = ({ appId }) => {
/>
</div>
<div className="form-group">
- <Label>{t('common.labels.value', 'Value')}</Label>
+ <Label htmlFor={`${fieldId}-value`}>{t('common.labels.value', 'Value')}</Label>
<Input
+ id={`${fieldId}-value`}
type="text"
value={newValue}
onChange={(e) => setNewValue(e.target.value)}
@@ -655,8 +658,9 @@ const EnvironmentVariables = ({ appId }) => {
/>
</div>
<div className="form-group">
- <Label>{t('common.labels.description', 'Description')} <span className="env-optional">(optional)</span></Label>
+ <Label htmlFor={`${fieldId}-description`}>{t('common.labels.description', 'Description')} <span className="env-optional">(optional)</span></Label>
<Input
+ id={`${fieldId}-description`}
type="text"
value={newDescription}
onChange={(e) => setNewDescription(e.target.value)}
diff --git a/frontend/src/components/JournalControls.jsx b/frontend/src/components/JournalControls.jsx
index 19022ffe..76ba0225 100644
--- a/frontend/src/components/JournalControls.jsx
+++ b/frontend/src/components/JournalControls.jsx
@@ -1,3 +1,4 @@
+import { useId } from 'react';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
@@ -37,12 +38,14 @@ export function JournalControls({
loadLabel = 'Load Logs',
}) {
const { t } = useTranslation();
+ const fieldId = useId();
return (
<div className="journal-controls">
<div className="control-group">
- <label>{unitLabel}</label>
+ <label htmlFor={`${fieldId}-unit`}>{unitLabel}</label>
<div className="input-with-suggestions">
<Input
+ id={`${fieldId}-unit`}
type="text"
value={unit}
onChange={(e) => onUnitChange?.(e.target.value)}
@@ -66,9 +69,9 @@ export function JournalControls({
{onLineCountChange && (
<div className="control-group">
- <label>{t('app.journalControls.lines', 'Lines')}</label>
+ <label htmlFor={`${fieldId}-lines`}>{t('app.journalControls.lines', 'Lines')}</label>
<Select value={String(lineCount)} onValueChange={(v) => onLineCountChange(parseInt(v, 10))}>
- <SelectTrigger aria-label={t('app.journalControls.lines', 'Lines')}>
+ <SelectTrigger id={`${fieldId}-lines`} aria-label={t('app.journalControls.lines', 'Lines')}>
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -82,12 +85,12 @@ export function JournalControls({
{showPriority && onPriorityChange && (
<div className="control-group">
- <label>{t('app.journalControls.priority', 'Priority')}</label>
+ <label htmlFor={`${fieldId}-priority`}>{t('app.journalControls.priority', 'Priority')}</label>
<Select
value={priority == null || priority === '' ? ALL_PRIORITIES : String(priority)}
onValueChange={(v) => onPriorityChange(v === ALL_PRIORITIES ? '' : v)}
>
- <SelectTrigger aria-label={t('app.journalControls.priority', 'Priority')}>
+ <SelectTrigger id={`${fieldId}-priority`} aria-label={t('app.journalControls.priority', 'Priority')}>
<SelectValue />
</SelectTrigger>
<SelectContent>
diff --git a/frontend/src/components/appdetail/BuildTab.jsx b/frontend/src/components/appdetail/BuildTab.jsx
index 8858bca0..a9e73aca 100644
--- a/frontend/src/components/appdetail/BuildTab.jsx
+++ b/frontend/src/components/appdetail/BuildTab.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect } from 'react';
+import { useCallback, useState, useEffect, useId } from 'react';
import { useNavigate } from 'react-router-dom';
import api from '../../services/api';
import EmptyState from '../EmptyState';
@@ -18,6 +18,7 @@ import { formatDateTime } from '@/utils/intl';
const BuildTab = ({ appId, app }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const { confirm: confirmBuild } = useConfirm();
const [buildConfig, setBuildConfig] = useState(null);
@@ -311,8 +312,9 @@ const BuildTab = ({ appId, app }) => {
</div>
{configForm.buildMethod === 'dockerfile' && (
<div className="form-group">
- <label>{t('app.buildTab.dockerfilePath', 'Dockerfile path')}</label>
+ <label htmlFor={`${fieldId}-dockerfile`}>{t('app.buildTab.dockerfilePath', 'Dockerfile path')}</label>
<Input
+ id={`${fieldId}-dockerfile`}
type="text"
value={configForm.dockerfilePath}
onChange={e => setConfigForm({...configForm, dockerfilePath: e.target.value})}
@@ -322,8 +324,9 @@ const BuildTab = ({ appId, app }) => {
{configForm.buildMethod === 'custom' && (
<>
<div className="form-group">
- <label>{t('app.buildTab.buildCommand', 'Build command')}</label>
+ <label htmlFor={`${fieldId}-build-cmd`}>{t('app.buildTab.buildCommand', 'Build command')}</label>
<Input
+ id={`${fieldId}-build-cmd`}
type="text"
value={configForm.customBuildCmd}
onChange={e => setConfigForm({...configForm, customBuildCmd: e.target.value})}
@@ -331,8 +334,9 @@ const BuildTab = ({ appId, app }) => {
/>
</div>
<div className="form-group">
- <label>{t('app.buildTab.startCommand', 'Start command')}</label>
+ <label htmlFor={`${fieldId}-start-cmd`}>{t('app.buildTab.startCommand', 'Start command')}</label>
<Input
+ id={`${fieldId}-start-cmd`}
type="text"
value={configForm.customStartCmd}
onChange={e => setConfigForm({...configForm, customStartCmd: e.target.value})}
@@ -342,8 +346,9 @@ const BuildTab = ({ appId, app }) => {
</>
)}
<div className="form-group">
- <label>{t('app.buildTab.timeoutSeconds', 'Timeout (seconds)')}</label>
+ <label htmlFor={`${fieldId}-timeout`}>{t('app.buildTab.timeoutSeconds', 'Timeout (seconds)')}</label>
<Input
+ id={`${fieldId}-timeout`}
type="number"
value={configForm.timeout}
onChange={e => setConfigForm({...configForm, timeout: parseInt(e.target.value)})}
diff --git a/frontend/src/components/appdetail/DeployTab.jsx b/frontend/src/components/appdetail/DeployTab.jsx
index 2b0a079b..102611cf 100644
--- a/frontend/src/components/appdetail/DeployTab.jsx
+++ b/frontend/src/components/appdetail/DeployTab.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect } from 'react';
+import { useCallback, useState, useEffect, useId } from 'react';
import { GitMerge } from 'lucide-react';
import api from '../../services/api';
import EmptyState from '../EmptyState';
@@ -23,6 +23,7 @@ import { formatDateTime } from '@/utils/intl';
// history and config checkpoints.
const DeployTab = ({ appId, embedded = false }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const { confirm: confirmDeploy } = useConfirm();
const [config, setConfig] = useState(null);
@@ -270,8 +271,9 @@ const DeployTab = ({ appId, embedded = false }) => {
{!embedded && (
<>
<div className="form-group">
- <label>{t('app.deployTab.repositoryUrl', 'Repository URL')}</label>
+ <label htmlFor={`${fieldId}-repo-url`}>{t('app.deployTab.repositoryUrl', 'Repository URL')}</label>
<Input
+ id={`${fieldId}-repo-url`}
type="text"
value={configForm.repoUrl}
onChange={e => setConfigForm({...configForm, repoUrl: e.target.value})}
@@ -280,8 +282,9 @@ const DeployTab = ({ appId, embedded = false }) => {
/>
</div>
<div className="form-group">
- <label>{t('common.labels.branch', 'Branch')}</label>
+ <label htmlFor={`${fieldId}-branch`}>{t('common.labels.branch', 'Branch')}</label>
<Input
+ id={`${fieldId}-branch`}
type="text"
value={configForm.branch}
onChange={e => setConfigForm({...configForm, branch: e.target.value})}
@@ -301,8 +304,9 @@ const DeployTab = ({ appId, embedded = false }) => {
</>
)}
<div className="form-group">
- <label>{t('app.deployTab.preDeployScript', 'Pre-deploy script')}</label>
+ <label htmlFor={`${fieldId}-pre-deploy`}>{t('app.deployTab.preDeployScript', 'Pre-deploy script')}</label>
<Textarea
+ id={`${fieldId}-pre-deploy`}
value={configForm.preDeployScript}
onChange={e => setConfigForm({...configForm, preDeployScript: e.target.value})}
placeholder={t('app.deployTab.npmInstall', 'npm install')}
@@ -310,8 +314,9 @@ const DeployTab = ({ appId, embedded = false }) => {
/>
</div>
<div className="form-group">
- <label>{t('app.deployTab.postDeployScript', 'Post-deploy script')}</label>
+ <label htmlFor={`${fieldId}-post-deploy`}>{t('app.deployTab.postDeployScript', 'Post-deploy script')}</label>
<Textarea
+ id={`${fieldId}-post-deploy`}
value={configForm.postDeployScript}
onChange={e => setConfigForm({...configForm, postDeployScript: e.target.value})}
placeholder={t('app.deployTab.npmRunBuild', 'npm run build')}
diff --git a/frontend/src/components/backups/ScheduleCard.jsx b/frontend/src/components/backups/ScheduleCard.jsx
index 6ed7b8f0..e4bd7201 100644
--- a/frontend/src/components/backups/ScheduleCard.jsx
+++ b/frontend/src/components/backups/ScheduleCard.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import { SegControl } from '@/components/ds';
import { Switch } from '@/components/ui/switch';
import { Button } from '@/components/ui/button';
@@ -27,6 +27,7 @@ const toNum = (value) => {
const ScheduleCard = ({ policy, remoteConfigured, onSave, saving }) => {
const { t } = useTranslation();
+ const fieldId = useId();
// All hooks run unconditionally, before any early return (Rules of Hooks).
// The form is only shown once a policy exists, so the seed values used when
// `policy` is null are throwaway and get re-seeded by the effect on load.
@@ -145,9 +146,10 @@ const ScheduleCard = ({ policy, remoteConfigured, onSave, saving }) => {
</div>
<div className="schedule-card__field">
- <label>{t('app.scheduleCard.fullBackupEvery', 'Full backup every')}</label>
+ <label htmlFor={`${fieldId}-full-every`}>{t('app.scheduleCard.fullBackupEvery', 'Full backup every')}</label>
<div className="schedule-card__retention-row">
<Input
+ id={`${fieldId}-full-every`}
type="number"
min={MIN_COUNT}
value={fullEvery}
diff --git a/frontend/src/components/databases/modals.jsx b/frontend/src/components/databases/modals.jsx
index a09d9be9..a9765316 100644
--- a/frontend/src/components/databases/modals.jsx
+++ b/frontend/src/components/databases/modals.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useId, useState } from 'react';
import { Plus } from 'lucide-react';
import api from '../../services/api';
import Modal from '@/components/Modal';
@@ -108,6 +108,7 @@ function EnginePicker({ value, onChange, status, onInstallEngine }) {
export function CreateDatabaseModal({ engine: initialEngine = 'mysql', status, onClose, onCreated, onInstallEngine }) {
const { t } = useTranslation();
+ const fieldId = useId();
const [engine, setEngine] = useState(initialEngine);
const [formData, setFormData] = useState({
name: '', charset: 'utf8mb4', collation: 'utf8mb4_unicode_ci', encoding: 'UTF8', create_user: true,
@@ -188,8 +189,8 @@ export function CreateDatabaseModal({ engine: initialEngine = 'mysql', status, o
</div>
<div className="form-group">
- <label>{t('app.modals.databaseName', 'Database name *')}</label>
- <Input type="text" value={formData.name} onChange={(e) => setFormData({ ...formData, name: e.target.value })} placeholder="my_database" required pattern="[a-zA-Z0-9_]+" autoFocus />
+ <label htmlFor={`${fieldId}-name`}>{t('app.modals.databaseName', 'Database name *')}</label>
+ <Input id={`${fieldId}-name`} type="text" value={formData.name} onChange={(e) => setFormData({ ...formData, name: e.target.value })} placeholder="my_database" required pattern="[a-zA-Z0-9_]+" autoFocus />
</div>
{isMySQL ? (
@@ -268,6 +269,7 @@ export function CreateDatabaseModal({ engine: initialEngine = 'mysql', status, o
export function CreateMySQLUserModal({ databases, onClose, onCreated }) {
const { t } = useTranslation();
+ const fieldId = useId();
const [formData, setFormData] = useState({ username: '', password: '', host: 'localhost', database: '', privileges: 'ALL' });
const [loading, setLoading] = useState(false);
const [error, setError] = useState('');
@@ -311,13 +313,13 @@ export function CreateMySQLUserModal({ databases, onClose, onCreated }) {
{error && <div className="error-message">{error}</div>}
<form onSubmit={handleSubmit}>
<div className="form-group">
- <label>{t('app.modals.username', 'Username *')}</label>
- <Input type="text" value={formData.username} onChange={(e) => setFormData({ ...formData, username: e.target.value })} placeholder="db_user" required autoFocus />
+ <label htmlFor={`${fieldId}-username`}>{t('app.modals.username', 'Username *')}</label>
+ <Input id={`${fieldId}-username`} type="text" value={formData.username} onChange={(e) => setFormData({ ...formData, username: e.target.value })} placeholder="db_user" required autoFocus />
</div>
<div className="form-group">
- <label>{t('common.labels.password', 'Password')}</label>
+ <label htmlFor={`${fieldId}-password`}>{t('common.labels.password', 'Password')}</label>
<div className="input-with-button">
- <Input type="text" value={formData.password} onChange={(e) => setFormData({ ...formData, password: e.target.value })} placeholder={t('app.modals.leaveEmptyToAutoGenerate', 'Leave empty to auto-generate')} />
+ <Input id={`${fieldId}-password`} type="text" value={formData.password} onChange={(e) => setFormData({ ...formData, password: e.target.value })} placeholder={t('app.modals.leaveEmptyToAutoGenerate', 'Leave empty to auto-generate')} />
<Button type="button" variant="outline" size="sm" onClick={generatePassword}>{t('app.modals.generate', 'Generate')}</Button>
</div>
</div>
@@ -352,6 +354,7 @@ export function CreateMySQLUserModal({ databases, onClose, onCreated }) {
export function CreatePostgreSQLUserModal({ databases, onClose, onCreated }) {
const { t } = useTranslation();
+ const fieldId = useId();
const [formData, setFormData] = useState({ username: '', password: '', database: '' });
const [loading, setLoading] = useState(false);
const [error, setError] = useState('');
@@ -395,13 +398,13 @@ export function CreatePostgreSQLUserModal({ databases, onClose, onCreated }) {
{error && <div className="error-message">{error}</div>}
<form onSubmit={handleSubmit}>
<div className="form-group">
- <label>{t('app.modals.username', 'Username *')}</label>
- <Input type="text" value={formData.username} onChange={(e) => setFormData({ ...formData, username: e.target.value })} placeholder="db_user" required autoFocus />
+ <label htmlFor={`${fieldId}-username`}>{t('app.modals.username', 'Username *')}</label>
+ <Input id={`${fieldId}-username`} type="text" value={formData.username} onChange={(e) => setFormData({ ...formData, username: e.target.value })} placeholder="db_user" required autoFocus />
</div>
<div className="form-group">
- <label>{t('common.labels.password', 'Password')}</label>
+ <label htmlFor={`${fieldId}-password`}>{t('common.labels.password', 'Password')}</label>
<div className="input-with-button">
- <Input type="text" value={formData.password} onChange={(e) => setFormData({ ...formData, password: e.target.value })} placeholder={t('app.modals.leaveEmptyToAutoGenerate', 'Leave empty to auto-generate')} />
+ <Input id={`${fieldId}-password`} type="text" value={formData.password} onChange={(e) => setFormData({ ...formData, password: e.target.value })} placeholder={t('app.modals.leaveEmptyToAutoGenerate', 'Leave empty to auto-generate')} />
<Button type="button" variant="outline" size="sm" onClick={generatePassword}>{t('app.modals.generate', 'Generate')}</Button>
</div>
</div>
diff --git a/frontend/src/components/docker/ContainersTab.jsx b/frontend/src/components/docker/ContainersTab.jsx
index 44ba0b97..cff8da2d 100644
--- a/frontend/src/components/docker/ContainersTab.jsx
+++ b/frontend/src/components/docker/ContainersTab.jsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react';
+import React, { useState, useEffect, useMemo, useRef, useCallback, useId } from 'react';
import { statusKind } from '@/components/ds/status';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
@@ -1171,6 +1171,7 @@ function portMappings(rows) {
const RunContainerModal = ({ onClose, onCreated }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const [formData, setFormData] = useState({
image: '',
name: '',
@@ -1219,8 +1220,9 @@ const RunContainerModal = ({ onClose, onCreated }) => {
<form onSubmit={handleSubmit}>
<div className="form-group">
- <label>{t('app.containersTab.image3', 'Image *')}</label>
+ <label htmlFor={`${fieldId}-image`}>{t('app.containersTab.image3', 'Image *')}</label>
<Input
+ id={`${fieldId}-image`}
type="text"
name="image"
value={formData.image}
@@ -1231,8 +1233,9 @@ const RunContainerModal = ({ onClose, onCreated }) => {
</div>
<div className="form-group">
- <label>{t('app.containersTab.containerName', 'Container name')}</label>
+ <label htmlFor={`${fieldId}-name`}>{t('app.containersTab.containerName', 'Container name')}</label>
<Input
+ id={`${fieldId}-name`}
type="text"
name="name"
value={formData.name}
@@ -1289,8 +1292,9 @@ const RunContainerModal = ({ onClose, onCreated }) => {
</div>
<div className="form-group">
- <label>{t('app.containersTab.volumesCommaSeparated', 'Volumes (comma-separated)')}</label>
+ <label htmlFor={`${fieldId}-volumes`}>{t('app.containersTab.volumesCommaSeparated', 'Volumes (comma-separated)')}</label>
<Input
+ id={`${fieldId}-volumes`}
type="text"
name="volumes"
value={formData.volumes}
diff --git a/frontend/src/components/docker/ImagesTab.jsx b/frontend/src/components/docker/ImagesTab.jsx
index f520e31b..4cae5802 100644
--- a/frontend/src/components/docker/ImagesTab.jsx
+++ b/frontend/src/components/docker/ImagesTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
+import { useState, useEffect, useMemo, useCallback, useRef, useId } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '../../hooks/useConfirm';
@@ -441,6 +441,7 @@ const ImagesTab = ({ onStatsChange }) => {
};
const PullImageModal = ({ onClose, onPulled }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const { serverId, isRemote } = useServer();
const [image, setImage] = useState('');
@@ -475,8 +476,9 @@ const PullImageModal = ({ onClose, onPulled }) => {
<form onSubmit={handleSubmit}>
<div className="form-group">
- <label>{t('app.imagesTab.imageName', 'Image name *')}</label>
+ <label htmlFor={`${fieldId}-image`}>{t('app.imagesTab.imageName', 'Image name *')}</label>
<Input
+ id={`${fieldId}-image`}
type="text"
value={image}
onChange={(e) => setImage(e.target.value)}
@@ -486,8 +488,9 @@ const PullImageModal = ({ onClose, onPulled }) => {
</div>
<div className="form-group">
- <label>{t('app.imagesTab.tag', 'Tag')}</label>
+ <label htmlFor={`${fieldId}-tag`}>{t('app.imagesTab.tag', 'Tag')}</label>
<Input
+ id={`${fieldId}-tag`}
type="text"
value={tag}
onChange={(e) => setTag(e.target.value)}
diff --git a/frontend/src/components/docker/NetworksTab.jsx b/frontend/src/components/docker/NetworksTab.jsx
index aec32e74..9bc83594 100644
--- a/frontend/src/components/docker/NetworksTab.jsx
+++ b/frontend/src/components/docker/NetworksTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
+import { useState, useEffect, useMemo, useCallback, useRef, useId } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '../../hooks/useConfirm';
@@ -363,6 +363,7 @@ const NetworksTab = ({ onStatsChange }) => {
};
const CreateNetworkModal = ({ onClose, onCreated }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const [name, setName] = useState('');
const [driver, setDriver] = useState('bridge');
@@ -391,8 +392,9 @@ const CreateNetworkModal = ({ onClose, onCreated }) => {
<form onSubmit={handleSubmit}>
<div className="form-group">
- <label>{t('app.networksTab.networkName', 'Network name *')}</label>
+ <label htmlFor={`${fieldId}-name`}>{t('app.networksTab.networkName', 'Network name *')}</label>
<Input
+ id={`${fieldId}-name`}
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
diff --git a/frontend/src/components/docker/VolumesTab.jsx b/frontend/src/components/docker/VolumesTab.jsx
index d60fe13e..60dad561 100644
--- a/frontend/src/components/docker/VolumesTab.jsx
+++ b/frontend/src/components/docker/VolumesTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
+import { useState, useEffect, useMemo, useCallback, useRef, useId } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '../../hooks/useConfirm';
@@ -359,6 +359,7 @@ const VolumesTab = ({ onStatsChange }) => {
};
const CreateVolumeModal = ({ onClose, onCreated }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const [name, setName] = useState('');
const [loading, setLoading] = useState(false);
@@ -386,8 +387,9 @@ const CreateVolumeModal = ({ onClose, onCreated }) => {
<form onSubmit={handleSubmit}>
<div className="form-group">
- <label>{t('app.volumesTab.volumeName', 'Volume name *')}</label>
+ <label htmlFor={`${fieldId}-name`}>{t('app.volumesTab.volumeName', 'Volume name *')}</label>
<Input
+ id={`${fieldId}-name`}
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
diff --git a/frontend/src/components/file-manager/FileDialogs.jsx b/frontend/src/components/file-manager/FileDialogs.jsx
index 37918e78..6cfbd830 100644
--- a/frontend/src/components/file-manager/FileDialogs.jsx
+++ b/frontend/src/components/file-manager/FileDialogs.jsx
@@ -1,4 +1,4 @@
-import { useState } from 'react';
+import { useState, useId } from 'react';
import { useTranslation } from 'react-i18next';
import Modal from '@/components/Modal';
import { Button } from '@/components/ui/button';
@@ -12,6 +12,7 @@ import { Label } from '@/components/ui/label';
export function NamePromptModal({
title, label, initialValue = '', placeholder, hint, submitLabel, onSubmit, onClose,
}) {
+ const fieldId = useId();
const { t } = useTranslation();
const [value, setValue] = useState(initialValue);
const submit = () => {
@@ -20,8 +21,9 @@ export function NamePromptModal({
return (
<Modal open onClose={onClose} title={title}>
<div className="form-group">
- <Label>{label}</Label>
+ <Label htmlFor={`${fieldId}-name`}>{label}</Label>
<Input
+ id={`${fieldId}-name`}
type="text"
value={value}
onChange={(e) => setValue(e.target.value)}
@@ -40,6 +42,7 @@ export function NamePromptModal({
}
export function PermissionsModal({ entry, onSubmit, onClose }) {
+ const fieldId = useId();
const { t } = useTranslation();
const [mode, setMode] = useState(entry.permissions_octal || '755');
const submit = () => {
@@ -48,8 +51,9 @@ export function PermissionsModal({ entry, onSubmit, onClose }) {
return (
<Modal open onClose={onClose} title={t('app.fileManager.changePermissions', 'Change permissions')}>
<div className="form-group">
- <Label>{t('app.fileManager.permissionsOctal', 'Permissions (octal)')}</Label>
+ <Label htmlFor={`${fieldId}-mode`}>{t('app.fileManager.permissionsOctal', 'Permissions (octal)')}</Label>
<Input
+ id={`${fieldId}-mode`}
type="text"
value={mode}
onChange={(e) => setMode(e.target.value)}
diff --git a/frontend/src/components/proxy/ProxyStackPanel.jsx b/frontend/src/components/proxy/ProxyStackPanel.jsx
index 5ade7b92..b3e5ead0 100644
--- a/frontend/src/components/proxy/ProxyStackPanel.jsx
+++ b/frontend/src/components/proxy/ProxyStackPanel.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useCallback } from 'react';
+import { useState, useEffect, useCallback, useId } from 'react';
import { Link } from 'react-router-dom';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
@@ -31,6 +31,7 @@ const PROXY_OPTIONS = [
const ProxyStackPanel = ({ serverId }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const [stack, setStack] = useState(null);
const [loading, setLoading] = useState(true);
@@ -275,8 +276,9 @@ const ProxyStackPanel = ({ serverId }) => {
{!isNginx && (
<section className="proxy-panel__section">
- <label className="proxy-panel__label">{t('app.proxyStackPanel.customConfigSnippet', 'Custom config snippet')}</label>
+ <label htmlFor={`${fieldId}-snippet`} className="proxy-panel__label">{t('app.proxyStackPanel.customConfigSnippet', 'Custom config snippet')}</label>
<Textarea
+ id={`${fieldId}-snippet`}
rows={6}
value={snippet}
onChange={(e) => setSnippet(e.target.value)}
diff --git a/frontend/src/components/security/FirewallTab.jsx b/frontend/src/components/security/FirewallTab.jsx
index 99ec25f9..c9fbd592 100644
--- a/frontend/src/components/security/FirewallTab.jsx
+++ b/frontend/src/components/security/FirewallTab.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect, useMemo } from 'react';
+import { useCallback, useState, useEffect, useMemo, useId } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '@/hooks/useConfirm';
@@ -91,6 +91,7 @@ const FIREWALL_VIEWS = [
const FirewallTab = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const [status, setStatus] = useState(null);
const [rules, setRules] = useState([]);
const [blockedIPs, setBlockedIPs] = useState([]);
@@ -694,8 +695,9 @@ const FirewallTab = () => {
{/* Block IP Modal */}
<Modal open={showBlockIPModal} onClose={() => setShowBlockIPModal(false)} title={t('app.firewallTab.blockIpAddress', 'Block IP address')}>
<div className="form-group">
- <Label>{t('common.labels.ipAddress', 'IP address')}</Label>
+ <Label htmlFor={`${fieldId}-block-ip`}>{t('common.labels.ipAddress', 'IP address')}</Label>
<Input
+ id={`${fieldId}-block-ip`}
type="text"
value={blockIP}
onChange={(e) => setBlockIP(e.target.value)}
@@ -725,9 +727,9 @@ const FirewallTab = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.firewallTab.protocol', 'Protocol')}</Label>
+ <Label htmlFor={`${fieldId}-protocol`}>{t('app.firewallTab.protocol', 'Protocol')}</Label>
<Select value={newPort.protocol} onValueChange={(value) => setNewPort({ ...newPort, protocol: value })}>
- <SelectTrigger>
+ <SelectTrigger id={`${fieldId}-protocol`}>
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -748,9 +750,9 @@ const FirewallTab = () => {
{/* Install Firewall Modal */}
<Modal open={showInstallModal} onClose={() => setShowInstallModal(false)} title={t('app.firewallTab.installFirewall', 'Install firewall')}>
<div className="form-group">
- <Label>{t('app.firewallTab.selectFirewall', 'Select firewall')}</Label>
+ <Label htmlFor={`${fieldId}-firewall`}>{t('app.firewallTab.selectFirewall', 'Select firewall')}</Label>
<Select value={selectedFirewall} onValueChange={setSelectedFirewall}>
- <SelectTrigger>
+ <SelectTrigger id={`${fieldId}-firewall`}>
<SelectValue />
</SelectTrigger>
<SelectContent>
diff --git a/frontend/src/components/security/IPListsTab.jsx b/frontend/src/components/security/IPListsTab.jsx
index 402af3e1..a4b90d88 100644
--- a/frontend/src/components/security/IPListsTab.jsx
+++ b/frontend/src/components/security/IPListsTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '@/hooks/useConfirm';
@@ -131,6 +131,7 @@ const IP_LIST_VIEWS = [
];
const IPListsTab = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const [lists, setLists] = useState({ allowlist: [], blocklist: [] });
const [loading, setLoading] = useState(true);
@@ -334,8 +335,9 @@ const IPListsTab = () => {
<Modal open={!!showAddModal} onClose={() => setShowAddModal(null)} title={t('app.iPListsTab.addTo2', 'Add to {{value}}', { value: showAddModal || '' })}>
<div className="form-group">
- <Label>{t('app.iPListsTab.ipAddressOrCidr', 'IP address or CIDR')}</Label>
+ <Label htmlFor={`${fieldId}-ip`}>{t('app.iPListsTab.ipAddressOrCidr', 'IP address or CIDR')}</Label>
<Input
+ id={`${fieldId}-ip`}
type="text"
value={newIP}
onChange={(e) => setNewIP(e.target.value)}
@@ -343,8 +345,9 @@ const IPListsTab = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.iPListsTab.commentOptional', 'Comment (optional)')}</Label>
+ <Label htmlFor={`${fieldId}-comment`}>{t('app.iPListsTab.commentOptional', 'Comment (optional)')}</Label>
<Input
+ id={`${fieldId}-comment`}
type="text"
value={newComment}
onChange={(e) => setNewComment(e.target.value)}
diff --git a/frontend/src/components/security/SSHKeysTab.jsx b/frontend/src/components/security/SSHKeysTab.jsx
index 581a40a6..5fd33474 100644
--- a/frontend/src/components/security/SSHKeysTab.jsx
+++ b/frontend/src/components/security/SSHKeysTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useMemo } from 'react';
+import { useState, useEffect, useMemo, useId } from 'react';
import { KeyRound } from 'lucide-react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
@@ -63,6 +63,7 @@ const SSH_KEY_VIEWS = [
];
const SSHKeysTab = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const [keys, setKeys] = useState([]);
const [loading, setLoading] = useState(true);
@@ -281,8 +282,9 @@ const SSHKeysTab = () => {
<Modal open={showAddModal} onClose={() => setShowAddModal(false)} title={t('app.sSHKeysTab.addSshPublicKey', 'Add SSH public key')} size="lg">
<div className="form-group">
- <Label>{t('app.sSHKeysTab.publicKey', 'Public key')}</Label>
+ <Label htmlFor={`${fieldId}-public-key`}>{t('app.sSHKeysTab.publicKey', 'Public key')}</Label>
<Textarea
+ id={`${fieldId}-public-key`}
value={newKey}
onChange={(e) => setNewKey(e.target.value)}
placeholder={t('app.sSHKeysTab.sshRsaAaaaUserHostOr', 'ssh-rsa AAAA... user@host or ssh-ed25519 AAAA... user@host')}
diff --git a/frontend/src/components/security/SecurityConfigTab.jsx b/frontend/src/components/security/SecurityConfigTab.jsx
index 72ebc406..a2206c15 100644
--- a/frontend/src/components/security/SecurityConfigTab.jsx
+++ b/frontend/src/components/security/SecurityConfigTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import api from '../../services/api';
import { Button } from '@/components/ui/button';
import ErrorState from '@/components/ErrorState';
@@ -9,6 +9,7 @@ import { useTranslation } from 'react-i18next';
import { Card as SharedCard, CardHeader as SharedCardHeader, CardContent as SharedCardContent } from '@/components/ui/card';
const SecurityConfigTab = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const [config, setConfig] = useState(null);
const [loading, setLoading] = useState(true);
@@ -109,8 +110,9 @@ const SecurityConfigTab = () => {
</div>
<div className="form-group">
- <Label>{t('app.securityConfigTab.quarantinePath', 'Quarantine path')}</Label>
+ <Label htmlFor={`${fieldId}-quarantine`}>{t('app.securityConfigTab.quarantinePath', 'Quarantine path')}</Label>
<Input
+ id={`${fieldId}-quarantine`}
type="text"
value={config?.clamav?.quarantine_path || '/var/quarantine'}
onChange={(e) => updateConfig('clamav', 'quarantine_path', e.target.value)}
diff --git a/frontend/src/components/serverdetail/ServerSettingsTab.jsx b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
index 9108d393..8627202c 100644
--- a/frontend/src/components/serverdetail/ServerSettingsTab.jsx
+++ b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
@@ -1,5 +1,5 @@
import { TOKEN_EXPIRY_OPTIONS } from './serverDetailData';
-import { useCallback, useState, useEffect } from 'react';
+import { useCallback, useState, useEffect, useId } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '../../hooks/useConfirm';
@@ -62,6 +62,7 @@ const AgentRegistrationSection = ({ server, onRegenerateToken }) => {
const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const { confirm: confirmSettings } = useConfirm();
const [formData, setFormData] = useState({
name: server.name || '',
@@ -181,8 +182,9 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
</div>
</div>
<div className="form-group">
- <label>{t('app.serverSettingsTab.serverName', 'Server name')}</label>
+ <label htmlFor={`${fieldId}-name`}>{t('app.serverSettingsTab.serverName', 'Server name')}</label>
<Input
+ id={`${fieldId}-name`}
type="text"
name="name"
value={formData.name}
@@ -192,8 +194,9 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
</div>
<div className="form-group">
- <label>{t('common.labels.description', 'Description')}</label>
+ <label htmlFor={`${fieldId}-description`}>{t('common.labels.description', 'Description')}</label>
<Textarea
+ id={`${fieldId}-description`}
name="description"
value={formData.description}
onChange={handleChange}
@@ -203,8 +206,9 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
<div className="form-row">
<div className="form-group">
- <label>{t('app.serverSettingsTab.hostname', 'Hostname')}</label>
+ <label htmlFor={`${fieldId}-hostname`}>{t('app.serverSettingsTab.hostname', 'Hostname')}</label>
<Input
+ id={`${fieldId}-hostname`}
type="text"
name="hostname"
value={formData.hostname}
@@ -212,8 +216,9 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
/>
</div>
<div className="form-group">
- <label>{t('common.labels.ipAddress', 'IP address')}</label>
+ <label htmlFor={`${fieldId}-ip`}>{t('common.labels.ipAddress', 'IP address')}</label>
<Input
+ id={`${fieldId}-ip`}
type="text"
name="ip_address"
value={formData.ip_address}
diff --git a/frontend/src/components/servers/LinkPanelForm.jsx b/frontend/src/components/servers/LinkPanelForm.jsx
index b7e59eda..1421adb8 100644
--- a/frontend/src/components/servers/LinkPanelForm.jsx
+++ b/frontend/src/components/servers/LinkPanelForm.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useState, useId } from 'react';
import { Unlink } from 'lucide-react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
@@ -27,6 +27,7 @@ function formatTimestamp(iso) {
// badge flips to Connected live.
const LinkPanelForm = ({ onClose }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const [status, setStatus] = useState(null); // null = still loading
const [masterUrl, setMasterUrl] = useState('');
@@ -136,8 +137,9 @@ const LinkPanelForm = ({ onClose }) => {
{linkError && <div className="error-message">{linkError}</div>}
<div className="form-group">
- <label>{t('app.linkPanelForm.masterUrl', 'Master URL *')}</label>
+ <label htmlFor={`${fieldId}-master-url`}>{t('app.linkPanelForm.masterUrl', 'Master URL *')}</label>
<Input
+ id={`${fieldId}-master-url`}
type="url"
value={masterUrl}
onChange={(e) => setMasterUrl(e.target.value)}
@@ -147,8 +149,9 @@ const LinkPanelForm = ({ onClose }) => {
</div>
<div className="form-group">
- <label>{t('app.linkPanelForm.registrationToken', 'Registration token *')}</label>
+ <label htmlFor={`${fieldId}-token`}>{t('app.linkPanelForm.registrationToken', 'Registration token *')}</label>
<Input
+ id={`${fieldId}-token`}
type="password"
value={token}
onChange={(e) => setToken(e.target.value)}
@@ -158,8 +161,9 @@ const LinkPanelForm = ({ onClose }) => {
</div>
<div className="form-group">
- <label>{t('app.linkPanelForm.displayName', 'Display name')}</label>
+ <label htmlFor={`${fieldId}-name`}>{t('app.linkPanelForm.displayName', 'Display name')}</label>
<Input
+ id={`${fieldId}-name`}
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
diff --git a/frontend/src/components/service-detail/SettingsTab.jsx b/frontend/src/components/service-detail/SettingsTab.jsx
index 35123e07..ed479b77 100644
--- a/frontend/src/components/service-detail/SettingsTab.jsx
+++ b/frontend/src/components/service-detail/SettingsTab.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useState, useId } from 'react';
import { useNavigate, useParams, Link } from 'react-router-dom';
import {
SlidersHorizontal,
@@ -467,6 +467,7 @@ where a new release is asked, and for how long. */}
// show current primary domain, SSL health, attach a new domain, and request a
// certificate from Let&apos;s Encrypt.
const DomainSslPanel = ({ app, domains, primaryDomain, onUpdate }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const toast = useToast();
const [health, setHealth] = useState(null);
@@ -652,8 +653,9 @@ const DomainSslPanel = ({ app, domains, primaryDomain, onUpdate }) => {
<CheckItem ok label={t('app.settingsTab.domainConfigured', 'Domain {{primaryDomain}} configured', { primaryDomain: primaryDomain })} />
</div>
<div className="form-group">
- <Label>{t('app.settingsTab.adminEmail', 'Admin email')}</Label>
+ <Label htmlFor={`${fieldId}-email`}>{t('app.settingsTab.adminEmail', 'Admin email')}</Label>
<Input
+ id={`${fieldId}-email`}
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
diff --git a/frontend/src/components/settings/ActivityTab.jsx b/frontend/src/components/settings/ActivityTab.jsx
index 7769de9a..3f6160c1 100644
--- a/frontend/src/components/settings/ActivityTab.jsx
+++ b/frontend/src/components/settings/ActivityTab.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect } from 'react';
+import { useCallback, useState, useEffect, useId } from 'react';
import api from '../../services/api';
import ContributionGraph from './ContributionGraph';
import EmptyState from '../EmptyState';
@@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next';
import { formatDateTime } from '@/utils/intl';
const ActivityTab = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const register = useSettingFocus();
const [summary, setSummary] = useState(null);
@@ -212,12 +213,12 @@ const ActivityTab = () => {
<div className="filters-bar">
<div className="filter-group">
- <label><Filter size={12} /> {t('app.activityTab.actionType', 'Action type')}</label>
+ <label htmlFor={`${fieldId}-action`}><Filter size={12} /> {t('app.activityTab.actionType', 'Action type')}</label>
<Select
value={filters.action || '__all__'}
onValueChange={(val) => handleFilterChange('action', val === '__all__' ? '' : val)}
>
- <SelectTrigger>
+ <SelectTrigger id={`${fieldId}-action`}>
<SelectValue placeholder={t('app.activityTab.allActions', 'All actions')} />
</SelectTrigger>
<SelectContent>
@@ -229,12 +230,12 @@ const ActivityTab = () => {
</Select>
</div>
<div className="filter-group">
- <label><UserIcon size={12} /> {t('common.labels.user', 'User')}</label>
+ <label htmlFor={`${fieldId}-user`}><UserIcon size={12} /> {t('common.labels.user', 'User')}</label>
<Select
value={filters.user_id || '__all__'}
onValueChange={(val) => handleFilterChange('user_id', val === '__all__' ? '' : val)}
>
- <SelectTrigger>
+ <SelectTrigger id={`${fieldId}-user`}>
<SelectValue placeholder={t('app.activityTab.allUsers', 'All users')} />
</SelectTrigger>
<SelectContent>
diff --git a/frontend/src/components/settings/ApiKeyModal.jsx b/frontend/src/components/settings/ApiKeyModal.jsx
index 4533742b..9d2e66a5 100644
--- a/frontend/src/components/settings/ApiKeyModal.jsx
+++ b/frontend/src/components/settings/ApiKeyModal.jsx
@@ -1,4 +1,4 @@
-import { useState } from 'react';
+import { useState, useId } from 'react';
import { AlertTriangle } from 'lucide-react';
import Modal from '../Modal';
import ApiKeyScopesModal from '../api/ApiKeyScopesModal';
@@ -16,6 +16,7 @@ const TIER_OPTIONS = [
const ApiKeyModal = ({ onClose, onSubmit, createdKey }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const [name, setName] = useState('');
const [scopes, setScopes] = useState(['*']);
const [tier, setTier] = useState('standard');
@@ -59,8 +60,9 @@ const ApiKeyModal = ({ onClose, onSubmit, createdKey }) => {
<form onSubmit={handleSubmit}>
<div className="modal-body">
<div className="form-group">
- <Label>{t('common.labels.name', 'Name')}</Label>
+ <Label htmlFor={`${fieldId}-name`}>{t('common.labels.name', 'Name')}</Label>
<Input
+ id={`${fieldId}-name`}
type="text"
value={name}
onChange={e => setName(e.target.value)}
@@ -92,8 +94,9 @@ const ApiKeyModal = ({ onClose, onSubmit, createdKey }) => {
</div>
<div className="form-group">
- <Label>{t('app.apiKeyModal.expirationOptional', 'Expiration (optional)')}</Label>
+ <Label htmlFor={`${fieldId}-expires`}>{t('app.apiKeyModal.expirationOptional', 'Expiration (optional)')}</Label>
<Input
+ id={`${fieldId}-expires`}
type="datetime-local"
value={expiresAt}
onChange={e => setExpiresAt(e.target.value)}
diff --git a/frontend/src/components/settings/ApiSettingsTab.jsx b/frontend/src/components/settings/ApiSettingsTab.jsx
index 9f0a7efc..059291e4 100644
--- a/frontend/src/components/settings/ApiSettingsTab.jsx
+++ b/frontend/src/components/settings/ApiSettingsTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useCallback } from 'react';
+import { useState, useEffect, useCallback, useId } from 'react';
import { useAuth } from '../../contexts/useAuth.js';
import api from '../../services/api';
import useSettingFocus from '../../hooks/useSettingFocus';
@@ -354,6 +354,7 @@ const ApiKeysSection = () => {
// ─── Rate Limits Section ───────────────────────────────
const RateLimitsSection = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const register = useSettingFocus();
const [limits, setLimits] = useState({
@@ -420,8 +421,9 @@ const RateLimitsSection = () => {
<div className="api-settings__rate-limits">
{Object.entries(limits).map(([key, value]) => (
<div key={key} className="form-group form-group--inline">
- <Label>{labels[key]}</Label>
+ <Label htmlFor={`${fieldId}-${key}`}>{labels[key]}</Label>
<Input
+ id={`${fieldId}-${key}`}
type="text"
value={value}
onChange={e => setLimits(prev => ({ ...prev, [key]: e.target.value }))}
diff --git a/frontend/src/components/settings/AppearanceTab.jsx b/frontend/src/components/settings/AppearanceTab.jsx
index 7e94be40..721fa0f8 100644
--- a/frontend/src/components/settings/AppearanceTab.jsx
+++ b/frontend/src/components/settings/AppearanceTab.jsx
@@ -1,4 +1,4 @@
-import { useRef, useState } from 'react';
+import { useRef, useState, useId } from 'react';
import { useTheme } from '../../contexts/useTheme.js';
import { useAuth } from '../../contexts/useAuth.js';
import { useToast } from '../../contexts/useToast.js';
@@ -27,6 +27,7 @@ const ACCENT_PRESETS = [
];
const AppearanceTab = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const {
theme, setTheme, accentColor, setAccentColor, hasCustomAccent, resetAccentColor,
@@ -161,9 +162,10 @@ const AppearanceTab = () => {
))}
</div>
<div className="accent-custom">
- <label className="accent-custom-label">{t('app.appearanceTab.customColor', 'Custom color')}</label>
+ <label className="accent-custom-label" htmlFor={`${fieldId}-accent`}>{t('app.appearanceTab.customColor', 'Custom color')}</label>
<div className="accent-custom-row">
<input
+ id={`${fieldId}-accent`}
type="color"
className="accent-custom-input"
value={accentColor}
diff --git a/frontend/src/components/settings/NotificationsTab.jsx b/frontend/src/components/settings/NotificationsTab.jsx
index f9f22231..f8090475 100644
--- a/frontend/src/components/settings/NotificationsTab.jsx
+++ b/frontend/src/components/settings/NotificationsTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import { useAuth } from '../../contexts/useAuth.js';
import api from '../../services/api';
import { Button } from '@/components/ui/button';
@@ -14,6 +14,7 @@ import { useTranslation } from 'react-i18next';
const NotificationsTab = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const { isAdmin, user } = useAuth();
const register = useSettingFocus();
const [loading, setLoading] = useState(true);
@@ -178,8 +179,8 @@ const NotificationsTab = () => {
<div {...register('notifications-email', 'settings-card')}>
<h3>{t('app.notificationsTab.emailSettings', 'Email settings')}</h3>
<div className="form-group">
- <Label>{t('app.notificationsTab.notificationEmailOptional', 'Notification email (optional)')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-pref-email`}>{t('app.notificationsTab.notificationEmailOptional', 'Notification email (optional)')}</Label>
+ <Input id={`${fieldId}-pref-email`}
type="email"
value={userPrefs.email || ''}
onChange={(e) => setUserPrefs({...userPrefs, email: e.target.value})}
@@ -194,8 +195,8 @@ const NotificationsTab = () => {
<div {...register('notifications-discord-webhook', 'settings-card')}>
<h3>{t('app.notificationsTab.personalDiscordWebhook', 'Personal Discord webhook')}</h3>
<div className="form-group">
- <Label>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-pref-discord`}>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
+ <Input id={`${fieldId}-pref-discord`}
type="text"
value={userPrefs.discord_webhook || ''}
onChange={(e) => setUserPrefs({...userPrefs, discord_webhook: e.target.value})}
@@ -210,8 +211,8 @@ const NotificationsTab = () => {
<div {...register('notifications-telegram', 'settings-card')}>
<h3>{t('app.notificationsTab.personalTelegram', 'Personal Telegram')}</h3>
<div className="form-group">
- <Label>{t('app.notificationsTab.yourChatId', 'Your chat ID')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-pref-telegram`}>{t('app.notificationsTab.yourChatId', 'Your chat ID')}</Label>
+ <Input id={`${fieldId}-pref-telegram`}
type="text"
value={userPrefs.telegram_chat_id || ''}
onChange={(e) => setUserPrefs({...userPrefs, telegram_chat_id: e.target.value})}
@@ -285,8 +286,8 @@ const NotificationsTab = () => {
{userPrefs.quiet_hours?.enabled && (
<div className="form-row">
<div className="form-group">
- <Label>{t('app.notificationsTab.startTime', 'Start time')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-quiet-start`}>{t('app.notificationsTab.startTime', 'Start time')}</Label>
+ <Input id={`${fieldId}-quiet-start`}
type="time"
value={userPrefs.quiet_hours?.start || '22:00'}
onChange={(e) => setUserPrefs({
@@ -296,8 +297,8 @@ const NotificationsTab = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.notificationsTab.endTime', 'End time')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-quiet-end`}>{t('app.notificationsTab.endTime', 'End time')}</Label>
+ <Input id={`${fieldId}-quiet-end`}
type="time"
value={userPrefs.quiet_hours?.end || '08:00'}
onChange={(e) => setUserPrefs({
@@ -434,8 +435,8 @@ const NotificationsTab = () => {
{channel.id === 'discord' && (
<>
<div className="form-group">
- <Label>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-discord-webhook`}>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
+ <Input id={`${fieldId}-discord-webhook`}
type="text"
value={config.discord.webhook_url || ''}
onChange={(e) => updateChannelConfig('discord', 'webhook_url', e.target.value)}
@@ -445,8 +446,8 @@ const NotificationsTab = () => {
</div>
<div className="form-row">
<div className="form-group">
- <Label>{t('app.notificationsTab.botUsername', 'Bot username')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-discord-username`}>{t('app.notificationsTab.botUsername', 'Bot username')}</Label>
+ <Input id={`${fieldId}-discord-username`}
type="text"
value={config.discord.username || 'ServerKit'}
onChange={(e) => updateChannelConfig('discord', 'username', e.target.value)}
@@ -454,8 +455,8 @@ const NotificationsTab = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.notificationsTab.avatarUrlOptional', 'Avatar URL (optional)')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-discord-avatar`}>{t('app.notificationsTab.avatarUrlOptional', 'Avatar URL (optional)')}</Label>
+ <Input id={`${fieldId}-discord-avatar`}
type="text"
value={config.discord.avatar_url || ''}
onChange={(e) => updateChannelConfig('discord', 'avatar_url', e.target.value)}
@@ -469,8 +470,8 @@ const NotificationsTab = () => {
{channel.id === 'slack' && (
<>
<div className="form-group">
- <Label>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-slack-webhook`}>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
+ <Input id={`${fieldId}-slack-webhook`}
type="text"
value={config.slack.webhook_url || ''}
onChange={(e) => updateChannelConfig('slack', 'webhook_url', e.target.value)}
@@ -480,8 +481,8 @@ const NotificationsTab = () => {
</div>
<div className="form-row">
<div className="form-group">
- <Label>{t('app.notificationsTab.channelOptional', 'Channel (optional)')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-slack-channel`}>{t('app.notificationsTab.channelOptional', 'Channel (optional)')}</Label>
+ <Input id={`${fieldId}-slack-channel`}
type="text"
value={config.slack.channel || ''}
onChange={(e) => updateChannelConfig('slack', 'channel', e.target.value)}
@@ -489,8 +490,8 @@ const NotificationsTab = () => {
/>
</div>
<div className="form-group">
- <Label>{t('common.labels.username', 'Username')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-slack-username`}>{t('common.labels.username', 'Username')}</Label>
+ <Input id={`${fieldId}-slack-username`}
type="text"
value={config.slack.username || 'ServerKit'}
onChange={(e) => updateChannelConfig('slack', 'username', e.target.value)}
@@ -504,8 +505,8 @@ const NotificationsTab = () => {
{channel.id === 'telegram' && (
<>
<div className="form-group">
- <Label>{t('app.notificationsTab.botToken', 'Bot token')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-telegram-token`}>{t('app.notificationsTab.botToken', 'Bot token')}</Label>
+ <Input id={`${fieldId}-telegram-token`}
type="password"
value={config.telegram.bot_token || ''}
onChange={(e) => updateChannelConfig('telegram', 'bot_token', e.target.value)}
@@ -514,8 +515,8 @@ const NotificationsTab = () => {
<span className="form-help">{t('app.notificationsTab.getABotTokenFromBotfather', 'Get a bot token from @BotFather on Telegram.')}</span>
</div>
<div className="form-group">
- <Label>{t('app.notificationsTab.chatId', 'Chat ID')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-telegram-chat`}>{t('app.notificationsTab.chatId', 'Chat ID')}</Label>
+ <Input id={`${fieldId}-telegram-chat`}
type="text"
value={config.telegram.chat_id || ''}
onChange={(e) => updateChannelConfig('telegram', 'chat_id', e.target.value)}
@@ -530,8 +531,8 @@ const NotificationsTab = () => {
<>
<div className="form-row">
<div className="form-group">
- <Label>{t('app.notificationsTab.smtpHost', 'SMTP host')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-smtp-host`}>{t('app.notificationsTab.smtpHost', 'SMTP host')}</Label>
+ <Input id={`${fieldId}-smtp-host`}
type="text"
value={config.email.smtp_host || ''}
onChange={(e) => updateChannelConfig('email', 'smtp_host', e.target.value)}
@@ -552,8 +553,8 @@ const NotificationsTab = () => {
</div>
<div className="form-row">
<div className="form-group">
- <Label>{t('app.notificationsTab.smtpUsername', 'SMTP username')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-smtp-user`}>{t('app.notificationsTab.smtpUsername', 'SMTP username')}</Label>
+ <Input id={`${fieldId}-smtp-user`}
type="text"
value={config.email.smtp_user || ''}
onChange={(e) => updateChannelConfig('email', 'smtp_user', e.target.value)}
@@ -561,8 +562,8 @@ const NotificationsTab = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.notificationsTab.smtpPassword', 'SMTP password')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-smtp-password`}>{t('app.notificationsTab.smtpPassword', 'SMTP password')}</Label>
+ <Input id={`${fieldId}-smtp-password`}
type="password"
value={config.email.smtp_password || ''}
onChange={(e) => updateChannelConfig('email', 'smtp_password', e.target.value)}
@@ -572,8 +573,8 @@ const NotificationsTab = () => {
</div>
<div className="form-row">
<div className="form-group">
- <Label>{t('app.notificationsTab.fromEmail', 'From email')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-from-email`}>{t('app.notificationsTab.fromEmail', 'From email')}</Label>
+ <Input id={`${fieldId}-from-email`}
type="email"
value={config.email.from_email || ''}
onChange={(e) => updateChannelConfig('email', 'from_email', e.target.value)}
@@ -581,8 +582,8 @@ const NotificationsTab = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.notificationsTab.fromName', 'From name')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-from-name`}>{t('app.notificationsTab.fromName', 'From name')}</Label>
+ <Input id={`${fieldId}-from-name`}
type="text"
value={config.email.from_name || 'ServerKit'}
onChange={(e) => updateChannelConfig('email', 'from_name', e.target.value)}
@@ -591,8 +592,8 @@ const NotificationsTab = () => {
</div>
</div>
<div className="form-group">
- <Label>{t('app.notificationsTab.recipientEmailsCommaSeparated', 'Recipient emails (comma-separated)')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-to-emails`}>{t('app.notificationsTab.recipientEmailsCommaSeparated', 'Recipient emails (comma-separated)')}</Label>
+ <Input id={`${fieldId}-to-emails`}
type="text"
value={(config.email.to_emails || []).join(', ')}
onChange={(e) => updateChannelConfig('email', 'to_emails', e.target.value.split(',').map(s => s.trim()).filter(Boolean))}
@@ -601,11 +602,11 @@ const NotificationsTab = () => {
</div>
<div className="form-group">
<div className="settings-notification-option">
- <Switch disabled={saving} aria-label={t('app.notificationsTab.useTls', 'Use TLS')}
+ <Switch id={`${fieldId}-smtp-tls`} disabled={saving} aria-label={t('app.notificationsTab.useTls', 'Use TLS')}
checked={config.email.smtp_tls !== false}
onCheckedChange={(checked) => updateChannelConfig('email', 'smtp_tls', checked)}
/>
- <Label>{t('app.notificationsTab.useTls', 'Use TLS')}</Label>
+ <Label htmlFor={`${fieldId}-smtp-tls`}>{t('app.notificationsTab.useTls', 'Use TLS')}</Label>
</div>
</div>
</>
@@ -613,8 +614,8 @@ const NotificationsTab = () => {
{channel.id === 'generic_webhook' && (
<div className="form-group">
- <Label>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-generic-webhook`}>{t('app.notificationsTab.webhookUrl', 'Webhook URL')}</Label>
+ <Input id={`${fieldId}-generic-webhook`}
type="text"
value={config.generic_webhook.url || ''}
onChange={(e) => updateChannelConfig('generic_webhook', 'url', e.target.value)}
diff --git a/frontend/src/components/settings/SSOConfigTab.jsx b/frontend/src/components/settings/SSOConfigTab.jsx
index ce5b5953..2715b687 100644
--- a/frontend/src/components/settings/SSOConfigTab.jsx
+++ b/frontend/src/components/settings/SSOConfigTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import api from '../../services/api';
import useSettingFocus from '../../hooks/useSettingFocus';
import SSOProviderIcon from '../SSOProviderIcon';
@@ -42,6 +42,7 @@ const FIELD_LABELS = {
const SSOConfigTab = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const register = useSettingFocus();
const [config, setConfig] = useState({});
const [loading, setLoading] = useState(true);
@@ -179,11 +180,12 @@ const SSOConfigTab = () => {
<div className="sso-general-form">
<div className="settings-row">
<div className="settings-label">
- <Label>{t('app.sSOConfigTab.autoProvisionUsers', 'Auto-provision users')}</Label>
+ <Label htmlFor={`${fieldId}-auto-provision`}>{t('app.sSOConfigTab.autoProvisionUsers', 'Auto-provision users')}</Label>
<span className="settings-hint">{t('app.sSOConfigTab.automaticallyCreateAccountsForNewSso', 'Automatically create accounts for new SSO users')}</span>
</div>
<div className="settings-control">
<Switch
+ id={`${fieldId}-auto-provision`}
checked={autoProvision}
onCheckedChange={setAutoProvision}
/>
@@ -191,9 +193,9 @@ const SSOConfigTab = () => {
</div>
<div className="form-group">
- <Label>{t('app.sSOConfigTab.defaultRoleForNewSsoUsers', 'Default role for new SSO users')}</Label>
+ <Label htmlFor={`${fieldId}-default-role`}>{t('app.sSOConfigTab.defaultRoleForNewSsoUsers', 'Default role for new SSO users')}</Label>
<Select value={defaultRole} onValueChange={setDefaultRole}>
- <SelectTrigger>
+ <SelectTrigger id={`${fieldId}-default-role`}>
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -206,7 +208,7 @@ const SSOConfigTab = () => {
<div className="settings-row">
<div className="settings-label">
- <Label>{t('app.sSOConfigTab.ssoOnlyMode', 'SSO-only mode')}</Label>
+ <Label htmlFor={`${fieldId}-force-sso`}>{t('app.sSOConfigTab.ssoOnlyMode', 'SSO-only mode')}</Label>
<span className="settings-hint">
{forceSso ? (
<span className="text-warning">
@@ -219,6 +221,7 @@ const SSOConfigTab = () => {
</div>
<div className="settings-control">
<Switch
+ id={`${fieldId}-force-sso`}
checked={forceSso}
onCheckedChange={setForceSso}
/>
@@ -226,8 +229,9 @@ const SSOConfigTab = () => {
</div>
<div className="form-group">
- <Label>{t('app.sSOConfigTab.allowedEmailDomains', 'Allowed email domains')}</Label>
+ <Label htmlFor={`${fieldId}-allowed-domains`}>{t('app.sSOConfigTab.allowedEmailDomains', 'Allowed email domains')}</Label>
<Input
+ id={`${fieldId}-allowed-domains`}
type="text"
value={allowedDomains}
onChange={e => setAllowedDomains(e.target.value)}
@@ -275,10 +279,11 @@ const SSOConfigTab = () => {
<div className="sso-provider-config__body">
<div className="settings-row">
<div className="settings-label">
- <Label>{t('common.actions.enable', 'Enable')} {provider.name}</Label>
+ <Label htmlFor={`${fieldId}-${provider.id}-enabled`}>{t('common.actions.enable', 'Enable')} {provider.name}</Label>
</div>
<div className="settings-control">
<Switch
+ id={`${fieldId}-${provider.id}-enabled`}
checked={enabled}
onCheckedChange={(checked) => setFieldValue(provider.id, 'enabled', checked)}
/>
@@ -287,9 +292,10 @@ const SSOConfigTab = () => {
{provider.fields.map(field => (
<div key={field} className="form-group">
- <Label>{FIELD_LABELS[field] || field}</Label>
+ <Label htmlFor={`${fieldId}-${provider.id}-${field}`}>{FIELD_LABELS[field] || field}</Label>
{field === 'idp_cert' ? (
<Textarea
+ id={`${fieldId}-${provider.id}-${field}`}
rows={4}
value={getFieldValue(provider.id, field)}
onChange={e => setFieldValue(provider.id, field, e.target.value)}
@@ -297,6 +303,7 @@ const SSOConfigTab = () => {
/>
) : (
<Input
+ id={`${fieldId}-${provider.id}-${field}`}
type={field.includes('secret') ? 'password' : 'text'}
value={getFieldValue(provider.id, field)}
onChange={e => setFieldValue(provider.id, field, e.target.value)}
diff --git a/frontend/src/components/settings/SecuritySettingsTab.jsx b/frontend/src/components/settings/SecuritySettingsTab.jsx
index 2193fdbc..8a1f2c03 100644
--- a/frontend/src/components/settings/SecuritySettingsTab.jsx
+++ b/frontend/src/components/settings/SecuritySettingsTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import { useAuth } from '../../contexts/useAuth.js';
import api from '../../services/api';
import useSettingFocus from '../../hooks/useSettingFocus';
@@ -130,6 +130,7 @@ const LinkedAccounts = ({ register }) => {
const SecuritySettingsTab = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const { updateUser, user, isAdmin } = useAuth();
const register = useSettingFocus();
const [formData, setFormData] = useState({
@@ -389,8 +390,9 @@ Keep these codes in a safe place.`;
<h3>{t('app.securitySettingsTab.changePassword', 'Change password')}</h3>
<div className="form-group">
- <Label>{t('app.securitySettingsTab.currentPassword', 'Current password')}</Label>
+ <Label htmlFor={`${fieldId}-current-password`}>{t('app.securitySettingsTab.currentPassword', 'Current password')}</Label>
<Input
+ id={`${fieldId}-current-password`}
type="password"
value={formData.currentPassword}
onChange={(e) => setFormData({ ...formData, currentPassword: e.target.value })}
@@ -399,8 +401,9 @@ Keep these codes in a safe place.`;
</div>
<div className="form-group">
- <Label>{t('app.securitySettingsTab.newPassword', 'New password')}</Label>
+ <Label htmlFor={`${fieldId}-new-password`}>{t('app.securitySettingsTab.newPassword', 'New password')}</Label>
<Input
+ id={`${fieldId}-new-password`}
type="password"
value={formData.newPassword}
onChange={(e) => setFormData({ ...formData, newPassword: e.target.value })}
@@ -411,8 +414,9 @@ Keep these codes in a safe place.`;
</div>
<div className="form-group">
- <Label>{t('app.securitySettingsTab.confirmNewPassword', 'Confirm new password')}</Label>
+ <Label htmlFor={`${fieldId}-confirm-password`}>{t('app.securitySettingsTab.confirmNewPassword', 'Confirm new password')}</Label>
<Input
+ id={`${fieldId}-confirm-password`}
type="password"
value={formData.confirmPassword}
onChange={(e) => setFormData({ ...formData, confirmPassword: e.target.value })}
@@ -524,8 +528,9 @@ Keep these codes in a safe place.`;
<p>{t('app.securitySettingsTab.disabling2faWillMakeYourAccount', 'Disabling 2FA will make your account less secure. You will only need your password to sign in.')}</p>
</div>
<div className="form-group">
- <Label>{t('app.securitySettingsTab.enterAVerificationCodeOrBackup', 'Enter a verification code or backup code to disable 2FA:')}</Label>
+ <Label htmlFor={`${fieldId}-disable-code`}>{t('app.securitySettingsTab.enterAVerificationCodeOrBackup', 'Enter a verification code or backup code to disable 2FA:')}</Label>
<Input
+ id={`${fieldId}-disable-code`}
type="text"
value={verificationCode}
onChange={(e) => setVerificationCode(e.target.value)}
@@ -576,8 +581,9 @@ Keep these codes in a safe place.`;
<>
<p>{t('app.securitySettingsTab.enterACodeFromYourAuthenticator', 'Enter a code from your authenticator app to generate new backup codes. This will invalidate all existing backup codes.')}</p>
<div className="form-group">
- <Label>{t('app.securitySettingsTab.verificationCode', 'Verification code')}</Label>
+ <Label htmlFor={`${fieldId}-verify-code`}>{t('app.securitySettingsTab.verificationCode', 'Verification code')}</Label>
<Input
+ id={`${fieldId}-verify-code`}
type="text"
value={verificationCode}
onChange={(e) => setVerificationCode(e.target.value.replace(/\D/g, '').slice(0, 6))}
diff --git a/frontend/src/components/settings/SiteSettingsTab.jsx b/frontend/src/components/settings/SiteSettingsTab.jsx
index 46412c13..6857037b 100644
--- a/frontend/src/components/settings/SiteSettingsTab.jsx
+++ b/frontend/src/components/settings/SiteSettingsTab.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect } from 'react';
+import { useCallback, useState, useEffect, useId } from 'react';
import api from '../../services/api';
import { Switch } from '@/components/ui/switch';
import { Label } from '@/components/ui/label';
@@ -13,6 +13,7 @@ import { useAuth } from '../../contexts/useAuth.js';
import { useTranslation } from 'react-i18next';
const SiteSettingsTab = ({ onDevModeChange }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const register = useSettingFocus();
const { refreshSetupStatus } = useAuth();
@@ -399,9 +400,10 @@ const SiteSettingsTab = ({ onDevModeChange }) => {
<div className="form-group">
<div className="settings-row">
<div className="settings-label">
- <Label>{t('app.siteSettingsTab.enablePublicRegistration', 'Enable public registration')}</Label>
+ <Label htmlFor={`${fieldId}-registration`}>{t('app.siteSettingsTab.enablePublicRegistration', 'Enable public registration')}</Label>
</div>
<Switch
+ id={`${fieldId}-registration`}
checked={settings.registration_enabled}
onCheckedChange={() => handleToggleSetting('registration_enabled', 'User registration')}
disabled={saving}
@@ -598,9 +600,10 @@ const SiteSettingsTab = ({ onDevModeChange }) => {
<div className="form-group">
<div className="settings-row">
<div className="settings-label">
- <Label>{t('app.siteSettingsTab.enableDeveloperMode', 'Enable developer mode')}</Label>
+ <Label htmlFor={`${fieldId}-dev-mode`}>{t('app.siteSettingsTab.enableDeveloperMode', 'Enable developer mode')}</Label>
</div>
<Switch
+ id={`${fieldId}-dev-mode`}
checked={settings.dev_mode}
onCheckedChange={() => handleToggleSetting('dev_mode', 'Developer mode')}
disabled={saving}
diff --git a/frontend/src/components/settings/SystemTab.jsx b/frontend/src/components/settings/SystemTab.jsx
index 6cace6f1..ec3ef2d4 100644
--- a/frontend/src/components/settings/SystemTab.jsx
+++ b/frontend/src/components/settings/SystemTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import { useAuth } from '../../contexts/useAuth.js';
import { useTheme } from '../../contexts/useTheme.js';
import api from '../../services/api';
@@ -34,6 +34,7 @@ function formatPercent(value) {
const SystemTab = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const register = useSettingFocus();
const { isAdmin } = useAuth();
const { whiteLabel } = useTheme();
@@ -262,13 +263,13 @@ const SystemTab = () => {
)}
{timezonesError && <ErrorState compact error={timezonesError} onRetry={loadTimezones} />}
<div className="form-group">
- <label>{t('app.systemTab.changeTimezone', 'Change time zone')}</label>
+ <label htmlFor={`${fieldId}-timezone`}>{t('app.systemTab.changeTimezone', 'Change time zone')}</label>
<div className="timezone-selector">
<Select
value={selectedTimezone || '__none__'}
onValueChange={(val) => setSelectedTimezone(val === '__none__' ? '' : val)}
>
- <SelectTrigger>
+ <SelectTrigger id={`${fieldId}-timezone`}>
<SelectValue placeholder={t('app.systemTab.selectTimezone', 'Select time zone…')} />
</SelectTrigger>
<SelectContent>
diff --git a/frontend/src/components/settings/ThemeStudioModal.jsx b/frontend/src/components/settings/ThemeStudioModal.jsx
index d789f1dd..8a4a87e6 100644
--- a/frontend/src/components/settings/ThemeStudioModal.jsx
+++ b/frontend/src/components/settings/ThemeStudioModal.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useMemo, useState } from 'react';
+import { useEffect, useMemo, useState, useId } from 'react';
import { Download, Save, Github } from 'lucide-react';
import {
Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription,
@@ -36,6 +36,7 @@ function seedTokens(theme, mode) {
// the skin preview), start from any installed theme, then Export a valid
// theme.json, Save it into this panel, or Submit it to the registry.
const ThemeStudioModal = ({ open, onOpenChange }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const { availableThemes, previewSkin, clearPreview, refreshInstalledThemes, setSkin } = useTheme();
const { user } = useAuth();
@@ -203,7 +204,7 @@ const ThemeStudioModal = ({ open, onOpenChange }) => {
const value = activeTokens[token] ?? '';
return (
<div key={token} className="theme-studio__token">
- <label>{token}</label>
+ <label htmlFor={`${fieldId}-${token}`}>{token}</label>
<div className="theme-studio__token-input">
{isColor && /^#([0-9a-fA-F]{6})$/.test(value) && (
<input
@@ -213,6 +214,7 @@ const ThemeStudioModal = ({ open, onOpenChange }) => {
/>
)}
<input
+ id={`${fieldId}-${token}`}
type="text"
value={value}
placeholder="unset"
diff --git a/frontend/src/components/settings/TwoFactorPolicyCard.jsx b/frontend/src/components/settings/TwoFactorPolicyCard.jsx
index 34976c55..a29f69dc 100644
--- a/frontend/src/components/settings/TwoFactorPolicyCard.jsx
+++ b/frontend/src/components/settings/TwoFactorPolicyCard.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useState, useId } from 'react';
import api from '../../services/api';
import { Button } from '@/components/ui/button';
import ErrorState from '../ErrorState';
@@ -21,6 +21,7 @@ const POLICY_LABELS = {
// `props` are spread onto the card root so a parent can attach a ref /
// focus-highlight class (see useSettingFocus / command-palette deep links).
const TwoFactorPolicyCard = (props) => {
+ const fieldId = useId();
const { t } = useTranslation();
const [policy, setPolicy] = useState('off');
const [graceDays, setGraceDays] = useState(7);
@@ -89,9 +90,9 @@ const TwoFactorPolicyCard = (props) => {
</p>
<div className="form-group">
- <label>{t('app.twoFactorPolicyCard.whoMustEnrol', 'Who must enrol')}</label>
+ <label htmlFor={`${fieldId}-policy`}>{t('app.twoFactorPolicyCard.whoMustEnrol', 'Who must enrol')}</label>
<Select value={policy} onValueChange={setPolicy}>
- <SelectTrigger>
+ <SelectTrigger id={`${fieldId}-policy`}>
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -104,8 +105,9 @@ const TwoFactorPolicyCard = (props) => {
{policy !== 'off' && (
<div className="form-group">
- <label>{t('app.twoFactorPolicyCard.gracePeriodDays', 'Grace period (days)')}</label>
+ <label htmlFor={`${fieldId}-grace`}>{t('app.twoFactorPolicyCard.gracePeriodDays', 'Grace period (days)')}</label>
<Input
+ id={`${fieldId}-grace`}
type="number"
className="policy-grace-input"
min="0"
diff --git a/frontend/src/components/settings/WebhookSubscriptionModal.jsx b/frontend/src/components/settings/WebhookSubscriptionModal.jsx
index 7535bd27..2e80566f 100644
--- a/frontend/src/components/settings/WebhookSubscriptionModal.jsx
+++ b/frontend/src/components/settings/WebhookSubscriptionModal.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import api from '../../services/api';
import Modal from '../Modal';
import { Button } from '@/components/ui/button';
@@ -9,6 +9,7 @@ import { useTranslation } from 'react-i18next';
const WebhookSubscriptionModal = ({ subscription, onClose, onSubmit }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const [name, setName] = useState('');
const [url, setUrl] = useState('');
const [selectedEvents, setSelectedEvents] = useState([]);
@@ -80,8 +81,9 @@ const WebhookSubscriptionModal = ({ subscription, onClose, onSubmit }) => {
<form onSubmit={handleSubmit}>
<div className="modal-body">
<div className="form-group">
- <Label>{t('common.labels.name', 'Name')}</Label>
+ <Label htmlFor={`${fieldId}-name`}>{t('common.labels.name', 'Name')}</Label>
<Input
+ id={`${fieldId}-name`}
type="text"
value={name}
onChange={e => setName(e.target.value)}
@@ -91,8 +93,9 @@ const WebhookSubscriptionModal = ({ subscription, onClose, onSubmit }) => {
</div>
<div className="form-group">
- <Label>{t('app.webhookSubscriptionModal.payloadUrl', 'Payload URL')}</Label>
+ <Label htmlFor={`${fieldId}-url`}>{t('app.webhookSubscriptionModal.payloadUrl', 'Payload URL')}</Label>
<Input
+ id={`${fieldId}-url`}
type="url"
value={url}
onChange={e => setUrl(e.target.value)}
@@ -136,8 +139,9 @@ const WebhookSubscriptionModal = ({ subscription, onClose, onSubmit }) => {
<div className="form-row">
<div className="form-group">
- <Label>{t('app.webhookSubscriptionModal.retryCount', 'Retry count')}</Label>
+ <Label htmlFor={`${fieldId}-retry-count`}>{t('app.webhookSubscriptionModal.retryCount', 'Retry count')}</Label>
<Input
+ id={`${fieldId}-retry-count`}
type="number"
value={retryCount}
onChange={e => setRetryCount(parseInt(e.target.value) || 3)}
@@ -146,8 +150,9 @@ const WebhookSubscriptionModal = ({ subscription, onClose, onSubmit }) => {
/>
</div>
<div className="form-group">
- <Label>{t('app.webhookSubscriptionModal.timeoutSeconds', 'Timeout (seconds)')}</Label>
+ <Label htmlFor={`${fieldId}-timeout`}>{t('app.webhookSubscriptionModal.timeoutSeconds', 'Timeout (seconds)')}</Label>
<Input
+ id={`${fieldId}-timeout`}
type="number"
value={timeoutSeconds}
onChange={e => setTimeoutSeconds(parseInt(e.target.value) || 10)}
diff --git a/frontend/src/components/settings/WebhooksTab.jsx b/frontend/src/components/settings/WebhooksTab.jsx
index cdc23973..5087678a 100644
--- a/frontend/src/components/settings/WebhooksTab.jsx
+++ b/frontend/src/components/settings/WebhooksTab.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useEffect, useMemo, useState } from 'react';
+import { useCallback, useEffect, useMemo, useState, useId } from 'react';
import api from '../../services/api';
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
@@ -30,6 +30,7 @@ const formatDate = (d) => (d ? formatDateTime(d) : '—');
* (Secret storage moved to the Organization tab group at /vaults earlier.)
*/
export default function WebhooksTab() {
+ const fieldId = useId();
const { t } = useTranslation();
const toast = useToast();
const { confirm } = useConfirm();
@@ -340,8 +341,8 @@ export default function WebhooksTab() {
>
<p className="sk-modal__subtitle">{t('app.webhooksTab.copyThisSecretNowItWill', 'Copy this secret now. It will not be shown again.')}</p>
<div className="settings-webhook-secret-field">
- <Label>{t('app.webhooksTab.endpoint', 'Endpoint')}</Label>
- <Input readOnly value={regeneratedSecret?.name || ''} />
+ <Label htmlFor={`${fieldId}-endpoint`}>{t('app.webhooksTab.endpoint', 'Endpoint')}</Label>
+ <Input id={`${fieldId}-endpoint`} readOnly value={regeneratedSecret?.name || ''} />
<CopyField label={t('app.webhooksTab.secret', 'Secret')} value={regeneratedSecret?.secret || ''} secret />
</div>
</Modal>
diff --git a/frontend/src/components/settings/WhiteLabelTab.jsx b/frontend/src/components/settings/WhiteLabelTab.jsx
index f100612b..2d56fc44 100644
--- a/frontend/src/components/settings/WhiteLabelTab.jsx
+++ b/frontend/src/components/settings/WhiteLabelTab.jsx
@@ -1,4 +1,4 @@
-import { useRef } from 'react';
+import { useRef, useId } from 'react';
import { useTheme } from '../../contexts/useTheme.js';
import { Star, X, Layers, Image, Type, Upload } from 'lucide-react';
import { Button } from '@/components/ui/button';
@@ -16,6 +16,7 @@ const WHITELABEL_MODES = [
const WhiteLabelTab = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const { whiteLabel, setWhiteLabel } = useTheme();
const logoInputRef = useRef(null);
const register = useSettingFocus();
@@ -32,11 +33,12 @@ const WhiteLabelTab = () => {
<div className="settings-row">
<div className="settings-label">
- <Label>{t('app.whiteLabelTab.enableCustomBranding', 'Enable custom branding')}</Label>
+ <Label htmlFor={`${fieldId}-enabled`}>{t('app.whiteLabelTab.enableCustomBranding', 'Enable custom branding')}</Label>
<span className="settings-hint">{t('app.whiteLabelTab.replacesTheSidebarLogoNameAnd', 'Replaces the sidebar logo, name, and GitHub star link.')}</span>
</div>
<div className="settings-control">
<Switch
+ id={`${fieldId}-enabled`}
checked={whiteLabel.enabled}
onCheckedChange={(checked) => setWhiteLabel({ enabled: checked })}
/>
@@ -62,8 +64,9 @@ const WhiteLabelTab = () => {
<div className="whitelabel-fields">
{whiteLabel.mode !== 'image_full' && (
<div className="form-group">
- <Label>{t('app.whiteLabelTab.brandName', 'Brand name')}</Label>
+ <Label htmlFor={`${fieldId}-brand-name`}>{t('app.whiteLabelTab.brandName', 'Brand name')}</Label>
<Input
+ id={`${fieldId}-brand-name`}
type="text"
value={whiteLabel.brandName}
onChange={(e) => setWhiteLabel({ brandName: e.target.value })}
@@ -75,7 +78,7 @@ const WhiteLabelTab = () => {
{whiteLabel.mode !== 'text_only' && (
<div className="form-group">
- <Label>{t('app.whiteLabelTab.logoImage', 'Logo image')}</Label>
+ <Label htmlFor={`${fieldId}-logo`}>{t('app.whiteLabelTab.logoImage', 'Logo image')}</Label>
<div className="whitelabel-upload" onClick={() => logoInputRef.current?.click()}>
{whiteLabel.logoData ? (
<div className="whitelabel-logo-preview">
@@ -96,6 +99,7 @@ const WhiteLabelTab = () => {
</div>
)}
<input
+ id={`${fieldId}-logo`}
ref={logoInputRef}
type="file"
accept="image/png,image/jpeg,image/svg+xml,image/webp"
diff --git a/frontend/src/components/workspaces/WorkspaceSettingsTab.jsx b/frontend/src/components/workspaces/WorkspaceSettingsTab.jsx
index 5a754e04..0cb3375e 100644
--- a/frontend/src/components/workspaces/WorkspaceSettingsTab.jsx
+++ b/frontend/src/components/workspaces/WorkspaceSettingsTab.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useId } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { Settings, PanelLeft, Check, Archive, ArchiveRestore, Trash2 } from 'lucide-react';
import { useToast } from '../../contexts/useToast.js';
@@ -37,21 +37,24 @@ const SETTINGS_ITEMS = SETTINGS_GROUPS.flatMap((g) => g.items);
const GeneralSection = ({ form, setForm }) => {
const { t } = useTranslation();
+ const fieldId = useId();
return (
<div className="ws-settings__section">
<h3 className="ws-settings__section-title">{t('app.workspaceSettingsTab.general', 'General')}</h3>
<SharedCard variant="legacy" className="card settings-section">
<div className="form-group">
- <label>{t('common.labels.name', 'Name')}</label>
+ <label htmlFor={`${fieldId}-name`}>{t('common.labels.name', 'Name')}</label>
<Input
+ id={`${fieldId}-name`}
value={form.name}
onChange={(e) => setForm((f) => ({ ...f, name: e.target.value }))}
placeholder={t('app.workspaceSettingsTab.myTeam', 'My team')}
/>
</div>
<div className="form-group">
- <label>{t('common.labels.description', 'Description')}</label>
+ <label htmlFor={`${fieldId}-description`}>{t('common.labels.description', 'Description')}</label>
<Textarea
+ id={`${fieldId}-description`}
value={form.description}
onChange={(e) => setForm((f) => ({ ...f, description: e.target.value }))}
rows={2}
@@ -59,16 +62,18 @@ const GeneralSection = ({ form, setForm }) => {
</div>
<div className="form-row">
<div className="form-group">
- <label>{t('app.workspaceSettingsTab.maxServers0Unlimited', 'Max servers (0 = unlimited)')}</label>
+ <label htmlFor={`${fieldId}-max-servers`}>{t('app.workspaceSettingsTab.maxServers0Unlimited', 'Max servers (0 = unlimited)')}</label>
<Input
+ id={`${fieldId}-max-servers`}
type="number"
value={form.max_servers}
onChange={(e) => setForm((f) => ({ ...f, max_servers: parseInt(e.target.value) || 0 }))}
/>
</div>
<div className="form-group">
- <label>{t('app.workspaceSettingsTab.maxUsers0Unlimited', 'Max users (0 = unlimited)')}</label>
+ <label htmlFor={`${fieldId}-max-users`}>{t('app.workspaceSettingsTab.maxUsers0Unlimited', 'Max users (0 = unlimited)')}</label>
<Input
+ id={`${fieldId}-max-users`}
type="number"
value={form.max_users}
onChange={(e) => setForm((f) => ({ ...f, max_users: parseInt(e.target.value) || 0 }))}
@@ -76,8 +81,9 @@ const GeneralSection = ({ form, setForm }) => {
</div>
</div>
<div className="form-group">
- <label>{t('app.workspaceSettingsTab.brandColor', 'Brand color')}</label>
+ <label htmlFor={`${fieldId}-brand-color`}>{t('app.workspaceSettingsTab.brandColor', 'Brand color')}</label>
<input
+ id={`${fieldId}-brand-color`}
type="color"
className="workspace-color-input"
value={form.primary_color}
diff --git a/frontend/src/pages/AgentFleet.jsx b/frontend/src/pages/AgentFleet.jsx
index 277365f3..48ffa603 100644
--- a/frontend/src/pages/AgentFleet.jsx
+++ b/frontend/src/pages/AgentFleet.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect } from 'react';
+import { useCallback, useId, useState, useEffect } from 'react';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import {
Shield,
@@ -42,6 +42,7 @@ import { formatDate, formatDateTime } from '@/utils/intl';
const AgentFleet = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const [activeTab, setActiveTab] = useState('dashboard');
const [loading, setLoading] = useState(true);
const [loadError, setLoadError] = useState(null);
@@ -637,8 +638,8 @@ const AgentFleet = () => {
{rolloutStrategy === 'staged' && (
<>
<div className="form-group">
- <label>{t('app.agentFleet.batchSize', 'Batch size')}</label>
- <Input
+ <label htmlFor={`${fieldId}-batch-size`}>{t('app.agentFleet.batchSize', 'Batch size')}</label>
+ <Input id={`${fieldId}-batch-size`}
type="number"
value={rolloutBatchSize}
onChange={e => setRolloutBatchSize(parseInt(e.target.value) || 5)}
@@ -646,8 +647,8 @@ const AgentFleet = () => {
/>
</div>
<div className="form-group">
- <label>{t('app.agentFleet.delayMinutes', 'Delay (minutes)')}</label>
- <Input
+ <label htmlFor={`${fieldId}-delay`}>{t('app.agentFleet.delayMinutes', 'Delay (minutes)')}</label>
+ <Input id={`${fieldId}-delay`}
type="number"
value={rolloutDelay}
onChange={e => setRolloutDelay(parseInt(e.target.value) || 10)}
diff --git a/frontend/src/pages/Backups.jsx b/frontend/src/pages/Backups.jsx
index 8d5d4a61..3a697e13 100644
--- a/frontend/src/pages/Backups.jsx
+++ b/frontend/src/pages/Backups.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useCallback, useMemo } from 'react';
+import { useState, useEffect, useCallback, useMemo, useId } from 'react';
import useTabParam from '../hooks/useTabParam';
import { Upload, Check, AlertTriangle, Archive, Clock, Database, Package, FolderArchive, HardDrive, History, Cloud, RefreshCw, Trash2, Plus, FileArchive, DollarSign } from 'lucide-react';
import api from '../services/api';
@@ -131,6 +131,7 @@ const SNAPSHOT_VIEWS = [
const Backups = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const { confirm } = useConfirm();
const [backups, setBackups] = useState([]);
@@ -1205,8 +1206,9 @@ const Backups = () => {
{backupForm.type === 'files' && (
<>
<div className="form-group">
- <label>{t('app.backups.backupNameOptional', 'Backup name (optional)')}</label>
+ <label htmlFor={`${fieldId}-backup-name`}>{t('app.backups.backupNameOptional', 'Backup name (optional)')}</label>
<Input
+ id={`${fieldId}-backup-name`}
type="text"
value={backupForm.fileName}
onChange={(e) => setBackupForm({...backupForm, fileName: e.target.value})}
@@ -1214,8 +1216,9 @@ const Backups = () => {
/>
</div>
<div className="form-group">
- <label>{t('app.backups.fileDirectoryPathsOnePerLine', 'File/Directory Paths (one per line)')}</label>
+ <label htmlFor={`${fieldId}-file-paths`}>{t('app.backups.fileDirectoryPathsOnePerLine', 'File/Directory Paths (one per line)')}</label>
<Textarea
+ id={`${fieldId}-file-paths`}
value={backupForm.filePaths}
onChange={(e) => setBackupForm({...backupForm, filePaths: e.target.value})}
placeholder={"/etc/nginx/nginx.conf\n/var/www/mysite/config\n/home/user/.env"}
@@ -1244,8 +1247,9 @@ const Backups = () => {
</div>
<div className="form-group">
- <label>{t('app.backups.databaseName', 'Database name')}</label>
+ <label htmlFor={`${fieldId}-db-name`}>{t('app.backups.databaseName', 'Database name')}</label>
<Input
+ id={`${fieldId}-db-name`}
type="text"
value={backupForm.dbName}
onChange={(e) => setBackupForm({...backupForm, dbName: e.target.value})}
@@ -1255,8 +1259,9 @@ const Backups = () => {
<div className="form-row">
<div className="form-group">
- <label>{t('common.labels.username', 'Username')}</label>
+ <label htmlFor={`${fieldId}-db-user`}>{t('common.labels.username', 'Username')}</label>
<Input
+ id={`${fieldId}-db-user`}
type="text"
value={backupForm.dbUser}
onChange={(e) => setBackupForm({...backupForm, dbUser: e.target.value})}
@@ -1264,8 +1269,9 @@ const Backups = () => {
</div>
<div className="form-group">
- <label>{t('common.labels.password', 'Password')}</label>
+ <label htmlFor={`${fieldId}-db-password`}>{t('common.labels.password', 'Password')}</label>
<Input
+ id={`${fieldId}-db-password`}
type="password"
value={backupForm.dbPassword}
onChange={(e) => setBackupForm({...backupForm, dbPassword: e.target.value})}
@@ -1274,8 +1280,9 @@ const Backups = () => {
</div>
<div className="form-group">
- <label>{t('app.backups.host', 'Host')}</label>
+ <label htmlFor={`${fieldId}-db-host`}>{t('app.backups.host', 'Host')}</label>
<Input
+ id={`${fieldId}-db-host`}
type="text"
value={backupForm.dbHost}
onChange={(e) => setBackupForm({...backupForm, dbHost: e.target.value})}
diff --git a/frontend/src/pages/CloudProvision.jsx b/frontend/src/pages/CloudProvision.jsx
index cc1a2279..d897bd78 100644
--- a/frontend/src/pages/CloudProvision.jsx
+++ b/frontend/src/pages/CloudProvision.jsx
@@ -1,5 +1,5 @@
import { Card as SharedCard } from '@/components/ui/card';
-import { useState, useEffect, useCallback } from 'react';
+import { useState, useEffect, useCallback, useId } from 'react';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import api from '../services/api';
import { useToast } from '../contexts/useToast.js';
@@ -19,6 +19,7 @@ import { toastError } from '@/utils/errorMessage';
const CloudProvision = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const { user } = useAuth();
const [providers, setProviders] = useState([]);
@@ -215,8 +216,8 @@ const CloudProvision = () => {
</SelectContent>
</Select>
</div>
- <div className="form-group"><label>{t('common.labels.name', 'Name')}</label><Input value={providerForm.name} onChange={e => setProviderForm({...providerForm, name: e.target.value})} /></div>
- <div className="form-group"><label>{t('app.cloudProvision.apiKey', 'API key')}</label><Input type="password" value={providerForm.api_key} onChange={e => setProviderForm({...providerForm, api_key: e.target.value})} /></div>
+ <div className="form-group"><label htmlFor={`${fieldId}-provider-name`}>{t('common.labels.name', 'Name')}</label><Input id={`${fieldId}-provider-name`} value={providerForm.name} onChange={e => setProviderForm({...providerForm, name: e.target.value})} /></div>
+ <div className="form-group"><label htmlFor={`${fieldId}-api-key`}>{t('app.cloudProvision.apiKey', 'API key')}</label><Input id={`${fieldId}-api-key`} type="password" value={providerForm.api_key} onChange={e => setProviderForm({...providerForm, api_key: e.target.value})} /></div>
</Modal>
<Modal
@@ -242,7 +243,7 @@ const CloudProvision = () => {
</SelectContent>
</Select>
</div>
- <div className="form-group"><label>{t('app.cloudProvision.serverName', 'Server name')}</label><Input value={serverForm.name} onChange={e => setServerForm({...serverForm, name: e.target.value})} /></div>
+ <div className="form-group"><label htmlFor={`${fieldId}-server-name`}>{t('app.cloudProvision.serverName', 'Server name')}</label><Input id={`${fieldId}-server-name`} value={serverForm.name} onChange={e => setServerForm({...serverForm, name: e.target.value})} /></div>
{providerOptions && (
<>
<div className="form-group">
diff --git a/frontend/src/pages/Domains.jsx b/frontend/src/pages/Domains.jsx
index 844edec0..52d53989 100644
--- a/frontend/src/pages/Domains.jsx
+++ b/frontend/src/pages/Domains.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useCallback, useMemo } from 'react';
+import { useState, useEffect, useCallback, useMemo, useId } from 'react';
import { useSearchParams } from 'react-router-dom';
import {
Globe, Plus, ShieldCheck, RefreshCw, Trash2, ExternalLink,
@@ -128,6 +128,7 @@ const BUILTIN_VIEWS = [
];
const Domains = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const { confirm } = useConfirm();
const toast = useToast();
@@ -897,9 +898,9 @@ const Domains = () => {
<Modal open={showAddModal} onClose={() => setShowAddModal(false)} title={t('app.domains.addDomain2', 'Add domain')}>
<form onSubmit={handleAddDomain}>
<div className="form-group">
- <Label>{t('app.domains.application', 'Service')}</Label>
+ <Label htmlFor={`${fieldId}-app`}>{t('app.domains.application', 'Service')}</Label>
<Select value={selectedAppId} onValueChange={setSelectedAppId} required>
- <SelectTrigger><SelectValue placeholder={t('app.domains.selectAnApplication', 'Select a service')} /></SelectTrigger>
+ <SelectTrigger id={`${fieldId}-app`}><SelectValue placeholder={t('app.domains.selectAnApplication', 'Select a service')} /></SelectTrigger>
<SelectContent>
{apps.map(app => (
<SelectItem key={app.id} value={String(app.id)}>{app.name}</SelectItem>
@@ -908,9 +909,10 @@ const Domains = () => {
</Select>
</div>
<div className="form-group">
- <Label>{t('common.labels.domain', 'Domain')}</Label>
+ <Label htmlFor={`${fieldId}-domain`}>{t('common.labels.domain', 'Domain')}</Label>
{showAddModal && (
<DomainField
+ id={`${fieldId}-domain`}
exclude={domains.map((d) => d.name)}
rejectExisting
onChange={(name, info) => { setDomainName(name); setDomainInfo(info); }}
@@ -945,8 +947,9 @@ const Domains = () => {
</div>
</div>
<div className="form-group">
- <Label>{t('app.domains.emailAddress', 'Email address')}</Label>
+ <Label htmlFor={`${fieldId}-email`}>{t('app.domains.emailAddress', 'Email address')}</Label>
<Input
+ id={`${fieldId}-email`}
type="email"
placeholder={acmeContact || '[email protected]'}
value={sslEmail || acmeContact}
diff --git a/frontend/src/pages/FTPServer.jsx b/frontend/src/pages/FTPServer.jsx
index 7f1d3cb7..903a53c2 100644
--- a/frontend/src/pages/FTPServer.jsx
+++ b/frontend/src/pages/FTPServer.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect } from 'react';
+import { useCallback, useState, useEffect, useId } from 'react';
import {
FolderUp, UserPlus, Network, Activity, Server, Users as UsersIcon,
Cable, KeyRound, Ban, Check, Trash2, RefreshCw, X,
@@ -62,6 +62,7 @@ const FTP_USER_VIEWS = [
function FTPServer() {
const { t } = useTranslation();
+ const fieldId = useId();
const [status, setStatus] = useState(null);
const [users, setUsers] = useState([]);
const [connections, setConnections] = useState([]);
@@ -817,8 +818,9 @@ function FTPServer() {
{/* Create User Modal */}
<Modal open={showUserModal} onClose={() => setShowUserModal(false)} title={t('app.fTPServer.createFtpUser', 'New FTP user')}>
<div className="form-group">
- <Label>{t('app.fTPServer.username2', 'Username *')}</Label>
+ <Label htmlFor={`${fieldId}-username`}>{t('app.fTPServer.username2', 'Username *')}</Label>
<Input
+ id={`${fieldId}-username`}
type="text"
value={newUser.username}
onChange={(e) => setNewUser({ ...newUser, username: e.target.value })}
@@ -826,8 +828,9 @@ function FTPServer() {
/>
</div>
<div className="form-group">
- <Label>{t('app.fTPServer.passwordLeaveEmptyToAutoGenerate', 'Password (leave empty to auto-generate)')}</Label>
+ <Label htmlFor={`${fieldId}-password`}>{t('app.fTPServer.passwordLeaveEmptyToAutoGenerate', 'Password (leave empty to auto-generate)')}</Label>
<Input
+ id={`${fieldId}-password`}
type="password"
value={newUser.password}
onChange={(e) => setNewUser({ ...newUser, password: e.target.value })}
@@ -835,8 +838,9 @@ function FTPServer() {
/>
</div>
<div className="form-group">
- <Label>{t('app.fTPServer.homeDirectoryOptional', 'Home directory (optional)')}</Label>
+ <Label htmlFor={`${fieldId}-home-dir`}>{t('app.fTPServer.homeDirectoryOptional', 'Home directory (optional)')}</Label>
<Input
+ id={`${fieldId}-home-dir`}
type="text"
value={newUser.homeDir}
onChange={(e) => setNewUser({ ...newUser, homeDir: e.target.value })}
@@ -860,8 +864,9 @@ function FTPServer() {
<Modal open={showPasswordModal} onClose={() => setShowPasswordModal(false)} title={t('app.fTPServer.changePassword', 'Change password')}>
<p>{t('app.fTPServer.changingPasswordForUser', 'Changing password for user:')} <strong>{passwordTarget}</strong></p>
<div className="form-group">
- <Label>{t('app.fTPServer.newPasswordLeaveEmptyToAuto', 'New password (leave empty to auto-generate)')}</Label>
+ <Label htmlFor={`${fieldId}-new-password`}>{t('app.fTPServer.newPasswordLeaveEmptyToAuto', 'New password (leave empty to auto-generate)')}</Label>
<Input
+ id={`${fieldId}-new-password`}
type="password"
value={newPassword}
onChange={(e) => setNewPassword(e.target.value)}
diff --git a/frontend/src/pages/RemoteAccess.jsx b/frontend/src/pages/RemoteAccess.jsx
index 8bbd2060..641cf642 100644
--- a/frontend/src/pages/RemoteAccess.jsx
+++ b/frontend/src/pages/RemoteAccess.jsx
@@ -1,5 +1,5 @@
import { statusKind } from '@/components/ds/status';
-import { useState, useEffect, useCallback, useMemo } from 'react';
+import { useState, useEffect, useCallback, useMemo, useId } from 'react';
import { Link } from 'react-router-dom';
import {
Network, Plus, Trash2, Globe, Lock, ShieldCheck, ExternalLink,
@@ -38,6 +38,7 @@ const EMPTY_FORM = {
const RemoteAccess = ({ serverId }) => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const [tunnels, setTunnels] = useState([]);
const [services, setServices] = useState({}); // tunnelId -> [service]
@@ -440,32 +441,34 @@ const RemoteAccess = ({ serverId }) => {
<div className="ra-service-option">
<div>
- <Label>{t('app.remoteAccess.httpsLetSEncrypt', 'HTTPS (Let\'s Encrypt)')}</Label>
+ <Label htmlFor={`${fieldId}-ssl`}>{t('app.remoteAccess.httpsLetSEncrypt', 'HTTPS (Let\'s Encrypt)')}</Label>
<p className="ra-service-hint">{t('app.remoteAccess.obtainACertificateOnTheEdge', 'Obtain a certificate on the edge.')}</p>
</div>
- <Switch checked={form.ssl} onCheckedChange={(v) => setField('ssl', v)} />
+ <Switch id={`${fieldId}-ssl`} checked={form.ssl} onCheckedChange={(v) => setField('ssl', v)} />
</div>
<div className="ra-service-option">
<div>
- <Label>{t('app.remoteAccess.requireLoginBasicAuth', 'Require login (basic auth)')}</Label>
+ <Label htmlFor={`${fieldId}-require-auth`}>{t('app.remoteAccess.requireLoginBasicAuth', 'Require login (basic auth)')}</Label>
<p className="ra-service-hint">{t('app.remoteAccess.putAUsernamePasswordInFront', 'Put a username/password in front of the service.')}</p>
</div>
- <Switch checked={form.requireAuth} onCheckedChange={(v) => setField('requireAuth', v)} />
+ <Switch id={`${fieldId}-require-auth`} checked={form.requireAuth} onCheckedChange={(v) => setField('requireAuth', v)} />
</div>
{form.requireAuth && (
<div className="ra-service-credentials">
<div className="ra-service-field">
- <Label>{t('common.labels.username', 'Username')}</Label>
+ <Label htmlFor={`${fieldId}-auth-username`}>{t('common.labels.username', 'Username')}</Label>
<Input
+ id={`${fieldId}-auth-username`}
value={form.authUsername}
onChange={(e) => setField('authUsername', e.target.value)}
/>
</div>
<div className="ra-service-field">
- <Label>{t('common.labels.password', 'Password')}</Label>
+ <Label htmlFor={`${fieldId}-auth-password`}>{t('common.labels.password', 'Password')}</Label>
<Input
+ id={`${fieldId}-auth-password`}
type="password"
value={form.authPassword}
onChange={(e) => setField('authPassword', e.target.value)}
diff --git a/frontend/src/pages/SSLCertificates.jsx b/frontend/src/pages/SSLCertificates.jsx
index b8bddd91..3c8fe874 100644
--- a/frontend/src/pages/SSLCertificates.jsx
+++ b/frontend/src/pages/SSLCertificates.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useMemo } from 'react';
+import { useState, useEffect, useId, useMemo } from 'react';
import {
ShieldCheck, RefreshCw, Plus, Lock, MoreVertical,
Settings, Download, Upload,
@@ -97,6 +97,7 @@ const SSL_BUILTIN_VIEWS = [
const SSLCertificates = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const { confirm } = useConfirm();
const [status, setStatus] = useState(null);
@@ -586,8 +587,8 @@ const SSLCertificates = () => {
{!wildcard && (
<>
<div className="form-group">
- <Label>{t('app.sSLCertificates.emailAddress', 'Email address')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-email`}>{t('app.sSLCertificates.emailAddress', 'Email address')}</Label>
+ <Input id={`${fieldId}-email`}
type="email"
placeholder="[email protected]"
value={email}
@@ -607,8 +608,8 @@ const SSLCertificates = () => {
</div>
{!useNginx && (
<div className="form-group">
- <Label>{t('app.sSLCertificates.webrootPath', 'Webroot path')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-webroot`}>{t('app.sSLCertificates.webrootPath', 'Webroot path')}</Label>
+ <Input id={`${fieldId}-webroot`}
type="text"
placeholder="/var/www/html"
value={webrootPath}
@@ -634,8 +635,8 @@ const SSLCertificates = () => {
</div>
{dnsProvider === 'cloudflare' ? (
<div className="form-group">
- <Label>{t('app.sSLCertificates.cloudflareApiToken', 'Cloudflare API token')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-cf-token`}>{t('app.sSLCertificates.cloudflareApiToken', 'Cloudflare API token')}</Label>
+ <Input id={`${fieldId}-cf-token`}
type="password"
placeholder={t('app.sSLCertificates.apiTokenWithDnsEditRights', 'API token with DNS edit rights')}
value={dnsToken}
@@ -646,8 +647,8 @@ const SSLCertificates = () => {
) : (
<>
<div className="form-group">
- <Label>{t('app.sSLCertificates.awsAccessKeyId', 'AWS access key ID')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-aws-access-key`}>{t('app.sSLCertificates.awsAccessKeyId', 'AWS access key ID')}</Label>
+ <Input id={`${fieldId}-aws-access-key`}
type="text"
value={awsAccessKey}
onChange={e => setAwsAccessKey(e.target.value)}
@@ -655,8 +656,8 @@ const SSLCertificates = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.sSLCertificates.awsSecretAccessKey', 'AWS secret access key')}</Label>
- <Input
+ <Label htmlFor={`${fieldId}-aws-secret-key`}>{t('app.sSLCertificates.awsSecretAccessKey', 'AWS secret access key')}</Label>
+ <Input id={`${fieldId}-aws-secret-key`}
type="password"
value={awsSecretKey}
onChange={e => setAwsSecretKey(e.target.value)}
@@ -705,8 +706,8 @@ const SSLCertificates = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.sSLCertificates.certificatePem', 'Certificate (PEM)')}</Label>
- <textarea
+ <Label htmlFor={`${fieldId}-cert-pem`}>{t('app.sSLCertificates.certificatePem', 'Certificate (PEM)')}</Label>
+ <textarea id={`${fieldId}-cert-pem`}
className="ui-textarea ssl-pem-input"
rows={5}
placeholder={t('app.sSLCertificates.beginCertificate', '-----BEGIN CERTIFICATE-----')}
@@ -716,8 +717,8 @@ const SSLCertificates = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.sSLCertificates.privateKeyPem', 'Private key (PEM)')}</Label>
- <textarea
+ <Label htmlFor={`${fieldId}-key-pem`}>{t('app.sSLCertificates.privateKeyPem', 'Private key (PEM)')}</Label>
+ <textarea id={`${fieldId}-key-pem`}
className="ui-textarea ssl-pem-input"
rows={5}
placeholder={t('app.sSLCertificates.beginPrivateKey', '-----BEGIN PRIVATE KEY-----')}
@@ -727,8 +728,8 @@ const SSLCertificates = () => {
/>
</div>
<div className="form-group">
- <Label>{t('app.sSLCertificates.chainPemOptional', 'Chain (PEM, optional)')}</Label>
- <textarea
+ <Label htmlFor={`${fieldId}-chain-pem`}>{t('app.sSLCertificates.chainPemOptional', 'Chain (PEM, optional)')}</Label>
+ <textarea id={`${fieldId}-chain-pem`}
className="ui-textarea ssl-pem-input"
rows={4}
placeholder={t('app.sSLCertificates.beginCertificateIntermediateChain', '-----BEGIN CERTIFICATE----- (intermediate chain)')}
diff --git a/frontend/src/pages/ServerTemplates.jsx b/frontend/src/pages/ServerTemplates.jsx
index 65137389..54a31fa8 100644
--- a/frontend/src/pages/ServerTemplates.jsx
+++ b/frontend/src/pages/ServerTemplates.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useCallback, useMemo } from 'react';
+import { useState, useEffect, useCallback, useMemo, useId } from 'react';
import { useTopbarActions, useTopbarChrome } from '@/hooks/useTopbarActions';
import { useTableSort } from '@/hooks/useTableSort';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
@@ -216,6 +216,7 @@ const BUILTIN_VIEWS = [
];
const ServerTemplates = () => {
+ const fieldId = useId();
const { t } = useTranslation();
const toast = useToast();
const { user } = useAuth();
@@ -676,12 +677,12 @@ const ServerTemplates = () => {
)}
>
<div className="form-group">
- <label>{t('common.labels.name', 'Name')}</label>
- <Input value={form.name} onChange={e => setForm({...form, name: e.target.value})} />
+ <label htmlFor={`${fieldId}-name`}>{t('common.labels.name', 'Name')}</label>
+ <Input id={`${fieldId}-name`} value={form.name} onChange={e => setForm({...form, name: e.target.value})} />
</div>
<div className="form-group">
- <label>{t('common.labels.description', 'Description')}</label>
- <Textarea value={form.description} onChange={e => setForm({...form, description: e.target.value})} rows={2} />
+ <label htmlFor={`${fieldId}-description`}>{t('common.labels.description', 'Description')}</label>
+ <Textarea id={`${fieldId}-description`} value={form.description} onChange={e => setForm({...form, description: e.target.value})} rows={2} />
</div>
<div className="form-group">
<label htmlFor="server-template-category">{t('app.serverTemplates.category', 'Category')}</label>
@@ -693,8 +694,8 @@ const ServerTemplates = () => {
</Select>
</div>
<div className="form-group">
- <label>{t('app.serverTemplates.packagesOnePerLine', 'Packages (one per line)')}</label>
- <Textarea className="form-input--mono" value={form.packages} onChange={e => setForm({...form, packages: e.target.value})} rows={4} placeholder={t('app.serverTemplates.nginxPhpFpmCertbot', 'nginx\nphp-fpm\ncertbot')} />
+ <label htmlFor={`${fieldId}-packages`}>{t('app.serverTemplates.packagesOnePerLine', 'Packages (one per line)')}</label>
+ <Textarea id={`${fieldId}-packages`} className="form-input--mono" value={form.packages} onChange={e => setForm({...form, packages: e.target.value})} rows={4} placeholder={t('app.serverTemplates.nginxPhpFpmCertbot', 'nginx\nphp-fpm\ncertbot')} />
</div>
<div className="form-group">
<label className="checkbox-label">
diff --git a/frontend/src/pages/Servers.jsx b/frontend/src/pages/Servers.jsx
index 13308237..ea743b98 100644
--- a/frontend/src/pages/Servers.jsx
+++ b/frontend/src/pages/Servers.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useCallback, useMemo } from 'react';
+import { useState, useEffect, useCallback, useMemo, useId } from 'react';
import { useNavigate } from 'react-router-dom';
import { ChevronRight, Folder, Plus, RefreshCw, Server as ServerLucideIcon, X } from 'lucide-react';
import api from '../services/api';
@@ -554,6 +554,7 @@ const Servers = () => {
};
const PairAgentForm = ({ groups, onClose, onClaimed }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const [pairCode, setPairCode] = useState('');
const [passphrase, setPassphrase] = useState('');
@@ -653,8 +654,9 @@ const PairAgentForm = ({ groups, onClose, onClaimed }) => {
</div>
<div className="form-group">
- <label>{t('app.servers.pairCode', 'Pair code')}</label>
+ <label htmlFor={`${fieldId}-code`}>{t('app.servers.pairCode', 'Pair code')}</label>
<Input
+ id={`${fieldId}-code`}
type="text"
value={formatDisplay(formattedCode)}
onChange={(e) => {
@@ -692,8 +694,9 @@ const PairAgentForm = ({ groups, onClose, onClaimed }) => {
)}
<div className="form-group">
- <label>{t('app.servers.passphrase', 'Passphrase *')}</label>
+ <label htmlFor={`${fieldId}-passphrase`}>{t('app.servers.passphrase', 'Passphrase *')}</label>
<Input
+ id={`${fieldId}-passphrase`}
type="text"
value={passphrase}
onChange={(e) => setPassphrase(e.target.value)}
@@ -707,8 +710,9 @@ const PairAgentForm = ({ groups, onClose, onClaimed }) => {
<div className="form-row">
<div className="form-group">
- <label>{t('app.servers.serverName', 'Server name')}</label>
+ <label htmlFor={`${fieldId}-name`}>{t('app.servers.serverName', 'Server name')}</label>
<Input
+ id={`${fieldId}-name`}
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
diff --git a/frontend/src/pages/StatusPages.jsx b/frontend/src/pages/StatusPages.jsx
index 19d620c8..7f0bca85 100644
--- a/frontend/src/pages/StatusPages.jsx
+++ b/frontend/src/pages/StatusPages.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useMemo, useState } from 'react';
+import { useEffect, useId, useMemo, useState } from 'react';
import api from '../services/api';
import { useToast } from '../contexts/useToast.js';
import { useAuth } from '../contexts/useAuth.js';
@@ -104,6 +104,7 @@ function getOverallStatus(components) {
const StatusPages = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const { user } = useAuth();
const [pages, setPages] = useState([]);
@@ -625,12 +626,12 @@ const StatusPages = () => {
)}
>
<div className="form-group">
- <label>{t('common.labels.name', 'Name')}</label>
- <Input value={pageForm.name} onChange={(e) => handlePageNameChange(e.target.value)} autoFocus />
+ <label htmlFor={`${fieldId}-page-name`}>{t('common.labels.name', 'Name')}</label>
+ <Input id={`${fieldId}-page-name`} value={pageForm.name} onChange={(e) => handlePageNameChange(e.target.value)} autoFocus />
</div>
<div className="form-group">
- <label>{t('app.statusPages.slug', 'Slug')}</label>
- <Input
+ <label htmlFor={`${fieldId}-page-slug`}>{t('app.statusPages.slug', 'Slug')}</label>
+ <Input id={`${fieldId}-page-slug`}
value={pageForm.slug}
onChange={(e) => setPageForm({ ...pageForm, slug: normalizeSlug(e.target.value) })}
placeholder="my-services"
@@ -638,8 +639,8 @@ const StatusPages = () => {
<span className="form-help">/status/{pageForm.slug || 'my-services'}</span>
</div>
<div className="form-group">
- <label>{t('common.labels.description', 'Description')}</label>
- <Textarea
+ <label htmlFor={`${fieldId}-page-description`}>{t('common.labels.description', 'Description')}</label>
+ <Textarea id={`${fieldId}-page-description`}
value={pageForm.description}
onChange={(e) => setPageForm({ ...pageForm, description: e.target.value })}
rows={3}
@@ -698,12 +699,12 @@ const StatusPages = () => {
>
<div className="status-modal-grid">
<div className="form-group">
- <label>{t('common.labels.name', 'Name')}</label>
- <Input value={compForm.name} onChange={(e) => setCompForm({ ...compForm, name: e.target.value })} autoFocus />
+ <label htmlFor={`${fieldId}-comp-name`}>{t('common.labels.name', 'Name')}</label>
+ <Input id={`${fieldId}-comp-name`} value={compForm.name} onChange={(e) => setCompForm({ ...compForm, name: e.target.value })} autoFocus />
</div>
<div className="form-group">
- <label>{t('app.statusPages.group', 'Group')}</label>
- <Input value={compForm.group} onChange={(e) => setCompForm({ ...compForm, group: e.target.value })} />
+ <label htmlFor={`${fieldId}-comp-group`}>{t('app.statusPages.group', 'Group')}</label>
+ <Input id={`${fieldId}-comp-group`} value={compForm.group} onChange={(e) => setCompForm({ ...compForm, group: e.target.value })} />
</div>
<div className="form-group">
<label htmlFor="status-comp-check-type">{t('app.statusPages.checkType', 'Check type')}</label>
@@ -721,16 +722,16 @@ const StatusPages = () => {
</Select>
</div>
<div className="form-group">
- <label>{t('common.labels.target', 'Target')}</label>
- <Input
+ <label htmlFor={`${fieldId}-comp-target`}>{t('common.labels.target', 'Target')}</label>
+ <Input id={`${fieldId}-comp-target`}
value={compForm.check_target}
onChange={(e) => setCompForm({ ...compForm, check_target: e.target.value })}
placeholder={CHECK_TARGET_PLACEHOLDERS[compForm.check_type]}
/>
</div>
<div className="form-group">
- <label>{t('app.statusPages.interval', 'Interval')}</label>
- <Input
+ <label htmlFor={`${fieldId}-comp-interval`}>{t('app.statusPages.interval', 'Interval')}</label>
+ <Input id={`${fieldId}-comp-interval`}
type="number"
min="30"
value={compForm.check_interval}
@@ -738,8 +739,8 @@ const StatusPages = () => {
/>
</div>
<div className="form-group">
- <label>{t('app.statusPages.timeout', 'Timeout')}</label>
- <Input
+ <label htmlFor={`${fieldId}-comp-timeout`}>{t('app.statusPages.timeout', 'Timeout')}</label>
+ <Input id={`${fieldId}-comp-timeout`}
type="number"
min="1"
value={compForm.check_timeout}
@@ -765,8 +766,8 @@ const StatusPages = () => {
)}
>
<div className="form-group">
- <label>{t('common.labels.title', 'Title')}</label>
- <Input value={incidentForm.title} onChange={(e) => setIncidentForm({ ...incidentForm, title: e.target.value })} autoFocus />
+ <label htmlFor={`${fieldId}-incident-title`}>{t('common.labels.title', 'Title')}</label>
+ <Input id={`${fieldId}-incident-title`} value={incidentForm.title} onChange={(e) => setIncidentForm({ ...incidentForm, title: e.target.value })} autoFocus />
</div>
<div className="status-modal-grid">
<div className="form-group">
@@ -799,8 +800,8 @@ const StatusPages = () => {
</div>
</div>
<div className="form-group">
- <label>{t('common.labels.description', 'Description')}</label>
- <Textarea
+ <label htmlFor={`${fieldId}-incident-body`}>{t('common.labels.description', 'Description')}</label>
+ <Textarea id={`${fieldId}-incident-body`}
value={incidentForm.body}
onChange={(e) => setIncidentForm({ ...incidentForm, body: e.target.value })}
rows={4}
diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsx
index e347ee61..457a117c 100644
--- a/frontend/src/pages/Templates.jsx
+++ b/frontend/src/pages/Templates.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useState, useEffect, useMemo, useRef } from 'react';
+import { useCallback, useState, useEffect, useMemo, useRef, useId } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import {
Search, BookOpen, Container, Globe, BarChart3,
@@ -690,6 +690,7 @@ const CapacityNote = ({ capacity, loading }) => {
};
const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const navigate = useNavigate();
const isRepo = (template.kind || 'compose') === 'repo';
@@ -936,7 +937,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
<span className="sk-formdrawer__label">{t('app.templates.configuration', 'Settings')}</span>
{visibleVars.map(variable => (
<div key={variable.name} className="form-group">
- <label>
+ <label htmlFor={`${fieldId}-var-${variable.name}`}>
{variable.name}
{variable.required && ' *'}
</label>
@@ -946,7 +947,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
onValueChange={(v) => setVariables({...variables, [variable.name]: v})}
required={variable.required}
>
- <SelectTrigger aria-label={variable.name}>
+ <SelectTrigger id={`${fieldId}-var-${variable.name}`} aria-label={variable.name}>
<SelectValue placeholder={t('app.templates.select', 'Select…')} />
</SelectTrigger>
<SelectContent>
@@ -959,6 +960,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
// Host ports are only checked against this panel's
// host; on a remote server just the range applies.
<PortField
+ id={`${fieldId}-var-${variable.name}`}
value={variables[variable.name] || ''}
onChange={(port) => setVariables({...variables, [variable.name]: port === '' ? '' : String(port)})}
host={isLocalTarget}
@@ -967,6 +969,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
/>
) : variable.type === 'password' ? (
<Input
+ id={`${fieldId}-var-${variable.name}`}
type="password"
value={variables[variable.name] || ''}
onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
@@ -975,6 +978,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
/>
) : (
<Input
+ id={`${fieldId}-var-${variable.name}`}
type="text"
value={variables[variable.name] || ''}
onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
diff --git a/frontend/src/pages/Workspaces.jsx b/frontend/src/pages/Workspaces.jsx
index 7da253aa..bb17d59a 100644
--- a/frontend/src/pages/Workspaces.jsx
+++ b/frontend/src/pages/Workspaces.jsx
@@ -1,4 +1,4 @@
-import { useState, useCallback } from 'react';
+import { useState, useCallback, useId } from 'react';
import { useNavigate } from 'react-router-dom';
import api from '../services/api';
import { useToast } from '../contexts/useToast.js';
@@ -86,6 +86,7 @@ const formatSince = (iso) => {
const Workspaces = () => {
const { t } = useTranslation();
+ const fieldId = useId();
const toast = useToast();
const navigate = useNavigate();
const { activeWorkspaceId } = useWorkspace();
@@ -283,26 +284,27 @@ const Workspaces = () => {
)}
>
<div className="form-group">
- <label>{t('common.labels.name', 'Name')}</label>
- <Input value={form.name} onChange={e => setForm({...form, name: e.target.value})} placeholder={t('app.workspaces.myTeam', 'My team')} />
+ <label htmlFor={`${fieldId}-name`}>{t('common.labels.name', 'Name')}</label>
+ <Input id={`${fieldId}-name`} value={form.name} onChange={e => setForm({...form, name: e.target.value})} placeholder={t('app.workspaces.myTeam', 'My team')} />
</div>
<div className="form-group">
- <label>{t('common.labels.description', 'Description')}</label>
- <Textarea value={form.description} onChange={e => setForm({...form, description: e.target.value})} rows={2} />
+ <label htmlFor={`${fieldId}-description`}>{t('common.labels.description', 'Description')}</label>
+ <Textarea id={`${fieldId}-description`} value={form.description} onChange={e => setForm({...form, description: e.target.value})} rows={2} />
</div>
<div className="form-row">
<div className="form-group">
- <label>{t('app.workspaces.maxServers0Unlimited', 'Max servers (0 = unlimited)')}</label>
- <Input type="number" value={form.max_servers} onChange={e => setForm({...form, max_servers: parseInt(e.target.value) || 0})} />
+ <label htmlFor={`${fieldId}-max-servers`}>{t('app.workspaces.maxServers0Unlimited', 'Max servers (0 = unlimited)')}</label>
+ <Input id={`${fieldId}-max-servers`} type="number" value={form.max_servers} onChange={e => setForm({...form, max_servers: parseInt(e.target.value) || 0})} />
</div>
<div className="form-group">
- <label>{t('app.workspaces.maxUsers0Unlimited', 'Max users (0 = unlimited)')}</label>
- <Input type="number" value={form.max_users} onChange={e => setForm({...form, max_users: parseInt(e.target.value) || 0})} />
+ <label htmlFor={`${fieldId}-max-users`}>{t('app.workspaces.maxUsers0Unlimited', 'Max users (0 = unlimited)')}</label>
+ <Input id={`${fieldId}-max-users`} type="number" value={form.max_users} onChange={e => setForm({...form, max_users: parseInt(e.target.value) || 0})} />
</div>
</div>
<div className="form-group">
- <label>{t('app.workspaces.brandColor', 'Brand color')}</label>
+ <label htmlFor={`${fieldId}-color`}>{t('app.workspaces.brandColor', 'Brand color')}</label>
<input
+ id={`${fieldId}-color`}
type="color"
className="workspace-color-input"
value={form.primary_color}
diff --git a/frontend/src/pages/new-service/ReviewStep.jsx b/frontend/src/pages/new-service/ReviewStep.jsx
index 6c1422d1..5287cf1a 100644
--- a/frontend/src/pages/new-service/ReviewStep.jsx
+++ b/frontend/src/pages/new-service/ReviewStep.jsx
@@ -1,4 +1,4 @@
-import { useMemo } from 'react';
+import { useMemo, useId } from 'react';
import {
ChevronDown, Database, FolderKanban, Globe, Layers3, Lock, Network,
Settings2, Zap, CheckCircle2,
@@ -22,6 +22,7 @@ import { Button as SharedButton } from '@/components/ui/button';
// Step 3 — Review & deploy. Only renders cards that have real data; the core
// fields live in one grid, Advanced keeps the genuinely rare bits.
const ReviewStep = ({ form }) => {
+ const fieldId = useId();
const { t } = useTranslation();
const { activeWorkspaceId, isAllWorkspaces } = useWorkspace();
const {
@@ -278,10 +279,10 @@ const ReviewStep = ({ form }) => {
{sourceMode !== 'local' && (
<div className="new-service-page__toggle">
<div>
- <Label>{t('app.reviewStep.autoDeploy', 'Auto-deploy')}</Label>
+ <Label htmlFor={`${fieldId}-auto-deploy`}>{t('app.reviewStep.autoDeploy', 'Auto-deploy')}</Label>
<span>{sourceMode === 'upload' ? t('app.reviewStep.deployAfterUpload', 'Deploy immediately after upload.') : t('app.reviewStep.webhookDeployForBranch', 'Deploy on push to this branch through the webhook.')}</span>
</div>
- <Switch checked={autoDeploy} onCheckedChange={setAutoDeploy} />
+ <Switch id={`${fieldId}-auto-deploy`} checked={autoDeploy} onCheckedChange={setAutoDeploy} />
</div>
)}
</div>