32 lines
1.1 KiB
Markdown
32 lines
1.1 KiB
Markdown
# Data Model: Fix UI Styling, WebSocket Port Mismatch, and URL Validation
|
|
|
|
## Entities
|
|
|
|
### ServiceConnection
|
|
Represents the configuration for an external service.
|
|
|
|
| Field | Type | Description | Validation |
|
|
|-------|------|-------------|------------|
|
|
| `base_url` | `AnyHttpUrl` | The base URL of the service. | Normalized to include `/api/v1` if missing. |
|
|
| `name` | `string` | Friendly name for the connection. | Required. |
|
|
| `status` | `string` | Connection status (connected, failed, etc.). | Read-only. |
|
|
|
|
### TaskLogMessage
|
|
The structure of messages sent over the WebSocket for real-time logs.
|
|
|
|
| Field | Type | Description |
|
|
|-------|------|-------------|
|
|
| `task_id` | `string` | Unique identifier for the task. |
|
|
| `message` | `string` | The log message text. |
|
|
| `timestamp` | `datetime` | When the log was generated. |
|
|
| `level` | `string` | Log level (INFO, ERROR, etc.). |
|
|
|
|
## State Transitions
|
|
|
|
### Connection Validation
|
|
1. User inputs `base_url`.
|
|
2. System validates URL format.
|
|
3. System checks for `/api/v1` suffix.
|
|
4. If missing, system appends `/api/v1`.
|
|
5. System attempts connection and updates `status`.
|