AgentControlPanel.module.css 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. /* ===== 遮罩层 ===== */
  2. .overlay {
  3. position: fixed;
  4. inset: 0;
  5. background: rgba(0, 0, 0, 0.5);
  6. z-index: 1000;
  7. display: flex;
  8. align-items: center;
  9. justify-content: center;
  10. backdrop-filter: blur(2px);
  11. }
  12. /* ===== 面板主体 ===== */
  13. .panel {
  14. width: 720px;
  15. max-width: 95vw;
  16. max-height: 90vh;
  17. background: #ffffff;
  18. border-radius: 16px;
  19. box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  20. display: flex;
  21. flex-direction: column;
  22. overflow: hidden;
  23. font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  24. }
  25. /* ===== 头部 ===== */
  26. .header {
  27. display: flex;
  28. align-items: center;
  29. justify-content: space-between;
  30. padding: 16px 20px;
  31. border-bottom: 1px solid #f0f0f0;
  32. background: #fafafa;
  33. border-radius: 16px 16px 0 0;
  34. gap: 12px;
  35. }
  36. .headerLeft {
  37. display: flex;
  38. align-items: center;
  39. gap: 10px;
  40. flex: 1;
  41. min-width: 0;
  42. }
  43. .title {
  44. font-size: 16px;
  45. font-weight: 700;
  46. color: #1a1a1a;
  47. white-space: nowrap;
  48. }
  49. .statusDot {
  50. width: 10px;
  51. height: 10px;
  52. border-radius: 50%;
  53. flex-shrink: 0;
  54. }
  55. .statusDot.running {
  56. background: #22c55e;
  57. box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  58. animation: pulse 1.5s infinite;
  59. }
  60. .statusDot.stopped {
  61. background: #f59e0b;
  62. }
  63. .statusDot.completed {
  64. background: #6366f1;
  65. }
  66. .statusDot.failed {
  67. background: #ef4444;
  68. }
  69. .statusDot.unknown {
  70. background: #9ca3af;
  71. }
  72. @keyframes pulse {
  73. 0%,
  74. 100% {
  75. opacity: 1;
  76. }
  77. 50% {
  78. opacity: 0.5;
  79. }
  80. }
  81. .statusBadge {
  82. font-size: 11px;
  83. font-weight: 700;
  84. padding: 2px 8px;
  85. border-radius: 999px;
  86. letter-spacing: 0.05em;
  87. background: #f0f0f0;
  88. color: #555;
  89. }
  90. .badge_running {
  91. background: #dcfce7;
  92. color: #16a34a;
  93. }
  94. .badge_stopped {
  95. background: #fef3c7;
  96. color: #d97706;
  97. }
  98. .badge_completed {
  99. background: #ede9fe;
  100. color: #7c3aed;
  101. }
  102. .badge_failed {
  103. background: #fee2e2;
  104. color: #dc2626;
  105. }
  106. .headerRight {
  107. display: flex;
  108. align-items: center;
  109. gap: 8px;
  110. flex-shrink: 0;
  111. }
  112. .btn {
  113. display: inline-flex;
  114. align-items: center;
  115. gap: 5px;
  116. height: 32px;
  117. padding: 0 14px;
  118. border-radius: 8px;
  119. font-size: 13px;
  120. font-weight: 600;
  121. cursor: pointer;
  122. border: 1.5px solid transparent;
  123. transition: all 0.15s;
  124. white-space: nowrap;
  125. }
  126. .btnPause {
  127. background: #fff7ed;
  128. color: #d97706;
  129. border-color: #d97706;
  130. }
  131. .btnPause:hover:not(:disabled) {
  132. background: #fed7aa;
  133. }
  134. .btnResume {
  135. background: #f0fdf4;
  136. color: #16a34a;
  137. border-color: #16a34a;
  138. }
  139. .btnResume:hover:not(:disabled) {
  140. background: #bbf7d0;
  141. }
  142. .btnStop {
  143. background: #fff1f2;
  144. color: #e11d48;
  145. border-color: #e11d48;
  146. }
  147. .btnStop:hover:not(:disabled) {
  148. background: #fecdd3;
  149. }
  150. .btn:disabled {
  151. opacity: 0.45;
  152. cursor: not-allowed;
  153. }
  154. .closeBtn {
  155. width: 30px;
  156. height: 30px;
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. font-size: 16px;
  161. cursor: pointer;
  162. border: none;
  163. background: transparent;
  164. color: #9ca3af;
  165. border-radius: 6px;
  166. transition: all 0.15s;
  167. }
  168. .closeBtn:hover {
  169. background: #f3f4f6;
  170. color: #374151;
  171. }
  172. /* ===== 控制台日志区 ===== */
  173. .logSection {
  174. flex: 1;
  175. display: flex;
  176. flex-direction: column;
  177. min-height: 0;
  178. padding: 12px 20px 8px;
  179. }
  180. .logHeader {
  181. display: flex;
  182. justify-content: space-between;
  183. align-items: center;
  184. padding: 8px 16px;
  185. background: #1e293b;
  186. border-bottom: 1px solid #334155;
  187. }
  188. .tabs {
  189. display: flex;
  190. gap: 16px;
  191. }
  192. .tabItem {
  193. background: transparent;
  194. border: none;
  195. color: #94a3b8;
  196. font-size: 13px;
  197. font-weight: 500;
  198. cursor: pointer;
  199. padding: 4px 0;
  200. position: relative;
  201. display: flex;
  202. align-items: center;
  203. gap: 6px;
  204. }
  205. .tabActive {
  206. color: #f8fafc;
  207. }
  208. .tabActive::after {
  209. content: "";
  210. position: absolute;
  211. bottom: -8px;
  212. left: 0;
  213. right: 0;
  214. height: 2px;
  215. background: #3b82f6;
  216. }
  217. .dot {
  218. width: 6px;
  219. height: 6px;
  220. border-radius: 50%;
  221. }
  222. .dotOk {
  223. background: #10b981;
  224. }
  225. .dotOff {
  226. background: #ef4444;
  227. }
  228. .logLabel {
  229. font-size: 12px;
  230. font-weight: 600;
  231. color: #94a3b8;
  232. letter-spacing: 0.05em;
  233. text-transform: uppercase;
  234. }
  235. .traceIdLabel {
  236. font-size: 11px;
  237. color: #94a3b8;
  238. font-family: "SF Mono", "Fira Code", monospace;
  239. }
  240. .logContainer {
  241. flex: 1;
  242. overflow-y: auto;
  243. padding: 12px;
  244. background: #0f172a;
  245. font-family:
  246. "JetBrains Mono",
  247. "Fira Code",
  248. "Menlo",
  249. monospace;
  250. font-size: 13px;
  251. line-height: 1.6;
  252. }
  253. .logContainerBackend {
  254. background: #000;
  255. }
  256. .logLine {
  257. display: flex;
  258. gap: 8px;
  259. margin-bottom: 4px;
  260. word-break: break-all;
  261. }
  262. .backendLogLine {
  263. display: flex;
  264. gap: 10px;
  265. margin-bottom: 2px;
  266. }
  267. .logTime {
  268. color: #475569;
  269. flex-shrink: 0;
  270. }
  271. .logTag {
  272. font-weight: 700;
  273. flex-shrink: 0;
  274. }
  275. .logText {
  276. color: #cbd5e1;
  277. word-break: break-all;
  278. }
  279. .log_system .logTag {
  280. color: #60a5fa;
  281. }
  282. .log_system .logText {
  283. color: #94a3b8;
  284. font-style: italic;
  285. }
  286. .log_agent .logTag {
  287. color: #34d399;
  288. }
  289. .log_agent .logText {
  290. color: #d1fae5;
  291. }
  292. .log_tool .logTag {
  293. color: #f59e0b;
  294. }
  295. .log_tool .logText {
  296. color: #fde68a;
  297. }
  298. .log_result .logTag {
  299. color: #a78bfa;
  300. }
  301. .log_result .logText {
  302. color: #ddd6fe;
  303. }
  304. .log_error .logTag {
  305. color: #f87171;
  306. }
  307. .log_error .logText {
  308. color: #fca5a5;
  309. }
  310. .log_warn .logTag {
  311. color: #fb923c;
  312. }
  313. .log_warn .logText {
  314. color: #fed7aa;
  315. }
  316. /* ===== 操作按钮区 ===== */
  317. .actionSection {
  318. display: grid;
  319. grid-template-columns: 1fr 1fr;
  320. gap: 10px;
  321. padding: 10px 20px;
  322. }
  323. .actionCard {
  324. display: flex;
  325. flex-direction: column;
  326. align-items: center;
  327. justify-content: center;
  328. gap: 6px;
  329. padding: 14px;
  330. background: #f8f7ff;
  331. border: 1.5px solid #e0e7ff;
  332. border-radius: 12px;
  333. cursor: pointer;
  334. transition: all 0.15s;
  335. font-size: 13px;
  336. font-weight: 600;
  337. color: #4338ca;
  338. }
  339. .actionCard:hover:not(:disabled) {
  340. background: #ede9fe;
  341. border-color: #c4b5fd;
  342. }
  343. .actionCard:disabled {
  344. opacity: 0.4;
  345. cursor: not-allowed;
  346. background: #f9fafb;
  347. border-color: #e5e7eb;
  348. color: #9ca3af;
  349. }
  350. .actionCard.actionCardActive {
  351. background: #ede9fe;
  352. border-color: #a78bfa;
  353. }
  354. .actionIcon {
  355. font-size: 22px;
  356. line-height: 1;
  357. }
  358. .actionLabel {
  359. font-size: 13px;
  360. }
  361. /* ===== 干预消息输入区 ===== */
  362. .interventionSection {
  363. display: flex;
  364. gap: 10px;
  365. padding: 8px 20px 14px;
  366. align-items: flex-end;
  367. }
  368. .interventionInput {
  369. flex: 1;
  370. padding: 10px 14px;
  371. border: 1.5px solid #e2e8f0;
  372. border-radius: 10px;
  373. font-size: 13px;
  374. resize: none;
  375. outline: none;
  376. font-family: inherit;
  377. line-height: 1.5;
  378. color: #1e293b;
  379. background: #f8fafc;
  380. transition: border-color 0.15s;
  381. min-height: 60px;
  382. }
  383. .interventionInput:focus {
  384. border-color: #6366f1;
  385. background: #fff;
  386. }
  387. .interventionInput::placeholder {
  388. color: #94a3b8;
  389. }
  390. .submitBtn {
  391. height: 40px;
  392. padding: 0 18px;
  393. background: #4f46e5;
  394. color: white;
  395. border: none;
  396. border-radius: 8px;
  397. font-size: 13px;
  398. font-weight: 600;
  399. cursor: pointer;
  400. flex-shrink: 0;
  401. transition: all 0.15s;
  402. }
  403. .submitBtn:hover:not(:disabled) {
  404. background: #4338ca;
  405. }
  406. .submitBtn:disabled {
  407. opacity: 0.4;
  408. cursor: not-allowed;
  409. }
  410. /* ===== 底部状态栏 ===== */
  411. .footer {
  412. display: flex;
  413. align-items: center;
  414. gap: 16px;
  415. padding: 8px 20px;
  416. border-top: 1px solid #f0f0f0;
  417. background: #fafafa;
  418. font-size: 12px;
  419. color: #64748b;
  420. border-radius: 0 0 16px 16px;
  421. }
  422. .wsStatus {
  423. margin-left: auto;
  424. font-weight: 500;
  425. }
  426. .wsOk {
  427. color: #16a34a;
  428. }
  429. .wsOff {
  430. color: #9ca3af;
  431. }