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
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:
@@ -91,7 +91,6 @@ export function ConfigTable({ configs }: ConfigTableProps) {
|
|||||||
Autostart <SortIcon field="autostart" />
|
Autostart <SortIcon field="autostart" />
|
||||||
</th>
|
</th>
|
||||||
<th className="text-center p-3">Priority</th>
|
<th className="text-center p-3">Priority</th>
|
||||||
<th className="text-center p-3">Processes</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -117,8 +116,7 @@ export function ConfigTable({ configs }: ConfigTableProps) {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3 text-center text-sm">{config.priority}</td>
|
<td className="p-3 text-center text-sm">{config.process_prio}</td>
|
||||||
<td className="p-3 text-center text-sm">{config.numprocs}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -159,15 +157,9 @@ export function ConfigTable({ configs }: ConfigTableProps) {
|
|||||||
<div className="mt-1 text-xs break-all">{config.directory}</div>
|
<div className="mt-1 text-xs break-all">{config.directory}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-4 pt-2">
|
<div className="pt-2">
|
||||||
<div>
|
<span className="text-muted-foreground">Priority:</span>
|
||||||
<span className="text-muted-foreground">Priority:</span>
|
<span className="ml-2 font-mono">{config.process_prio}</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@@ -62,32 +62,33 @@ export const ConfigInfoSchema = z.object({
|
|||||||
name: z.string(),
|
name: z.string(),
|
||||||
group: z.string(),
|
group: z.string(),
|
||||||
autostart: z.boolean(),
|
autostart: z.boolean(),
|
||||||
directory: z.union([z.string(), z.null()]),
|
autorestart: z.string(), // "auto", "none", or "unexpected"
|
||||||
|
directory: z.string(),
|
||||||
command: z.string(),
|
command: z.string(),
|
||||||
environment: z.union([z.string(), z.null()]),
|
|
||||||
exitcodes: z.array(z.number()),
|
exitcodes: z.array(z.number()),
|
||||||
|
group_prio: z.number(),
|
||||||
|
inuse: z.boolean(),
|
||||||
|
killasgroup: z.boolean(),
|
||||||
|
process_prio: z.number(),
|
||||||
redirect_stderr: z.boolean(),
|
redirect_stderr: z.boolean(),
|
||||||
|
serverurl: z.string(),
|
||||||
|
startretries: z.number(),
|
||||||
|
startsecs: z.number(),
|
||||||
stderr_capture_maxbytes: z.number(),
|
stderr_capture_maxbytes: z.number(),
|
||||||
stderr_events_enabled: z.boolean(),
|
stderr_events_enabled: z.boolean(),
|
||||||
stderr_logfile: z.string(),
|
stderr_logfile: z.string(),
|
||||||
stderr_logfile_backups: z.number(),
|
stderr_logfile_backups: z.number(),
|
||||||
stderr_logfile_maxbytes: 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_capture_maxbytes: z.number(),
|
||||||
stdout_events_enabled: z.boolean(),
|
stdout_events_enabled: z.boolean(),
|
||||||
stdout_logfile: z.string(),
|
stdout_logfile: z.string(),
|
||||||
stdout_logfile_backups: z.number(),
|
stdout_logfile_backups: z.number(),
|
||||||
stdout_logfile_maxbytes: z.number(),
|
stdout_logfile_maxbytes: z.number(),
|
||||||
stopsignal: z.string(),
|
stdout_syslog: z.boolean(),
|
||||||
stopwaitsecs: z.number(),
|
uid: z.string(), // Username string
|
||||||
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(),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ReloadConfigResultSchema = z.object({
|
export const ReloadConfigResultSchema = z.object({
|
||||||
|
|||||||
Reference in New Issue
Block a user