Customers commited on
Commit
bfd5042
·
verified ·
1 Parent(s): 955f18e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +122 -121
app.py CHANGED
@@ -3306,137 +3306,138 @@ with gr.Blocks(
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
- with gr.Tab("🔗 Following"): # New tab for organized links
3429
- with gr.Column():
3430
- # Add the BotBook embed
3431
- botbook_embed = gr.HTML(f"""
3432
- <div style="margin-top: 20px;">
3433
- <div style="font-weight: bold; margin-bottom: 3px; color: #006400; background: #e8f5e9; padding: 8px; border-radius: 8px;">
3434
- BotBook
3435
- </div>
3436
- <iframe src="https://gadek-gadek3.hf.space"
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