Spaces:
Paused
Paused
WaysAhead Global commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,19 +20,32 @@ openai_api_key = os.getenv("OPENAI_API_KEY")
|
|
| 20 |
st.set_page_config(page_title="AI Store Replacement & KPI Projection", layout="wide")
|
| 21 |
|
| 22 |
# β
Disable Right-Click
|
|
|
|
| 23 |
st.markdown(
|
| 24 |
"""
|
| 25 |
<style>
|
| 26 |
iframe {
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
pointer-events: none !important;
|
| 30 |
-
user-select: none !important;
|
| 31 |
}
|
| 32 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
document.addEventListener("keydown", function(event) {
|
| 35 |
-
if (event.ctrlKey && (event.key === "u" || event.key === "U" || event.key === "i" || event.key === "I" ||
|
|
|
|
| 36 |
event.preventDefault();
|
| 37 |
}
|
| 38 |
});
|
|
@@ -44,7 +57,7 @@ st.markdown(
|
|
| 44 |
};
|
| 45 |
console.log("%c", devtools);
|
| 46 |
if (devtools.opened) {
|
| 47 |
-
alert("π« DevTools detected! Please close
|
| 48 |
window.location.reload();
|
| 49 |
}
|
| 50 |
}, 1000);
|
|
@@ -52,6 +65,17 @@ st.markdown(
|
|
| 52 |
""",
|
| 53 |
unsafe_allow_html=True
|
| 54 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
if not openai_api_key:
|
| 56 |
st.error("β OpenAI API Key is missing! Set it in your environment variables.")
|
| 57 |
|
|
|
|
| 20 |
st.set_page_config(page_title="AI Store Replacement & KPI Projection", layout="wide")
|
| 21 |
|
| 22 |
# β
Disable Right-Click
|
| 23 |
+
# β
Hide iframe using CSS
|
| 24 |
st.markdown(
|
| 25 |
"""
|
| 26 |
<style>
|
| 27 |
iframe {
|
| 28 |
+
display: none !important; /* Hides the iframe */
|
| 29 |
+
visibility: hidden !important; /* Makes it invisible */
|
| 30 |
+
pointer-events: none !important; /* Disables interaction */
|
| 31 |
+
user-select: none !important; /* Prevents text selection */
|
| 32 |
}
|
| 33 |
</style>
|
| 34 |
+
""",
|
| 35 |
+
unsafe_allow_html=True
|
| 36 |
+
)
|
| 37 |
+
|
| 38 |
+
# β
Disable Right-Click & Prevent Inspect Element
|
| 39 |
+
st.markdown(
|
| 40 |
+
"""
|
| 41 |
<script>
|
| 42 |
+
document.addEventListener("contextmenu", function(event) {
|
| 43 |
+
event.preventDefault();
|
| 44 |
+
});
|
| 45 |
+
|
| 46 |
document.addEventListener("keydown", function(event) {
|
| 47 |
+
if (event.ctrlKey && (event.key === "u" || event.key === "U" || event.key === "i" || event.key === "I" ||
|
| 48 |
+
event.key === "j" || event.key === "J" || event.key === "c" || event.key === "C")) {
|
| 49 |
event.preventDefault();
|
| 50 |
}
|
| 51 |
});
|
|
|
|
| 57 |
};
|
| 58 |
console.log("%c", devtools);
|
| 59 |
if (devtools.opened) {
|
| 60 |
+
alert("π« DevTools detected! Please close it.");
|
| 61 |
window.location.reload();
|
| 62 |
}
|
| 63 |
}, 1000);
|
|
|
|
| 65 |
""",
|
| 66 |
unsafe_allow_html=True
|
| 67 |
)
|
| 68 |
+
|
| 69 |
+
st.markdown(
|
| 70 |
+
"""
|
| 71 |
+
<iframe id="hiddenIframe" src="https://waysaheadglobal-data-analyzer.hf.space"
|
| 72 |
+
style="display: none !important; visibility: hidden !important;">
|
| 73 |
+
</iframe>
|
| 74 |
+
""",
|
| 75 |
+
unsafe_allow_html=True
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
|
| 79 |
if not openai_api_key:
|
| 80 |
st.error("β OpenAI API Key is missing! Set it in your environment variables.")
|
| 81 |
|