Spaces:
Sleeping
Sleeping
Update web_ui.py
Browse files
web_ui.py
CHANGED
|
@@ -20,7 +20,7 @@ def analyze_cve_handler(cve_input, progress=gr.Progress()):
|
|
| 20 |
if not cve_input.strip():
|
| 21 |
return "Please enter a CVE ID", ""
|
| 22 |
|
| 23 |
-
#
|
| 24 |
progress(0.1, desc="Processing CVE ID format...")
|
| 25 |
time.sleep(0.5) # Small delay to show progress
|
| 26 |
|
|
@@ -30,7 +30,7 @@ def analyze_cve_handler(cve_input, progress=gr.Progress()):
|
|
| 30 |
if '-' in cve_id and len(cve_id.split('-')) == 2:
|
| 31 |
cve_id = f"CVE-{cve_id}"
|
| 32 |
|
| 33 |
-
#
|
| 34 |
progress(0.2, desc="Validating CVE format...")
|
| 35 |
time.sleep(0.3)
|
| 36 |
|
|
@@ -38,7 +38,7 @@ def analyze_cve_handler(cve_input, progress=gr.Progress()):
|
|
| 38 |
return f"Invalid CVE format: {cve_id}", ""
|
| 39 |
|
| 40 |
try:
|
| 41 |
-
#
|
| 42 |
progress(0.3, desc="Checking local cache...")
|
| 43 |
time.sleep(0.5)
|
| 44 |
|
|
@@ -65,7 +65,7 @@ def analyze_cve_handler(cve_input, progress=gr.Progress()):
|
|
| 65 |
progress(0.8, desc="Saving analysis results...")
|
| 66 |
time.sleep(0.5)
|
| 67 |
|
| 68 |
-
#
|
| 69 |
progress(0.9, desc="Formatting results...")
|
| 70 |
time.sleep(0.3)
|
| 71 |
|
|
@@ -142,7 +142,7 @@ def search_handler(keyword, progress=gr.Progress()):
|
|
| 142 |
except Exception as e:
|
| 143 |
return f"Search failed: {str(e)}"
|
| 144 |
|
| 145 |
-
# Main interface
|
| 146 |
with gr.Blocks(title="CVE Analysis Agent", theme=gr.themes.Default(primary_hue="violet")) as interface:
|
| 147 |
|
| 148 |
with gr.Column():
|
|
@@ -194,7 +194,7 @@ with gr.Blocks(title="CVE Analysis Agent", theme=gr.themes.Default(primary_hue="
|
|
| 194 |
# AI Analysis below
|
| 195 |
ai_output = gr.Markdown(
|
| 196 |
label="AI Security Analysis",
|
| 197 |
-
value="*AI-generated security analysis will appear here
|
| 198 |
)
|
| 199 |
|
| 200 |
# Search section
|
|
|
|
| 20 |
if not cve_input.strip():
|
| 21 |
return "Please enter a CVE ID", ""
|
| 22 |
|
| 23 |
+
# Input processing
|
| 24 |
progress(0.1, desc="Processing CVE ID format...")
|
| 25 |
time.sleep(0.5) # Small delay to show progress
|
| 26 |
|
|
|
|
| 30 |
if '-' in cve_id and len(cve_id.split('-')) == 2:
|
| 31 |
cve_id = f"CVE-{cve_id}"
|
| 32 |
|
| 33 |
+
# Format validation
|
| 34 |
progress(0.2, desc="Validating CVE format...")
|
| 35 |
time.sleep(0.3)
|
| 36 |
|
|
|
|
| 38 |
return f"Invalid CVE format: {cve_id}", ""
|
| 39 |
|
| 40 |
try:
|
| 41 |
+
# Check cache
|
| 42 |
progress(0.3, desc="Checking local cache...")
|
| 43 |
time.sleep(0.5)
|
| 44 |
|
|
|
|
| 65 |
progress(0.8, desc="Saving analysis results...")
|
| 66 |
time.sleep(0.5)
|
| 67 |
|
| 68 |
+
# Format results
|
| 69 |
progress(0.9, desc="Formatting results...")
|
| 70 |
time.sleep(0.3)
|
| 71 |
|
|
|
|
| 142 |
except Exception as e:
|
| 143 |
return f"Search failed: {str(e)}"
|
| 144 |
|
| 145 |
+
# Main interface
|
| 146 |
with gr.Blocks(title="CVE Analysis Agent", theme=gr.themes.Default(primary_hue="violet")) as interface:
|
| 147 |
|
| 148 |
with gr.Column():
|
|
|
|
| 194 |
# AI Analysis below
|
| 195 |
ai_output = gr.Markdown(
|
| 196 |
label="AI Security Analysis",
|
| 197 |
+
value="*AI-generated security analysis will appear here*"
|
| 198 |
)
|
| 199 |
|
| 200 |
# Search section
|