fix: Scaffold dropdown missing modules on Render

This commit is contained in:
jade
2026-07-21 22:11:21 +09:00
parent 75b93d47c2
commit 140be4c7e9
2 changed files with 10 additions and 4 deletions

View File

@@ -95,11 +95,13 @@ public class ScaffoldingController {
File dir = new File(sourceDir);
File[] files = dir.listFiles(f -> f.isDirectory() && f.getName().startsWith("dap-tool-") && !f.getName().equals("dap-tool-core"));
if (files == null) return List.of("dap-tool-other");
if (files == null || files.length == 0) {
return List.of("dap-tool-other", "dap-tool-email", "dap-tool-hr", "dap-tool-payment", "dap-tool-sms");
}
return Arrays.stream(files).map(File::getName).sorted().collect(Collectors.toList());
} catch (Exception e) {
return List.of("dap-tool-other");
return List.of("dap-tool-other", "dap-tool-email", "dap-tool-hr", "dap-tool-payment", "dap-tool-sms");
}
}
}

View File

@@ -486,7 +486,11 @@
<div class="col-md-6">
<label class="form-label">Target Module</label>
<select class="form-select" name="moduleName" id="targetModuleSelect" required>
<option value="axhub-tool-other">axhub-tool-other</option>
<option value="dap-tool-other">dap-tool-other</option>
<option value="dap-tool-email">dap-tool-email</option>
<option value="dap-tool-hr">dap-tool-hr</option>
<option value="dap-tool-payment">dap-tool-payment</option>
<option value="dap-tool-sms">dap-tool-sms</option>
</select>
<div class="input-hint">Destination Pod directory.</div>
</div>
@@ -654,7 +658,7 @@
.then(modules => {
const select = document.getElementById('targetModuleSelect');
if (modules && modules.length > 0) {
select.innerHTML = modules.map(m => `<option value="${m}" ${m === 'axhub-tool-other' ? 'selected' : ''}>${m}</option>`).join('');
select.innerHTML = modules.map(m => `<option value="${m}" ${m === 'dap-tool-other' ? 'selected' : ''}>${m}</option>`).join('');
}
})
.catch(err => console.error('Failed to load modules:', err));