Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,11 +15,9 @@ footer { visibility: hidden; }
|
|
15 |
padding: 5px 10px;
|
16 |
margin: 5px;
|
17 |
border-radius: 5px;
|
18 |
-
font-size: 12px
|
19 |
-
|
20 |
-
|
21 |
-
.status-abnormal { background-color: red; color: white; }
|
22 |
-
"""
|
23 |
# ๋ชจ๋ํฐ๋ง ๋์ ๋ชฉ๋ก
|
24 |
TARGETS = [
|
25 |
{"name": "[MON]๊ด๋ฆฌ-HOME", "url": "https://seawolf2357-bnews1.hf.space"},
|
@@ -105,14 +103,19 @@ TARGETS = [
|
|
105 |
]
|
106 |
|
107 |
def request_model_schema():
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
class MyModel(BaseModel):
|
112 |
request: 'RequestModel'
|
113 |
|
114 |
@classmethod
|
115 |
-
def __get_pydantic_core_schema__(cls
|
116 |
return request_model_schema()
|
117 |
|
118 |
# URL ์ํ ํ์ธ ํจ์
|
@@ -140,7 +143,7 @@ def update_status():
|
|
140 |
# ์ฃผ๊ธฐ์ ์
๋ฐ์ดํธ๋ฅผ ์ํ ํจ์
|
141 |
def periodic_update(status_html):
|
142 |
while True:
|
143 |
-
time.sleep(60) #
|
144 |
new_status = update_status()
|
145 |
status_html.update(value=new_status)
|
146 |
|
|
|
15 |
padding: 5px 10px;
|
16 |
margin: 5px;
|
17 |
border-radius: 5px;
|
18 |
+
font-size: 12px
|
19 |
+
"""
|
20 |
+
|
|
|
|
|
21 |
# ๋ชจ๋ํฐ๋ง ๋์ ๋ชฉ๋ก
|
22 |
TARGETS = [
|
23 |
{"name": "[MON]๊ด๋ฆฌ-HOME", "url": "https://seawolf2357-bnews1.hf.space"},
|
|
|
103 |
]
|
104 |
|
105 |
def request_model_schema():
|
106 |
+
return {
|
107 |
+
'type': 'object',
|
108 |
+
'properties': {
|
109 |
+
'url': {'type': 'string', 'format': 'uri'},
|
110 |
+
'method': {'type': 'string'}
|
111 |
+
}
|
112 |
+
}
|
113 |
|
114 |
class MyModel(BaseModel):
|
115 |
request: 'RequestModel'
|
116 |
|
117 |
@classmethod
|
118 |
+
def __get_pydantic_core_schema__(cls, *args, **kwargs):
|
119 |
return request_model_schema()
|
120 |
|
121 |
# URL ์ํ ํ์ธ ํจ์
|
|
|
143 |
# ์ฃผ๊ธฐ์ ์
๋ฐ์ดํธ๋ฅผ ์ํ ํจ์
|
144 |
def periodic_update(status_html):
|
145 |
while True:
|
146 |
+
time.sleep(60) # 60์ด ๋๊ธฐ
|
147 |
new_status = update_status()
|
148 |
status_html.update(value=new_status)
|
149 |
|