larxius commited on
Commit
47b7657
·
verified ·
1 Parent(s): 5187fdc

Update frontend/src/pages/Dashboard.jsx

Browse files
Files changed (1) hide show
  1. frontend/src/pages/Dashboard.jsx +21 -17
frontend/src/pages/Dashboard.jsx CHANGED
@@ -385,21 +385,22 @@ export const Dashboard = () => {
385
 
386
  return (
387
  <div className="w-full bg-[#020617] border border-[#1e293b] rounded-xl overflow-hidden shadow-2xl">
388
- <div className="bg-[#0f172a] px-md py-sm border-b border-[#1e293b] flex flex-wrap items-center justify-between gap-sm">
389
- <div className="flex items-center gap-sm">
390
- <span className="relative flex h-3 w-3">
391
- <span className={`animate-ping absolute inline-flex h-full w-full rounded-full ${activeScan.status === 'scanning' ? 'bg-red-400' : 'bg-yellow-400'} opacity-75`}></span>
392
- <span className={`relative inline-flex rounded-full h-3 w-3 ${activeScan.status === 'scanning' ? 'bg-red-500' : 'bg-yellow-500'}`}></span>
393
- </span>
394
- <span className="font-label-md text-label-md text-white font-bold tracking-tight ml-1">
395
- LIVE AUDIT — {activeScan.target_url}
396
- </span>
397
- </div>
 
 
398
 
399
- <div className="flex items-center gap-sm flex-wrap">
400
- {/* Interactive Scan Tabs when multiple scans are active or queued */}
401
  {runningScansList.length > 1 && (
402
- <div className="flex items-center gap-1 bg-[#020617] p-1 rounded-lg border border-[#1e293b]">
403
  {runningScansList.map((s) => {
404
  const isSelected = activeScan.id === s.id;
405
  const domainName = getCleanDomain(s.target_url);
@@ -414,7 +415,7 @@ export const Dashboard = () => {
414
  startLogPolling(s);
415
  }
416
  }}
417
- className={`px-2.5 py-1 rounded text-xs font-mono transition-all flex items-center gap-1.5 cursor-pointer ${
418
  isSelected
419
  ? 'bg-sky-500/20 text-sky-300 border border-sky-500/40 font-semibold shadow-sm shadow-sky-500/20'
420
  : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800/80 border border-transparent'
@@ -431,8 +432,11 @@ export const Dashboard = () => {
431
  })}
432
  </div>
433
  )}
 
434
 
435
- <span className="font-label-sm text-label-sm text-slate-400 bg-slate-800 px-sm py-[2px] rounded uppercase">
 
 
436
  {activeScan.scan_type} Scan
437
  </span>
438
 
@@ -449,7 +453,7 @@ export const Dashboard = () => {
449
  startLogPolling(nextTarget);
450
  }
451
  }}
452
- className="font-label-sm text-label-sm text-sky-400 bg-sky-950/40 border border-sky-800/60 hover:bg-sky-900/60 hover:border-sky-700 px-sm py-[2px] rounded uppercase cursor-pointer transition-colors flex items-center gap-1 group"
453
  title="Click to view next queued scan in audit terminal"
454
  >
455
  <span>+{runningScansList.filter(s => s.id !== activeScan.id).length} Queued Next</span>
@@ -457,7 +461,7 @@ export const Dashboard = () => {
457
  </button>
458
  )}
459
 
460
- <span className={`font-label-sm text-label-sm ${activeScan.status === 'scanning' ? 'text-yellow-400 bg-yellow-400/10 border-yellow-400/20' : 'text-sky-400 bg-sky-400/10 border-sky-400/20'} border px-sm py-[2px] rounded uppercase animate-pulse`}>
461
  ● {activeScan.status === 'scanning' ? 'Running' : 'Queued'}
462
  </span>
463
  </div>
 
385
 
386
  return (
387
  <div className="w-full bg-[#020617] border border-[#1e293b] rounded-xl overflow-hidden shadow-2xl">
388
+ <div className="bg-[#0f172a] px-md py-sm border-b border-[#1e293b] flex items-center justify-between gap-sm min-w-0">
389
+ {/* Left Section: Live Audit Title + Scrollable Scan Tabs */}
390
+ <div className="flex items-center gap-sm min-w-0 flex-1 overflow-hidden">
391
+ <div className="flex items-center gap-sm shrink-0">
392
+ <span className="relative flex h-3 w-3">
393
+ <span className={`animate-ping absolute inline-flex h-full w-full rounded-full ${activeScan.status === 'scanning' ? 'bg-red-400' : 'bg-yellow-400'} opacity-75`}></span>
394
+ <span className={`relative inline-flex rounded-full h-3 w-3 ${activeScan.status === 'scanning' ? 'bg-red-500' : 'bg-yellow-500'}`}></span>
395
+ </span>
396
+ <span className="font-label-md text-label-md text-white font-bold tracking-tight ml-1 whitespace-nowrap">
397
+ LIVE AUDIT — {activeScan.target_url}
398
+ </span>
399
+ </div>
400
 
401
+ {/* Interactive Scan Tabs when multiple scans are active or queued (Scrollable horizontally) */}
 
402
  {runningScansList.length > 1 && (
403
+ <div className="flex items-center gap-1 bg-[#020617] p-1 rounded-lg border border-[#1e293b] overflow-x-auto scrollbar-none shrink min-w-0 max-w-full">
404
  {runningScansList.map((s) => {
405
  const isSelected = activeScan.id === s.id;
406
  const domainName = getCleanDomain(s.target_url);
 
415
  startLogPolling(s);
416
  }
417
  }}
418
+ className={`px-2.5 py-1 rounded text-xs font-mono transition-all flex items-center gap-1.5 cursor-pointer shrink-0 whitespace-nowrap ${
419
  isSelected
420
  ? 'bg-sky-500/20 text-sky-300 border border-sky-500/40 font-semibold shadow-sm shadow-sky-500/20'
421
  : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800/80 border border-transparent'
 
432
  })}
433
  </div>
434
  )}
435
+ </div>
436
 
437
+ {/* Right Section: QUICK SCAN, +N QUEUED NEXT, ● RUNNING (Pinned strictly to the right side) */}
438
+ <div className="flex items-center gap-xs md:gap-sm shrink-0 ml-auto">
439
+ <span className="font-label-sm text-label-sm text-slate-400 bg-slate-800 px-sm py-[2px] rounded uppercase shrink-0 whitespace-nowrap">
440
  {activeScan.scan_type} Scan
441
  </span>
442
 
 
453
  startLogPolling(nextTarget);
454
  }
455
  }}
456
+ className="font-label-sm text-label-sm text-sky-400 bg-sky-950/40 border border-sky-800/60 hover:bg-sky-900/60 hover:border-sky-700 px-sm py-[2px] rounded uppercase cursor-pointer transition-colors flex items-center gap-1 group shrink-0 whitespace-nowrap"
457
  title="Click to view next queued scan in audit terminal"
458
  >
459
  <span>+{runningScansList.filter(s => s.id !== activeScan.id).length} Queued Next</span>
 
461
  </button>
462
  )}
463
 
464
+ <span className={`font-label-sm text-label-sm ${activeScan.status === 'scanning' ? 'text-yellow-400 bg-yellow-400/10 border-yellow-400/20' : 'text-sky-400 bg-sky-400/10 border-sky-400/20'} border px-sm py-[2px] rounded uppercase animate-pulse shrink-0 whitespace-nowrap`}>
465
  ● {activeScan.status === 'scanning' ? 'Running' : 'Queued'}
466
  </span>
467
  </div>