Skip to content

Commit f04f1d8

Browse files
committed
feat(fe): task log view on small screen
1 parent 10b7d41 commit f04f1d8

File tree

2 files changed

+66
-41
lines changed

2 files changed

+66
-41
lines changed

web2/src/App.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@
4646
@close="onTaskLogDialogClosed()"
4747
>
4848
<template v-slot:title={}>
49-
<router-link
50-
class="breadcrumbs__item breadcrumbs__item--link"
51-
:to="`/project/${projectId}/templates/${template ? template.id : null}`"
52-
@click="taskLogDialog = false"
53-
>{{ template ? template.alias : null }}</router-link>
54-
<v-icon>mdi-chevron-right</v-icon>
55-
<span class="breadcrumbs__item">Task #{{ task ? task.id : null }}</span>
49+
<div class="text-truncate" style="max-width: calc(100% - 36px);">
50+
<router-link
51+
class="breadcrumbs__item breadcrumbs__item--link"
52+
:to="`/project/${projectId}/templates/${template ? template.id : null}`"
53+
@click="taskLogDialog = false"
54+
>{{ template ? template.alias : null }}</router-link>
55+
<v-icon>mdi-chevron-right</v-icon>
56+
<span class="breadcrumbs__item">Task #{{ task ? task.id : null }}</span>
57+
</div>
58+
5659
<v-spacer></v-spacer>
5760
<v-btn
5861
icon

web2/src/components/TaskLogView.vue

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<template>
2-
<div>
2+
<div class="task-log-view" :class="{'task-log-view--with-message': item.message}">
33
<v-alert
44
type="info"
55
text
66
v-if="item.message"
7-
>{{ item.message }}</v-alert>
7+
>{{ item.message }}
8+
</v-alert>
89

910
<v-container class="pa-0 mb-2">
1011
<v-row no-gutters>
@@ -13,21 +14,21 @@
1314
<v-list-item class="pa-0">
1415
<v-list-item-content>
1516
<div>
16-
<TaskStatus :status="item.status" />
17+
<TaskStatus :status="item.status"/>
1718
</div>
1819
</v-list-item-content>
1920
</v-list-item>
2021
</v-list>
2122
</v-col>
2223
<v-col>
23-
<v-list two-line subheader class="pa-0">
24-
<v-list-item class="pa-0">
25-
<v-list-item-content>
26-
<v-list-item-title>Author</v-list-item-title>
27-
<v-list-item-subtitle>{{ user.name }}</v-list-item-subtitle>
28-
</v-list-item-content>
29-
</v-list-item>
30-
</v-list>
24+
<v-list two-line subheader class="pa-0">
25+
<v-list-item class="pa-0">
26+
<v-list-item-content>
27+
<v-list-item-title>Author</v-list-item-title>
28+
<v-list-item-subtitle>{{ user.name }}</v-list-item-subtitle>
29+
</v-list-item-content>
30+
</v-list-item>
31+
</v-list>
3132
</v-col>
3233
<v-col>
3334
<v-list two-line subheader class="pa-0">
@@ -53,12 +54,12 @@
5354
</v-col>
5455
</v-row>
5556
</v-container>
56-
<div class="task-log-view" ref="output">
57-
<div class="task-log-view__record" v-for="record in output" :key="record.id">
58-
<div class="task-log-view__time">
57+
<div class="task-log-records" ref="output">
58+
<div class="task-log-records__record" v-for="record in output" :key="record.id">
59+
<div class="task-log-records__time">
5960
{{ record.time | formatTime }}
6061
</div>
61-
<div class="task-log-view__output">{{ record.output }}</div>
62+
<div class="task-log-records__output">{{ record.output }}</div>
6263
</div>
6364
</div>
6465

@@ -72,31 +73,52 @@
7273
</v-btn>
7374
</div>
7475
</template>
76+
7577
<style lang="scss">
76-
.task-log-view {
77-
background: black;
78-
color: white;
79-
height: calc(100vh - 300px);
80-
overflow: auto;
81-
font-family: monospace;
82-
margin: 0 -24px;
83-
padding: 5px 10px;
84-
}
8578
86-
.task-log-view__record {
87-
display: flex;
88-
flex-direction: row;
89-
justify-content: left;
90-
}
79+
@import '~vuetify/src/styles/settings/_variables';
80+
81+
.task-log-view {
82+
}
83+
84+
.task-log-records {
85+
background: black;
86+
color: white;
87+
height: calc(100vh - 250px);
88+
overflow: auto;
89+
font-family: monospace;
90+
margin: 0 -24px;
91+
padding: 5px 10px;
92+
}
93+
94+
.task-log-view--with-message .task-log-records {
95+
height: calc(100vh - 300px);
96+
}
97+
98+
.task-log-records__record {
99+
display: flex;
100+
flex-direction: row;
101+
justify-content: left;
102+
}
103+
104+
.task-log-records__time {
105+
width: 120px;
106+
min-width: 120px;
107+
}
108+
109+
.task-log-records__output {
110+
width: 100%;
111+
}
91112
92-
.task-log-view__time {
93-
width: 120px;
94-
min-width: 120px;
113+
@media #{map-get($display-breakpoints, 'sm-and-down')} {
114+
.task-log-records {
115+
height: calc(100vh - 340px);
95116
}
96117
97-
.task-log-view__output {
98-
width: 100%;
118+
.task-log-view--with-message .task-log-records {
119+
height: calc(100vh - 370px);
99120
}
121+
}
100122
</style>
101123
<script>
102124
import axios from 'axios';

0 commit comments

Comments
 (0)