Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -188,12 +188,27 @@ with gr.Blocks(title="Категоризатор сайтов", theme=gr.themes.
|
|
188 |
url_display, category, info = app.get_current_info()
|
189 |
|
190 |
# dynamically merge categories from data
|
191 |
-
all_categories = list(set(app.categories + [
|
192 |
-
|
|
|
|
|
193 |
iframe_html = f'<iframe src="{iframe_url}" width="100%" height="900px" style="border-radius:8px;"></iframe>'
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
else:
|
196 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
|
199 |
def handle_navigation(direction):
|
|
|
188 |
url_display, category, info = app.get_current_info()
|
189 |
|
190 |
# dynamically merge categories from data
|
191 |
+
all_categories = list(set(app.categories + [
|
192 |
+
c for c in (row["category"] for row in app.results_data) if c
|
193 |
+
]))
|
194 |
+
|
195 |
iframe_html = f'<iframe src="{iframe_url}" width="100%" height="900px" style="border-radius:8px;"></iframe>'
|
196 |
+
|
197 |
+
return (
|
198 |
+
status,
|
199 |
+
iframe_html,
|
200 |
+
url_display,
|
201 |
+
gr.update(choices=all_categories, value=category),
|
202 |
+
info
|
203 |
+
)
|
204 |
else:
|
205 |
+
return (
|
206 |
+
status,
|
207 |
+
website_viewer.value,
|
208 |
+
"",
|
209 |
+
gr.update(choices=app.categories, value=None),
|
210 |
+
""
|
211 |
+
)
|
212 |
|
213 |
|
214 |
def handle_navigation(direction):
|