戒酒的李白

The console on the right side of the web interface displays a height limit.

@@ -85,6 +85,7 @@ @@ -85,6 +85,7 @@
85 flex: 1; 85 flex: 1;
86 display: flex; 86 display: flex;
87 height: calc(100vh - 140px); 87 height: calc(100vh - 140px);
  88 + min-height: 0; /* 允许子元素缩小 */
88 } 89 }
89 90
90 /* 嵌入页面区域 */ 91 /* 嵌入页面区域 */
@@ -115,6 +116,7 @@ @@ -115,6 +116,7 @@
115 display: flex; 116 display: flex;
116 flex-direction: column; 117 flex-direction: column;
117 background-color: #ffffff; 118 background-color: #ffffff;
  119 + min-height: 0; /* 允许子元素缩小 */
118 } 120 }
119 121
120 /* 应用切换按钮 */ 122 /* 应用切换按钮 */
@@ -178,6 +180,8 @@ @@ -178,6 +180,8 @@
178 overflow-y: auto; 180 overflow-y: auto;
179 white-space: pre-wrap; 181 white-space: pre-wrap;
180 word-break: break-all; 182 word-break: break-all;
  183 + min-height: 0; /* 允许内容缩小 */
  184 + max-height: 100%; /* 限制最大高度 */
181 } 185 }
182 186
183 .console-line { 187 .console-line {
@@ -477,12 +481,7 @@ @@ -477,12 +481,7 @@
477 div.textContent = line; 481 div.textContent = line;
478 consoleOutput.appendChild(div); 482 consoleOutput.appendChild(div);
479 483
480 - // 保持最近100行  
481 - const lines = consoleOutput.children;  
482 - if (lines.length > 100) {  
483 - consoleOutput.removeChild(lines[0]);  
484 - }  
485 - 484 + // 自动滚动到底部显示最新内容
486 consoleOutput.scrollTop = consoleOutput.scrollHeight; 485 consoleOutput.scrollTop = consoleOutput.scrollHeight;
487 } 486 }
488 487