mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 00:01:34 +00:00
feat: add run.sh, agent name in sidebar, and vite preview proxy
- run.sh builds frontend then serves in production mode - Persist AGENT in .env.local and show it in worktree list - Add preview proxy config so production mode routes API/WS correctly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,9 @@ docker build -f Dockerfile.sandbox -t windmill-sandbox .
|
||||
cd dev-dashboard/frontend && bun install && cd ..
|
||||
|
||||
# 5. Start the dashboard
|
||||
./dev.sh # API on :5111, UI on :5112
|
||||
./dev.sh # dev mode (hot reload), UI on :5112
|
||||
# or
|
||||
./run.sh # production mode (build + serve), UI on :4173
|
||||
|
||||
# 6. Open http://localhost:5112
|
||||
```
|
||||
|
||||
@@ -182,6 +182,7 @@ async function handleApi(req: Request, url: URL): Promise<Response> {
|
||||
elapsed: st?.elapsed ?? "",
|
||||
title: st?.title ?? "",
|
||||
profile: env.PROFILE || null,
|
||||
agentName: env.AGENT || null,
|
||||
backendPort,
|
||||
frontendPort,
|
||||
backendRunning,
|
||||
|
||||
@@ -164,7 +164,7 @@ export async function addWorktree(
|
||||
const envPath = `${wtDir}/.env.local`;
|
||||
const existing = await Bun.file(envPath).text().catch(() => "");
|
||||
if (!existing.includes("PROFILE=")) {
|
||||
await Bun.write(envPath, existing.trimEnd() + `\nPROFILE=${profile}\n`);
|
||||
await Bun.write(envPath, existing.trimEnd() + `\nPROFILE=${profile}\nAGENT=${agent}\n`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
-2
@@ -4,8 +4,8 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Windmill Dev Dashboard</title>
|
||||
<script type="module" crossorigin src="/assets/index-78O2FXzb.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BAltYxoa.css">
|
||||
<script type="module" crossorigin src="/assets/index-p449rlwy.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DiqttxIP.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
<span class="font-medium truncate pr-5">{wt.branch}</span>
|
||||
<span class="flex gap-2 text-[11px] text-muted">
|
||||
<span><span class="inline-block w-2 h-2 rounded-full mr-1 align-middle {dotColor(wt.agent)}"></span>{wt.agent || "none"}</span>
|
||||
{#if wt.agentName}
|
||||
<span>{wt.agentName}</span>
|
||||
{/if}
|
||||
{#if wt.profile}
|
||||
<span>{wt.profile}</span>
|
||||
{/if}
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface WorktreeInfo {
|
||||
elapsed: string;
|
||||
title: string;
|
||||
profile: string | null;
|
||||
agentName: string | null;
|
||||
backendPort: number | null;
|
||||
frontendPort: number | null;
|
||||
backendRunning: boolean;
|
||||
|
||||
@@ -14,4 +14,14 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
preview: {
|
||||
port: 4173,
|
||||
proxy: {
|
||||
"/api": "http://localhost:5111",
|
||||
"/ws": {
|
||||
target: "ws://localhost:5111",
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Build frontend
|
||||
cd frontend
|
||||
bun run build
|
||||
cd ..
|
||||
|
||||
cleanup() {
|
||||
kill $BE_PID $FE_PID 2>/dev/null || true
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# Backend (production)
|
||||
cd backend
|
||||
bun run start 2>&1 | sed 's/^/[BE] /' &
|
||||
BE_PID=$!
|
||||
cd ..
|
||||
|
||||
# Frontend (preview built assets)
|
||||
cd frontend
|
||||
bun run preview 2>&1 | sed 's/^/[FE] /' &
|
||||
FE_PID=$!
|
||||
cd ..
|
||||
|
||||
wait
|
||||
Reference in New Issue
Block a user