fix: update ConfigInfo schema to match Supervisor API response
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m11s

Updated the ConfigInfoSchema to accurately reflect the data structure
returned by Supervisor's getAllConfigInfo() XML-RPC method, fixing Zod
validation errors on the /config page.

Schema changes:
- Removed fields not in API: environment, priority, process_name, numprocs, numprocs_start, username
- Added missing fields: autorestart, killasgroup, process_prio, group_prio, stdout_syslog, stderr_syslog, serverurl
- Fixed type mismatches:
  - stopsignal: string → number (API returns signal numbers like 15)
  - uid: number|null → string (API returns username strings)
  - directory: string|null → string

Updated ConfigTable.tsx to use process_prio instead of priority and
removed the non-existent numprocs column.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-23 22:39:33 +01:00
parent 20877abbc7
commit 145d37193c
2 changed files with 18 additions and 25 deletions

View File

@@ -91,7 +91,6 @@ export function ConfigTable({ configs }: ConfigTableProps) {
Autostart <SortIcon field="autostart" />
</th>
<th className="text-center p-3">Priority</th>
<th className="text-center p-3">Processes</th>
</tr>
</thead>
<tbody>
@@ -117,8 +116,7 @@ export function ConfigTable({ configs }: ConfigTableProps) {
)}
/>
</td>
<td className="p-3 text-center text-sm">{config.priority}</td>
<td className="p-3 text-center text-sm">{config.numprocs}</td>
<td className="p-3 text-center text-sm">{config.process_prio}</td>
</tr>
))}
</tbody>
@@ -159,15 +157,9 @@ export function ConfigTable({ configs }: ConfigTableProps) {
<div className="mt-1 text-xs break-all">{config.directory}</div>
</div>
<div className="flex gap-4 pt-2">
<div>
<span className="text-muted-foreground">Priority:</span>
<span className="ml-2 font-mono">{config.priority}</span>
</div>
<div>
<span className="text-muted-foreground">Processes:</span>
<span className="ml-2 font-mono">{config.numprocs}</span>
</div>
<div className="pt-2">
<span className="text-muted-foreground">Priority:</span>
<span className="ml-2 font-mono">{config.process_prio}</span>
</div>
</div>
</CardContent>

View File

@@ -62,32 +62,33 @@ export const ConfigInfoSchema = z.object({
name: z.string(),
group: z.string(),
autostart: z.boolean(),
directory: z.union([z.string(), z.null()]),
autorestart: z.string(), // "auto", "none", or "unexpected"
directory: z.string(),
command: z.string(),
environment: z.union([z.string(), z.null()]),
exitcodes: z.array(z.number()),
group_prio: z.number(),
inuse: z.boolean(),
killasgroup: z.boolean(),
process_prio: z.number(),
redirect_stderr: z.boolean(),
serverurl: z.string(),
startretries: z.number(),
startsecs: z.number(),
stderr_capture_maxbytes: z.number(),
stderr_events_enabled: z.boolean(),
stderr_logfile: z.string(),
stderr_logfile_backups: z.number(),
stderr_logfile_maxbytes: z.number(),
stderr_syslog: z.boolean(),
stopsignal: z.number(), // Signal number (e.g., 15 for SIGTERM)
stopwaitsecs: z.number(),
stdout_capture_maxbytes: z.number(),
stdout_events_enabled: z.boolean(),
stdout_logfile: z.string(),
stdout_logfile_backups: z.number(),
stdout_logfile_maxbytes: z.number(),
stopsignal: z.string(),
stopwaitsecs: z.number(),
priority: z.number(),
startretries: z.number(),
startsecs: z.number(),
process_name: z.string(),
numprocs: z.number(),
numprocs_start: z.number(),
uid: z.union([z.number(), z.null()]),
username: z.union([z.string(), z.null()]),
inuse: z.boolean(),
stdout_syslog: z.boolean(),
uid: z.string(), // Username string
});
export const ReloadConfigResultSchema = z.object({