feat: Docker 集群增强 — Gateway 通讯API、像素兵种系统、互动组件、UI 优化

This commit is contained in:
晴天
2026-03-09 05:35:30 +08:00
parent 5b8a7ab76f
commit 727903f94b
18 changed files with 3017 additions and 174 deletions

View File

@@ -858,6 +858,7 @@
.docker-node-card.offline {
opacity: 0.7;
}
.docker-node-pixel { line-height: 0; flex-shrink: 0; }
.docker-node-header {
display: flex;
align-items: center;
@@ -917,6 +918,177 @@
color: var(--text-secondary);
}
/* 军团单位卡片网格 */
.unit-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 12px;
}
/* 单位卡片 */
.unit-card {
position: relative;
background: var(--bg-card, var(--bg-primary));
border: 1px solid var(--border-primary);
border-radius: var(--radius-lg);
padding: 14px 16px;
transition: all 200ms;
border-left: 3px solid var(--unit-color, var(--border-primary));
}
.unit-card:hover {
border-color: var(--unit-color, var(--accent));
box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.unit-card.running {
border-left-color: var(--unit-color, #22c55e);
}
.unit-card.stopped {
opacity: 0.7;
border-left-color: var(--text-tertiary);
}
.unit-card.enlist {
border-left-color: var(--border-secondary);
opacity: 0.6;
}
.unit-card.enlist:hover { opacity: 0.9; }
.unit-card-select {
position: absolute;
top: 10px;
right: 10px;
}
.unit-card-select input[type="checkbox"] {
width: 16px;
height: 16px;
cursor: pointer;
accent-color: var(--accent, #00c8ff);
}
.unit-card-header {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 8px;
}
.unit-badge {
flex-shrink: 0;
line-height: 0;
}
.unit-badge svg {
filter: drop-shadow(0 1px 3px rgba(0,0,0,.15));
}
.unit-identity {
flex: 1;
min-width: 0;
}
.unit-name {
font-size: 14px;
font-weight: 700;
color: var(--text-primary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.unit-role {
font-size: 11px;
color: var(--text-tertiary);
margin-top: 1px;
}
.unit-id {
font-size: 10px;
color: var(--text-tertiary);
font-family: var(--font-mono);
}
.unit-state {
flex-shrink: 0;
font-size: 11px;
font-weight: 600;
padding: 2px 8px;
border-radius: 10px;
}
.unit-state.running {
background: rgba(34,197,94,.1);
color: #22c55e;
}
.unit-state.stopped {
background: var(--bg-secondary);
color: var(--text-tertiary);
}
.unit-links {
display: flex;
gap: 6px;
margin-bottom: 8px;
padding-left: 46px;
}
.unit-link {
font-size: 11px;
padding: 2px 10px;
border-radius: 8px;
text-decoration: none;
transition: all 150ms;
}
.unit-link.panel {
background: rgba(0,200,255,.06);
color: var(--accent, #00c8ff);
border: 1px solid rgba(0,200,255,.12);
}
.unit-link.panel:hover {
background: rgba(0,200,255,.12);
}
.unit-link.gateway {
background: rgba(168,85,247,.06);
color: #a855f7;
border: 1px solid rgba(168,85,247,.12);
cursor: pointer;
}
.unit-link.gateway:hover {
background: rgba(168,85,247,.12);
}
.unit-card-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 8px;
border-top: 1px solid var(--border-secondary);
}
.unit-image {
font-size: 10px;
color: var(--text-tertiary);
font-family: var(--font-mono);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 160px;
}
.unit-actions {
display: flex;
gap: 2px;
}
/* 批量操作栏改进 */
.batch-select-all {
display: flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: var(--text-secondary);
cursor: pointer;
}
.batch-select-all input[type="checkbox"] {
accent-color: var(--accent, #00c8ff);
}
@media (max-width: 768px) {
.cluster-header { flex-direction: column; align-items: flex-start; gap: 8px; }
.cluster-header-left { flex-direction: column; align-items: flex-start; gap: 4px; }
.unit-grid { grid-template-columns: 1fr; }
.unit-links { padding-left: 0; }
.batch-actions { flex-wrap: wrap; }
.task-mode-btn { padding: 5px 8px; font-size: 11px; }
}
/* 容器表格 */
.docker-table-wrap {
overflow-x: auto;
@@ -987,6 +1159,52 @@
font-size: 12px;
color: var(--text-secondary);
}
/* 批量操作 */
.batch-actions {
display: flex;
align-items: center;
gap: 6px;
}
.batch-count {
font-size: 12px;
font-weight: 600;
color: var(--accent, #00c8ff);
padding: 2px 10px;
background: rgba(0,200,255,.08);
border-radius: 10px;
}
.docker-ct-check {
width: 32px;
text-align: center;
padding: 0 4px !important;
}
.docker-ct-check input[type="checkbox"] {
width: 16px;
height: 16px;
cursor: pointer;
accent-color: var(--accent, #00c8ff);
}
.docker-ct-links {
display: flex;
gap: 6px;
margin-top: 4px;
}
.docker-ct-link {
font-size: 11px;
padding: 1px 8px;
border-radius: 8px;
background: rgba(0,240,255,.06);
color: var(--accent, #00c8ff);
text-decoration: none;
border: 1px solid rgba(0,240,255,.12);
white-space: nowrap;
transition: background .15s, border-color .15s;
}
.docker-ct-link:hover {
background: rgba(0,240,255,.12);
border-color: rgba(0,240,255,.25);
}
.docker-ct-actions {
display: flex;
gap: 4px;
@@ -1116,6 +1334,106 @@
margin-top: var(--space-lg);
}
/* 部署进度 */
.deploy-progress {
padding: 8px 0;
}
.deploy-progress-header {
text-align: center;
margin-bottom: 20px;
}
.deploy-progress-icon {
font-size: 40px;
animation: deployBounce 1.2s ease-in-out infinite;
}
@keyframes deployBounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
.deploy-progress-title {
font-size: 16px;
font-weight: 700;
margin-top: 8px;
color: var(--text-primary);
}
.deploy-progress-subtitle {
font-size: 12px;
color: var(--text-tertiary);
font-family: var(--font-mono);
margin-top: 2px;
}
.deploy-progress-steps {
display: flex;
flex-direction: column;
gap: 4px;
margin-bottom: 16px;
}
.deploy-step {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
border-radius: var(--radius-md);
background: var(--bg-secondary);
opacity: 0.4;
transition: all 300ms;
}
.deploy-step.active {
opacity: 1;
background: rgba(0, 200, 255, 0.06);
border-left: 3px solid var(--accent, #00c8ff);
}
.deploy-step.done {
opacity: 0.7;
}
.deploy-step.done .deploy-step-icon::after {
content: ' ✓';
color: #22c55e;
}
.deploy-step-icon {
font-size: 18px;
flex-shrink: 0;
width: 28px;
text-align: center;
}
.deploy-step-info {
flex: 1;
min-width: 0;
}
.deploy-step-label {
font-size: 13px;
font-weight: 600;
color: var(--text-primary);
}
.deploy-step-detail {
font-size: 11px;
color: var(--text-tertiary);
font-family: var(--font-mono);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.deploy-progress-bar-wrap {
height: 4px;
background: var(--bg-secondary);
border-radius: 2px;
overflow: hidden;
margin-bottom: 8px;
}
.deploy-progress-bar {
height: 100%;
background: linear-gradient(90deg, var(--accent, #00c8ff), #a78bfa);
border-radius: 2px;
transition: width 400ms ease;
}
.deploy-progress-log {
font-size: 11px;
color: var(--text-tertiary);
font-family: var(--font-mono);
text-align: center;
min-height: 16px;
}
/* 部署模式切换 */
.deploy-mode-toggle {
display: flex;
@@ -1230,6 +1548,549 @@ details.docker-other-section[open] > .docker-other-toggle::before {
font-weight: 600;
}
/* === 移动端响应式 === */
@media (max-width: 768px) {
.dashboard-overview {
grid-template-columns: 1fr;
gap: var(--space-md);
}
.overview-item {
padding: var(--space-sm) var(--space-md);
font-size: 13px;
}
.overview-value {
font-size: 13px;
}
.docker-dialog {
width: 92vw;
max-width: none;
padding: var(--space-lg);
}
.docker-table {
font-size: 12px;
}
.docker-table th,
.docker-table td {
padding: 6px 8px;
}
.gw-option-cards {
grid-template-columns: 1fr;
}
.model-provider-grid {
grid-template-columns: 1fr;
}
.quick-actions {
gap: var(--space-xs);
}
.quick-actions .btn {
font-size: 12px;
padding: 6px 10px;
}
.memory-layout {
grid-template-columns: 1fr;
height: auto;
}
.memory-sidebar {
max-height: 240px;
}
.memory-editor {
min-height: 300px;
}
.clawhub-item {
flex-direction: column;
gap: var(--space-sm);
}
.clawhub-item-actions {
align-self: flex-start;
}
.clawhub-item-actions .btn {
min-height: 34px;
padding: 6px 12px;
}
}
@media (max-width: 480px) {
.overview-item {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
}
/* 容器详情面板 */
.inspect-grid {
display: flex;
flex-direction: column;
gap: var(--space-md);
}
.inspect-section {
background: var(--bg-secondary);
border-radius: var(--radius-md);
padding: var(--space-md);
}
.inspect-section-title {
font-size: 11px;
font-weight: 600;
color: var(--text-tertiary);
text-transform: uppercase;
letter-spacing: .5px;
margin-bottom: var(--space-sm);
}
.inspect-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 0;
font-size: 13px;
}
.inspect-row + .inspect-row {
border-top: 1px solid var(--border-primary);
}
.inspect-label {
color: var(--text-tertiary);
font-size: 12px;
}
.inspect-value {
color: var(--text-primary);
font-weight: 500;
text-align: right;
max-width: 65%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.inspect-value.mono {
font-family: var(--font-mono);
font-size: 12px;
}
.inspect-links {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-sm);
}
.inspect-link-card {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
background: var(--bg-primary);
border: 1px solid var(--border-primary);
border-radius: var(--radius-md);
text-decoration: none;
transition: border-color .15s, box-shadow .15s;
}
.inspect-link-card:hover {
border-color: var(--accent, #00c8ff);
box-shadow: 0 0 0 2px rgba(0,200,255,.1);
}
.inspect-link-icon {
font-size: 22px;
flex-shrink: 0;
}
.inspect-link-text {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.inspect-link-text strong {
font-size: 13px;
color: var(--text-primary);
}
.inspect-link-text span {
font-size: 11px;
color: var(--text-tertiary);
font-family: var(--font-mono);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.inspect-logs {
max-height: 200px;
}
@media (max-width: 768px) {
.inspect-links {
grid-template-columns: 1fr;
}
}
/* === 集群页面 === */
/* 顶部紧凑头 */
.cluster-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-lg);
}
.cluster-header-left {
display: flex;
align-items: center;
gap: var(--space-md);
}
.cluster-title {
font-size: 20px;
font-weight: 700;
margin: 0;
white-space: nowrap;
}
.cluster-stats {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
color: var(--text-secondary);
}
.cluster-stat { display: inline-flex; align-items: center; gap: 4px; }
.cluster-stat .dot {
width: 7px; height: 7px; border-radius: 50%;
background: var(--text-tertiary);
flex-shrink: 0;
}
.cluster-stat .dot.online { background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.cluster-stat-sep { color: var(--text-tertiary); }
.cluster-stat.muted { color: var(--text-tertiary); }
/* 任务中心 */
.task-hub {
border: 1px solid var(--border-primary);
border-radius: var(--radius-lg, 12px);
overflow: hidden;
background: var(--bg-primary);
margin-bottom: var(--space-lg);
}
.task-hub-bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
border-bottom: 1px solid var(--border-primary);
background: var(--bg-secondary);
}
.task-mode {
display: flex;
gap: 2px;
background: var(--bg-primary);
border-radius: var(--radius-md);
padding: 2px;
border: 1px solid var(--border-primary);
}
.task-mode-btn {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 5px 12px;
border: none;
border-radius: calc(var(--radius-md) - 2px);
background: transparent;
color: var(--text-tertiary);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: all .15s;
white-space: nowrap;
}
.task-mode-btn:hover { color: var(--text-primary); background: var(--bg-secondary); }
.task-mode-btn.active {
background: var(--accent, #d97706);
color: white;
font-weight: 600;
}
.task-pick-bar {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-bottom: 1px solid var(--border-primary);
overflow-x: auto;
flex-wrap: wrap;
}
.pick-target {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 3px 10px;
border: 1.5px solid var(--border-primary);
border-radius: 20px;
font-size: 12px;
color: var(--text-secondary);
cursor: pointer;
transition: all .15s;
white-space: nowrap;
}
.pick-target:has(input:checked) {
border-color: var(--pick-color, var(--accent));
background: color-mix(in srgb, var(--pick-color, var(--accent)) 10%, var(--bg-primary));
color: var(--pick-color, var(--accent));
font-weight: 600;
}
.pick-target input { display: none; }
.pick-dot {
width: 6px; height: 6px; border-radius: 50%;
flex-shrink: 0; opacity: .6;
}
.pick-target:has(input:checked) .pick-dot { opacity: 1; box-shadow: 0 0 4px var(--pick-color); }
.task-input-row {
display: flex;
gap: 0;
align-items: flex-end;
}
.task-input {
flex: 1;
resize: none;
border: none;
padding: 12px 16px;
font-size: 14px;
font-family: inherit;
line-height: 1.5;
color: var(--text-primary);
background: transparent;
min-height: 48px;
max-height: 120px;
box-sizing: border-box;
}
.task-input:focus { outline: none; }
.task-input::placeholder { color: var(--text-tertiary); }
.task-send-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 48px;
height: 48px;
border: none;
background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
color: white;
cursor: pointer;
transition: all .15s;
flex-shrink: 0;
border-radius: 0;
}
.task-send-btn:hover:not(:disabled) {
background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}
.task-send-btn:disabled { opacity: .35; pointer-events: none; }
/* 任务结果 */
.task-results {
margin-bottom: var(--space-lg);
border: 1px solid var(--border-primary);
border-radius: var(--radius-lg, 12px);
overflow: hidden;
background: var(--bg-primary);
}
.task-results:empty { display: none; }
.task-results-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
font-size: 13px;
font-weight: 600;
color: var(--text-secondary);
background: var(--bg-secondary);
border-bottom: 1px solid var(--border-primary);
}
.task-results-mode {
font-size: 11px;
font-weight: 500;
color: var(--text-tertiary);
background: var(--bg-primary);
padding: 2px 8px;
border-radius: 10px;
border: 1px solid var(--border-primary);
}
.task-results-grid {
display: flex;
flex-direction: column;
}
.task-result-card {
border-bottom: 1px solid var(--border-primary);
}
.task-result-card:last-child { border-bottom: none; }
.task-result-header {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 14px;
background: var(--bg-secondary);
}
.task-result-name {
font-size: 12px;
font-weight: 600;
color: var(--text-primary);
font-family: var(--font-mono);
}
.task-result-status {
margin-left: auto;
font-size: 11px;
display: inline-flex;
align-items: center;
gap: 4px;
padding: 1px 6px;
border-radius: 8px;
}
.task-result-status.pending { color: var(--text-tertiary); }
.task-result-status.running { color: #f59e0b; }
.task-result-status.done { color: #22c55e; }
.task-result-status.error { color: #ef4444; }
.task-result-body {
padding: 10px 14px;
font-size: 13px;
line-height: 1.7;
color: var(--text-primary);
max-height: 240px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-word;
}
.task-result-body .typing-cursor {
display: inline-block;
width: 2px; height: 14px;
background: var(--primary);
margin-left: 2px;
vertical-align: text-bottom;
animation: cursor-blink .8s step-end infinite;
}
@keyframes cursor-blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
/* 分栏标题 */
.section-bar {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-sm);
}
.section-title {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
}
/* 基础设施摘要 */
.infra-detail {
font-weight: 400;
font-size: 12px;
color: var(--text-tertiary);
margin-left: 4px;
}
/* === 兵种选择器(游戏角色选择 UI === */
.role-selector {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
margin-top: 6px;
}
.role-card {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
padding: 14px 8px 12px;
border: 2px solid var(--border-primary);
border-radius: var(--radius-lg, 12px);
background: var(--bg-primary);
cursor: pointer;
transition: all .2s ease;
text-align: center;
overflow: hidden;
}
.role-card::before {
content: '';
position: absolute;
inset: 0;
background: radial-gradient(ellipse at 50% 0%, var(--role-color, #64748b) 0%, transparent 70%);
opacity: 0;
transition: opacity .3s ease;
pointer-events: none;
}
.role-card:hover {
border-color: color-mix(in srgb, var(--role-color, #64748b) 60%, transparent);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.role-card:hover::before { opacity: .08; }
.role-card.selected {
border-color: var(--role-color, #64748b);
background: color-mix(in srgb, var(--role-color, #64748b) 6%, var(--bg-primary));
box-shadow: 0 0 0 1px var(--role-color, #64748b), 0 4px 16px color-mix(in srgb, var(--role-color) 20%, transparent);
}
.role-card.selected::before { opacity: .12; }
.role-card.selected::after {
content: '';
position: absolute;
top: 6px;
right: 6px;
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--role-color, #64748b);
box-shadow: 0 0 6px var(--role-color, #64748b);
animation: role-pulse 1.5s ease-in-out infinite;
}
@keyframes role-pulse {
0%, 100% { box-shadow: 0 0 4px var(--role-color); opacity: 1; }
50% { box-shadow: 0 0 10px var(--role-color); opacity: .7; }
}
.role-card-badge {
position: relative;
z-index: 1;
line-height: 0;
filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
transition: transform .2s ease;
}
.role-card:hover .role-card-badge { transform: scale(1.1); }
.role-card.selected .role-card-badge { transform: scale(1.15); }
.role-card-title {
position: relative;
z-index: 1;
font-size: 13px;
font-weight: 600;
color: var(--text-primary);
line-height: 1.2;
}
.role-card.selected .role-card-title { color: var(--role-color, #64748b); }
.role-card-desc {
position: relative;
z-index: 1;
font-size: 11px;
color: var(--text-tertiary);
line-height: 1.3;
}
.role-card.selected .role-card-desc { color: var(--text-secondary); }
/* 选中角色信息展示 */
.role-selected-info {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
margin-top: 8px;
border-radius: var(--radius-md);
background: color-mix(in srgb, var(--role-color, #64748b) 8%, var(--bg-secondary));
border: 1px solid color-mix(in srgb, var(--role-color, #64748b) 20%, transparent);
animation: role-info-in .3s ease;
}
@keyframes role-info-in {
from { opacity: 0; transform: translateY(-6px); }
to { opacity: 1; transform: translateY(0); }
}
.role-selected-badge { line-height: 0; flex-shrink: 0; }
.role-selected-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.role-selected-text strong { color: var(--role-color, #64748b); font-weight: 600; }
@media (max-width: 480px) {
.role-selector { grid-template-columns: repeat(2, 1fr); }
}
/* 日志 */
.docker-logs-content {
background: var(--bg-primary);