Spaces:
Running
on
Zero
Running
on
Zero
te
Browse files- mysite/asgi.py +10 -6
- mysite/static/index.html +34 -0
- staticfiles/index.html +1 -0
- templates/index.html +1 -0
mysite/asgi.py
CHANGED
@@ -44,13 +44,19 @@ setup_webhook_routes(app)
|
|
44 |
# データベースルートの設定
|
45 |
setup_database_routes(app)
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
# Gradioアプリのマウント
|
48 |
-
app.mount("/
|
49 |
#gradio_interfaces.launch()
|
50 |
app = gr.mount_gradio_app(app, gradio_interfaces, "/")
|
51 |
|
52 |
-
|
53 |
-
templates = Jinja2Templates(directory="static")
|
54 |
|
55 |
def run_gradio():
|
56 |
gradio_interfaces.launch(server_name="0.0.0.0", server_port=7861, share=True)
|
@@ -59,6 +65,4 @@ def run_gradio():
|
|
59 |
#threading.Thread(target=run_gradio).start()
|
60 |
|
61 |
|
62 |
-
|
63 |
-
def get_some_page(request: Request):
|
64 |
-
return templates.TemplateResponse("index.html", {"request": request})
|
|
|
44 |
# データベースルートの設定
|
45 |
setup_database_routes(app)
|
46 |
|
47 |
+
# テンプレートファイルが格納されているディレクトリを指定
|
48 |
+
templates = Jinja2Templates(directory="templates")
|
49 |
+
|
50 |
+
@app.get("/tests")
|
51 |
+
def get_some_page(request: Request):
|
52 |
+
return templates.TemplateResponse("index.html", {"request": request})
|
53 |
+
|
54 |
# Gradioアプリのマウント
|
55 |
+
app.mount("/templates", StaticFiles(directory="templates", html=True), name="templates")
|
56 |
#gradio_interfaces.launch()
|
57 |
app = gr.mount_gradio_app(app, gradio_interfaces, "/")
|
58 |
|
59 |
+
|
|
|
60 |
|
61 |
def run_gradio():
|
62 |
gradio_interfaces.launch(server_name="0.0.0.0", server_port=7861, share=True)
|
|
|
65 |
#threading.Thread(target=run_gradio).start()
|
66 |
|
67 |
|
68 |
+
|
|
|
|
mysite/static/index.html
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Iframe Height 100%</title>
|
7 |
+
<style>
|
8 |
+
/* HTML, body, and parent container must all have 100% height */
|
9 |
+
html, body {
|
10 |
+
height: 100%;
|
11 |
+
margin: 0;
|
12 |
+
overflow: hidden; /* Prevents scrolling on the main page */
|
13 |
+
}
|
14 |
+
.iframe-container {
|
15 |
+
height: 100%;
|
16 |
+
width: 100%;
|
17 |
+
position: relative; /* Ensures the iframe is positioned correctly */
|
18 |
+
}
|
19 |
+
iframe {
|
20 |
+
height: 100%;
|
21 |
+
width: 100%;
|
22 |
+
border: none; /* optional, removes the iframe border */
|
23 |
+
position: absolute;
|
24 |
+
top: 0;
|
25 |
+
left: 0;
|
26 |
+
}
|
27 |
+
</style>
|
28 |
+
</head>
|
29 |
+
<body>
|
30 |
+
<div class="iframe-container">
|
31 |
+
<iframe src="https://kenken999-gradio-fastapi-statics.hf.space/gradio/"></iframe>
|
32 |
+
</div>
|
33 |
+
</body>
|
34 |
+
</html>
|
staticfiles/index.html
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ssssssssssssssssssssssssss
|
templates/index.html
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ssssssssssssssssssssssssss
|