Skip to content

Commit

Permalink
fix(ui): proper log display without multiple line
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jan 23, 2025
1 parent fc84ee3 commit a97448f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 21 deletions.
10 changes: 9 additions & 1 deletion ui/src/components/executions/TaskRunLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,15 @@
.attempt-header {
.el-select {
width: 8rem;
width: 10rem;
height: 24px;
margin-top: 0.35rem;
:deep(.el-select__wrapper) {
height: 24px;
min-height: 24px;
}
}
.attempt-number {
Expand Down
28 changes: 19 additions & 9 deletions ui/src/components/logs/LogLine.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
class="py-2 line font-monospace"
:class="{['log-border-' + log.level.toLowerCase()]: cursor && log.level !== undefined}"
:class="{['log-border-' + log.level.toLowerCase()]: cursor && log.level !== undefined, ['key-' + $.vnode.key]: true}"
v-if="filtered"
:style="logLineStyle"
>
Expand Down Expand Up @@ -30,7 +30,11 @@
</span>
</span>
</div>
<div ref="lineContent" v-html="renderedMarkdown" />
<div
ref="lineContent"
:class="{'d-inline': metaWithValue.length === 0, 'me-3': metaWithValue.length === 0}"
v-html="renderedMarkdown"
/>
</div>
</div>
</template>
Expand Down Expand Up @@ -185,31 +189,37 @@
};
</script>
<style scoped lang="scss">
@import "@kestra-io/ui-libs/src/scss/variables";
div.line {
cursor: text;
white-space: pre-wrap;
word-break: break-all;
display: flex;
align-items: center;
gap: $spacer;
align-items: flex-start;
gap: 1rem;
border-left-width: 2px !important;
border-left-style: solid;
border-left-color: transparent;
.icon_container{
border-top: 1px solid var(--ks-border-primary);
// hack for class containing 0
&[class*="-0"] {
border-top: 0;
}
.icon_container {
margin-left: -0.90rem;
}
.log-level {
padding: .25rem;
margin-top: 0.25rem;
}
.log-content {
.header > * + * {
margin-left: $spacer;
margin-left: 1rem;
}
}
Expand Down Expand Up @@ -243,7 +253,7 @@ div.line {
border-radius: 4px;
}
}
.message {
line-height: 1.8;
}
Expand Down
16 changes: 8 additions & 8 deletions ui/src/components/logs/LogsWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
<template #table v-if="logs !== undefined && logs.length > 0">
<div v-loading="isLoading">
<div class="logs-wrapper">
<template v-for="(log, i) in logs" :key="`${log.taskRunId}-${i}`">
<log-line
level="TRACE"
filter=""
:exclude-metas="isFlowEdit ? ['namespace', 'flowId'] : []"
:log="log"
/>
</template>
<log-line
v-for="(log, i) in logs"
:key="`${log.taskRunId}-${i}`"
level="TRACE"
filter=""
:exclude-metas="isFlowEdit ? ['namespace', 'flowId'] : []"
:log="log"
/>
</div>
</div>
</template>
Expand Down
7 changes: 5 additions & 2 deletions ui/src/components/logs/TaskRunDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@
margin-bottom: 0;
border: 1px solid var(--ks-border-primary);
:deep(.el-card__body) {
padding: 0;
}
.attempt-wrapper & {
border-radius: .25rem;
}
Expand All @@ -704,7 +708,7 @@
}
.attempt-header {
padding: .5rem;
padding: 0 .5rem .5rem;
border-bottom: 1px solid var(--ks-border-primary);
}
Expand All @@ -728,7 +732,6 @@
.log-lines {
max-height: 50vh;
transition: max-height 0.2s ease-out;
margin-top: .5rem;
.line {
padding: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/utils/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function render(markdown, options = {}) {
let md;
if (options.onlyLink) {
md = new markdownIt("zero");
md.enable(["link", "linkify", "entity", "html_inline", "newline"]);
md.enable(["link", "linkify", "entity", "html_inline"]);
} else {
md = new markdownIt();
}
Expand Down

0 comments on commit a97448f

Please sign in to comment.