seawolf2357 commited on
Commit
6f3d99c
ยท
verified ยท
1 Parent(s): b7f3af4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
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
- .status-normal { background-color: green; color: white; }
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
- # Pydantic์ด ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ํ˜•์‹์˜ ์Šคํ‚ค๋งˆ๋ฅผ ์ •์˜
109
- return create_model('RequestModel')
 
 
 
 
 
110
 
111
  class MyModel(BaseModel):
112
  request: 'RequestModel'
113
 
114
  @classmethod
115
- def __get_pydantic_core_schema__(cls) -> 'RequestModel':
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) # 10์ดˆ ๋Œ€๊ธฐ
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