feat: add folder picker and target_url input to Web UI

- Add /select-folder and /select-file APIs using PowerShell dialogs
- Add --target-url parameter to CLI for explicit target URL override
- Redesign Web UI with folder browse buttons for all path inputs
- Add target_url optional input field for specifying target page URL
- Auto-fill scene-id from selected folder name

🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
木炎
2026-04-17 00:23:09 +08:00
parent ce072c2ebe
commit f268668713
6 changed files with 252 additions and 118 deletions

View File

@@ -2,7 +2,7 @@ const { spawn } = require("child_process");
const path = require("path");
function runGenerator(params, sseWriter, projectRoot) {
const { sourceDir, sceneId, sceneName, sceneKind, outputRoot, lessons } = params;
const { sourceDir, sceneId, sceneName, sceneKind, targetUrl, outputRoot, lessons } = params;
const normalize = (p) => p.replace(/\\/g, "/");
@@ -24,6 +24,11 @@ function runGenerator(params, sseWriter, projectRoot) {
args.push("--scene-kind", sceneKind);
}
// 如果提供了 targetUrl添加参数
if (targetUrl) {
args.push("--target-url", targetUrl);
}
args.push(
"--output-root",
normalize(outputRoot),