@@ -357,7 +357,7 @@ def exportToHTML(self):
357357 <body>
358358 <h1>AutorizePro Report<h1>
359359 <div class="datagrid"><table>
360- <thead><tr><th width=\" 3%\" >ID</th><th width=\" 5%\" >Method</th><th width=\" 43%\" >URL</th><th width=\" 9%\" >Original length</th><th width=\" 9%\" >Modified length</th><th width=\" 9%\" >Unauthorized length</th><th width=\" 11%\" >Authorization Enforcement Status</th><th width=\" 11%\" >Authorization Unauthenticated Status</th></tr></thead>
360+ <thead><tr><th width=\" 3%\" >ID</th><th width=\" 5%\" >Method</th><th width=\" 43%\" >URL</th><th width=\" 9%\" >Original length</th><th width=\" 9%\" >Modified length</th><th width=\" 9%\" >Unauthorized length</th><th width=\" 11%\" >Authorization Enforcement Status</th><th width=\" 11%\" >Authorization Unauthenticated Status</th><th width= \" 11% \" >AI Analysis Result</th>< /tr></thead>
361361 <tbody>"""
362362 unique_HTML_lines = set () # 用于存储唯一值
363363 entries_count = 0 # 计数器,用于统计符合条件的条目数量
@@ -410,7 +410,15 @@ def exportToHTML(self):
410410
411411 if should_add :
412412 try :
413- htmlContent += "<tr><td>%d</td><td>%s</td><td><a href=\" %s\" >%s</a></td><td>%d</td><td>%d</td><td>%d</td><td bgcolor=\" %s\" >%s</td><td bgcolor=\" %s\" >%s</td></tr>" % (
413+ ai_color = ""
414+ ai_result = self ._log .get (i )._aiAnalysisResult
415+ if ai_result == self .BYPASSSED_STR :
416+ ai_color = "red"
417+ elif ai_result == self .IS_ENFORCED_STR :
418+ ai_color = "yellow"
419+ elif ai_result == self .ENFORCED_STR :
420+ ai_color = "LawnGreen"
421+ htmlContent += "<tr><td>%d</td><td>%s</td><td><a href=\" %s\" >%s</a></td><td>%d</td><td>%d</td><td>%d</td><td bgcolor=\" %s\" >%s</td><td bgcolor=\" %s\" >%s</td><td bgcolor=\" %s\" >%s</td></tr>" % (
414422 self ._log .get (i )._id ,
415423 self ._log .get (i )._method ,
416424 self ._log .get (i )._url ,
@@ -421,7 +429,9 @@ def exportToHTML(self):
421429 color_modified ,
422430 self ._log .get (i )._enfocementStatus ,
423431 color_unauthorized ,
424- self ._log .get (i )._enfocementStatusUnauthorized
432+ self ._log .get (i )._enfocementStatusUnauthorized ,
433+ ai_color ,
434+ ai_result
425435 )
426436 entries_count += 1
427437 except :
@@ -467,7 +477,7 @@ def exportToCSV(self):
467477 if self ._log .size () == 0 :
468478 return
469479
470- csvContent = "id\t Method\t URL\t Original length\t Modified length\t Unauthorized length\t Authorization Enforcement Status\t Authorization Unauthenticated Status\n "
480+ csvContent = "id\t Method\t URL\t Original length\t Modified length\t Unauthorized length\t Authorization Enforcement Status\t Authorization Unauthenticated Status\t AI Analysis Result \ n "
471481
472482 unique_CVS_lines = set ()
473483 entries_count = 0
@@ -501,15 +511,16 @@ def exportToCSV(self):
501511
502512 if should_add :
503513 try :
504- csvContent += "%d\t %s\t %s\t %d\t %d\t %d\t %s\t %s\n " % (
514+ csvContent += "%d\t %s\t %s\t %d\t %d\t %d\t %s\t %s\t %s \ n " % (
505515 self ._log .get (i )._id ,
506516 self ._log .get (i )._method ,
507517 self ._log .get (i )._url ,
508518 len (self ._log .get (i )._originalrequestResponse .getResponse ()) if self ._log .get (i )._originalrequestResponse is not None else 0 ,
509519 len (self ._log .get (i )._requestResponse .getResponse ()) if self ._log .get (i )._requestResponse is not None else 0 ,
510520 len (self ._log .get (i )._unauthorizedRequestResponse .getResponse ()) if self ._log .get (i )._unauthorizedRequestResponse is not None else 0 ,
511521 self ._log .get (i )._enfocementStatus ,
512- self ._log .get (i )._enfocementStatusUnauthorized
522+ self ._log .get (i )._enfocementStatusUnauthorized ,
523+ self ._log .get (i )._aiAnalysisResult
513524 )
514525 entries_count += 1
515526 except :
0 commit comments