Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
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(
|
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 |
|