wu981526092 commited on
Commit
674aa7e
Β·
1 Parent(s): b5628ea
src/display/formatting.py CHANGED
@@ -17,20 +17,18 @@ def make_clickable_report(report_url):
17
 
18
  If the report_url is a full URL (starts with http), use it directly
19
  Otherwise, assume it's a local file path and construct a local link
20
- using Gradio's markdown format that works in table cells.
21
  """
22
  if not report_url:
23
  return ""
24
 
25
  # Check if this is a URL or local file reference
26
  if report_url.startswith("http"):
27
- # External URL, use markdown format
28
- return f"[πŸ“ View Report]({report_url})"
29
  else:
30
  # Local file reference, create a relative path to the public directory
31
- # Use Gradio's file URL format which renders correctly in markdown cells
32
  report_path = f"file/reports/{report_url}"
33
- return f"[πŸ“ Report]({report_path})"
34
 
35
 
36
  def styled_error(error):
 
17
 
18
  If the report_url is a full URL (starts with http), use it directly
19
  Otherwise, assume it's a local file path and construct a local link
 
20
  """
21
  if not report_url:
22
  return ""
23
 
24
  # Check if this is a URL or local file reference
25
  if report_url.startswith("http"):
26
+ # External URL
27
+ return f'<a href="{report_url}" target="_blank" style="display:inline-block; padding:3px 8px; background-color:#f0f6ff; color:#0078d4; border-radius:4px; text-decoration:none; font-weight:bold;">πŸ“ View</a>'
28
  else:
29
  # Local file reference, create a relative path to the public directory
 
30
  report_path = f"file/reports/{report_url}"
31
+ return f'<a href="{report_path}" target="_blank" style="display:inline-block; padding:3px 8px; background-color:#f0f6ff; color:#0078d4; border-radius:4px; text-decoration:none; font-weight:bold;">πŸ“ View</a>'
32
 
33
 
34
  def styled_error(error):
src/display/utils.py CHANGED
@@ -39,7 +39,7 @@ auto_eval_column_dict.append(["stars", ColumnContent, ColumnContent("GitHub ⭐"
39
  auto_eval_column_dict.append(["last_update", ColumnContent, ColumnContent("Last Updated", "str", False)])
40
  auto_eval_column_dict.append(["verified", ColumnContent, ColumnContent("Independently Verified", "bool", False)])
41
  auto_eval_column_dict.append(["availability", ColumnContent, ColumnContent("Active Maintenance", "bool", True)])
42
- auto_eval_column_dict.append(["report_url", ColumnContent, ColumnContent("Report", "markdown", True)])
43
 
44
  # We use make dataclass to dynamically fill the scores from Tasks
45
  AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)
 
39
  auto_eval_column_dict.append(["last_update", ColumnContent, ColumnContent("Last Updated", "str", False)])
40
  auto_eval_column_dict.append(["verified", ColumnContent, ColumnContent("Independently Verified", "bool", False)])
41
  auto_eval_column_dict.append(["availability", ColumnContent, ColumnContent("Active Maintenance", "bool", True)])
42
+ auto_eval_column_dict.append(["report_url", ColumnContent, ColumnContent("Report", "html", True)])
43
 
44
  # We use make dataclass to dynamically fill the scores from Tasks
45
  AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)