Files
ax-hub-mcp_tool_new/axhub-gateway/src/main/resources/static/admin/scaffold.html
jade 1b9d6ef57d feat: Premium Dark Theme UI redesign for all admin pages
- index.html: Complete redesign with deep zinc-950 background, card-based dashboard, neon blue accents
- catalog.html: Full rewrite with dark theme, styled parameter tables with visible borders, tool cards
- playground.html: Full rewrite with dark theme, visible input fields, gradient Execute button with glow effect
- scaffold.html: CSS variables updated to dark theme (zinc-900 backgrounds, zinc-100 text, blue accents)
- ScaffoldingController.java: Added listModules API for dynamic module dropdown
2026-07-12 15:30:06 +09:00

702 lines
29 KiB
HTML

<!DOCTYPE html>
<html lang="ko" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AX HUB Developer Portal</title>
<!-- Geist Fonts -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/400.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/500.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/600.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-mono@5.0.1/400.css">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
:root {
--bg-color: #09090b;
--surface-color: #18181b;
--border-color: #3f3f46; /* zinc-700 */
--text-primary: #f4f4f5; /* zinc-100 */
--text-secondary: #a1a1aa; /* zinc-400 */
--accent-color: #3b82f6;
--accent-hover: #2563eb;
--link-color: #60a5fa; /* blue-400 */
--radius-md: 6px;
--radius-sm: 4px;
}
body {
font-family: 'Geist Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: var(--bg-color);
color: var(--text-primary);
min-height: 100vh;
padding: 4rem 0;
-webkit-font-smoothing: antialiased;
}
.container {
max-width: 1000px; /* Tighter layout */
width: 95%;
margin: 0 auto;
}
/* Editorial / Tech Header */
.page-header {
text-align: left;
margin-bottom: 2rem;
padding-bottom: 2rem;
border-bottom: 1px solid var(--border-color);
}
.page-header h1 {
font-weight: 600;
font-size: 2rem;
letter-spacing: -0.04em;
color: var(--text-primary);
margin-bottom: 0.25rem;
}
.page-header p {
color: var(--text-secondary);
font-size: 0.95rem;
margin: 0;
}
/* Clean Panel */
.panel {
background: var(--surface-color);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
overflow: hidden;
}
/* Minimalist Tabs */
.nav-tabs {
border-bottom: 1px solid var(--border-color);
background: #0f0f11;
padding: 0 1.5rem;
gap: 1.5rem;
}
.nav-tabs .nav-item {
margin-bottom: -1px;
}
.nav-tabs .nav-link {
border: none;
color: var(--text-secondary);
font-weight: 500;
font-size: 0.875rem;
padding: 1rem 0;
border-bottom: 2px solid transparent;
transition: color 0.15s ease;
background: transparent !important;
}
.nav-tabs .nav-link:hover {
color: var(--text-primary);
border-color: transparent;
}
.nav-tabs .nav-link.active {
color: var(--text-primary);
border-bottom: 2px solid var(--text-primary);
font-weight: 600;
}
.tab-content {
padding: 2rem 1.5rem;
background: var(--surface-color);
}
/* Dense Forms */
.form-label {
font-weight: 500;
color: var(--text-primary);
font-size: 0.875rem;
margin-bottom: 0.35rem;
}
.form-control, .form-select {
border-radius: var(--radius-sm);
border: 1px solid var(--border-color);
padding: 0.5rem 0.75rem;
font-size: 0.875rem;
background-color: var(--surface-color);
color: var(--text-primary);
box-shadow: none;
}
.form-control:focus, .form-select:focus {
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
background-color: var(--surface-color);
color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
border-color: var(--text-secondary);
box-shadow: 0 0 0 1px var(--text-secondary);
outline: none;
}
.form-control::placeholder {
color: #a1a1aa; /* zinc-400 */
}
.input-hint {
font-size: 0.75rem;
color: var(--text-secondary);
margin-top: 0.35rem;
}
/* Utilitarian Button */
.btn-action {
background: var(--accent-color);
color: #ffffff;
border: none;
border-radius: var(--radius-sm);
padding: 0.5rem 1rem;
font-weight: 500;
font-size: 0.875rem;
transition: background-color 0.1s ease, transform 0.1s ease;
}
.btn-action:hover {
background: var(--accent-hover);
color: #ffffff;
}
.btn-action:active {
transform: scale(0.98); /* Tactile feedback */
}
.btn-secondary-action {
background: var(--surface-color);
color: var(--text-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
padding: 0.3rem 0.75rem;
font-size: 0.75rem;
font-weight: 500;
}
.btn-secondary-action:hover {
background: #f4f4f5;
}
/* Result Box - Terminal Style */
#resultBox {
display: none;
margin-top: 1.5rem;
border-radius: var(--radius-md);
padding: 1.25rem;
white-space: pre-wrap;
font-family: 'Geist Mono', Consolas, monospace;
font-size: 0.8rem;
line-height: 1.6;
background-color: #09090b; /* zinc-950 */
color: #e4e4e7; /* zinc-200 */
border: 1px solid #27272a;
}
#resultBox.success {
border-top: 3px solid #10b981;
}
#resultBox.error {
border-top: 3px solid #ef4444;
}
/* Dense Table */
.table {
font-size: 0.875rem;
margin-bottom: 0;
}
.table th {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-secondary);
font-weight: 500;
border-bottom: 1px solid var(--border-color);
padding-bottom: 0.75rem;
background: transparent;
}
.table td {
vertical-align: middle;
padding: 1rem 0.5rem;
border-bottom: 1px solid var(--border-color);
color: var(--text-primary);
}
.table tr:last-child td {
border-bottom: none;
}
.badge-mono {
font-family: 'Geist Mono', monospace;
font-size: 0.7rem;
font-weight: 500;
padding: 0.25em 0.5em;
border-radius: 4px;
background: #f4f4f5;
color: var(--text-secondary);
border: 1px solid var(--border-color);
}
a.tool-link {
color: var(--text-primary);
text-decoration: none;
font-weight: 500;
}
a.tool-link:hover {
text-decoration: underline;
color: var(--link-color);
}
/* Modal styling overrides */
.modal-content {
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.modal-header {
border-bottom: 1px solid var(--border-color);
padding: 1.25rem 1.5rem;
}
.modal-title {
font-size: 1.1rem;
font-weight: 600;
}
.modal-footer {
border-top: 1px solid var(--border-color);
padding: 1rem 1.5rem;
}
</style>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Developer Portal</h1>
<p>AX HUB No-Code Scaffolding Wizard</p>
</div>
<div class="panel">
<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 Module</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 Function</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()">Registry</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">Module Name</label>
<input type="text" class="form-control" name="moduleName" placeholder="e.g. hr (will be prefixed with axhub-tool-)" required>
</div>
<div class="mb-4">
<label class="form-label">Service Port</label>
<input type="number" class="form-control" name="port" placeholder="e.g. 8086" required>
<div class="input-hint">Unique port for Gateway routing and local development.</div>
</div>
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Author</label>
<input type="text" class="form-control" name="author" placeholder="Defaults to OS user">
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Date</label>
<input type="text" class="form-control" name="date" placeholder="Defaults to today">
</div>
</div>
<div class="d-flex justify-content-end mt-4">
<button type="submit" class="btn-action">Generate Pod</button>
</div>
</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">Base Name (PascalCase)</label>
<input type="text" class="form-control" name="baseName" placeholder="e.g. ExchangeRate" required>
<div class="input-hint">Used for class generation (ExchangeRateService).</div>
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Legacy Interface ID</label>
<input type="text" class="form-control" name="interfaceId" placeholder="e.g. EXCH_001" required>
</div>
</div>
<div class="mb-3">
<label class="form-label">Description (LLM Prompt)</label>
<input type="text" class="form-control" name="description" placeholder="e.g. Fetch current exchange rates for customers." required>
<div class="input-hint">Critical for AI agent intent matching. Be descriptive.</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Domain Category</label>
<input type="text" class="form-control" name="categoryKey" pattern="^[a-z0-9][a-z0-9_-]*$" list="groupList" placeholder="e.g. common, hr, payment" oninput="this.value = this.value.toLowerCase()" 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">Protocol</label>
<select class="form-select" name="routingType">
<option value="HTTP">HTTP (REST)</option>
<option value="TCP">TCP (Socket)</option>
<option value="MCI">MCI (Legacy)</option>
<option value="EAI">EAI (Internal)</option>
</select>
</div>
</div>
<div class="row mb-4">
<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>
</select>
<div class="input-hint">Destination Pod directory.</div>
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Gateway Registration</label>
<select class="form-select" name="register">
<option value="true">True (Public)</option>
<option value="false">False (Private)</option>
</select>
<div class="input-hint">Controls dynamic routing exposure.</div>
</div>
</div>
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Author</label>
<input type="text" class="form-control" name="author" placeholder="Defaults to OS user">
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Date</label>
<input type="text" class="form-control" name="date" placeholder="Defaults to today">
</div>
</div>
<div class="d-flex justify-content-end mt-4">
<button type="submit" class="btn-action">Generate Tool</button>
</div>
</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-4">
<div>
<h5 class="mb-1" style="font-size: 1rem; font-weight: 600;">Active Tools</h5>
<div class="input-hint mt-0">Tools dynamically registered in the Gateway.</div>
</div>
<div class="d-flex gap-2">
<select id="groupFilterSelect" class="form-select" style="width: auto; min-width: 140px; padding: 0.25rem 0.5rem; font-size: 0.8rem; height: 30px;" onchange="filterTools()">
<option value="ALL">All Categories</option>
</select>
<input type="text" id="toolFilter" class="form-control" style="padding: 0.25rem 0.5rem; font-size: 0.8rem; height: 30px;" placeholder="Search..." onkeyup="filterTools()">
<button class="btn-secondary-action text-nowrap" style="height: 30px;" onclick="loadToolList()">Refresh</button>
</div>
</div>
<div class="table-responsive">
<table class="table align-middle" id="toolTable">
<thead>
<tr>
<th style="width: 10%;">Category</th>
<th style="width: 20%;">Tool Name</th>
<th style="width: 40%;">Description</th>
<th style="width: 15%;">Pod</th>
<th style="width: 15%;">Interface</th>
</tr>
</thead>
<tbody id="toolListBody">
<tr>
<td colspan="5" class="text-center py-5 text-muted">Loading data...</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">Edit Tool Definition</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">Tool Name</label>
<input type="text" class="form-control" id="editToolName" name="toolName" readonly style="background-color: #f4f4f5; color: #a1a1aa;">
</div>
<div class="mb-3">
<label class="form-label">Category</label>
<input type="text" class="form-control" id="editCategoryKey" name="categoryKey" pattern="^[a-z0-9][a-z0-9_-]*$" oninput="this.value = this.value.toLowerCase()">
</div>
<div class="mb-3">
<label class="form-label">Description</label>
<textarea class="form-control" id="editDescription" name="description" rows="3"></textarea>
</div>
<div class="mb-3">
<label class="form-label">Registry Exposure</label>
<select class="form-select" id="editRegister" name="register">
<option value="true">True (Public)</option>
<option value="false">False (Private)</option>
</select>
</div>
<div style="font-size: 0.8rem; color: #d97706; background: #fffbeb; padding: 0.75rem; border: 1px solid #fde68a; border-radius: var(--radius-sm); margin-top: 1rem;">
<strong>Notice:</strong> Applying edits modifies the physical Java source code. A rebuild of the backend container is required for changes to take effect.
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn-secondary-action" data-bs-dismiss="modal" style="padding: 0.5rem 1rem; font-size: 0.875rem;">Cancel</button>
<button type="button" class="btn-action" onclick="submitToolUpdate()">Apply Changes</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 = 'Processing...';
btn.disabled = true;
btn.style.opacity = '0.7';
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> Note: Please sync Gradle in your IDE to reflect source code generation.";
}
})
.catch(error => {
const resultBox = document.getElementById('resultBox');
resultBox.style.display = 'block';
resultBox.className = 'error';
resultBox.textContent = "Network error: " + error;
})
.finally(() => {
btn.innerHTML = originalText;
btn.disabled = false;
btn.style.opacity = '1';
});
});
}
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 === 'axhub-tool-other' ? 'selected' : ''}>${m}</option>`).join('');
}
})
.catch(err => console.error('Failed to load modules:', err));
});
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-5 text-muted">Loading data...</td></tr>';
fetch('/mcp/api/v1/tools/list', {
method: 'GET',
})
.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-5 text-muted">No tools registered.</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 Categories</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;
const badgeHtml = isReg ? '' : ' <span class="badge-mono" style="color:#d97706;border-color:#fde68a;background:#fffbeb;">Private</span>';
const escDesc = (t.description || '').replace(/'/g, "\\'").replace(/"/g, '&quot;');
return `
<tr class="tool-row">
<td><span class="badge-mono">${t.categoryKey || 'unknown'}</span></td>
<td>
<a href="javascript:void(0)" onclick="openEditModal('${t.name}', '${t.categoryKey}', '${escDesc}', ${isReg})" class="tool-link">
${t.name}
</a>
${badgeHtml}
</td>
<td class="text-secondary" style="font-size:0.8rem;">${t.description}</td>
<td><span class="badge-mono">${t.podUrl}</span></td>
<td><span class="badge-mono">${t.integrationType}</span> <span class="text-secondary ms-1" style="font-size:0.75rem;">${t.mciServiceId || '-'}</span></td>
</tr>
`}).join('');
filterTools();
})
.catch(err => {
tbody.innerHTML = `<tr><td colspan="5" class="text-center py-5 text-danger">Error loading data: ${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.cells[1].textContent.toLowerCase();
const group = row.cells[0].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-action');
const originalText = btn.innerHTML;
btn.innerHTML = 'Processing...';
btn.disabled = true;
btn.style.opacity = '0.7';
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('Error updating source:\n' + result);
} else {
alert('Source code updated successfully.\nPlease rebuild the Pod container to reflect changes.');
editModalInstance.hide();
loadToolList();
}
})
.catch(err => {
alert('Network error: ' + err);
})
.finally(() => {
btn.innerHTML = originalText;
btn.disabled = false;
btn.style.opacity = '1';
});
}
</script>
</body>
</html>