Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,33 +4,21 @@ import streamlit.components.v1 as components
|
|
4 |
# Set page config for dark theme
|
5 |
st.set_page_config(layout="wide", page_title="Web UI", page_icon=":ghost:", initial_sidebar_state="expanded")
|
6 |
|
7 |
-
# Apply dark theme
|
8 |
st.markdown("""
|
9 |
<style>
|
10 |
-
|
11 |
-
|
12 |
-
}
|
13 |
-
.
|
14 |
-
|
15 |
-
}
|
16 |
-
.
|
17 |
-
|
18 |
-
}
|
19 |
-
|
20 |
-
|
21 |
-
}
|
22 |
-
.stCheckbox>div{
|
23 |
-
color: white;
|
24 |
-
}
|
25 |
-
.stSelectbox>div{
|
26 |
-
color: white;
|
27 |
-
}
|
28 |
-
.main .block-container {
|
29 |
-
background-color: #000000;
|
30 |
-
}
|
31 |
-
iframe {
|
32 |
-
background-color: #000000;
|
33 |
-
}
|
34 |
</style>
|
35 |
""", unsafe_allow_html=True)
|
36 |
|
@@ -40,35 +28,28 @@ menu = st.sidebar.radio("선택하세요:", ("A", "B"))
|
|
40 |
|
41 |
# Main content
|
42 |
if menu == "A":
|
43 |
-
components.iframe("https://seawolf2357-flxloraexp.hf.space", height=
|
44 |
elif menu == "B":
|
45 |
-
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
# Make the layout responsive
|
48 |
-
st.markdown("""
|
49 |
-
<style>
|
50 |
-
.reportview-container .main .block-container {
|
51 |
-
max-width: 1000px;
|
52 |
-
padding-top: 2rem;
|
53 |
-
padding-right: 2rem;
|
54 |
-
padding-left: 2rem;
|
55 |
-
padding-bottom: 2rem;
|
56 |
-
}
|
57 |
-
.sidebar .sidebar-content {
|
58 |
-
width: 300px;
|
59 |
-
}
|
60 |
-
</style>
|
61 |
-
""", unsafe_allow_html=True)
|
62 |
-
|
63 |
-
# Ensure iframes are loaded correctly
|
64 |
st.markdown("""
|
65 |
<script>
|
66 |
window.addEventListener('load', function() {
|
67 |
var iframes = document.getElementsByTagName('iframe');
|
68 |
for (var i = 0; i < iframes.length; i++) {
|
69 |
-
iframes[i].
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
});
|
74 |
</script>
|
|
|
4 |
# Set page config for dark theme
|
5 |
st.set_page_config(layout="wide", page_title="Web UI", page_icon=":ghost:", initial_sidebar_state="expanded")
|
6 |
|
7 |
+
# Apply dark theme and maximize iframe
|
8 |
st.markdown("""
|
9 |
<style>
|
10 |
+
#root > div:nth-child(1) > div > div > div > div > section > div {padding-top: 0rem;}
|
11 |
+
.reportview-container {background-color: #000000;}
|
12 |
+
.sidebar .sidebar-content {background-color: #262730;}
|
13 |
+
.Widget>label {color: white;}
|
14 |
+
.stRadio>div{color: white;}
|
15 |
+
.stCheckbox>div{color: white;}
|
16 |
+
.stSelectbox>div{color: white;}
|
17 |
+
.main .block-container {background-color: #000000; padding: 0rem;}
|
18 |
+
iframe {width: 100vw; height: 100vh; border: none;}
|
19 |
+
header {visibility: hidden;}
|
20 |
+
#MainMenu {visibility: hidden;}
|
21 |
+
footer {visibility: hidden;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
</style>
|
23 |
""", unsafe_allow_html=True)
|
24 |
|
|
|
28 |
|
29 |
# Main content
|
30 |
if menu == "A":
|
31 |
+
components.iframe("https://seawolf2357-flxloraexp.hf.space", height=1000, scrolling=True)
|
32 |
elif menu == "B":
|
33 |
+
try:
|
34 |
+
components.iframe("http://hugpu.ai:8000", height=1000, scrolling=True)
|
35 |
+
except Exception as e:
|
36 |
+
st.error(f"B 메뉴 로딩 중 오류 발생: {str(e)}")
|
37 |
+
st.info("http://hugpu.ai:8000 에 접근할 수 없습니다. URL이 올바른지, 그리고 공개적으로 접근 가능한지 확인해 주세요.")
|
38 |
|
39 |
+
# Make the layout responsive and ensure iframes are loaded correctly
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
st.markdown("""
|
41 |
<script>
|
42 |
window.addEventListener('load', function() {
|
43 |
var iframes = document.getElementsByTagName('iframe');
|
44 |
for (var i = 0; i < iframes.length; i++) {
|
45 |
+
iframes[i].style.height = window.innerHeight + 'px';
|
46 |
+
iframes[i].style.width = '100%';
|
47 |
+
}
|
48 |
+
});
|
49 |
+
window.addEventListener('resize', function() {
|
50 |
+
var iframes = document.getElementsByTagName('iframe');
|
51 |
+
for (var i = 0; i < iframes.length; i++) {
|
52 |
+
iframes[i].style.height = window.innerHeight + 'px';
|
53 |
}
|
54 |
});
|
55 |
</script>
|