format tickets in Tickets.vue

This commit is contained in:
j3d1 2024-01-02 17:46:34 +01:00
parent 6dad675d1e
commit 3a5f35fa5d
7 changed files with 79 additions and 8 deletions

27
web/src/utils.js Normal file
View file

@ -0,0 +1,27 @@
function ticketStateColorLookup(ticket) {
if (ticket.startsWith('closed_')) {
return 'secondary';
}
if (ticket.startsWith('pending_')) {
return 'warning';
}
if (ticket.startsWith('waiting_')) {
return 'primary';
}
return 'danger';
}
function ticketStateIconLookup(ticket) {
if (ticket.startsWith('closed_')) {
return 'check';
}
if (ticket.startsWith('pending_')) {
return 'exclamation';
}
if (ticket.startsWith('waiting_')) {
return 'hourglass';
}
return 'exclamation';
}
export {ticketStateColorLookup, ticketStateIconLookup};