This commit is contained in:
2026-07-27 10:38:22 +02:00
parent 7b33b76b3d
commit ed4cb2a39c
11 changed files with 316 additions and 179 deletions
+1 -4
View File
@@ -30,7 +30,6 @@ The goal of this task is to add an "Add Server" button and creation functionalit
- Cancel and Create buttons with loading state handling.
- **Store Integration:** `useServerStore` must provide a `createServer` action that performs `POST /servers` with the appropriate payload (`{ name, password, is_default }`).
# Technical Design
### Current Implementation
@@ -80,7 +79,6 @@ graph LR
ServerStore -->|Updates servers list| AppLayout
```
# Testing
### Validation Approach
@@ -97,10 +95,9 @@ graph LR
- **Validation Error:** Empty server name disables the create button or shows an alert.
- **API Error Handling:** Catch and log API failures gracefully.
# Delivery Steps
### Step 1: Extend server Pinia store with createServer action
### * Step 1: Extend server Pinia store with createServer action
Extend the server Pinia store with createServer action.
- Update `frontend/src/stores/server.ts` to include `createServer(payload: { name: string; password?: string | null; is_default?: boolean })`.
- Handle error states, API POST requests to `/servers`, and state updates to push the newly created server to `this.servers`.