Display level as colored chip

This commit is contained in:
Erki Aas 2022-11-09 12:04:04 +02:00
parent 09e732f78e
commit 11fbc22af5
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,26 @@
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

@ -53,6 +53,7 @@ const config = {
},
{
field: 'level',
cellRenderer: 'ErrLevelRenderer',
},
],
}

View File

@ -34,6 +34,7 @@ import "ag-grid-community/styles//ag-theme-material.css";
import { VBtn } from 'vuetify/components/VBtn'
import ExamineLogModal from "./Modal/ExamineLogModal.vue";
import ComboboxFilter from "./Filter/ComboboxFilter.js";
import ErrLevelRenderer from "./Grid/Main/ErrLevelRenderer";
import flattenObj from "../helpers/flattenObj";
import parseEventData from "../helpers/parseEventData";
import {mapActions, mapGetters} from 'vuex';
@ -44,6 +45,7 @@ export default {
ExamineLogModal,
AgGridVue,
ComboboxFilter,
ErrLevelRenderer,
VBtn
},
data() {