@@ -96,29 +96,30 @@ class StreamlitOutputBuffer(io.TextIOBase):
|
||||
visible_lines.append(self.current_line)
|
||||
visible_lines = visible_lines[-self.max_lines :]
|
||||
content = html.escape("\n".join(visible_lines))
|
||||
self.placeholder.caption("Scan Details")
|
||||
components.html(
|
||||
f"""
|
||||
<div id="scan-details" style="
|
||||
height: {self.height}px;
|
||||
overflow-y: auto;
|
||||
white-space: pre-wrap;
|
||||
font-family: monospace;
|
||||
font-size: 0.9rem;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid rgba(49, 51, 63, 0.2);
|
||||
border-radius: 0.5rem;
|
||||
background: white;
|
||||
">{content}</div>
|
||||
<script>
|
||||
const el = document.getElementById("scan-details");
|
||||
if (el) {{
|
||||
el.scrollTop = el.scrollHeight;
|
||||
}}
|
||||
</script>
|
||||
""",
|
||||
height=self.height + 16,
|
||||
)
|
||||
with self.placeholder.container():
|
||||
st.caption("Scan Details")
|
||||
components.html(
|
||||
f"""
|
||||
<div id="scan-details" style="
|
||||
height: {self.height}px;
|
||||
overflow-y: auto;
|
||||
white-space: pre-wrap;
|
||||
font-family: monospace;
|
||||
font-size: 0.9rem;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid rgba(49, 51, 63, 0.2);
|
||||
border-radius: 0.5rem;
|
||||
background: white;
|
||||
">{content}</div>
|
||||
<script>
|
||||
const el = document.getElementById("scan-details");
|
||||
if (el) {{
|
||||
el.scrollTop = el.scrollHeight;
|
||||
}}
|
||||
</script>
|
||||
""",
|
||||
height=self.height + 16,
|
||||
)
|
||||
|
||||
def getvalue(self) -> str:
|
||||
visible_lines = list(self.lines)
|
||||
|
||||
Reference in New Issue
Block a user