Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/components/cylc/WarningIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td style="padding-right: 0.5em; vertical-align: top;">
<EventChip :level="event.level" />
</td><td>
<span>{{ event.message }}</span>
<span class="truncated-message">{{ event.message }}</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -134,3 +134,11 @@ export default {
path: PATH,
}
</script>

<style lang="scss" scoped>
@use "/src/styles/util";

.truncated-message {
@include util.line-clamp(2);
}
</style>
9 changes: 9 additions & 0 deletions src/styles/_util.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@
}
}
}

@mixin line-clamp($lines) {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: $lines;
line-clamp: $lines;
Comment on lines +33 to +36
Copy link
Member Author

@MetRonnie MetRonnie Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line-clamp is still not really supported, so have to include these webkit-prefixed styles as well - which are widely supported - https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/line-clamp

overflow: hidden;
text-overflow: ellipsis;
}
45 changes: 38 additions & 7 deletions src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
:items="workflowsTable"
:loading="isLoading"
id="dashboard-workflows"
items-per-page="-1"
:items-per-page="-1"
style="font-size: 1rem;"
density="compact"
>
Expand All @@ -43,24 +43,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<v-data-table
:headers="$options.eventsHeader"
:items="events"
:items-per-page="8"
v-model:items-per-page="eventsItemsPerPage"
:items-per-page-options="eventsItemsPerPageOptions"
density="compact"
data-cy="events-table"
>
<!-- Hide header: -->
<template v-slot:headers></template>
<template #headers></template>

<!-- Hide footer if no events: -->
<template v-if="!events.length" v-slot:bottom></template>
<template v-if="!events.length" #bottom></template>

<!-- Special template if there are no events to display -->
<template v-slot:no-data>
<td class="text-h6 text-disabled">No events</td>
<template #no-data>
<span class="text-h6 text-disabled">No events</span>
</template>

<template v-slot:item.level="{ item }">
<template #item.level="{ item }">
<EventChip :level="item.level" />
</template>
<template #item.message="{ item }">
<div class="truncated-message py-1">
{{ item.message }}
</div>
</template>
</v-data-table>
</v-col>
</v-row>
Expand Down Expand Up @@ -185,6 +191,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

<script>
import { mapState, mapGetters } from 'vuex'
import { useLocalStorage } from '@vueuse/core'
import {
mdiBook,
mdiBookMultiple,
Expand Down Expand Up @@ -249,6 +256,22 @@ export default {
EventChip,
},

setup () {
const eventsItemsPerPage = useLocalStorage('dashboardEventsItemsPerPage', 8)
const eventsItemsPerPageOptions = [
{ value: 5, title: '5' },
{ value: 8, title: '8' },
{ value: 10, title: '10' },
{ value: 20, title: '20' },
{ value: -1, title: 'All' },
]

return {
eventsItemsPerPage,
eventsItemsPerPageOptions,
}
},

data () {
return {
query: new SubscriptionQuery(
Expand Down Expand Up @@ -324,3 +347,11 @@ export default {
},
}
</script>

<style lang="scss" scoped>
@use "/src/styles/util";

.truncated-message {
@include util.line-clamp(4);
}
</style>