Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,6 @@ footer { visibility: hidden; }
|
|
20 |
.status-abnormal { background-color: red; color: white; }
|
21 |
"""
|
22 |
|
23 |
-
|
24 |
# ๋ชจ๋ํฐ๋ง ๋์ ๋ชฉ๋ก
|
25 |
TARGETS = [
|
26 |
{"name": "[MON]๊ด๋ฆฌ-HOME", "url": "https://seawolf2357-bnews1.hf.space"},
|
@@ -76,7 +75,7 @@ TARGETS = [
|
|
76 |
{"name": "[HUGPU]EveryText: ๋ชจ๋ ๋ฌธ์๊ฐ ์ด๋ฏธ์ง ์์ฑ์ ๋ฐ์ ", "url": "https://fantos-EveryText.hf.space"},
|
77 |
{"name": "[HUGPU]๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ I", "url": "https://aiqtech-kofaceid.hf.space"},
|
78 |
{"name": "[HUGPU]๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ II", "url": "https://aiqtech-sdfacid.hf.space"},
|
79 |
-
{"name": "[HUGPU]๊ณ ํด์๋ ์ด๋ฏธ์ง ์์ฑ REALVISXL V5", "url": "https://seawolf2357-REALVISXL-V5.hf.space"},
|
80 |
|
81 |
{"name": "[HUGPU]ํ
์คํธ๋ก ๊ฐ์ฒด๋ง ์๋ผ๋ด๊ณ ๋ฐฐ๊ฒฝ ํฌ๋ช
ํ", "url": "https://fantos-textcutobject.hf.space"},
|
82 |
{"name": "[HUGPU]๋น๋์ค ์ธ์ QnA ์ฑ๋ด ", "url": "https://ginipick-vidiqa.hf.space"},
|
@@ -105,6 +104,7 @@ TARGETS = [
|
|
105 |
|
106 |
]
|
107 |
|
|
|
108 |
# URL ์ํ ํ์ธ ํจ์
|
109 |
def check_url_status(url):
|
110 |
try:
|
@@ -127,27 +127,33 @@ def update_status():
|
|
127 |
status_html += f'<span class="status-button status-{status_class}">{target["name"]}: {status}</span>'
|
128 |
return status_html
|
129 |
|
130 |
-
#
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
status_html = gr.HTML()
|
137 |
-
|
138 |
-
refresh_button = gr.Button("์ํ ์๋ก๊ณ ์นจ")
|
139 |
-
refresh_button.click(fn=update_status, outputs=status_html)
|
140 |
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
time.sleep(60) # 60์ด ๋๊ธฐ
|
147 |
-
new_status = update_status()
|
148 |
-
status_html.update(value=new_status)
|
149 |
|
150 |
-
|
|
|
|
|
|
|
151 |
|
152 |
if __name__ == "__main__":
|
153 |
-
|
|
|
|
20 |
.status-abnormal { background-color: red; color: white; }
|
21 |
"""
|
22 |
|
|
|
23 |
# ๋ชจ๋ํฐ๋ง ๋์ ๋ชฉ๋ก
|
24 |
TARGETS = [
|
25 |
{"name": "[MON]๊ด๋ฆฌ-HOME", "url": "https://seawolf2357-bnews1.hf.space"},
|
|
|
75 |
{"name": "[HUGPU]EveryText: ๋ชจ๋ ๋ฌธ์๊ฐ ์ด๋ฏธ์ง ์์ฑ์ ๋ฐ์ ", "url": "https://fantos-EveryText.hf.space"},
|
76 |
{"name": "[HUGPU]๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ I", "url": "https://aiqtech-kofaceid.hf.space"},
|
77 |
{"name": "[HUGPU]๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ II", "url": "https://aiqtech-sdfacid.hf.space"},
|
78 |
+
# {"name": "[HUGPU]๊ณ ํด์๋ ์ด๋ฏธ์ง ์์ฑ REALVISXL V5", "url": "https://seawolf2357-REALVISXL-V5.hf.space"},
|
79 |
|
80 |
{"name": "[HUGPU]ํ
์คํธ๋ก ๊ฐ์ฒด๋ง ์๋ผ๋ด๊ณ ๋ฐฐ๊ฒฝ ํฌ๋ช
ํ", "url": "https://fantos-textcutobject.hf.space"},
|
81 |
{"name": "[HUGPU]๋น๋์ค ์ธ์ QnA ์ฑ๋ด ", "url": "https://ginipick-vidiqa.hf.space"},
|
|
|
104 |
|
105 |
]
|
106 |
|
107 |
+
|
108 |
# URL ์ํ ํ์ธ ํจ์
|
109 |
def check_url_status(url):
|
110 |
try:
|
|
|
127 |
status_html += f'<span class="status-button status-{status_class}">{target["name"]}: {status}</span>'
|
128 |
return status_html
|
129 |
|
130 |
+
# ์ฃผ๊ธฐ์ ์
๋ฐ์ดํธ๋ฅผ ์ํ ํจ์
|
131 |
+
def periodic_update(status_html):
|
132 |
+
while True:
|
133 |
+
time.sleep(60) # 10์ด ๋๊ธฐ
|
134 |
+
new_status = update_status()
|
135 |
+
status_html.update(value=new_status)
|
|
|
|
|
|
|
|
|
136 |
|
137 |
+
# Gradio ์ธํฐํ์ด์ค ์ค์
|
138 |
+
def create_dashboard():
|
139 |
+
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as app:
|
140 |
+
gr.Image("banner.png", show_label=False)
|
141 |
+
gr.Markdown("# 24์๊ฐ ๋ชจ๋ํฐ๋ง ์์คํ
")
|
142 |
+
gr.Markdown("## \n")
|
143 |
+
|
144 |
+
status_html = gr.HTML()
|
145 |
+
|
146 |
+
refresh_button = gr.Button("์ํ ์๋ก๊ณ ์นจ")
|
147 |
+
refresh_button.click(fn=update_status, outputs=status_html)
|
148 |
|
149 |
+
# ์ด๊ธฐ ์ํ ์
๋ฐ์ดํธ
|
150 |
+
app.load(fn=update_status, outputs=status_html)
|
|
|
|
|
|
|
151 |
|
152 |
+
# ๋ฐฑ๊ทธ๋ผ์ด๋์์ ์ฃผ๊ธฐ์ ์
๋ฐ์ดํธ ์์
|
153 |
+
threading.Thread(target=periodic_update, args=(status_html,), daemon=True).start()
|
154 |
+
|
155 |
+
return app
|
156 |
|
157 |
if __name__ == "__main__":
|
158 |
+
dashboard = create_dashboard()
|
159 |
+
dashboard.launch()
|