Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update frontend/src/pages/NewScan.jsx
Browse files- frontend/src/pages/NewScan.jsx +30 -30
frontend/src/pages/NewScan.jsx
CHANGED
|
@@ -617,19 +617,19 @@ export const NewScan = () => {
|
|
| 617 |
></div>
|
| 618 |
|
| 619 |
{/* Modal Content */}
|
| 620 |
-
<div className="relative bg-white
|
| 621 |
|
| 622 |
{/* Header */}
|
| 623 |
-
<div className="flex items-start justify-between pb-
|
| 624 |
<div className="flex items-center gap-3">
|
| 625 |
-
<div className="w-
|
| 626 |
-
<span className="material-symbols-outlined text-[
|
| 627 |
</div>
|
| 628 |
<div>
|
| 629 |
-
<h3 className="text-
|
| 630 |
Confirm Scan Execution
|
| 631 |
</h3>
|
| 632 |
-
<p className="text-
|
| 633 |
Review target parameters before starting the scan pipeline
|
| 634 |
</p>
|
| 635 |
</div>
|
|
@@ -637,46 +637,46 @@ export const NewScan = () => {
|
|
| 637 |
<button
|
| 638 |
type="button"
|
| 639 |
onClick={() => setShowConfirmModal(false)}
|
| 640 |
-
className="text-slate-400 hover:text-slate-600
|
| 641 |
>
|
| 642 |
-
<span className="material-symbols-outlined text-[
|
| 643 |
</button>
|
| 644 |
</div>
|
| 645 |
|
| 646 |
{/* Target Parameters Card */}
|
| 647 |
-
<div className="my-
|
| 648 |
<div className="flex items-center justify-between">
|
| 649 |
-
<span className="text-slate-500 font-bold uppercase tracking-wider">TARGET URL</span>
|
| 650 |
-
<span className="text-blue-600
|
| 651 |
</div>
|
| 652 |
<div className="flex items-center justify-between">
|
| 653 |
-
<span className="text-slate-500 font-bold uppercase tracking-wider">SCAN INTENSITY</span>
|
| 654 |
-
<span className="px-2.5 py-0.5 rounded-full bg-blue-
|
| 655 |
</div>
|
| 656 |
<div className="flex items-center justify-between">
|
| 657 |
-
<span className="text-slate-500 font-bold uppercase tracking-wider">EXECUTION TYPE</span>
|
| 658 |
-
<span className="text-slate-800
|
| 659 |
</div>
|
| 660 |
</div>
|
| 661 |
|
| 662 |
{/* Confirmation Checkbox & Policy Link */}
|
| 663 |
-
<div className="flex flex-col gap-
|
| 664 |
-
<label className={`flex items-start gap-
|
| 665 |
<input
|
| 666 |
type="checkbox"
|
| 667 |
disabled={!hasReadPolicy}
|
| 668 |
checked={isConfirmedChecked}
|
| 669 |
onChange={(e) => setIsConfirmedChecked(e.target.checked)}
|
| 670 |
-
className="mt-0.5 h-4 w-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500 cursor-pointer disabled:cursor-not-allowed"
|
| 671 |
/>
|
| 672 |
-
<span>
|
| 673 |
-
I confirm that I have <strong>explicit written authorization</strong> to execute active penetration testing against <
|
| 674 |
</span>
|
| 675 |
</label>
|
| 676 |
|
| 677 |
-
<div className="pl-
|
| 678 |
{hasReadPolicy ? (
|
| 679 |
-
<span className="inline-flex items-center gap-1 text-
|
| 680 |
<span className="material-symbols-outlined text-[16px]">check_circle</span>
|
| 681 |
Security Policy Read & Accepted
|
| 682 |
</span>
|
|
@@ -684,7 +684,7 @@ export const NewScan = () => {
|
|
| 684 |
<button
|
| 685 |
type="button"
|
| 686 |
onClick={() => setShowPolicyModal(true)}
|
| 687 |
-
className="text-
|
| 688 |
>
|
| 689 |
Read Security Policy & Authorization Terms
|
| 690 |
</button>
|
|
@@ -692,20 +692,20 @@ export const NewScan = () => {
|
|
| 692 |
</div>
|
| 693 |
</div>
|
| 694 |
|
| 695 |
-
{/* Warning Box */}
|
| 696 |
-
<div className="p-
|
| 697 |
-
<span className="material-symbols-outlined text-
|
| 698 |
<div>
|
| 699 |
-
Are you sure you want to run this scan on <strong className="
|
| 700 |
</div>
|
| 701 |
</div>
|
| 702 |
|
| 703 |
{/* Action Buttons */}
|
| 704 |
-
<div className="flex items-center justify-end gap-3 pt-3 border-t border-slate-100
|
| 705 |
<button
|
| 706 |
type="button"
|
| 707 |
onClick={() => setShowConfirmModal(false)}
|
| 708 |
-
className="px-
|
| 709 |
>
|
| 710 |
No, Cancel
|
| 711 |
</button>
|
|
@@ -713,7 +713,7 @@ export const NewScan = () => {
|
|
| 713 |
type="button"
|
| 714 |
disabled={!hasReadPolicy || !isConfirmedChecked || loading}
|
| 715 |
onClick={executeScan}
|
| 716 |
-
className="px-
|
| 717 |
>
|
| 718 |
<span className="material-symbols-outlined text-[16px]">play_circle</span>
|
| 719 |
<span>{loading ? "Initiating..." : "Yes, Start Scan"}</span>
|
|
|
|
| 617 |
></div>
|
| 618 |
|
| 619 |
{/* Modal Content */}
|
| 620 |
+
<div className="relative bg-white rounded-2xl border border-slate-200 shadow-2xl max-w-[480px] w-full p-6 overflow-hidden z-10 animate-slide-up text-left font-sans">
|
| 621 |
|
| 622 |
{/* Header */}
|
| 623 |
+
<div className="flex items-start justify-between pb-3.5 border-b border-slate-100">
|
| 624 |
<div className="flex items-center gap-3">
|
| 625 |
+
<div className="w-8 h-8 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center text-sm font-bold shrink-0 shadow-xs">
|
| 626 |
+
<span className="material-symbols-outlined text-[18px]">alternate_email</span>
|
| 627 |
</div>
|
| 628 |
<div>
|
| 629 |
+
<h3 className="text-[17px] font-extrabold text-slate-900 tracking-tight leading-tight">
|
| 630 |
Confirm Scan Execution
|
| 631 |
</h3>
|
| 632 |
+
<p className="text-[12px] font-medium text-slate-500 mt-[2px]">
|
| 633 |
Review target parameters before starting the scan pipeline
|
| 634 |
</p>
|
| 635 |
</div>
|
|
|
|
| 637 |
<button
|
| 638 |
type="button"
|
| 639 |
onClick={() => setShowConfirmModal(false)}
|
| 640 |
+
className="text-slate-400 hover:text-slate-600 transition-colors bg-transparent border-0 cursor-pointer p-1 rounded-full hover:bg-slate-100 flex items-center justify-center"
|
| 641 |
>
|
| 642 |
+
<span className="material-symbols-outlined text-[18px]">close</span>
|
| 643 |
</button>
|
| 644 |
</div>
|
| 645 |
|
| 646 |
{/* Target Parameters Card */}
|
| 647 |
+
<div className="my-4 p-3.5 rounded-xl bg-[#f8fafc] border border-slate-200/80 flex flex-col gap-2.5 text-[12px]">
|
| 648 |
<div className="flex items-center justify-between">
|
| 649 |
+
<span className="text-slate-500 font-bold uppercase tracking-wider text-[11px]">TARGET URL</span>
|
| 650 |
+
<span className="text-blue-600 font-bold font-mono break-all max-w-[280px] text-right">{targetUrl}</span>
|
| 651 |
</div>
|
| 652 |
<div className="flex items-center justify-between">
|
| 653 |
+
<span className="text-slate-500 font-bold uppercase tracking-wider text-[11px]">SCAN INTENSITY</span>
|
| 654 |
+
<span className="px-2.5 py-0.5 rounded-full bg-blue-50 text-blue-600 border border-blue-200 text-[11px] font-bold">{scanType} Scan</span>
|
| 655 |
</div>
|
| 656 |
<div className="flex items-center justify-between">
|
| 657 |
+
<span className="text-slate-500 font-bold uppercase tracking-wider text-[11px]">EXECUTION TYPE</span>
|
| 658 |
+
<span className="text-slate-800 font-semibold">{isScheduled ? 'Scheduled Execution' : 'Immediate Execution'}</span>
|
| 659 |
</div>
|
| 660 |
</div>
|
| 661 |
|
| 662 |
{/* Confirmation Checkbox & Policy Link */}
|
| 663 |
+
<div className="flex flex-col gap-1.5 mb-4">
|
| 664 |
+
<label className={`flex items-start gap-2.5 text-[12px] font-normal text-slate-700 cursor-pointer ${!hasReadPolicy ? 'opacity-60 cursor-not-allowed' : ''}`}>
|
| 665 |
<input
|
| 666 |
type="checkbox"
|
| 667 |
disabled={!hasReadPolicy}
|
| 668 |
checked={isConfirmedChecked}
|
| 669 |
onChange={(e) => setIsConfirmedChecked(e.target.checked)}
|
| 670 |
+
className="mt-0.5 h-4 w-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500 cursor-pointer disabled:cursor-not-allowed shrink-0"
|
| 671 |
/>
|
| 672 |
+
<span className="leading-snug">
|
| 673 |
+
I confirm that I have <strong className="font-extrabold text-slate-900">explicit written authorization</strong> to execute active penetration testing against <strong className="font-extrabold text-slate-900">{targetUrl}</strong>.
|
| 674 |
</span>
|
| 675 |
</label>
|
| 676 |
|
| 677 |
+
<div className="pl-6.5">
|
| 678 |
{hasReadPolicy ? (
|
| 679 |
+
<span className="inline-flex items-center gap-1 text-[12px] font-semibold text-emerald-600">
|
| 680 |
<span className="material-symbols-outlined text-[16px]">check_circle</span>
|
| 681 |
Security Policy Read & Accepted
|
| 682 |
</span>
|
|
|
|
| 684 |
<button
|
| 685 |
type="button"
|
| 686 |
onClick={() => setShowPolicyModal(true)}
|
| 687 |
+
className="text-[12px] font-bold text-blue-600 hover:underline bg-transparent border-0 p-0 cursor-pointer text-left"
|
| 688 |
>
|
| 689 |
Read Security Policy & Authorization Terms
|
| 690 |
</button>
|
|
|
|
| 692 |
</div>
|
| 693 |
</div>
|
| 694 |
|
| 695 |
+
{/* Warning Alert Box */}
|
| 696 |
+
<div className="p-3.5 rounded-xl bg-[#fffbeb] border border-[#fde68a] text-[#b45309] text-[12px] leading-relaxed flex items-start gap-2.5 mb-5">
|
| 697 |
+
<span className="material-symbols-outlined text-[#d97706] text-[18px] shrink-0 mt-0.5">help_outline</span>
|
| 698 |
<div>
|
| 699 |
+
Are you sure you want to run this scan on <strong className="font-bold text-[#92400e]">{targetUrl}?</strong> If you are sure, read the security policy to enable the confirmation box, check it, and click <strong className="font-bold text-[#92400e]">Yes, Start Scan.</strong>
|
| 700 |
</div>
|
| 701 |
</div>
|
| 702 |
|
| 703 |
{/* Action Buttons */}
|
| 704 |
+
<div className="flex items-center justify-end gap-3 pt-3.5 border-t border-slate-100">
|
| 705 |
<button
|
| 706 |
type="button"
|
| 707 |
onClick={() => setShowConfirmModal(false)}
|
| 708 |
+
className="px-4 py-2 rounded-xl text-[12px] font-bold text-slate-700 bg-slate-100 border border-slate-200 hover:bg-slate-200 transition-colors cursor-pointer"
|
| 709 |
>
|
| 710 |
No, Cancel
|
| 711 |
</button>
|
|
|
|
| 713 |
type="button"
|
| 714 |
disabled={!hasReadPolicy || !isConfirmedChecked || loading}
|
| 715 |
onClick={executeScan}
|
| 716 |
+
className="px-4 py-2 rounded-xl text-[12px] font-bold text-white bg-[#6366f1] hover:bg-[#4f46e5] disabled:opacity-40 disabled:cursor-not-allowed transition-all shadow-md shadow-indigo-500/20 flex items-center gap-1.5 cursor-pointer border-0"
|
| 717 |
>
|
| 718 |
<span className="material-symbols-outlined text-[16px]">play_circle</span>
|
| 719 |
<span>{loading ? "Initiating..." : "Yes, Start Scan"}</span>
|