Ship dashboard build config
Some checks failed
deploy / deploy (push) Has been cancelled

Proof: Include the Vite config required for the dashboard-builder image stage to build operator-dashboard static assets during deployment.

Assumptions: The current Vite config in the worktree is the intended build config for the deployed operator-dashboard frontend.

Still fake: External alert receiver remains unconfigured; this commit only resolves the image-build blocker for the dashboard deploy.
This commit is contained in:
philipp 2026-04-08 19:40:40 +02:00
parent 3226a68613
commit 2811a84deb

View file

@ -0,0 +1,41 @@
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
function buildProxyConfig({ target, authHeader, websocket = false }) {
return {
target,
changeOrigin: true,
ws: websocket,
configure(proxy) {
if (!authHeader) return;
proxy.on('proxyReq', (proxyReq) => {
proxyReq.setHeader('Authorization', authHeader);
});
proxy.on('proxyReqWs', (proxyReq) => {
proxyReq.setHeader('Authorization', authHeader);
});
},
};
}
const target = process.env.OPERATOR_DASHBOARD_DEV_UPSTREAM_URL || 'http://127.0.0.1:18090';
const authHeader = process.env.OPERATOR_DASHBOARD_DEV_BASIC_AUTH_HEADER || '';
export default defineConfig({
plugins: [react()],
root: 'src/operator-dashboard/static',
build: {
outDir: '../dist',
emptyOutDir: true,
},
server: {
host: process.env.OPERATOR_DASHBOARD_DEV_HOST || '127.0.0.1',
port: Number(process.env.OPERATOR_DASHBOARD_DEV_PORT || 5173),
strictPort: true,
proxy: {
'/api': buildProxyConfig({ target, authHeader }),
'/healthz': buildProxyConfig({ target, authHeader }),
'/ws': buildProxyConfig({ target, authHeader, websocket: true }),
},
},
});