blob: 77db7de92d506e113dce546ec72c23ab691fa4a3 [file] [log] [blame]
Yoshie Muranaka386df452020-06-18 12:45:13 -07001const TableDataFormatterMixin = {
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07002 methods: {
3 tableFormatter(value) {
Yoshie Muranakae24b17d2020-06-08 11:03:11 -07004 if (value === undefined || value === null || value === '') {
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07005 return '--';
6 } else {
7 return value;
8 }
9 },
10 statusIcon(status) {
11 switch (status) {
12 case 'OK':
13 return 'success';
14 case 'Warning':
15 return 'warning';
16 case 'Critical':
17 return 'danger';
18 default:
19 return '';
20 }
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070021 },
22 tableFormatterArray(value) {
23 return value.join(', ');
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070024 }
25 }
26};
27
Yoshie Muranaka386df452020-06-18 12:45:13 -070028export default TableDataFormatterMixin;