czczup commited on
Commit
dc27f25
·
verified ·
1 Parent(s): 6408b96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -35
app.py CHANGED
@@ -1,38 +1,33 @@
1
- import subprocess
2
- import sys
3
- from flask import Flask, render_template_string
4
 
5
- app = Flask(__name__)
6
 
7
- @app.route('/')
8
- def index():
9
- return render_template_string('''
10
- <!DOCTYPE html>
11
- <html lang="en">
12
- <head>
13
- <meta charset="UTF-8">
14
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
15
- <title>Embed Webpage</title>
16
- <style>
17
- body, html {
18
- margin: 0;
19
- padding: 0;
20
- height: 100%;
21
- overflow: hidden;
22
- }
23
- iframe {
24
- position: absolute;
25
- width: 100%;
26
- height: 100%;
27
- border: none;
28
- }
29
- </style>
30
- </head>
31
- <body>
32
- <iframe src="http://101.132.98.120:10003/"></iframe>
33
- </body>
34
- </html>
35
- ''')
36
 
37
- if __name__ == '__main__':
38
- app.run(debug=True)
 
1
+ import streamlit as st
 
 
2
 
3
+ st.set_page_config(layout="wide")
4
 
5
+ # Custom CSS to make the iframe full screen
6
+ st.markdown(
7
+ """
8
+ <style>
9
+ .fullScreenFrame > iframe {
10
+ position: absolute;
11
+ width: 100%;
12
+ height: 100%;
13
+ border: none;
14
+ }
15
+ .main > div {
16
+ padding: 0;
17
+ height: 100vh;
18
+ }
19
+ </style>
20
+ """,
21
+ unsafe_allow_html=True,
22
+ )
23
+
24
+ # Embed the external Streamlit webpage
25
+ st.markdown(
26
+ """
27
+ <div class="fullScreenFrame">
28
+ <iframe src="http://101.132.98.120:10003/"></iframe>
29
+ </div>
30
+ """,
31
+ unsafe_allow_html=True,
32
+ )
 
33