Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -144,11 +144,8 @@ def create_ui():
|
|
144 |
.minimal-button {min-width: 30px !important; height: 25px !important; line-height: 1 !important; font-size: 12px !important; padding: 2px 5px !important;}
|
145 |
.space-row {margin-bottom: 5px !important;}
|
146 |
#refresh-button {
|
147 |
-
|
148 |
-
|
149 |
-
border-radius: 20px !important;
|
150 |
-
padding: 0.5rem !important;
|
151 |
-
font-size: 1.2rem !important;
|
152 |
}
|
153 |
"""
|
154 |
|
@@ -170,16 +167,12 @@ def create_ui():
|
|
170 |
url_state = gr.State("")
|
171 |
last_url_state = gr.State("")
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
refresh_button = gr.Button("🔄", size="sm")
|
177 |
-
|
178 |
app_py_content = gr.Code(language="python", label="메인 소스코드")
|
179 |
update_trigger = gr.Button("Update Screenshot", visible=False)
|
180 |
|
181 |
-
|
182 |
-
|
183 |
for _, button, space in space_rows:
|
184 |
button.click(
|
185 |
lambda s=space: on_select(s),
|
@@ -190,15 +183,17 @@ def create_ui():
|
|
190 |
inputs=[url_state, last_url_state],
|
191 |
outputs=[screenshot_output, last_url_state]
|
192 |
)
|
|
|
|
|
|
|
|
|
|
|
193 |
refresh_button.click(
|
194 |
-
|
195 |
inputs=[url_state, last_url_state],
|
196 |
outputs=[screenshot_output, last_url_state]
|
197 |
-
).then(
|
198 |
-
lambda: print("Refresh button clicked")
|
199 |
)
|
200 |
|
201 |
-
|
202 |
update_trigger.click(
|
203 |
update_screenshot,
|
204 |
inputs=[url_state, last_url_state],
|
|
|
144 |
.minimal-button {min-width: 30px !important; height: 25px !important; line-height: 1 !important; font-size: 12px !important; padding: 2px 5px !important;}
|
145 |
.space-row {margin-bottom: 5px !important;}
|
146 |
#refresh-button {
|
147 |
+
width: 100% !important;
|
148 |
+
margin-top: 5px !important;
|
|
|
|
|
|
|
149 |
}
|
150 |
"""
|
151 |
|
|
|
167 |
url_state = gr.State("")
|
168 |
last_url_state = gr.State("")
|
169 |
|
170 |
+
screenshot_output = gr.Image(type="pil", label="Live 화면", height=360, width=600)
|
171 |
+
refresh_button = gr.Button("🔄 새로고침", elem_id="refresh-button")
|
172 |
+
|
|
|
|
|
173 |
app_py_content = gr.Code(language="python", label="메인 소스코드")
|
174 |
update_trigger = gr.Button("Update Screenshot", visible=False)
|
175 |
|
|
|
|
|
176 |
for _, button, space in space_rows:
|
177 |
button.click(
|
178 |
lambda s=space: on_select(s),
|
|
|
183 |
inputs=[url_state, last_url_state],
|
184 |
outputs=[screenshot_output, last_url_state]
|
185 |
)
|
186 |
+
|
187 |
+
def refresh_screenshot(url, last_url):
|
188 |
+
print(f"Refresh button clicked. URL: {url}, Last URL: {last_url}")
|
189 |
+
return update_screenshot(url, last_url)
|
190 |
+
|
191 |
refresh_button.click(
|
192 |
+
refresh_screenshot,
|
193 |
inputs=[url_state, last_url_state],
|
194 |
outputs=[screenshot_output, last_url_state]
|
|
|
|
|
195 |
)
|
196 |
|
|
|
197 |
update_trigger.click(
|
198 |
update_screenshot,
|
199 |
inputs=[url_state, last_url_state],
|