fix: resolve workspace path resolution and enhance GrowToolHint generation in ToolScaffolder
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 1m8s

This commit is contained in:
jade
2026-08-19 13:50:49 +09:00
parent d5a07cd846
commit 870412f0c7
3 changed files with 192 additions and 51 deletions

View File

@@ -825,6 +825,20 @@
<!-- Tool Creation Form -->
<div class="tab-pane fade" id="tool" role="tabpanel">
<form id="toolForm">
<div class="row mb-4">
<div class="col-md-12">
<label class="form-label">Workspace Path</label>
<div class="input-group">
<input type="text" class="form-control" name="workspacePath" id="workspacePathInput" placeholder="직접 폴더 경로를 입력(붙여넣기) 하거나 선택하세요" value="c:\eGovFrameDev-4.3.1-64bit\workspace-egov\dap-was-dapmt">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" style="border-color: #3f3f46; color: #a1a1aa;">폴더 선택</button>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-dark" style="background-color: #18181b; border-color: #3f3f46;">
<li><a class="dropdown-item" href="#" onclick="const input = document.getElementById('workspacePathInput'); input.value='c:\\eGovFrameDev-4.3.1-64bit\\workspace-egov\\dap-was-dapmt'; input.dispatchEvent(new Event('change')); return false;" style="color: #f4f4f5;">dap-was-dapmt (기본)</a></li>
<li><a class="dropdown-item" href="#" onclick="const input = document.getElementById('workspacePathInput'); input.value='c:\\eGovFrameDev-4.3.1-64bit\\workspace-egov\\axhub-backend-main'; input.dispatchEvent(new Event('change')); return false;" style="color: #f4f4f5;">axhub-backend-main</a></li>
</ul>
</div>
<div class="input-hint">직접 경로를 붙여넣거나 우측 <b>[폴더 선택]</b> 버튼을 눌러 선택하세요.</div>
</div>
</div>
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Target Module</label>
@@ -1521,18 +1535,27 @@
}
document.addEventListener('DOMContentLoaded', function() {
fetch('/api/v1/scaffold/modules')
.then(res => res.json())
.then(modules => {
const select = document.getElementById('targetModuleSelect');
if (modules && modules.length > 0) {
select.innerHTML = modules.map(m => `<option value="${m}" ${m === 'dap-was-cus' ? 'selected' : ''}>${m}</option>`).join('');
}
if (typeof loadCategoriesForSelection === 'function') {
loadCategoriesForSelection();
}
})
.catch(err => console.error('Failed to load modules:', err));
const loadModules = () => {
const workspacePath = document.querySelector('input[name="workspacePath"]')?.value || '';
fetch(`/api/v1/scaffold/modules?workspacePath=${encodeURIComponent(workspacePath)}`)
.then(res => res.json())
.then(modules => {
const select = document.getElementById('targetModuleSelect');
if (modules && modules.length > 0) {
select.innerHTML = modules.map(m => `<option value="${m}" ${m === 'dap-was-cus' ? 'selected' : ''}>${m}</option>`).join('');
}
if (typeof loadCategoriesForSelection === 'function') {
loadCategoriesForSelection();
}
})
.catch(err => console.error('Failed to load modules:', err));
};
loadModules();
const wsInput = document.querySelector('input[name="workspacePath"]');
if (wsInput) {
wsInput.addEventListener('change', loadModules);
wsInput.addEventListener('blur', loadModules); // Typing custom path and clicking away
}
});
handleFormSubmit('podForm', '/api/v1/scaffold/pod');
@@ -1603,12 +1626,13 @@
async function loadUseCasesForSelection() {
const moduleName = document.getElementById('targetModuleSelect').value;
const workspacePath = document.querySelector('input[name="workspacePath"]')?.value || '';
const categoryKey = document.querySelector('#toolForm [name="categoryKey"]').value.trim();
const select = document.getElementById('toolGroupUseCaseSelect');
select.innerHTML = '<option value="">새 UseCase 생성</option>';
if (!/^[a-z0-9]{3}$/.test(categoryKey)) return;
try {
const response = await fetch(`/api/v1/scaffold/usecases?moduleName=${encodeURIComponent(moduleName)}&categoryKey=${encodeURIComponent(categoryKey)}`);
const response = await fetch(`/api/v1/scaffold/usecases?moduleName=${encodeURIComponent(moduleName)}&categoryKey=${encodeURIComponent(categoryKey)}&workspacePath=${encodeURIComponent(workspacePath)}`);
if (!response.ok) throw new Error('UseCase 목록 조회 실패');
const useCases = await response.json();
useCases.forEach(useCaseName => select.add(new Option(`기존 ${useCaseName}에 함수 추가`, useCaseName)));
@@ -1619,11 +1643,12 @@
async function loadCategoriesForSelection() {
const moduleName = document.getElementById('targetModuleSelect').value;
const workspacePath = document.querySelector('input[name="workspacePath"]')?.value || '';
const select = document.getElementById('domainCategorySelect');
const nameInput = document.getElementById('domainCategoryName');
select.innerHTML = '<option value="">새 도메인 생성</option>';
try {
const response = await fetch(`/api/v1/scaffold/categories?moduleName=${encodeURIComponent(moduleName)}`);
const response = await fetch(`/api/v1/scaffold/categories?moduleName=${encodeURIComponent(moduleName)}&workspacePath=${encodeURIComponent(workspacePath)}`);
if (!response.ok) throw new Error('Category 목록 조회 실패');
const categories = await response.json();
categories.forEach(cat => select.add(new Option(`기존 ${cat} 도메인`, cat)));
@@ -1687,7 +1712,7 @@
fetch('/api/v1/scaffold/tool-group', {
method: 'POST', headers: {'Content-Type': 'application/json'},
body: JSON.stringify({useCaseName, moduleName: data.moduleName, author: data.author, date: data.date, tools})
body: JSON.stringify({useCaseName, moduleName: data.moduleName, author: data.author, date: data.date, workspacePath: data.workspacePath, tools})
}).then(response => response.text()).then(result => {
const resultBox = document.getElementById('resultBox');
resultBox.style.display = 'block'; resultBox.className = result.startsWith('Error:') ? 'error' : 'success';