Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ import requests
|
|
6 |
from sentence_transformers import SentenceTransformer
|
7 |
import faiss
|
8 |
import numpy as np
|
9 |
-
import pandas as pd
|
10 |
import asyncio
|
11 |
import aiohttp
|
12 |
|
@@ -103,20 +102,27 @@ def display_bookmarks():
|
|
103 |
for i, bookmark in enumerate(bookmarks):
|
104 |
index = i + 1 # Start index at 1
|
105 |
status = "Dead Link" if bookmark.get('dead_link') else "Active"
|
106 |
-
card_class = "card dead-link" if bookmark.get('dead_link') else "card"
|
107 |
title = bookmark['title']
|
108 |
url = bookmark['url']
|
109 |
etag = bookmark.get('etag', 'N/A')
|
110 |
summary = bookmark.get('summary', '')
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
card_html = f'''
|
113 |
-
<div class="{
|
114 |
<div class="card-content">
|
115 |
-
<h3>{index}. {title}</h3>
|
116 |
-
<p><strong>URL:</strong> <a href="{url}" target="_blank">{url}</a></p>
|
117 |
-
<p><strong>Status:</strong> {status}</p>
|
118 |
-
<p><strong>ETag:</strong> {etag}</p>
|
119 |
-
<p><strong>Summary:</strong> {summary}</p>
|
120 |
</div>
|
121 |
</div>
|
122 |
'''
|
|
|
6 |
from sentence_transformers import SentenceTransformer
|
7 |
import faiss
|
8 |
import numpy as np
|
|
|
9 |
import asyncio
|
10 |
import aiohttp
|
11 |
|
|
|
102 |
for i, bookmark in enumerate(bookmarks):
|
103 |
index = i + 1 # Start index at 1
|
104 |
status = "Dead Link" if bookmark.get('dead_link') else "Active"
|
|
|
105 |
title = bookmark['title']
|
106 |
url = bookmark['url']
|
107 |
etag = bookmark.get('etag', 'N/A')
|
108 |
summary = bookmark.get('summary', '')
|
109 |
|
110 |
+
# Apply inline styles for dead links
|
111 |
+
if bookmark.get('dead_link'):
|
112 |
+
card_style = "background-color: #FFF9C4; border: 2px solid #D32F2F;"
|
113 |
+
text_style = "color: #D32F2F;"
|
114 |
+
else:
|
115 |
+
card_style = ""
|
116 |
+
text_style = ""
|
117 |
+
|
118 |
card_html = f'''
|
119 |
+
<div class="card" style="{card_style}">
|
120 |
<div class="card-content">
|
121 |
+
<h3 style="{text_style}">{index}. {title}</h3>
|
122 |
+
<p style="{text_style}"><strong>URL:</strong> <a href="{url}" target="_blank" style="{text_style}">{url}</a></p>
|
123 |
+
<p style="{text_style}"><strong>Status:</strong> {status}</p>
|
124 |
+
<p style="{text_style}"><strong>ETag:</strong> {etag}</p>
|
125 |
+
<p style="{text_style}"><strong>Summary:</strong> {summary}</p>
|
126 |
</div>
|
127 |
</div>
|
128 |
'''
|