feat(ui): extend message log dialog

This commit is contained in:
Denis Gukov 2024-11-21 19:07:08 +05:00
parent 7681dfbf0b
commit 79396e51f6
3 changed files with 32 additions and 3 deletions

View File

@ -71,9 +71,10 @@
<EditDialog
v-model="taskLogDialog"
save-button-text="Delete"
:max-width="1000"
:hide-buttons="true"
:expandable="true"
name="TaskLogDialog"
@close="onTaskLogDialogClosed()"
>
<template v-slot:title={}>

View File

@ -8,6 +8,7 @@ Can use used in tandem with ItemFormBase.js. See KeyForm.vue for example.
v-model="dialog"
:max-width="maxWidth || 400"
persistent
:fullscreen="fullscreen"
:transition="false"
:content-class="'item-dialog item-dialog--' + position"
>
@ -19,7 +20,12 @@ Can use used in tandem with ItemFormBase.js. See KeyForm.vue for example.
</slot>
<v-spacer></v-spacer>
<v-btn icon @click="close()">
<v-btn icon @click="toggleFullscreen()" class="mr-3">
<v-icon>mdi-arrow-{{ fullscreen ? 'collapse' : 'expand' }}</v-icon>
</v-btn>
<v-btn icon @click="close()" style="margin-right: -6px;">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-card-title>
@ -82,6 +88,7 @@ export default {
dontCloseOnSave: Boolean,
cancelButtonText: String,
saveButtonText: String,
expandable: Boolean,
},
data() {
@ -89,6 +96,7 @@ export default {
dialog: false,
needSave: false,
needReset: false,
fullscreen: null,
};
},
@ -106,6 +114,18 @@ export default {
async value(val) {
this.dialog = val;
},
fullscreen(val) {
if (val) {
localStorage.setItem(`EditDialog_${this.name}__fullscreen`, '1');
} else {
localStorage.removeItem(`EditDialog_${this.name}__fullscreen`);
}
},
},
created() {
this.fullscreen = localStorage.getItem(`EditDialog_${this.name}__fullscreen`) === '1';
},
methods: {
@ -118,6 +138,10 @@ export default {
this.close(e);
},
toggleFullscreen() {
this.fullscreen = !this.fullscreen;
},
close(e) {
this.dialog = false;

View File

@ -123,6 +123,10 @@
padding: 5px 10px 50px;
}
.v-dialog--fullscreen .task-log-records {
height: calc(100vh - 136px);
}
.task-log-view--with-message .task-log-records {
height: calc(100vh - 300px);
}
@ -140,7 +144,7 @@
.task-log-records__output {
width: 100%;
white-space: pre;
white-space: pre-wrap;
}
@media #{map-get($display-breakpoints, 'sm-and-down')} {