feat(all): 重炼 crates/common 核心组件、上线 Web 运维看板与 Docker 容器化部署
This commit is contained in:
@@ -0,0 +1,308 @@
|
||||
// DCTS Cluster Dashboard Client Logic (全中文,无占位符,对接所有后端 API)
|
||||
|
||||
const defaultYamlConfig = `name: sdB_cno
|
||||
description: sdB CNO 6D Stellar Atmosphere Grid
|
||||
grid:
|
||||
teff: [20000.0, 40000.0, 5000.0]
|
||||
logg: [5.0, 6.2, 0.3]
|
||||
loghe: [-1.0, -1.0, 0.0]
|
||||
logc: [-5.0, -2.0, 0.5]
|
||||
logn: [-5.0, -2.0, 0.5]
|
||||
logo: [-5.0, -2.0, 0.5]
|
||||
convergence:
|
||||
max_relc: 0.01
|
||||
max_iterations: 30
|
||||
`;
|
||||
|
||||
// 获取状态数据
|
||||
async function fetchStatus() {
|
||||
try {
|
||||
const res = await fetch('/api/status');
|
||||
if (!res.ok) throw new Error(`HTTP 错误代码: ${res.status}`);
|
||||
const data = await res.json();
|
||||
updateUI(data);
|
||||
updateServerStatus(true);
|
||||
} catch (err) {
|
||||
console.warn('获取 DCTS 状态失败:', err);
|
||||
updateServerStatus(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取工作流列表
|
||||
async function fetchWorkflows() {
|
||||
try {
|
||||
const res = await fetch('/api/workflows');
|
||||
if (!res.ok) return;
|
||||
const json = await res.json();
|
||||
if (json.success && json.data) {
|
||||
renderWorkflows(json.data);
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('获取工作流列表失败:', err);
|
||||
}
|
||||
}
|
||||
|
||||
function updateServerStatus(online) {
|
||||
const statusText = document.getElementById('server-status-text');
|
||||
const indicator = document.getElementById('status-indicator-box');
|
||||
if (!statusText || !indicator) return;
|
||||
|
||||
if (online) {
|
||||
statusText.textContent = '服务端正常运行';
|
||||
indicator.className = 'status-indicator online';
|
||||
} else {
|
||||
statusText.textContent = '服务端已断开连接';
|
||||
indicator.className = 'status-indicator offline';
|
||||
}
|
||||
}
|
||||
|
||||
function updateUI(data) {
|
||||
const nodes = data.nodes || [];
|
||||
const activeNodesCount = data.nodes_online !== undefined ? data.nodes_online : nodes.length;
|
||||
const activeSlots = data.total_active_slots || 0;
|
||||
const maxSlots = data.total_max_slots || 0;
|
||||
|
||||
const gridStats = data.grid_stats || {};
|
||||
const totalPoints = gridStats.total || 0;
|
||||
const pendingPoints = gridStats.pending || 0;
|
||||
const runningPoints = gridStats.running || 0;
|
||||
const convergedPoints = gridStats.converged || 0;
|
||||
|
||||
// 更新指标卡片
|
||||
document.getElementById('val-active-nodes').textContent = activeNodesCount;
|
||||
document.getElementById('val-total-slots').textContent = `${activeSlots} / ${maxSlots} CPU 槽位占用`;
|
||||
|
||||
document.getElementById('val-pending-tasks').textContent = pendingPoints;
|
||||
document.getElementById('val-running-tasks').textContent = `${runningPoints} 个网格点计算中`;
|
||||
|
||||
document.getElementById('val-completed-tasks').textContent = convergedPoints;
|
||||
const rate = totalPoints > 0 ? ((convergedPoints / totalPoints) * 100).toFixed(1) : '0.0';
|
||||
document.getElementById('val-completion-rate').textContent = `全网网格总数: ${totalPoints} (完成率 ${rate}%)`;
|
||||
|
||||
document.getElementById('node-count-badge').textContent = `${activeNodesCount} 个节点在线`;
|
||||
|
||||
renderNodesTable(nodes);
|
||||
}
|
||||
|
||||
function renderNodesTable(nodes) {
|
||||
const tbody = document.getElementById('nodes-table-body');
|
||||
if (!tbody) return;
|
||||
|
||||
if (!nodes || nodes.length === 0) {
|
||||
tbody.innerHTML = `
|
||||
<tr>
|
||||
<td colspan="7" class="empty-cell">
|
||||
暂无在线计算节点。请启动 DCTS Node Worker 节点程序。
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
|
||||
tbody.innerHTML = nodes.map(node => {
|
||||
const isOnline = node.status === 'online' || node.status === 'active';
|
||||
const statusText = isOnline ? '在线 (Online)' : '离线 (Offline)';
|
||||
const badgeClass = isOnline ? 'online' : 'offline';
|
||||
const lastHeartbeat = node.last_heartbeat ? new Date(node.last_heartbeat).toLocaleTimeString('zh-CN') : '未知';
|
||||
|
||||
return `
|
||||
<tr>
|
||||
<td class="node-id">${node.node_id || node.id || 'N/A'}</td>
|
||||
<td>${node.host_name || node.host || '127.0.0.1'}</td>
|
||||
<td>${node.active_slots || 0} / ${node.max_slots || 4}</td>
|
||||
<td>${(node.cpu_usage || 0).toFixed(1)}%</td>
|
||||
<td>${(node.memory_usage || 0).toFixed(1)}%</td>
|
||||
<td>${lastHeartbeat}</td>
|
||||
<td><span class="status-badge ${badgeClass}">${statusText}</span></td>
|
||||
</tr>
|
||||
`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
function renderWorkflows(workflows) {
|
||||
const container = document.getElementById('workflows-list');
|
||||
const wfMetric = document.getElementById('val-total-workflows');
|
||||
const wfSub = document.getElementById('val-active-wf');
|
||||
if (!container) return;
|
||||
|
||||
if (wfMetric) wfMetric.textContent = workflows.length;
|
||||
|
||||
if (!workflows || workflows.length === 0) {
|
||||
if (wfSub) wfSub.textContent = '暂无已注册工作流';
|
||||
container.innerHTML = `
|
||||
<div class="empty-cell">
|
||||
暂无预置工作流。可点击右上角「创建工作流」按钮快速注册。
|
||||
</div>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
|
||||
const runningCount = workflows.filter(w => w.status === 'running').length;
|
||||
if (wfSub) {
|
||||
wfSub.textContent = runningCount > 0 ? `${runningCount} 个工作流运行中` : '集群待命';
|
||||
}
|
||||
|
||||
container.innerHTML = workflows.map(wf => {
|
||||
let statusCn = '闲置 (Idle)';
|
||||
let statusClass = 'secondary';
|
||||
if (wf.status === 'running') {
|
||||
statusCn = '运行中 (Running)';
|
||||
statusClass = 'online';
|
||||
} else if (wf.status === 'paused') {
|
||||
statusCn = '已暂停 (Paused)';
|
||||
statusClass = 'offline';
|
||||
}
|
||||
|
||||
return `
|
||||
<div class="workflow-card">
|
||||
<div class="wf-header">
|
||||
<span class="wf-name">${wf.name}</span>
|
||||
<span class="status-badge ${statusClass}">${statusCn}</span>
|
||||
</div>
|
||||
<div class="wf-desc">${wf.description || '无详细描述'}</div>
|
||||
<div class="wf-meta">
|
||||
<span>创建时间: ${wf.created_at || '最近'}</span>
|
||||
</div>
|
||||
<div class="wf-actions">
|
||||
${wf.status !== 'running' ? `
|
||||
<button class="btn btn-primary btn-sm" onclick="startWorkflow('${wf.name}')">启动计算</button>
|
||||
` : `
|
||||
<button class="btn btn-secondary btn-sm" onclick="stopWorkflow('${wf.name}')">暂停计算</button>
|
||||
`}
|
||||
<button class="btn btn-secondary btn-sm" onclick="viewWorkflowYaml('${wf.name}')">查看 YAML</button>
|
||||
<button class="btn btn-danger btn-sm" onclick="deleteWorkflow('${wf.name}')">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
// 模态弹窗交互
|
||||
function initModals() {
|
||||
const modalWf = document.getElementById('modal-workflow');
|
||||
const modalYaml = document.getElementById('modal-view-yaml');
|
||||
const btnCreateWf = document.getElementById('btn-create-wf');
|
||||
const btnCloseModal = document.getElementById('modal-close-btn');
|
||||
const btnCancelModal = document.getElementById('btn-cancel-modal');
|
||||
const formWf = document.getElementById('form-workflow');
|
||||
|
||||
const btnCloseYaml = document.getElementById('view-yaml-close-btn');
|
||||
const btnCloseYamlFoot = document.getElementById('btn-close-yaml-modal');
|
||||
|
||||
btnCreateWf?.addEventListener('click', () => {
|
||||
document.getElementById('input-wf-name').value = '';
|
||||
document.getElementById('input-wf-desc').value = '';
|
||||
document.getElementById('input-wf-yaml').value = defaultYamlConfig;
|
||||
modalWf?.classList.remove('hidden');
|
||||
});
|
||||
|
||||
const hideWfModal = () => modalWf?.classList.add('hidden');
|
||||
btnCloseModal?.addEventListener('click', hideWfModal);
|
||||
btnCancelModal?.addEventListener('click', hideWfModal);
|
||||
|
||||
const hideYamlModal = () => modalYaml?.classList.add('hidden');
|
||||
btnCloseYaml?.addEventListener('click', hideYamlModal);
|
||||
btnCloseYamlFoot?.addEventListener('click', hideYamlModal);
|
||||
|
||||
// 提交创建工作流
|
||||
formWf?.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const name = document.getElementById('input-wf-name').value.trim();
|
||||
const description = document.getElementById('input-wf-desc').value.trim();
|
||||
const config_yaml = document.getElementById('input-wf-yaml').value;
|
||||
|
||||
if (!name || !config_yaml) {
|
||||
alert('请填写工作流名称及 YAML 配置内容!');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/workflows', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name, description, config_yaml }),
|
||||
});
|
||||
const json = await res.json();
|
||||
if (json.success) {
|
||||
alert(`工作流 '${name}' 保存成功!`);
|
||||
hideWfModal();
|
||||
fetchWorkflows();
|
||||
} else {
|
||||
alert(`保存失败: ${json.message}`);
|
||||
}
|
||||
} catch (err) {
|
||||
alert(`请求异常: ${err.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 暴露操作给全局 window 对象
|
||||
window.startWorkflow = async function(name) {
|
||||
if (!confirm(`确定要启动工作流 '${name}' 展开计算网格点吗?`)) return;
|
||||
try {
|
||||
const res = await fetch(`/api/workflows/${name}/start`, { method: 'POST' });
|
||||
const json = await res.json();
|
||||
alert(json.message);
|
||||
fetchWorkflows();
|
||||
fetchStatus();
|
||||
} catch (err) {
|
||||
alert(`启动失败: ${err.message}`);
|
||||
}
|
||||
};
|
||||
|
||||
window.stopWorkflow = async function(name) {
|
||||
try {
|
||||
const res = await fetch(`/api/workflows/${name}/stop`, { method: 'POST' });
|
||||
const json = await res.json();
|
||||
alert(json.message);
|
||||
fetchWorkflows();
|
||||
} catch (err) {
|
||||
alert(`暂停失败: ${err.message}`);
|
||||
}
|
||||
};
|
||||
|
||||
window.deleteWorkflow = async function(name) {
|
||||
if (!confirm(`确定要删除工作流 '${name}' 吗?`)) return;
|
||||
try {
|
||||
const res = await fetch(`/api/workflows/${name}`, { method: 'DELETE' });
|
||||
const json = await res.json();
|
||||
alert(json.message);
|
||||
fetchWorkflows();
|
||||
} catch (err) {
|
||||
alert(`删除失败: ${err.message}`);
|
||||
}
|
||||
};
|
||||
|
||||
window.viewWorkflowYaml = async function(name) {
|
||||
try {
|
||||
const res = await fetch(`/api/workflows/${name}`);
|
||||
const json = await res.json();
|
||||
if (json.success && json.data) {
|
||||
document.getElementById('view-yaml-title').textContent = `工作流 '${name}' 配置 YAML`;
|
||||
document.getElementById('view-yaml-content').textContent = json.data.config_yaml;
|
||||
document.getElementById('modal-view-yaml')?.classList.remove('hidden');
|
||||
} else {
|
||||
alert(`获取详情失败: ${json.message}`);
|
||||
}
|
||||
} catch (err) {
|
||||
alert(`请求异常: ${err.message}`);
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化与定时轮询
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
fetchStatus();
|
||||
fetchWorkflows();
|
||||
initModals();
|
||||
|
||||
document.getElementById('refresh-btn')?.addEventListener('click', () => {
|
||||
fetchStatus();
|
||||
fetchWorkflows();
|
||||
});
|
||||
|
||||
// 每 5 秒轮询刷新
|
||||
setInterval(() => {
|
||||
fetchStatus();
|
||||
fetchWorkflows();
|
||||
}, 5000);
|
||||
});
|
||||
@@ -0,0 +1,565 @@
|
||||
/* DCTS Cluster Dashboard — AstroResearch 暖纸张学术风 (Light Academic Paper Style) */
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
color-scheme: light;
|
||||
|
||||
/* ── AstroResearch 暖纸张学术风 (Light Academic Paper) ── */
|
||||
--bg-app: #faf9f6; /* 暖白纸底 */
|
||||
--bg-surface: #ffffff; /* 卡片/面板纯白 */
|
||||
--bg-elevated: #ffffff; /* 弹层面板 */
|
||||
--bg-sunken: #f4f2ed; /* 表头/凹陷底面 */
|
||||
|
||||
--text-primary: #292524; /* 暖墨黑 (stone-800) */
|
||||
--text-secondary: #57534e; /* 暖深灰 (stone-600) */
|
||||
--text-muted: #78716c; /* 暖中灰 (stone-500) */
|
||||
|
||||
--border-default: #e7e5e4; /* 基础描述线 (stone-200) */
|
||||
--border-subtle: #f5f2ec; /* 更轻分割线 */
|
||||
--border-strong: #ddd7cc; /* 强调分割线 */
|
||||
|
||||
/* 品牌与功能强调色 */
|
||||
--accent-blueprint: #0369a1;/* 学术蓝 (Blueprint Blue) */
|
||||
--accent-cyan: #0284c7; /* 天空蓝 (Sky Cyan) */
|
||||
--accent-purple: #6d28d9; /* 皇家紫 */
|
||||
--accent-emerald: #047857; /* 翡翠绿 (Success) */
|
||||
--accent-amber: #b45309; /* 琥珀金 (Warning/Star) */
|
||||
--accent-rose: #dc2626; /* 珊瑚红 (Danger) */
|
||||
|
||||
--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
|
||||
--font-mono: 'JetBrains Mono', monospace;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--bg-app);
|
||||
background-image:
|
||||
radial-gradient(at 10% 10%, rgba(3, 105, 161, 0.04) 0px, transparent 50%),
|
||||
radial-gradient(at 90% 90%, rgba(180, 83, 9, 0.04) 0px, transparent 50%);
|
||||
background-attachment: fixed;
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-sans);
|
||||
min-height: 100vh;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 暖纸张卡片面板 */
|
||||
.glass {
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
/* 导航顶栏 Header */
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1.1rem 2.2rem;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
backdrop-filter: blur(12px);
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.logo-icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(135deg, var(--accent-blueprint), var(--accent-cyan));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
box-shadow: 0 4px 12px rgba(3, 105, 161, 0.25);
|
||||
}
|
||||
|
||||
.logo-title {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.logo-subtitle {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.header-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.status-indicator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.85rem;
|
||||
padding: 0.4rem 0.9rem;
|
||||
border-radius: 20px;
|
||||
font-family: var(--font-mono);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.status-indicator.online {
|
||||
background: rgba(4, 120, 87, 0.08);
|
||||
border: 1px solid rgba(4, 120, 87, 0.25);
|
||||
color: var(--accent-emerald);
|
||||
}
|
||||
|
||||
.status-indicator.offline {
|
||||
background: rgba(220, 38, 38, 0.08);
|
||||
border: 1px solid rgba(220, 38, 38, 0.25);
|
||||
color: var(--accent-rose);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--accent-emerald);
|
||||
box-shadow: 0 0 8px var(--accent-emerald);
|
||||
animation: pulse 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% { transform: scale(0.95); opacity: 0.8; }
|
||||
50% { transform: scale(1.15); opacity: 1; }
|
||||
100% { transform: scale(0.95); opacity: 0.8; }
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.55rem 1.1rem;
|
||||
border-radius: 8px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: var(--bg-sunken);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-default);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #eae6df;
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: linear-gradient(135deg, var(--accent-blueprint), var(--accent-cyan));
|
||||
color: white;
|
||||
box-shadow: 0 3px 10px rgba(3, 105, 161, 0.25);
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
opacity: 0.92;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: rgba(220, 38, 38, 0.1);
|
||||
color: var(--accent-rose);
|
||||
border: 1px solid rgba(220, 38, 38, 0.2);
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: rgba(220, 38, 38, 0.2);
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
padding: 0.35rem 0.7rem;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
/* 主内容容器 */
|
||||
.main-container {
|
||||
max-width: 1400px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
/* 指标卡片矩阵 */
|
||||
.metrics-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.metric-card {
|
||||
padding: 1.35rem 1.5rem;
|
||||
transition: transform 0.2s ease, border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.metric-card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
.metric-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 0.85rem;
|
||||
}
|
||||
|
||||
.metric-title {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.metric-icon {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nodes-icon { background: rgba(3, 105, 161, 0.08); color: var(--accent-blueprint); }
|
||||
.pending-icon { background: rgba(180, 83, 9, 0.08); color: var(--accent-amber); }
|
||||
.success-icon { background: rgba(4, 120, 87, 0.08); color: var(--accent-emerald); }
|
||||
.workflow-icon { background: rgba(109, 40, 217, 0.08); color: var(--accent-purple); }
|
||||
|
||||
.metric-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.metric-value {
|
||||
font-size: 2.1rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.03em;
|
||||
font-family: var(--font-mono);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.metric-sub {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
/* 内容双栏布局 */
|
||||
.content-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 3fr 2fr;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.content-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* 面板 */
|
||||
.panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1.1rem 1.5rem;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
background: var(--bg-sunken);
|
||||
}
|
||||
|
||||
.panel-header h2 {
|
||||
font-size: 1.05rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.badge {
|
||||
background: rgba(3, 105, 161, 0.08);
|
||||
color: var(--accent-blueprint);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
padding: 0.25rem 0.65rem;
|
||||
border-radius: 12px;
|
||||
font-family: var(--font-mono);
|
||||
border: 1px solid rgba(3, 105, 161, 0.2);
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
padding: 1.35rem 1.5rem;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* 表格组件 */
|
||||
.table-responsive {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
text-align: left;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.data-table th {
|
||||
padding: 0.8rem 1rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
background: var(--bg-sunken);
|
||||
}
|
||||
|
||||
.data-table td {
|
||||
padding: 0.85rem 1rem;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.data-table tr:hover {
|
||||
background: rgba(0, 0, 0, 0.015);
|
||||
}
|
||||
|
||||
.node-id {
|
||||
font-family: var(--font-mono);
|
||||
font-weight: 600;
|
||||
color: var(--accent-blueprint);
|
||||
}
|
||||
|
||||
.empty-cell {
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
padding: 2.5rem !important;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 0.2rem 0.55rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
.status-badge.online {
|
||||
background: rgba(4, 120, 87, 0.1);
|
||||
color: var(--accent-emerald);
|
||||
}
|
||||
|
||||
.status-badge.offline {
|
||||
background: rgba(220, 38, 38, 0.1);
|
||||
color: var(--accent-rose);
|
||||
}
|
||||
|
||||
/* 工作流卡片 */
|
||||
.workflows-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.workflow-card {
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: 10px;
|
||||
padding: 1.2rem;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.workflow-card:hover {
|
||||
border-color: var(--border-strong);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.wf-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.wf-name {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.wf-desc {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 0.85rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.wf-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.wf-progress-bar {
|
||||
width: 100%;
|
||||
height: 7px;
|
||||
background: #e7e5e4;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.wf-progress-fill {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, var(--accent-blueprint), var(--accent-cyan));
|
||||
border-radius: 4px;
|
||||
transition: width 0.4s ease;
|
||||
}
|
||||
|
||||
.wf-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 0.78rem;
|
||||
color: var(--text-muted);
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
/* 模态弹窗 (Modal Dialog) */
|
||||
.modal-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(41, 37, 36, 0.4);
|
||||
backdrop-filter: blur(4px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.modal-backdrop.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.modal-card {
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: 12px;
|
||||
width: 90%;
|
||||
max-width: 650px;
|
||||
padding: 1.75rem;
|
||||
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
padding-bottom: 0.85rem;
|
||||
}
|
||||
|
||||
.modal-header h3 {
|
||||
font-size: 1.15rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 1.5rem;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.form-input, .form-textarea {
|
||||
background: var(--bg-sunken);
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: 6px;
|
||||
padding: 0.6rem 0.8rem;
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-sans);
|
||||
}
|
||||
|
||||
.form-textarea {
|
||||
font-family: var(--font-mono);
|
||||
min-height: 180px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.form-input:focus, .form-textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent-blueprint);
|
||||
box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.75rem;
|
||||
border-top: 1px solid var(--border-default);
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
/* 页脚 Footer */
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1.5rem;
|
||||
border-top: 1px solid var(--border-default);
|
||||
color: var(--text-muted);
|
||||
font-size: 0.82rem;
|
||||
background: var(--bg-surface);
|
||||
}
|
||||
Reference in New Issue
Block a user