mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 修复 wget 换行符为 \r 导致 html 日志不换行
This commit is contained in:
parent
db94e18bb3
commit
ea89d61b86
@ -11,10 +11,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#log-container {
|
#log-container {
|
||||||
height: calc(100vh - 20px);
|
height: calc(100vh - 24px);
|
||||||
padding: 10px;
|
padding: 12px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
white-space: pre;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#scroll-to-bottom {
|
#scroll-to-bottom {
|
||||||
@ -38,7 +37,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="log-container"></div>
|
<pre id="log-container"></pre>
|
||||||
<button id="scroll-to-bottom">
|
<button id="scroll-to-bottom">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||||
<path d="M5 10l7 7 7-7H5z" />
|
<path d="M5 10l7 7 7-7H5z" />
|
||||||
@ -59,7 +58,8 @@
|
|||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const logContent = await response.text();
|
const logContent = await response.text();
|
||||||
logContainer.textContent = logContent;
|
// 修复 wget 换行符为 \r 导致不换行
|
||||||
|
logContainer.textContent = logContent.replace(/[\r\n]+/g, "\n");;
|
||||||
|
|
||||||
if (shouldScrollToBottom) {
|
if (shouldScrollToBottom) {
|
||||||
logContainer.scrollTop = logContainer.scrollHeight;
|
logContainer.scrollTop = logContainer.scrollHeight;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user