Update app.py
Browse files
app.py
CHANGED
|
@@ -3306,137 +3306,138 @@ with gr.Blocks(
|
|
| 3306 |
|
| 3307 |
# Keep the actual clear button but hide it
|
| 3308 |
|
| 3309 |
-
|
| 3310 |
-
|
| 3311 |
-
|
| 3312 |
-
|
| 3313 |
-
|
| 3314 |
-
|
| 3315 |
-
|
| 3316 |
-
|
| 3317 |
-
|
| 3318 |
-
|
| 3319 |
-
|
| 3320 |
-
|
| 3321 |
-
|
| 3322 |
-
|
| 3323 |
-
|
| 3324 |
-
|
| 3325 |
-
|
| 3326 |
-
|
| 3327 |
-
|
| 3328 |
-
|
| 3329 |
-
|
| 3330 |
-
|
| 3331 |
-
|
| 3332 |
-
|
| 3333 |
-
|
| 3334 |
-
|
| 3335 |
-
|
| 3336 |
-
|
| 3337 |
-
|
| 3338 |
-
}}
|
| 3339 |
-
}} catch (error) {{
|
| 3340 |
-
console.error('Error loading business chatbots:', error);
|
| 3341 |
-
document.getElementById('business-chatbots').innerHTML = 'Error loading chatbots';
|
| 3342 |
}}
|
|
|
|
|
|
|
|
|
|
| 3343 |
}}
|
| 3344 |
-
|
| 3345 |
-
|
| 3346 |
-
|
| 3347 |
-
</
|
| 3348 |
</div>
|
| 3349 |
-
|
| 3350 |
-
|
| 3351 |
-
|
| 3352 |
-
|
| 3353 |
-
|
| 3354 |
-
|
| 3355 |
-
|
| 3356 |
-
|
| 3357 |
-
|
| 3358 |
-
|
| 3359 |
-
|
| 3360 |
-
|
| 3361 |
-
|
| 3362 |
-
|
| 3363 |
-
|
| 3364 |
-
|
| 3365 |
-
|
| 3366 |
-
|
| 3367 |
-
|
| 3368 |
-
|
| 3369 |
-
|
| 3370 |
-
|
| 3371 |
-
|
| 3372 |
-
|
| 3373 |
-
|
| 3374 |
-
|
| 3375 |
-
|
| 3376 |
-
|
| 3377 |
-
|
| 3378 |
-
}} catch (error) {{
|
| 3379 |
-
console.error('Error loading family chatbots:', error);
|
| 3380 |
-
document.getElementById('family-chatbots').innerHTML = 'Error loading chatbots';
|
| 3381 |
}}
|
|
|
|
|
|
|
|
|
|
| 3382 |
}}
|
| 3383 |
-
|
| 3384 |
-
|
| 3385 |
-
|
| 3386 |
-
</
|
| 3387 |
</div>
|
| 3388 |
-
|
| 3389 |
-
|
| 3390 |
-
|
| 3391 |
-
|
| 3392 |
-
|
| 3393 |
-
|
| 3394 |
-
|
| 3395 |
-
|
| 3396 |
-
|
| 3397 |
-
|
| 3398 |
-
|
| 3399 |
-
|
| 3400 |
-
|
| 3401 |
-
|
| 3402 |
-
|
| 3403 |
-
|
| 3404 |
-
|
| 3405 |
-
|
| 3406 |
-
|
| 3407 |
-
|
| 3408 |
-
|
| 3409 |
-
|
| 3410 |
-
|
| 3411 |
-
|
| 3412 |
-
|
| 3413 |
-
|
| 3414 |
-
|
| 3415 |
-
|
| 3416 |
-
|
| 3417 |
-
}} catch (error) {{
|
| 3418 |
-
console.error('Error loading friends chatbots:', error);
|
| 3419 |
-
document.getElementById('friends-chatbots').innerHTML = 'Error loading chatbots';
|
| 3420 |
}}
|
|
|
|
|
|
|
|
|
|
| 3421 |
}}
|
| 3422 |
-
|
| 3423 |
-
|
| 3424 |
-
|
| 3425 |
-
</
|
| 3426 |
</div>
|
| 3427 |
-
|
| 3428 |
-
|
| 3429 |
-
|
| 3430 |
-
|
| 3431 |
-
|
| 3432 |
-
|
| 3433 |
-
|
| 3434 |
-
|
| 3435 |
-
|
| 3436 |
-
|
| 3437 |
-
style="width:100%; height:500px; border:none; border-radius:8px; margin-top:10px;"></iframe>
|
| 3438 |
</div>
|
| 3439 |
-
""
|
|
|
|
|
|
|
|
|
|
| 3440 |
|
| 3441 |
|
| 3442 |
|
|
|
|
| 3306 |
|
| 3307 |
# Keep the actual clear button but hide it
|
| 3308 |
|
| 3309 |
+
with gr.Tab("🔗 Following"): # New tab for organized links
|
| 3310 |
+
with gr.Column():
|
| 3311 |
+
# Add Business, Family, Friends chatbots right below the button row
|
| 3312 |
+
business_html_display = gr.HTML(f"""
|
| 3313 |
+
<div style="margin-top: 3px;">
|
| 3314 |
+
<div style="font-weight: bold; margin-bottom: 3px; color: #006400; background: #e8f5e9; padding: 8px; border-radius: 8px;">
|
| 3315 |
+
Business Chatbots
|
| 3316 |
+
</div>
|
| 3317 |
+
<div id="business-chatbots" style="
|
| 3318 |
+
display: flex;
|
| 3319 |
+
overflow-x: auto;
|
| 3320 |
+
gap: 8px;
|
| 3321 |
+
padding: 8px;
|
| 3322 |
+
width: 100%;
|
| 3323 |
+
background: #e8f5e9;
|
| 3324 |
+
border-radius: 8px;
|
| 3325 |
+
white-space: nowrap;
|
| 3326 |
+
">
|
| 3327 |
+
<script>
|
| 3328 |
+
async function loadBusinessChatbots() {{
|
| 3329 |
+
try {{
|
| 3330 |
+
const email = "{OWNER_EMAIL}"
|
| 3331 |
+
const response = await fetch(`https://script.google.com/macros/s/AKfycbxyKoCLcJT-Z4Y8-SaTJ-hyMFSv5qOm4TPFNk2CAexHNfTwMIOfc7KvwY0qdFxiuCZ2/exec?type=business&email=${{encodeURIComponent(email)}}`);
|
| 3332 |
+
const data = await response.json();
|
| 3333 |
+
|
| 3334 |
+
if (data.status === "success") {{
|
| 3335 |
+
document.getElementById('business-chatbots').innerHTML = data.html;
|
| 3336 |
+
}} else {{
|
| 3337 |
+
document.getElementById('business-chatbots').innerHTML = 'No business chatbots found';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3338 |
}}
|
| 3339 |
+
}} catch (error) {{
|
| 3340 |
+
console.error('Error loading business chatbots:', error);
|
| 3341 |
+
document.getElementById('business-chatbots').innerHTML = 'Error loading chatbots';
|
| 3342 |
}}
|
| 3343 |
+
}}
|
| 3344 |
+
loadBusinessChatbots();
|
| 3345 |
+
setInterval(loadBusinessChatbots, 15000);
|
| 3346 |
+
</script>
|
| 3347 |
</div>
|
| 3348 |
+
</div>
|
| 3349 |
+
""")
|
| 3350 |
+
|
| 3351 |
+
family_html_display = gr.HTML(f"""
|
| 3352 |
+
<div style="margin-top: 3px;">
|
| 3353 |
+
<div style="font-weight: bold; margin-bottom: 3px; color: #006400; background: #e8f5e9; padding: 8px; border-radius: 8px;">
|
| 3354 |
+
Family Chatbots
|
| 3355 |
+
</div>
|
| 3356 |
+
<div id="family-chatbots" style="
|
| 3357 |
+
display: flex;
|
| 3358 |
+
overflow-x: auto;
|
| 3359 |
+
gap: 8px;
|
| 3360 |
+
padding: 8px;
|
| 3361 |
+
width: 100%;
|
| 3362 |
+
background: #e8f5e9;
|
| 3363 |
+
border-radius: 8px;
|
| 3364 |
+
white-space: nowrap;
|
| 3365 |
+
">
|
| 3366 |
+
<script>
|
| 3367 |
+
async function loadFamilyChatbots() {{
|
| 3368 |
+
try {{
|
| 3369 |
+
const email = "{OWNER_EMAIL}";
|
| 3370 |
+
const response = await fetch(`https://script.google.com/macros/s/AKfycbxyKoCLcJT-Z4Y8-SaTJ-hyMFSv5qOm4TPFNk2CAexHNfTwMIOfc7KvwY0qdFxiuCZ2/exec?type=family&email=${{encodeURIComponent(email)}}`);
|
| 3371 |
+
const data = await response.json();
|
| 3372 |
+
|
| 3373 |
+
if (data.status === "success") {{
|
| 3374 |
+
document.getElementById('family-chatbots').innerHTML = data.html;
|
| 3375 |
+
}} else {{
|
| 3376 |
+
document.getElementById('family-chatbots').innerHTML = 'No family chatbots found';
|
|
|
|
|
|
|
|
|
|
| 3377 |
}}
|
| 3378 |
+
}} catch (error) {{
|
| 3379 |
+
console.error('Error loading family chatbots:', error);
|
| 3380 |
+
document.getElementById('family-chatbots').innerHTML = 'Error loading chatbots';
|
| 3381 |
}}
|
| 3382 |
+
}}
|
| 3383 |
+
loadFamilyChatbots();
|
| 3384 |
+
setInterval(loadFamilyChatbots, 15000);
|
| 3385 |
+
</script>
|
| 3386 |
</div>
|
| 3387 |
+
</div>
|
| 3388 |
+
""")
|
| 3389 |
+
|
| 3390 |
+
friends_html_display = gr.HTML(f"""
|
| 3391 |
+
<div style="margin-top: 3px;">
|
| 3392 |
+
<div style="font-weight: bold; margin-bottom: 3px; color: #006400; background: #e8f5e9; padding: 8px; border-radius: 8px;">
|
| 3393 |
+
Friends Chatbots
|
| 3394 |
+
</div>
|
| 3395 |
+
<div id="friends-chatbots" style="
|
| 3396 |
+
display: flex;
|
| 3397 |
+
overflow-x: auto;
|
| 3398 |
+
gap: 8px;
|
| 3399 |
+
padding: 8px;
|
| 3400 |
+
width: 100%;
|
| 3401 |
+
background: #e8f5e9;
|
| 3402 |
+
border-radius: 8px;
|
| 3403 |
+
white-space: nowrap;
|
| 3404 |
+
">
|
| 3405 |
+
<script>
|
| 3406 |
+
async function loadFriendsChatbots() {{
|
| 3407 |
+
try {{
|
| 3408 |
+
const email = "{OWNER_EMAIL}";
|
| 3409 |
+
const response = await fetch(`https://script.google.com/macros/s/AKfycbxyKoCLcJT-Z4Y8-SaTJ-hyMFSv5qOm4TPFNk2CAexHNfTwMIOfc7KvwY0qdFxiuCZ2/exec?type=friends&email=${{encodeURIComponent(email)}}`);
|
| 3410 |
+
const data = await response.json();
|
| 3411 |
+
|
| 3412 |
+
if (data.status === "success") {{
|
| 3413 |
+
document.getElementById('friends-chatbots').innerHTML = data.html;
|
| 3414 |
+
}} else {{
|
| 3415 |
+
document.getElementById('friends-chatbots').innerHTML = 'No friends chatbots found';
|
|
|
|
|
|
|
|
|
|
| 3416 |
}}
|
| 3417 |
+
}} catch (error) {{
|
| 3418 |
+
console.error('Error loading friends chatbots:', error);
|
| 3419 |
+
document.getElementById('friends-chatbots').innerHTML = 'Error loading chatbots';
|
| 3420 |
}}
|
| 3421 |
+
}}
|
| 3422 |
+
loadFriendsChatbots();
|
| 3423 |
+
setInterval(loadFriendsChatbots, 15000);
|
| 3424 |
+
</script>
|
| 3425 |
</div>
|
| 3426 |
+
</div>
|
| 3427 |
+
""")
|
| 3428 |
+
|
| 3429 |
+
with gr.Tab("BotBook"): # New tab for organized links
|
| 3430 |
+
with gr.Column():
|
| 3431 |
+
# Add the BotBook embed
|
| 3432 |
+
botbook_embed = gr.HTML(f"""
|
| 3433 |
+
<div style="margin-top: 20px;">
|
| 3434 |
+
<div style="font-weight: bold; margin-bottom: 3px; color: #006400; background: #e8f5e9; padding: 8px; border-radius: 8px;">
|
| 3435 |
+
BotBook
|
|
|
|
| 3436 |
</div>
|
| 3437 |
+
<iframe src="https://gadek-gadek3.hf.space"
|
| 3438 |
+
style="width:100%; height:500px; border:none; border-radius:8px; margin-top:10px;"></iframe>
|
| 3439 |
+
</div>
|
| 3440 |
+
""")
|
| 3441 |
|
| 3442 |
|
| 3443 |
|