Remove level column, display level as colored icon before message
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone Build is failing
				
			This commit is contained in:
		| @@ -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 |  | ||||||
|         }; |  | ||||||
|     }, |  | ||||||
| }; |  | ||||||
							
								
								
									
										47
									
								
								src/components/Grid/Main/MessageWithLevelRenderer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/components/Grid/Main/MessageWithLevelRenderer.js
									
									
									
									
									
										Normal 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 | ||||||
|  |         }; | ||||||
|  |     }, | ||||||
|  | }; | ||||||
| @@ -49,12 +49,9 @@ const config = { | |||||||
|         { |         { | ||||||
|             field: 'message', |             field: 'message', | ||||||
|             tooltipValueGetter: (params) => params.value, |             tooltipValueGetter: (params) => params.value, | ||||||
|  |             cellRenderer: 'MessageWithLevelRenderer', | ||||||
|             width: 500, |             width: 500, | ||||||
|         }, |         }, | ||||||
|         { |  | ||||||
|             field: 'level', |  | ||||||
|             cellRenderer: 'ErrLevelRenderer', |  | ||||||
|         }, |  | ||||||
|     ], |     ], | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -49,7 +49,7 @@ import { VRow, VCol } from 'vuetify/components/VGrid' | |||||||
| import { Resize } from 'vuetify/directives'; | import { Resize } from 'vuetify/directives'; | ||||||
| import ExamineLogModal from "./Modal/ExamineLogModal.vue"; | import ExamineLogModal from "./Modal/ExamineLogModal.vue"; | ||||||
| import ComboboxFilter from "./Grid/Main/Filter/ComboboxFilter.js"; | 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 flattenObj from "../helpers/flattenObj"; | ||||||
| import parseEventData from "../helpers/parseEventData"; | import parseEventData from "../helpers/parseEventData"; | ||||||
| import {mapActions, mapGetters} from 'vuex'; | import {mapActions, mapGetters} from 'vuex'; | ||||||
| @@ -63,7 +63,7 @@ export default { | |||||||
|     ExamineLogModal, |     ExamineLogModal, | ||||||
|     AgGridVue, |     AgGridVue, | ||||||
|     ComboboxFilter, |     ComboboxFilter, | ||||||
|     ErrLevelRenderer, |     MessageWithLevelRenderer, | ||||||
|     VBtn, |     VBtn, | ||||||
|     VRow, |     VRow, | ||||||
|     VCol, |     VCol, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user