|
1 | 1 | package templates |
2 | 2 |
|
3 | | -import "github.com/co-browser/agent-browser/internal/backend/models" |
| 3 | +import "github.com/co-browser/agent-browser/internal/web/templates/blocks" |
4 | 4 |
|
5 | | -templ IndexPage(servers []models.MCPServer) { |
| 5 | +templ IndexPage() { |
6 | 6 | <!DOCTYPE html> |
7 | 7 | <html lang="en" data-theme="light"> |
| 8 | + <html lang="en"> |
8 | 9 | <head> |
9 | 10 | <meta charset="UTF-8"/> |
10 | 11 | <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |
11 | | - <title>Agent Browser UI</title> |
12 | | - <link href="https://cdn.jsdelivr.net/npm/daisyui@4.10.1/dist/full.min.css" rel="stylesheet" type="text/css"/> |
13 | | - <script src="https://cdn.tailwindcss.com"></script> |
14 | | - <script src="https://unpkg.com/htmx.org@1.9.10/dist/htmx.min.js"></script> |
15 | | - <script src="https://unpkg.com/htmx.org@1.9.10/dist/ext/sse.js"></script> |
| 12 | + <title>MCP Aggregator</title> |
| 13 | + <style> |
| 14 | + html, body { |
| 15 | + height: 100%; |
| 16 | + margin: 0; |
| 17 | + } |
| 18 | + |
| 19 | + body { |
| 20 | + display: flex; |
| 21 | + flex-direction: column; |
| 22 | + min-height: 100vh; |
| 23 | + } |
| 24 | + |
| 25 | + main { |
| 26 | + flex: 1; |
| 27 | + } |
| 28 | + </style> |
16 | 29 | </head> |
17 | | - <body class="bg-base-100"> |
18 | | - <div class="container mx-auto px-4 py-8"> |
19 | | - <h1 class="text-3xl font-bold mb-6">Agent Browser Control Panel</h1> |
20 | | - <!-- SSE Connection --> |
21 | | - <div hx-ext="sse" sse-connect="/api/events"> |
22 | | - <!-- Server list is rendered separately, tbody below listens for updates --> |
23 | | - @ServerListComponent(servers) |
24 | | - </div> |
25 | | - <!-- Add Server Form --> |
26 | | - <div class="mt-8 p-6 bg-base-200 rounded-lg shadow-md"> |
27 | | - <h2 class="text-xl font-semibold mb-4">Add New MCP Server</h2> |
28 | | - <form |
29 | | - hx-post="/api/mcp/servers" |
30 | | - hx-target="#server-list-body" |
31 | | - hx-swap="innerHTML" |
32 | | - hx-indicator="#add-server-indicator" |
33 | | - hx-on:after-request="if(event.detail.successful) this.reset()" |
34 | | - class="space-y-4" |
35 | | - > |
36 | | - <div> |
37 | | - <label for="name" class="label"> |
38 | | - <span class="label-text">Server Name</span> |
39 | | - </label> |
40 | | - <input id="name" type="text" name="name" placeholder="e.g., Development Server" class="input input-bordered w-full max-w-xs" required/> |
41 | | - </div> |
42 | | - <div> |
43 | | - <label for="url" class="label"> |
44 | | - <span class="label-text">Server URL</span> |
45 | | - </label> |
46 | | - <input id="url" type="url" name="url" placeholder="e.g., http://localhost:8081" class="input input-bordered w-full max-w-xs" required/> |
47 | | - </div> |
48 | | - <div class="flex items-center space-x-2"> |
49 | | - <button type="submit" class="btn btn-primary"> |
50 | | - Add Server |
51 | | - </button> |
52 | | - <span id="add-server-indicator" class="loading loading-spinner loading-md htmx-indicator"></span> |
53 | | - </div> |
54 | | - <div id="add-server-error" class="text-red-500 mt-2"></div> <!-- Placeholder for error messages --> |
55 | | - </form> |
56 | | - </div> |
57 | | - </div> |
| 30 | + <body style="margin: 0"> |
| 31 | + @blocks.Header("Welcome to MCP Aggregator") |
| 32 | + <main> |
| 33 | + <!-- Add more content here --> |
| 34 | + </main> |
| 35 | + @blocks.Footer("Footer") |
58 | 36 | </body> |
59 | 37 | </html> |
60 | 38 | } |
0 commit comments