Implement client username display in myextension: add getClientUsername method to retrieve usernames for clients and update the UI to show usernames instead of client IDs in the table.
This commit is contained in:
parent
b615ed0504
commit
2bc9a00c47
2 changed files with 7 additions and 1 deletions
|
|
@ -140,6 +140,11 @@ window.app = Vue.createApp({
|
|||
return date.toLocaleDateString() + ' ' + date.toLocaleTimeString('en-US', { hour12: false })
|
||||
},
|
||||
|
||||
getClientUsername(clientId) {
|
||||
const client = this.dcaClients.find(c => c.id === clientId)
|
||||
return client ? (client.username || client.user_id.substring(0, 8) + '...') : clientId
|
||||
},
|
||||
|
||||
|
||||
// Configuration Methods
|
||||
async getLamassuConfig() {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,8 @@
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.field == 'amount'">${ formatCurrency(col.value) }</div>
|
||||
<div v-if="col.field == 'client_id'">${ getClientUsername(col.value) }</div>
|
||||
<div v-else-if="col.field == 'amount'">${ formatCurrency(col.value) }</div>
|
||||
<div v-else-if="col.field == 'status'">
|
||||
<q-badge :color="col.value === 'confirmed' ? 'green' : 'orange'">
|
||||
${ col.value }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue