1
1
Fork 1
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-09 00:46:08 +02:00
This commit is contained in:
bytedream 2024-04-26 22:38:43 -04:00 committed by GitHub
commit c2dd61bd83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -191,11 +191,22 @@ const sfc = {
},
appendLogs(stepIndex, logLines, startTime) {
// position of the client view relative to the website top
const clientHeight = document.documentElement.clientHeight + window.scrollY;
// height of the logs container relative to the website top
const logsContainerHeight = this.$refs.stepsContainer.getBoundingClientRect().bottom + window.scrollY;
for (const line of logLines) {
// TODO: group support: ##[group]GroupTitle , ##[endgroup]
const el = this.getLogsContainer(stepIndex);
el.append(this.createLogLine(line, startTime, stepIndex));
}
// scrolls to the bottom if job is running and the bottom of the logs container is visible
if (!this.run.done && logLines.length && clientHeight >= logsContainerHeight) {
const newLogsContainerHeight = this.$refs.stepsContainer.getBoundingClientRect().bottom + window.scrollY;
window.scrollTo({top: clientHeight + (newLogsContainerHeight - logsContainerHeight), behavior: 'smooth'});
}
},
async fetchArtifacts() {
@ -436,7 +447,7 @@ export function initRepositoryActionView() {
</div>
</div>
<div class="action-view-right">
<div class="action-view-right" ref="stepsContainer">
<div class="job-info-header">
<div class="job-info-header-left gt-ellipsis">
<h3 class="job-info-header-title gt-ellipsis">