| Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 1 | const TableDataFormatter = { |
| 2 | methods: { | ||||
| 3 | tableFormatter(value) { | ||||
| 4 | if (value === undefined || value === '') { | ||||
| 5 | 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 | } | ||||
| 21 | } | ||||
| 22 | } | ||||
| 23 | }; | ||||
| 24 | |||||
| 25 | export default TableDataFormatter; | ||||