Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -118,27 +118,13 @@ def generate_html(llm_response):
|
|
| 118 |
|
| 119 |
#print(data) # {'Status': 'COMPLIANT', 'Severity': 'LOW', ...}
|
| 120 |
html = """
|
| 121 |
-
|
| 122 |
-
<div>
|
| 123 |
-
<style>
|
| 124 |
-
table { border-collapse: collapse; width: 100%; font-family: Arial; }
|
| 125 |
-
th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }
|
| 126 |
-
th { background-color: #f2f2f2; font-weight: bold; }
|
| 127 |
-
tr:nth-child(even) { background-color: #f9f9f9; }
|
| 128 |
-
.status-compliant { color: green; font-weight: bold; }
|
| 129 |
-
.status-low { color: orange; }
|
| 130 |
-
.analysis { background-color: #f0f8ff; }
|
| 131 |
-
</style>
|
| 132 |
-
</div>
|
| 133 |
-
|
| 134 |
-
<table>
|
| 135 |
<tr><th>Status</th><td class="status-compliant">{Status}</td></tr>
|
| 136 |
<tr><th>Severity</th><td class="status-low">{Severity}</td></tr>
|
| 137 |
<tr><th>Deviations</th><td>{Deviations}</td></tr>
|
| 138 |
<tr><th>Fix</th><td>{Fix}</td></tr>
|
| 139 |
<tr><th>Analysis</th><td class="analysis">{Analysis}</td></tr>
|
| 140 |
-
|
| 141 |
-
"""
|
| 142 |
return html
|
| 143 |
|
| 144 |
|
|
@@ -203,7 +189,7 @@ def loop_function(df):
|
|
| 203 |
rr = generate_response(manual_rules, proposal_details)
|
| 204 |
rr_html=generate_html(rr)
|
| 205 |
text += rr_html
|
| 206 |
-
text += "<hr>"
|
| 207 |
yield text
|
| 208 |
time.sleep(3)
|
| 209 |
except Exception as e:
|
|
|
|
| 118 |
|
| 119 |
#print(data) # {'Status': 'COMPLIANT', 'Severity': 'LOW', ...}
|
| 120 |
html = """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
<tr><th>Status</th><td class="status-compliant">{Status}</td></tr>
|
| 122 |
<tr><th>Severity</th><td class="status-low">{Severity}</td></tr>
|
| 123 |
<tr><th>Deviations</th><td>{Deviations}</td></tr>
|
| 124 |
<tr><th>Fix</th><td>{Fix}</td></tr>
|
| 125 |
<tr><th>Analysis</th><td class="analysis">{Analysis}</td></tr>
|
| 126 |
+
|
| 127 |
+
""".format(**data)
|
| 128 |
return html
|
| 129 |
|
| 130 |
|
|
|
|
| 189 |
rr = generate_response(manual_rules, proposal_details)
|
| 190 |
rr_html=generate_html(rr)
|
| 191 |
text += rr_html
|
| 192 |
+
text += "</table><hr>"
|
| 193 |
yield text
|
| 194 |
time.sleep(3)
|
| 195 |
except Exception as e:
|