openfree commited on
Commit
8d88ee0
โ€ข
1 Parent(s): 756b2f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +74 -4
app.py CHANGED
@@ -316,6 +316,67 @@ def get_vercel_card(deployment, index):
316
  </div>
317
  """
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  # get_user_spaces ํ•จ์ˆ˜ ์ˆ˜์ •
320
  def get_user_spaces():
321
  # ๊ธฐ์กด Hugging Face ์ŠคํŽ˜์ด์Šค ๊ฐ€์ ธ์˜ค๊ธฐ
@@ -339,6 +400,7 @@ def get_user_spaces():
339
  # Vercel ๋ฐฐํฌ ๊ฐ€์ ธ์˜ค๊ธฐ
340
  vercel_deployments = get_vercel_deployments()
341
 
 
342
  html_content = f"""
343
  <div style='padding: 20px; background-color: #f5f5f5;'>
344
  <div style='margin-bottom: 20px;'>
@@ -355,18 +417,26 @@ def get_user_spaces():
355
  </p>
356
  </div>
357
 
 
 
 
 
 
 
 
358
  <!-- Vercel Deployments -->
359
  <h3 style='color: #333; margin: 20px 0;'>โšก Vercel Deployments</h3>
360
- <div id="vercel-container" style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;'>
361
  {"".join(get_vercel_card(dep, idx) for idx, dep in enumerate(vercel_deployments))}
362
  </div>
363
 
364
  <!-- Hugging Face Spaces -->
365
  <h3 style='color: #333; margin: 20px 0;'>๐Ÿค— Hugging Face Spaces</h3>
366
- <div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;'>
367
  {"".join(get_space_card(space, idx) for idx, space in enumerate(user_spaces))}
368
  </div>
369
  </div>
 
370
 
371
  <script>
372
  document.addEventListener('DOMContentLoaded', function() {{
@@ -420,7 +490,7 @@ def get_user_spaces():
420
  }});
421
  </script>
422
  """
423
-
424
  return html_content
425
 
426
  except Exception as e:
@@ -432,7 +502,7 @@ def get_user_spaces():
432
  <p>Please try again later.</p>
433
  </div>
434
  """
435
-
436
  # Creating the Gradio interface
437
  demo = gr.Blocks()
438
 
 
316
  </div>
317
  """
318
 
319
+ # Top Best URLs ์ •์˜
320
+ TOP_BEST_URLS = [
321
+ {
322
+ "url": "abcdef.vercel.app",
323
+ "name": "๋ณด์„ ํŒกํŒก ๊ฒŒ์ž„",
324
+ "created": "2024-03-15 14:30",
325
+ "state": "READY"
326
+ },
327
+ {
328
+ "url": "ghijkl.vercel.app",
329
+ "name": "MBTI ์ง„๋‹จ ์„œ๋น„์Šค",
330
+ "created": "2024-03-14 15:20",
331
+ "state": "READY"
332
+ },
333
+ {
334
+ "url": "mnopqr.vercel.app",
335
+ "name": "ํˆฌ์ž ํฌํŠธํด๋ฆฌ์˜ค ๋Œ€์‹œ๋ณด๋“œ",
336
+ "created": "2024-03-13 16:10",
337
+ "state": "READY"
338
+ },
339
+ {
340
+ "url": "stuvwx.vercel.app",
341
+ "name": "์˜ค๋””์˜ค ๋น„์ฃผ์–ผ๋ผ์ด์ €",
342
+ "created": "2024-03-12 17:00",
343
+ "state": "READY"
344
+ },
345
+ {
346
+ "url": "yzabcd.vercel.app",
347
+ "name": "์ฒด์Šค ๊ฒŒ์ž„",
348
+ "created": "2024-03-11 18:40",
349
+ "state": "READY"
350
+ },
351
+ {
352
+ "url": "efghij.vercel.app",
353
+ "name": "ํƒ€๋กœ์นด๋“œ ์šด์„ธ",
354
+ "created": "2024-03-10 19:30",
355
+ "state": "READY"
356
+ },
357
+ {
358
+ "url": "klmnop.vercel.app",
359
+ "name": "AI ์š”๋ฆฌ์‚ฌ",
360
+ "created": "2024-03-09 20:20",
361
+ "state": "READY"
362
+ },
363
+ {
364
+ "url": "qrstuv.vercel.app",
365
+ "name": "3D ๋ถ„์ž ์‹œ๋ฎฌ๋ ˆ์ด์…˜",
366
+ "created": "2024-03-08 21:10",
367
+ "state": "READY"
368
+ },
369
+ {
370
+ "url": "wxyzab.vercel.app",
371
+ "name": "์ด๋ฉ”์ผ ํšŒ์›๊ฐ€์ž… ๋ฐ ๋กœ๊ทธ์ธ",
372
+ "created": "2024-03-07 22:00",
373
+ "state": "READY"
374
+ }
375
+ ]
376
+
377
+
378
+
379
+
380
  # get_user_spaces ํ•จ์ˆ˜ ์ˆ˜์ •
381
  def get_user_spaces():
382
  # ๊ธฐ์กด Hugging Face ์ŠคํŽ˜์ด์Šค ๊ฐ€์ ธ์˜ค๊ธฐ
 
400
  # Vercel ๋ฐฐํฌ ๊ฐ€์ ธ์˜ค๊ธฐ
401
  vercel_deployments = get_vercel_deployments()
402
 
403
+
404
  html_content = f"""
405
  <div style='padding: 20px; background-color: #f5f5f5;'>
406
  <div style='margin-bottom: 20px;'>
 
417
  </p>
418
  </div>
419
 
420
+ <!-- Top Best -->
421
+ <h3 style='color: #333; margin: 20px 0;'>๐Ÿ† Top Best</h3>
422
+ <div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px;'>
423
+ {"".join(get_vercel_card({"url": url["url"], "created": url["created"], "name": url["name"], "state": url["state"]}, idx)
424
+ for idx, url in enumerate(TOP_BEST_URLS))}
425
+ </div>
426
+
427
  <!-- Vercel Deployments -->
428
  <h3 style='color: #333; margin: 20px 0;'>โšก Vercel Deployments</h3>
429
+ <div id="vercel-container" style='display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px;'>
430
  {"".join(get_vercel_card(dep, idx) for idx, dep in enumerate(vercel_deployments))}
431
  </div>
432
 
433
  <!-- Hugging Face Spaces -->
434
  <h3 style='color: #333; margin: 20px 0;'>๐Ÿค— Hugging Face Spaces</h3>
435
+ <div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px;'>
436
  {"".join(get_space_card(space, idx) for idx, space in enumerate(user_spaces))}
437
  </div>
438
  </div>
439
+
440
 
441
  <script>
442
  document.addEventListener('DOMContentLoaded', function() {{
 
490
  }});
491
  </script>
492
  """
493
+
494
  return html_content
495
 
496
  except Exception as e:
 
502
  <p>Please try again later.</p>
503
  </div>
504
  """
505
+
506
  # Creating the Gradio interface
507
  demo = gr.Blocks()
508