forked from kimhyungsik/ax_hub_mcp_tool
613 lines
27 KiB
HTML
613 lines
27 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>신한라이프 AXHUB Developer Portal</title>
|
|
<!-- Google Fonts: Inter -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
|
|
--surface-color: rgba(255, 255, 255, 0.95);
|
|
--bg-color: #f3f4f6;
|
|
--text-primary: #1f2937;
|
|
--text-secondary: #6b7280;
|
|
--border-radius: 16px;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Inter', sans-serif;
|
|
background-color: var(--bg-color);
|
|
background-image:
|
|
radial-gradient(at 0% 0%, hsla(253,16%,7%,0.05) 0, transparent 50%),
|
|
radial-gradient(at 50% 0%, hsla(225,39%,30%,0.05) 0, transparent 50%),
|
|
radial-gradient(at 100% 0%, hsla(339,49%,30%,0.05) 0, transparent 50%);
|
|
background-attachment: fixed;
|
|
color: var(--text-primary);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 2rem 0;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1200px;
|
|
width: 95%;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.page-header {
|
|
text-align: center;
|
|
margin-bottom: 2.5rem;
|
|
}
|
|
|
|
.page-header h1 {
|
|
font-weight: 700;
|
|
font-size: 2.5rem;
|
|
letter-spacing: -0.025em;
|
|
background: var(--primary-gradient);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.page-header p {
|
|
color: var(--text-secondary);
|
|
font-size: 1.1rem;
|
|
font-weight: 400;
|
|
}
|
|
|
|
.glass-card {
|
|
background: var(--surface-color);
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
border-radius: var(--border-radius);
|
|
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
|
|
overflow: hidden;
|
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
|
}
|
|
|
|
.glass-card:hover {
|
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
/* Custom Tabs */
|
|
.nav-tabs {
|
|
border-bottom: 1px solid rgba(0,0,0,0.08);
|
|
background: rgba(249, 250, 251, 0.5);
|
|
padding: 0.5rem 1rem 0;
|
|
}
|
|
|
|
.nav-tabs .nav-item {
|
|
margin-bottom: -1px;
|
|
}
|
|
|
|
.nav-tabs .nav-link {
|
|
border: none;
|
|
color: var(--text-secondary);
|
|
font-weight: 500;
|
|
padding: 1rem 1.5rem;
|
|
border-bottom: 3px solid transparent;
|
|
transition: all 0.2s ease;
|
|
font-size: 1.05rem;
|
|
}
|
|
|
|
.nav-tabs .nav-link:hover {
|
|
color: #4f46e5;
|
|
background: transparent;
|
|
border-color: transparent;
|
|
}
|
|
|
|
.nav-tabs .nav-link.active {
|
|
color: #4f46e5;
|
|
background: transparent;
|
|
border-bottom: 3px solid #4f46e5;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.tab-content {
|
|
padding: 2rem;
|
|
}
|
|
|
|
/* Form Controls */
|
|
.form-label {
|
|
font-weight: 500;
|
|
color: #374151;
|
|
font-size: 0.95rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.form-control, .form-select {
|
|
border-radius: 8px;
|
|
border: 1px solid #d1d5db;
|
|
padding: 0.75rem 1rem;
|
|
font-size: 0.95rem;
|
|
transition: all 0.2s;
|
|
background-color: #f9fafb;
|
|
}
|
|
|
|
.form-control:focus, .form-select:focus {
|
|
border-color: #4f46e5;
|
|
box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
|
|
background-color: #fff;
|
|
}
|
|
|
|
.form-control::placeholder {
|
|
color: #9ca3af;
|
|
}
|
|
|
|
/* Buttons */
|
|
.btn-gradient {
|
|
background: var(--primary-gradient);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
padding: 0.8rem 1.5rem;
|
|
font-weight: 600;
|
|
font-size: 1.05rem;
|
|
letter-spacing: 0.025em;
|
|
transition: all 0.3s ease;
|
|
box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
|
|
}
|
|
|
|
.btn-gradient:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.15);
|
|
color: white;
|
|
}
|
|
|
|
.btn-gradient:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
/* Result Box */
|
|
#resultBox {
|
|
display: none;
|
|
margin-top: 2rem;
|
|
border-radius: 12px;
|
|
padding: 1.5rem;
|
|
white-space: pre-wrap;
|
|
font-family: 'Consolas', 'Monaco', monospace;
|
|
font-size: 0.9rem;
|
|
line-height: 1.5;
|
|
border: none;
|
|
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
|
background-color: #f8fafc;
|
|
color: #334155;
|
|
animation: fadeIn 0.4s ease forwards;
|
|
}
|
|
|
|
#resultBox.success {
|
|
border-left: 4px solid #10b981;
|
|
}
|
|
|
|
#resultBox.error {
|
|
border-left: 4px solid #ef4444;
|
|
background-color: #fef2f2;
|
|
color: #991b1b;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(10px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
/* Input Groups */
|
|
.input-icon-wrapper {
|
|
position: relative;
|
|
}
|
|
.input-hint {
|
|
font-size: 0.8rem;
|
|
color: #6b7280;
|
|
margin-top: 0.25rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container">
|
|
<div class="page-header">
|
|
<h1>신한라이프 AXHUB Developer Portal</h1>
|
|
<p>No-Code 스캐폴딩 마법사로 모듈과 툴을 즉시 생성하세요</p>
|
|
</div>
|
|
|
|
<div class="glass-card">
|
|
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link active" id="pod-tab" data-bs-toggle="tab" data-bs-target="#pod" type="button" role="tab">📦 Pod (모듈) 생성</button>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link" id="tool-tab" data-bs-toggle="tab" data-bs-target="#tool" type="button" role="tab">⚙️ Tool (기능) 생성</button>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link" id="list-tab" data-bs-toggle="tab" data-bs-target="#list" type="button" role="tab" onclick="loadToolList()">📋 등록된 Tool 목록</button>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="card-body p-0">
|
|
<div class="tab-content" id="myTabContent">
|
|
|
|
<!-- Pod Creation Form -->
|
|
<div class="tab-pane fade show active" id="pod" role="tabpanel">
|
|
<form id="podForm">
|
|
<div class="mb-4">
|
|
<label class="form-label">새로운 모듈 이름</label>
|
|
<input type="text" class="form-control" name="moduleName" placeholder="예: hr (입력 시 axhub-tool-hr 로 자동 변환)" required>
|
|
</div>
|
|
<div class="mb-4">
|
|
<label class="form-label">서비스 포트 번호</label>
|
|
<input type="number" class="form-control" name="port" placeholder="예: 8086" required>
|
|
<div class="input-hint">Gateway 라우팅 및 Local 실행 시 사용할 고유 포트 번호입니다.</div>
|
|
</div>
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<label class="form-label">작성자 (선택)</label>
|
|
<input type="text" class="form-control" name="author" placeholder="미입력 시 OS 사용자명">
|
|
</div>
|
|
<div class="col-md-6 mt-3 mt-md-0">
|
|
<label class="form-label">작성일 (선택)</label>
|
|
<input type="text" class="form-control" name="date" placeholder="미입력 시 오늘 날짜">
|
|
</div>
|
|
</div>
|
|
<button type="submit" class="btn btn-gradient w-100">🚀 Pod 모듈 자동 생성</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Tool Creation Form -->
|
|
<div class="tab-pane fade" id="tool" role="tabpanel">
|
|
<form id="toolForm">
|
|
<div class="row mb-3">
|
|
<div class="col-md-6">
|
|
<label class="form-label">기본 이름 (PascalCase)</label>
|
|
<input type="text" class="form-control" name="baseName" placeholder="예: ExchangeRate" required>
|
|
<div class="input-hint">클래스명 생성에 사용됩니다. (ExchangeRateService 등)</div>
|
|
</div>
|
|
<div class="col-md-6 mt-3 mt-md-0">
|
|
<label class="form-label">레거시 API 인터페이스 ID</label>
|
|
<input type="text" class="form-control" name="interfaceId" placeholder="예: EXCH_001" required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">기능 설명 (LLM 프롬프트용)</label>
|
|
<input type="text" class="form-control" name="description" placeholder="예: 고객의 현재 환율을 조회합니다." required>
|
|
<div class="input-hint">AI 에이전트가 이 설명을 보고 툴 호출 여부를 결정하므로 상세히 적어주세요.</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<div class="col-md-6">
|
|
<label class="form-label">소속 도메인 그룹</label>
|
|
<input type="text" class="form-control" name="categoryKey" pattern="^[a-z0-9][a-z0-9_-]*$" list="groupList" placeholder="선택 또는 직접 입력 (대문자)" oninput="this.value = this.value.toUpperCase()" required>
|
|
<datalist id="groupList">
|
|
<option value="COMMON">COMMON (공통)</option>
|
|
<option value="CUSTOMER">CUSTOMER (고객)</option>
|
|
<option value="CONTRACT">CONTRACT (계약)</option>
|
|
<option value="CLAIM">CLAIM (보상)</option>
|
|
</datalist>
|
|
</div>
|
|
<div class="col-md-6 mt-3 mt-md-0">
|
|
<label class="form-label">통신 프로토콜</label>
|
|
<select class="form-select" name="routingType">
|
|
<option value="HTTP">HTTP (REST)</option>
|
|
<option value="TCP">TCP (Socket)</option>
|
|
<option value="MCI">MCI (대내외 연계)</option>
|
|
<option value="EAI">EAI (내부 연계)</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<label class="form-label">타겟 모듈명</label>
|
|
<input type="text" class="form-control" name="moduleName" value="axhub-tool-other" required>
|
|
<div class="input-hint">코드가 생성될 대상 프로젝트(Pod) 폴더명입니다.</div>
|
|
</div>
|
|
<div class="col-md-6 mt-3 mt-md-0">
|
|
<label class="form-label">레지스트리 등록 (register)</label>
|
|
<select class="form-select" name="register">
|
|
<option value="true">True (공개)</option>
|
|
<option value="false">False (비공개)</option>
|
|
</select>
|
|
<div class="input-hint">Gateway에서 자동 라우팅될지 여부입니다.</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<label class="form-label">작성자 (선택)</label>
|
|
<input type="text" class="form-control" name="author" placeholder="미입력 시 OS 사용자명">
|
|
</div>
|
|
<div class="col-md-6 mt-3 mt-md-0">
|
|
<label class="form-label">작성일 (선택)</label>
|
|
<input type="text" class="form-control" name="date" placeholder="미입력 시 오늘 날짜">
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-gradient w-100">✨ Tool 기능 자동 생성</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Tool List Form -->
|
|
<div class="tab-pane fade" id="list" role="tabpanel">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div>
|
|
<h5 class="mb-1 text-secondary">현재 시스템에 라우팅 가능한 Tool 목록입니다.</h5>
|
|
<small class="text-muted">Redis에 등록되지 않은(비공개) Tool도 포함되어 조회됩니다.</small>
|
|
</div>
|
|
<div class="d-flex gap-2">
|
|
<select id="groupFilterSelect" class="form-select form-select-sm" style="width: auto; min-width: 140px;" onchange="filterTools()">
|
|
<option value="ALL">ALL (전체 그룹)</option>
|
|
</select>
|
|
<input type="text" id="toolFilter" class="form-control form-control-sm" placeholder="🔍 이름 또는 그룹 검색..." onkeyup="filterTools()">
|
|
<button class="btn btn-sm btn-outline-primary text-nowrap" onclick="loadToolList()">🔄 새로고침</button>
|
|
</div>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-hover align-middle" id="toolTable">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th style="width: 10%; min-width: 100px;">그룹</th>
|
|
<th style="width: 20%; min-width: 150px;">서브툴 이름</th>
|
|
<th style="width: 35%; min-width: 200px;">설명</th>
|
|
<th style="width: 15%; min-width: 180px;">Pod 모듈</th>
|
|
<th style="width: 20%; min-width: 150px;">인터페이스 (ID)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="toolListBody">
|
|
<tr>
|
|
<td colspan="5" class="text-center py-4 text-muted">데이터를 불러오는 중입니다...</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="resultBox"></div>
|
|
</div>
|
|
|
|
<!-- Edit Tool Modal -->
|
|
<div class="modal fade" id="editToolModal" tabindex="-1" aria-labelledby="editToolModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="editToolModalLabel">Tool 소스 코드 수정</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="editToolForm">
|
|
<div class="mb-3">
|
|
<label class="form-label">서브툴 이름 (수정불가)</label>
|
|
<input type="text" class="form-control" id="editToolName" name="toolName" readonly>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">소속 도메인 그룹</label>
|
|
<input type="text" class="form-control" id="editCategoryKey" name="categoryKey" pattern="^[a-z0-9][a-z0-9_-]*$" oninput="this.value = this.value.toUpperCase()">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">설명</label>
|
|
<textarea class="form-control" id="editDescription" name="description" rows="3"></textarea>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">레지스트리 등록 (register)</label>
|
|
<select class="form-select" id="editRegister" name="register">
|
|
<option value="true">True (공개)</option>
|
|
<option value="false">False (비공개)</option>
|
|
</select>
|
|
</div>
|
|
<div class="alert alert-warning p-2" style="font-size: 0.85rem;">
|
|
⚠️ <strong>주의</strong>: 수정을 적용하면 물리적인 자바 소스 코드가 변경됩니다. 반영을 위해서는 백엔드 컨테이너의 재빌드가 필요합니다!
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">취소</button>
|
|
<button type="button" class="btn btn-primary" onclick="submitToolUpdate()">소스 수정 적용</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bootstrap JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
function handleFormSubmit(formId, apiUrl) {
|
|
document.getElementById(formId).addEventListener('submit', function(e) {
|
|
e.preventDefault();
|
|
const formData = new FormData(this);
|
|
const data = Object.fromEntries(formData.entries());
|
|
const btn = this.querySelector('button[type="submit"]');
|
|
const originalText = btn.innerHTML;
|
|
|
|
btn.innerHTML = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> 생성 중...';
|
|
btn.disabled = true;
|
|
|
|
fetch(apiUrl, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(data)
|
|
})
|
|
.then(response => response.text())
|
|
.then(result => {
|
|
const resultBox = document.getElementById('resultBox');
|
|
resultBox.style.display = 'block';
|
|
|
|
if (result.includes('[오류]') || result.includes('오류 발생:')) {
|
|
resultBox.className = 'error';
|
|
resultBox.textContent = result;
|
|
} else {
|
|
resultBox.className = 'success';
|
|
resultBox.textContent = result + "\n\n💡 변경사항 반영을 위해 IDE에서 반드시 Gradle 리로드(Sync)를 수행해주세요!";
|
|
}
|
|
})
|
|
.catch(error => {
|
|
const resultBox = document.getElementById('resultBox');
|
|
resultBox.style.display = 'block';
|
|
resultBox.className = 'error';
|
|
resultBox.textContent = "네트워크 오류 발생: " + error;
|
|
})
|
|
.finally(() => {
|
|
btn.innerHTML = originalText;
|
|
btn.disabled = false;
|
|
});
|
|
});
|
|
}
|
|
|
|
handleFormSubmit('podForm', '/api/v1/scaffold/pod');
|
|
handleFormSubmit('toolForm', '/api/v1/scaffold/tool');
|
|
|
|
function loadToolList() {
|
|
const tbody = document.getElementById('toolListBody');
|
|
tbody.innerHTML = '<tr><td colspan="5" class="text-center py-4 text-muted"><span class="spinner-border spinner-border-sm"></span> 데이터를 불러오는 중입니다...</td></tr>';
|
|
|
|
fetch('/mcp/api/v1/tools/list', {
|
|
method: 'GET',
|
|
headers: {
|
|
'X-API-KEY': 'SHINHAN_MCP_SECRET_KEY_2026'
|
|
}
|
|
})
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
let tools = data.result.tools || [];
|
|
if (tools.length === 0) {
|
|
tbody.innerHTML = '<tr><td colspan="5" class="text-center py-4 text-muted">등록된 Tool이 없습니다.</td></tr>';
|
|
return;
|
|
}
|
|
|
|
// 그룹명 기준으로 오름차순 정렬
|
|
tools.sort((a, b) => {
|
|
const gA = a.categoryKey || '';
|
|
const gB = b.categoryKey || '';
|
|
return gA.localeCompare(gB);
|
|
});
|
|
|
|
// 그룹 필터 옵션 채우기
|
|
const groupSet = new Set();
|
|
tools.forEach(t => groupSet.add(t.categoryKey || 'UNKNOWN'));
|
|
const groupSelect = document.getElementById('groupFilterSelect');
|
|
const currentSelectedGroup = groupSelect.value;
|
|
groupSelect.innerHTML = '<option value="ALL">ALL (전체 그룹)</option>';
|
|
Array.from(groupSet).sort().forEach(g => {
|
|
const opt = document.createElement('option');
|
|
opt.value = g;
|
|
opt.textContent = g;
|
|
groupSelect.appendChild(opt);
|
|
});
|
|
if (groupSet.has(currentSelectedGroup)) {
|
|
groupSelect.value = currentSelectedGroup;
|
|
}
|
|
|
|
tbody.innerHTML = tools.map(t => {
|
|
const isReg = t.registered !== false; // default true
|
|
const badgeHtml = isReg ? '' : ' <span class="badge bg-warning text-dark border border-warning" title="Redis 미등록 (직접 호출만 가능)">비공개 (미등록)</span>';
|
|
const escDesc = (t.description || '').replace(/'/g, "\\'").replace(/"/g, '"');
|
|
|
|
return `
|
|
<tr class="tool-row">
|
|
<td class="text-nowrap"><span class="badge bg-secondary tool-group">${t.categoryKey || 'UNKNOWN'}</span></td>
|
|
<td class="fw-bold text-primary text-break tool-name">
|
|
<a href="javascript:void(0)" onclick="openEditModal('${t.name}', '${t.categoryKey}', '${escDesc}', ${isReg})" class="text-decoration-none">
|
|
${t.name}
|
|
</a>
|
|
${badgeHtml}
|
|
</td>
|
|
<td class="text-break">${t.description}</td>
|
|
<td class="text-nowrap"><span class="badge bg-light text-dark border">${t.podUrl}</span></td>
|
|
<td class="text-nowrap"><span class="badge bg-info text-dark">${t.integrationType}</span> <small class="text-muted ms-1">${t.mciServiceId || '-'}</small></td>
|
|
</tr>
|
|
`}).join('');
|
|
|
|
// Re-apply filter if text is already present
|
|
filterTools();
|
|
})
|
|
.catch(err => {
|
|
tbody.innerHTML = `<tr><td colspan="5" class="text-center py-4 text-danger">목록을 불러오는 중 오류가 발생했습니다: ${err.message}</td></tr>`;
|
|
});
|
|
}
|
|
|
|
function filterTools() {
|
|
const input = document.getElementById('toolFilter').value.toLowerCase();
|
|
const selectedGroup = document.getElementById('groupFilterSelect').value;
|
|
const rows = document.querySelectorAll('.tool-row');
|
|
|
|
rows.forEach(row => {
|
|
const name = row.querySelector('.tool-name').textContent.toLowerCase();
|
|
const group = row.querySelector('.tool-group').textContent;
|
|
|
|
const matchText = name.includes(input) || group.toLowerCase().includes(input);
|
|
const matchGroup = (selectedGroup === 'ALL' || group === selectedGroup);
|
|
|
|
if (matchText && matchGroup) {
|
|
row.style.display = '';
|
|
} else {
|
|
row.style.display = 'none';
|
|
}
|
|
});
|
|
}
|
|
|
|
let editModalInstance = null;
|
|
function openEditModal(toolName, categoryKey, description, isReg) {
|
|
document.getElementById('editToolName').value = toolName;
|
|
document.getElementById('editCategoryKey').value = categoryKey !== 'null' ? categoryKey : '';
|
|
document.getElementById('editDescription').value = description;
|
|
document.getElementById('editRegister').value = isReg ? 'true' : 'false';
|
|
|
|
if (!editModalInstance) {
|
|
editModalInstance = new bootstrap.Modal(document.getElementById('editToolModal'));
|
|
}
|
|
editModalInstance.show();
|
|
}
|
|
|
|
function submitToolUpdate() {
|
|
const toolName = document.getElementById('editToolName').value;
|
|
const categoryKey = document.getElementById('editCategoryKey').value;
|
|
const description = document.getElementById('editDescription').value;
|
|
const register = document.getElementById('editRegister').value;
|
|
|
|
const btn = document.querySelector('#editToolModal .btn-primary');
|
|
const originalText = btn.innerHTML;
|
|
btn.innerHTML = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> 처리중...';
|
|
btn.disabled = true;
|
|
|
|
fetch('/api/v1/scaffold/tool/update', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
toolName: toolName,
|
|
categoryKey: categoryKey,
|
|
description: description,
|
|
register: register
|
|
})
|
|
})
|
|
.then(response => response.text())
|
|
.then(result => {
|
|
if (result.includes('[오류]') || result.includes('오류 발생:')) {
|
|
alert('수정 중 오류가 발생했습니다.\n' + result);
|
|
} else {
|
|
alert('소스 코드가 성공적으로 수정되었습니다!\n반영을 위해 모듈(Pod)을 재빌드해주세요.');
|
|
editModalInstance.hide();
|
|
loadToolList(); // Refresh list
|
|
}
|
|
})
|
|
.catch(err => {
|
|
alert('네트워크 오류 발생: ' + err);
|
|
})
|
|
.finally(() => {
|
|
btn.innerHTML = originalText;
|
|
btn.disabled = false;
|
|
});
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|