/
h0tnanny
/
IotPlatform
Обзор
Документация
Войти
/
h0tnanny
/
IotPlatform
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
client/src/components/WorkflowEditor/ConsolePanel.module.scss
546 строк
10 KB
h0tnanny
pop-up окно для логов, а также скрытие окна состояние выполнения
09 мар 2026, 22:59
09 мар 2026, 22:59
1a449ca
Код
Авторство
О чём код?
.consolePanel { display: flex; flex-direction: column; height: 100%; background: #ffffff; border: 2px solid var(--border-card, #9ca3af); border-radius: 8px; overflow: hidden; .header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #f8f9fa; border-bottom: 1px solid var(--border-color, #e5e7eb); h3 { margin: 0; font-size: 14px; font-weight: 600; color: #111827; display: flex; align-items: center; gap: 8px; svg { width: 16px; height: 16px; color: #6b7280; } } .actions { display: flex; gap: 8px; button { padding: 4px 12px; font-size: 12px; background: #ffffff; color: #374151; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer; transition: all 0.2s; &:hover:not(:disabled) { background: #f3f4f6; color: #111827; border-color: #9ca3af; } &:disabled { opacity: 0.5; cursor: not-allowed; } } } } .logContainer { flex: 1; overflow-y: auto; padding: 8px; font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; line-height: 1.5; background: #ffffff; &::-webkit-scrollbar { width: 8px; } &::-webkit-scrollbar-track { background: #f5f5f5; } &::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; &:hover { background: #9ca3af; } } } .logEntry { padding: 4px 8px; margin-bottom: 2px; border-radius: 4px; display: flex; align-items: flex-start; gap: 8px; transition: background 0.2s; &:hover { background: #f9fafb; } .timestamp { color: #6b7280; font-size: 11px; white-space: nowrap; user-select: none; } .message { flex: 1; word-break: break-word; } &.info { .message { color: #374151; } } &.success { background: rgba(16, 185, 129, 0.08); .message { color: #059669; } } &.warning { background: rgba(245, 158, 11, 0.08); .message { color: #d97706; } } &.error { background: rgba(239, 68, 68, 0.08); .message { color: #dc2626; } } } .emptyState { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #6b7280; text-align: center; padding: 32px; svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.5; color: #9ca3af; } p { margin: 0; font-size: 14px; } } .statusBar { padding: 8px 16px; background: #f8f9fa; border-top: 1px solid var(--border-color, #e5e7eb); font-size: 12px; color: #6b7280; display: flex; align-items: center; justify-content: space-between; .status { display: flex; align-items: center; gap: 8px; .indicator { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; &.running { background: #10b981; animation: pulse 1.5s ease-in-out infinite; } &.idle { background: #9ca3af; } &.error { background: #ef4444; } } } .count { color: #6b7280; } } } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } // ─── Log level badge (используется и в popup) ──────────────────────── .levelBadge { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; padding: 1px 6px; border-radius: 3px; white-space: nowrap; line-height: 1.6; font-family: 'Consolas', 'Monaco', monospace; &[data-level='info'] { background: #e5e7eb; color: #374151; } &[data-level='success'] { background: rgba(16, 185, 129, 0.15); color: #059669; } &[data-level='warning'] { background: rgba(245, 158, 11, 0.15); color: #d97706; } &[data-level='error'] { background: rgba(239, 68, 68, 0.15); color: #dc2626; } } // ─── Popup overlay ─────────────────────────────────────────────────── @keyframes popupFadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes popupSlideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } } .popupOverlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 32px; animation: popupFadeIn 0.2s ease-out; } .popupModal { width: 100%; max-width: 960px; height: 80vh; background: #ffffff; border-radius: 12px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; overflow: hidden; animation: popupSlideUp 0.25s ease-out; .logContainer { flex: 1; overflow-y: auto; padding: 12px 16px; font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; line-height: 1.6; background: #fafafa; &::-webkit-scrollbar { width: 8px; } &::-webkit-scrollbar-track { background: #f0f0f0; } &::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 4px; &:hover { background: #999; } } } .logEntry { padding: 5px 10px; margin-bottom: 2px; border-radius: 4px; display: flex; align-items: flex-start; gap: 10px; transition: background 0.15s; &:hover { background: #f0f1f3; } .timestamp { color: #6b7280; font-size: 12px; white-space: nowrap; user-select: none; min-width: 90px; } .message { flex: 1; word-break: break-word; } &.info .message { color: #374151; } &.success { background: rgba(16, 185, 129, 0.06); .message { color: #059669; } } &.warning { background: rgba(245, 158, 11, 0.06); .message { color: #d97706; } } &.error { background: rgba(239, 68, 68, 0.06); .message { color: #dc2626; } } } .emptyState { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #9ca3af; padding: 48px; svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.4; } p { margin: 0; font-size: 14px; } } } // ─── Popup header ──────────────────────────────────────────────────── .popupHeader { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e5e7eb; background: #f8f9fa; gap: 16px; flex-wrap: wrap; } .popupTitle { display: flex; align-items: center; gap: 10px; svg { color: #6b7280; flex-shrink: 0; } h2 { margin: 0; font-size: 16px; font-weight: 600; color: #111827; white-space: nowrap; } } .popupStats { display: flex; align-items: center; gap: 8px; margin-left: 4px; span { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; } } .statTotal { background: #e5e7eb; color: #4b5563; } .statError { background: rgba(239, 68, 68, 0.12); color: #dc2626; } .statWarning { background: rgba(245, 158, 11, 0.12); color: #d97706; } // ─── Popup actions (фильтры, кнопки) ──────────────────────────────── .popupActions { display: flex; align-items: center; gap: 8px; } .filterGroup { display: flex; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; } .filterBtn { padding: 4px 10px; font-size: 12px; font-weight: 500; border: none; background: #fff; color: #6b7280; cursor: pointer; transition: all 0.15s; white-space: nowrap; &:not(:last-child) { border-right: 1px solid #e5e7eb; } &:hover { background: #f3f4f6; color: #374151; } &.filterActive { background: #111827; color: #fff; &[data-level='error'] { background: #dc2626; } &[data-level='warning'] { background: #d97706; } &[data-level='success'] { background: #059669; } &[data-level='info'] { background: #374151; } } } .popupBtn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; color: #6b7280; cursor: pointer; transition: all 0.15s; &:hover { background: #f3f4f6; color: #374151; border-color: #9ca3af; } } .popupCloseBtn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: none; background: transparent; color: #6b7280; cursor: pointer; transition: all 0.15s; &:hover { background: #fee2e2; color: #dc2626; } } // ─── Popup footer ──────────────────────────────────────────────────── .popupFooter { padding: 10px 20px; border-top: 1px solid #e5e7eb; background: #f8f9fa; font-size: 12px; color: #6b7280; display: flex; align-items: center; justify-content: space-between; }