jcloud/dashboard/index.html
jingrow 2b360106ed fix(dashboard): 配置开发环境支持外部访问并修复 CSRF token 问题
- 添加 Naive UI 依赖到 package.json
- 配置 Vite 开发服务器支持外部访问 (0.0.0.0:8080)
- 配置 API 代理到后端 localhost:80,并正确处理 cookie 和 CSRF token
- 修复 index.html 中 Jinja2 模板语法在开发模式下的问题
- 修改 get_context_for_dev 方法支持 GET 请求并返回 CSRF token
- 修改前端使用 GET 请求获取初始数据,避免 CSRF token 验证问题
2025-12-28 00:39:50 +08:00

44 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html class="h-full overflow-hidden" lang="zh">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>今果 Jingrow</title>
<link rel="icon" href="/favicon.png" type="image/x-icon" />
</head>
<body class="h-full">
<noscript>
<strong>
今果 Jingrow Dashboard doesn't work properly without JavaScript enabled.
Please enable it to continue.
</strong>
</noscript>
<!-- Main Vue App -->
<div id="app" class="h-full"></div>
<!-- For Teleports -->
<div id="modals"></div>
<div id="popovers"></div>
<script>
// 开发模式下,这些变量会通过 API 获取(在 src2/main.js 的 getInitialData 中)
// 生产模式下,这些变量由后端模板引擎注入
// 开发模式:设置默认空值,避免未定义错误
window.jcloud_frontend_sentry_dsn = window.jcloud_frontend_sentry_dsn || '';
window.jcloud_dashboard_sentry_dsn = window.jcloud_dashboard_sentry_dsn || '';
window.jcloud_frontend_posthog_host = window.jcloud_frontend_posthog_host || '';
window.jcloud_frontend_posthog_project_id = window.jcloud_frontend_posthog_project_id || '';
// 生产模式下的模板注入(开发模式下会被忽略)
// {% for key in boot %}
// window["{{ key }}"] = {{ boot[key] | tojson }};
// {% endfor %}
</script>
<!-- <script type="module" src="/src/main.js"></script> -->
<script type="module" src="/src2/main.js"></script>
</body>
</html>