logs.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. // 全局变量定义
  2. $primary-color: #165DFF;
  3. $secondary-color: #6B7280;
  4. $success-color: #00B42A;
  5. $warning-color: #FFAA00;
  6. $error-color: #F53F3F;
  7. $text-primary: #333333;
  8. $text-secondary: #666666;
  9. $text-tertiary: #999999;
  10. $border-color: #E5E7EB;
  11. $bg-light: #F9FAFB;
  12. $bg-white: #FFFFFF;
  13. $shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  14. $shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  15. $shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  16. // 主容器
  17. .logs {
  18. padding: 24px;
  19. min-height: 100vh;
  20. background-color: $bg-light;
  21. }
  22. // 页面标题区域
  23. .page-header {
  24. display: flex;
  25. flex-direction: column;
  26. margin-bottom: 24px;
  27. padding-bottom: 16px;
  28. border-bottom: 1px solid $border-color;
  29. .page-title {
  30. font-size: 24px;
  31. font-weight: 600;
  32. color: $text-primary;
  33. margin: 0 0 4px 0;
  34. }
  35. .page-description {
  36. font-size: 14px;
  37. color: $text-tertiary;
  38. margin: 0;
  39. }
  40. }
  41. // 搜索区域
  42. .search-filter-section {
  43. margin-bottom: 24px;
  44. .search-input-wrapper {
  45. position: relative;
  46. display: flex;
  47. align-items: center;
  48. background-color: $bg-white;
  49. border-radius: 8px;
  50. box-shadow: $shadow-sm;
  51. overflow: hidden;
  52. .search-icon {
  53. position: absolute;
  54. left: 16px;
  55. color: $text-tertiary;
  56. z-index: 1;
  57. }
  58. .search-input {
  59. flex: 1;
  60. padding: 12px 16px 12px 48px;
  61. border: none;
  62. background-color: transparent;
  63. font-size: 14px;
  64. color: $text-primary;
  65. outline: none;
  66. &::placeholder {
  67. color: $text-tertiary;
  68. }
  69. }
  70. .clear-search-btn,
  71. .search-btn {
  72. padding: 12px 16px;
  73. color: $text-secondary;
  74. min-width: auto;
  75. &:hover {
  76. background-color: $bg-light;
  77. color: $text-primary;
  78. }
  79. }
  80. }
  81. }
  82. // 高级筛选区域
  83. .advanced-filters {
  84. background-color: $bg-white;
  85. border-radius: 12px;
  86. padding: 24px;
  87. box-shadow: $shadow-sm;
  88. margin-bottom: 24px;
  89. .filter-grid {
  90. display: grid;
  91. grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  92. gap: 20px;
  93. margin-bottom: 20px;
  94. .filter-item {
  95. .filter-field {
  96. width: 100%;
  97. .mat-form-field-wrapper {
  98. .mat-form-field-flex {
  99. border-radius: 6px;
  100. }
  101. .mat-form-field-outline {
  102. border-radius: 6px;
  103. }
  104. .mat-form-field-infix {
  105. padding: 8px 0;
  106. .mat-input-element {
  107. font-size: 14px;
  108. color: $text-primary;
  109. }
  110. }
  111. .mat-form-field-label {
  112. font-size: 14px;
  113. color: $text-secondary;
  114. }
  115. .mat-form-field-suffix {
  116. .mat-icon {
  117. color: $text-tertiary;
  118. }
  119. }
  120. }
  121. }
  122. }
  123. }
  124. .date-range-filter {
  125. display: flex;
  126. gap: 20px;
  127. margin-bottom: 20px;
  128. flex-wrap: wrap;
  129. .date-filter-item {
  130. .date-field {
  131. width: 200px;
  132. .mat-form-field-wrapper {
  133. .mat-form-field-flex {
  134. border-radius: 6px;
  135. }
  136. .mat-form-field-outline {
  137. border-radius: 6px;
  138. }
  139. .mat-form-field-infix {
  140. padding: 8px 0;
  141. .mat-input-element {
  142. font-size: 14px;
  143. color: $text-primary;
  144. }
  145. }
  146. .mat-form-field-label {
  147. font-size: 14px;
  148. color: $text-secondary;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. .filter-actions {
  155. display: flex;
  156. gap: 12px;
  157. justify-content: flex-end;
  158. .clear-btn,
  159. .expand-btn {
  160. display: flex;
  161. align-items: center;
  162. gap: 6px;
  163. padding: 8px 16px;
  164. font-size: 14px;
  165. color: $text-secondary;
  166. border: 1px solid $border-color;
  167. border-radius: 6px;
  168. background-color: $bg-white;
  169. transition: all 0.2s ease;
  170. &:hover {
  171. background-color: $bg-light;
  172. border-color: $text-tertiary;
  173. color: $text-primary;
  174. }
  175. }
  176. }
  177. }
  178. // 操作按钮区域
  179. .log-actions {
  180. display: flex;
  181. justify-content: space-between;
  182. align-items: center;
  183. margin-bottom: 24px;
  184. flex-wrap: wrap;
  185. gap: 16px;
  186. .logs-summary {
  187. font-size: 14px;
  188. color: $text-secondary;
  189. .highlight {
  190. font-weight: 600;
  191. color: $primary-color;
  192. }
  193. }
  194. .action-buttons {
  195. display: flex;
  196. gap: 12px;
  197. .export-btn {
  198. display: flex;
  199. align-items: center;
  200. gap: 8px;
  201. padding: 10px 20px;
  202. font-size: 14px;
  203. font-weight: 500;
  204. background-color: $primary-color;
  205. color: $bg-white;
  206. border-radius: 6px;
  207. transition: all 0.2s ease;
  208. box-shadow: $shadow-sm;
  209. &:hover:not(:disabled) {
  210. background-color: #0E4BD8;
  211. box-shadow: $shadow-md;
  212. transform: translateY(-1px);
  213. }
  214. &:disabled {
  215. opacity: 0.5;
  216. cursor: not-allowed;
  217. transform: none;
  218. box-shadow: none;
  219. }
  220. }
  221. }
  222. }
  223. // 日志表格容器
  224. .logs-table-container {
  225. background-color: $bg-white;
  226. border-radius: 12px;
  227. box-shadow: $shadow-sm;
  228. overflow: hidden;
  229. margin-bottom: 24px;
  230. .logs-table {
  231. width: 100%;
  232. border-collapse: collapse;
  233. .table-header {
  234. background-color: $bg-light;
  235. font-weight: 600;
  236. color: $text-secondary;
  237. font-size: 13px;
  238. text-align: left;
  239. padding: 14px 16px;
  240. border-bottom: 1px solid $border-color;
  241. cursor: pointer;
  242. transition: background-color 0.2s ease;
  243. &:hover {
  244. background-color: #F3F4F6;
  245. }
  246. .header-content {
  247. display: flex;
  248. align-items: center;
  249. justify-content: space-between;
  250. }
  251. .sort-icon {
  252. opacity: 0.5;
  253. }
  254. }
  255. .table-cell {
  256. padding: 12px 16px;
  257. border-bottom: 1px solid $border-color;
  258. font-size: 13px;
  259. color: $text-primary;
  260. vertical-align: middle;
  261. &.details-cell {
  262. max-width: 300px;
  263. .details-content {
  264. white-space: nowrap;
  265. overflow: hidden;
  266. text-overflow: ellipsis;
  267. }
  268. }
  269. .status-badge {
  270. display: flex;
  271. align-items: center;
  272. gap: 6px;
  273. padding: 4px 12px;
  274. border-radius: 16px;
  275. font-size: 12px;
  276. font-weight: 500;
  277. color: $bg-white;
  278. text-align: center;
  279. white-space: nowrap;
  280. .status-icon {
  281. font-size: 14px;
  282. }
  283. }
  284. .user-info {
  285. .user-name {
  286. font-weight: 500;
  287. }
  288. }
  289. .action-badge,
  290. .resource-badge {
  291. display: inline-block;
  292. padding: 4px 12px;
  293. border-radius: 16px;
  294. font-size: 12px;
  295. font-weight: 500;
  296. background-color: #E6F0FF;
  297. color: $primary-color;
  298. white-space: nowrap;
  299. }
  300. .ip-address {
  301. font-family: 'Courier New', monospace;
  302. color: $text-secondary;
  303. }
  304. }
  305. tr:last-child .table-cell {
  306. border-bottom: none;
  307. }
  308. tr:hover .table-cell {
  309. background-color: $bg-light;
  310. }
  311. }
  312. // 无数据状态
  313. .empty-state {
  314. display: flex;
  315. flex-direction: column;
  316. align-items: center;
  317. justify-content: center;
  318. padding: 80px 20px;
  319. text-align: center;
  320. svg {
  321. margin-bottom: 16px;
  322. opacity: 0.5;
  323. }
  324. p {
  325. font-size: 16px;
  326. color: $text-tertiary;
  327. margin-bottom: 24px;
  328. }
  329. button {
  330. border-radius: 8px;
  331. padding: 8px 24px;
  332. font-size: 14px;
  333. font-weight: 500;
  334. }
  335. }
  336. }
  337. // 分页控件
  338. .pagination-controls {
  339. display: flex;
  340. justify-content: space-between;
  341. align-items: center;
  342. padding: 20px;
  343. background-color: $bg-white;
  344. border-radius: 12px;
  345. box-shadow: $shadow-sm;
  346. .pagination-info {
  347. font-size: 14px;
  348. color: $text-tertiary;
  349. }
  350. .pagination-buttons {
  351. display: flex;
  352. align-items: center;
  353. gap: 8px;
  354. button {
  355. padding: 6px 12px;
  356. border-radius: 6px;
  357. font-size: 13px;
  358. font-weight: 500;
  359. transition: all 0.2s ease;
  360. min-width: auto;
  361. &:disabled {
  362. opacity: 0.5;
  363. cursor: not-allowed;
  364. }
  365. &.active {
  366. background-color: $primary-color;
  367. color: $bg-white;
  368. }
  369. }
  370. .page-numbers {
  371. display: flex;
  372. gap: 4px;
  373. }
  374. }
  375. }
  376. // 日志统计卡片
  377. .log-stats-cards {
  378. display: grid;
  379. grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  380. gap: 20px;
  381. margin-top: 32px;
  382. .stat-card {
  383. display: flex;
  384. align-items: center;
  385. gap: 16px;
  386. background-color: $bg-white;
  387. border-radius: 12px;
  388. padding: 24px;
  389. box-shadow: $shadow-sm;
  390. transition: all 0.2s ease;
  391. &:hover {
  392. box-shadow: $shadow-md;
  393. transform: translateY(-2px);
  394. }
  395. .stat-icon {
  396. width: 48px;
  397. height: 48px;
  398. border-radius: 12px;
  399. display: flex;
  400. align-items: center;
  401. justify-content: center;
  402. color: $bg-white;
  403. &.primary {
  404. background-color: $primary-color;
  405. }
  406. &.success {
  407. background-color: $success-color;
  408. }
  409. &.error {
  410. background-color: $error-color;
  411. }
  412. &.warning {
  413. background-color: $warning-color;
  414. }
  415. }
  416. .stat-content {
  417. flex: 1;
  418. .stat-value {
  419. font-size: 28px;
  420. font-weight: 700;
  421. color: $text-primary;
  422. margin-bottom: 4px;
  423. }
  424. .stat-label {
  425. font-size: 14px;
  426. color: $text-tertiary;
  427. }
  428. }
  429. }
  430. }
  431. // 响应式设计
  432. @media (max-width: 1200px) {
  433. .logs-table {
  434. .table-header,
  435. .table-cell {
  436. padding: 12px;
  437. }
  438. }
  439. .date-range-filter {
  440. flex-direction: column;
  441. gap: 16px !important;
  442. .date-field {
  443. width: 100% !important;
  444. }
  445. }
  446. }
  447. @media (max-width: 992px) {
  448. .logs {
  449. padding: 16px;
  450. }
  451. .filter-grid {
  452. grid-template-columns: 1fr !important;
  453. }
  454. .logs-table-container {
  455. overflow-x: auto;
  456. }
  457. .pagination-controls {
  458. flex-direction: column;
  459. gap: 16px;
  460. .pagination-buttons {
  461. flex-wrap: wrap;
  462. justify-content: center;
  463. }
  464. }
  465. .log-stats-cards {
  466. grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  467. }
  468. }
  469. @media (max-width: 768px) {
  470. .advanced-filters {
  471. padding: 16px;
  472. }
  473. .log-actions {
  474. flex-direction: column;
  475. align-items: stretch;
  476. gap: 12px;
  477. }
  478. .action-buttons {
  479. justify-content: center;
  480. }
  481. .stat-card {
  482. padding: 20px;
  483. .stat-icon {
  484. width: 40px;
  485. height: 40px;
  486. }
  487. .stat-value {
  488. font-size: 24px;
  489. }
  490. }
  491. }
  492. @media (max-width: 480px) {
  493. .logs {
  494. padding: 12px;
  495. }
  496. .page-title {
  497. font-size: 20px !important;
  498. }
  499. .log-stats-cards {
  500. grid-template-columns: 1fr;
  501. gap: 16px;
  502. }
  503. }
  504. // 滚动条样式
  505. .logs-table-container,
  506. .advanced-filters {
  507. &::-webkit-scrollbar {
  508. width: 6px;
  509. }
  510. &::-webkit-scrollbar-track {
  511. background: $bg-light;
  512. border-radius: 3px;
  513. }
  514. &::-webkit-scrollbar-thumb {
  515. background: $border-color;
  516. border-radius: 3px;
  517. }
  518. &::-webkit-scrollbar-thumb:hover {
  519. background: $text-tertiary;
  520. }
  521. }