Remove level column, display level as colored icon before message
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
Erki Aas 2022-11-16 13:16:11 +02:00
parent ca467005a7
commit cab82049bf
4 changed files with 50 additions and 32 deletions

View File

@ -1,26 +0,0 @@
import { VChip } from 'vuetify/components/VChip'
export default {
template: `<v-chip
class="ma-2"
:color="color"
text-color="white"
>
{{ displayValue }}
</v-chip>`,
components: {
VChip
},
setup(props) {
let displayValue = props.params.value
let colors = {
'error': 'red',
'info': 'orange',
}
let color = colors[displayValue]
return {
displayValue,
color
};
},
};

View File

@ -0,0 +1,47 @@
import { VRow, VCol } from 'vuetify/components/VGrid'
import { VIcon } from 'vuetify/components/VIcon'
export default {
template: `<v-row>
<v-col>
<v-icon :color="color" class="mr-2">{{ icon }}</v-icon>
{{ message }}
</v-col>
</v-row>`,
components: {
VRow,
VCol,
VIcon
},
setup(props) {
let message = props.params.data.message
let level = props.params.data.level
let icons = {
'emergency': 'mdi-alert-circle',
'alert': 'mdi-alert-circle',
'critical': 'mdi-alert-circle',
'error': 'mdi-alert-circle',
'warning': 'mdi-alert-circle',
'notice': 'mdi-alert-circle',
'info': 'mdi-information',
'debug': 'mdi-information',
}
let colors = {
'emergency': 'red',
'alert': 'red',
'critical': 'red',
'error': 'red',
'warning': 'orange',
'notice': 'orange',
'info': 'green',
'debug': 'green',
}
let color = colors[level]
let icon = icons[level]
return {
message,
color,
icon
};
},
};

View File

@ -49,12 +49,9 @@ const config = {
{
field: 'message',
tooltipValueGetter: (params) => params.value,
cellRenderer: 'MessageWithLevelRenderer',
width: 500,
},
{
field: 'level',
cellRenderer: 'ErrLevelRenderer',
},
],
}

View File

@ -49,7 +49,7 @@ import { VRow, VCol } from 'vuetify/components/VGrid'
import { Resize } from 'vuetify/directives';
import ExamineLogModal from "./Modal/ExamineLogModal.vue";
import ComboboxFilter from "./Grid/Main/Filter/ComboboxFilter.js";
import ErrLevelRenderer from "./Grid/Main/ErrLevelRenderer";
import MessageWithLevelRenderer from "./Grid/Main/MessageWithLevelRenderer";
import flattenObj from "../helpers/flattenObj";
import parseEventData from "../helpers/parseEventData";
import {mapActions, mapGetters} from 'vuex';
@ -63,7 +63,7 @@ export default {
ExamineLogModal,
AgGridVue,
ComboboxFilter,
ErrLevelRenderer,
MessageWithLevelRenderer,
VBtn,
VRow,
VCol,