优化log显示效果

This commit is contained in:
liuwei
2025-05-28 17:32:08 +08:00
parent 029d1a4589
commit ae540be597

View File

@@ -74,6 +74,7 @@
const logDiv = this.$el.querySelector('.log-content'); const logDiv = this.$el.querySelector('.log-content');
if (logDiv) { if (logDiv) {
logDiv.scrollTop = logDiv.scrollHeight; logDiv.scrollTop = logDiv.scrollHeight;
console.log('log-content scrollHeight:', logDiv.scrollHeight, 'clientHeight:', logDiv.clientHeight);
} }
}); });
} else { } else {
@@ -118,23 +119,32 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 0; margin: 0;
height: 100%;
}
.el-card__body {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
} }
.log-content-wrapper { .log-content-wrapper {
flex: 1; flex: 1;
overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden;
} }
.log-content { .log-content {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto !important;
overflow-x: auto; overflow-x: auto !important;
background-color: #f5f5f5; background-color: #f5f5f5;
padding: 10px; padding: 10px;
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
min-height: 0;
} }
.log-content pre { .log-content pre {
@@ -142,6 +152,7 @@
white-space: pre-wrap; white-space: pre-wrap;
word-break: break-all; word-break: break-all;
font-family: monospace; font-family: monospace;
line-height: 1.5;
} }
.empty-log { .empty-log {
@@ -149,16 +160,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} overflow: hidden;
.el-card {
height: 100% !important;
}
.el-card__body {
flex: 1;
display: flex;
flex-direction: column;
} }
</style> </style>
{% endblock %} {% endblock %}