feat: add log viewer components and fix build issues
Some checks failed
Build and Push Docker Image to Gitea / build-and-push (push) Failing after 53s

- Add LogViewer component with syntax highlighting and auto-scroll
- Add LogControls for play/pause, auto-scroll, refresh, download, clear
- Add LogSearch component with search highlighting
- Add Input UI component
- Fix TypeScript type issues in ProcessCard and types.ts
- Fix XML-RPC client type issues
- Add force-dynamic to layout to prevent SSR issues with client components
- Add mounted state to Navbar for theme toggle hydration
- Add custom 404 page

Components added:
- components/logs/LogViewer.tsx - Main log viewer with real-time display
- components/logs/LogControls.tsx - Control panel for log viewing
- components/logs/LogSearch.tsx - Search input for filtering logs
- components/ui/input.tsx - Reusable input component

Fixes:
- ProcessStateCode type casting in ProcessCard
- XML-RPC client options type (use any to avoid library type issues)
- canStartProcess/canStopProcess type assertions
- Dynamic rendering to prevent SSR hydration issues

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-23 18:43:55 +01:00
parent e0cfd371c0
commit 5bda617339
11 changed files with 308 additions and 26 deletions

View File

@@ -27,7 +27,7 @@ export class SupervisorClient {
constructor(config: SupervisorClientConfig) {
this.config = config;
const clientOptions: xmlrpc.ClientOptions = {
const clientOptions: any = {
host: config.host,
port: config.port,
path: '/RPC2',
@@ -49,9 +49,9 @@ export class SupervisorClient {
*/
private async call<T>(method: string, params: any[] = []): Promise<T> {
return new Promise((resolve, reject) => {
this.client.methodCall(method, params, (error, value) => {
this.client.methodCall(method, params, (error: any, value: any) => {
if (error) {
reject(new Error(`XML-RPC Error: ${error.message}`));
reject(new Error(`XML-RPC Error: ${error?.message || 'Unknown error'}`));
} else {
resolve(value);
}

View File

@@ -168,12 +168,12 @@ export function getProcessStateClass(state: ProcessStateCode): string {
// Helper function to determine if a process can be started
export function canStartProcess(state: ProcessStateCode): boolean {
return [ProcessState.STOPPED, ProcessState.EXITED, ProcessState.FATAL].includes(state);
return [ProcessState.STOPPED as ProcessStateCode, ProcessState.EXITED as ProcessStateCode, ProcessState.FATAL as ProcessStateCode].includes(state);
}
// Helper function to determine if a process can be stopped
export function canStopProcess(state: ProcessStateCode): boolean {
return [ProcessState.RUNNING, ProcessState.STARTING].includes(state);
return [ProcessState.RUNNING as ProcessStateCode, ProcessState.STARTING as ProcessStateCode].includes(state);
}
// Helper function to format uptime