Spaces:
Running
Running
Commit
Β·
674aa7e
1
Parent(s):
b5628ea
update
Browse files- src/display/formatting.py +3 -5
- src/display/utils.py +1 -1
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
|
28 |
-
return f"
|
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"
|
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", "
|
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)
|