@@ -70,7 +70,7 @@ q-page.container.q-pa-sm
7070 template( #body-cell-document ='props' )
7171 q-td( :props ='props' )
7272 q-chip.bg-positive.text-white.q-pa-sm (
73- v-if ='props.row?.coll === "Identities" && props.row?.documentId '
73+ v-if ='props.row?.coll === "Identities" && canOpenDocument( props.row) '
7474 icon ='mdi-account'
7575 clickable
7676 dense
@@ -80,13 +80,13 @@ q-page.container.q-pa-sm
8080 q-tooltip.text-body2 ( anchor ='top middle' self ='bottom middle' )
8181 span Voir la fiche identité
8282 q-chip.bg-positive.text-white.q-pa-sm (
83- v-else-if ='["Agents", "auth"].includes(props.row?.coll) && props.row?.documentId '
83+ v-else-if ='["Agents", "auth"].includes(props.row?.coll) && canOpenDocument( props.row) '
8484 icon ='mdi-account'
8585 clickable
8686 dense
8787 @click ='openDocument(props.row)'
8888 )
89- span( v-text ='props.row?.documentId ' )
89+ span( v-text ='getDocumentLabel( props.row) ' )
9090 q-tooltip.text-body2 ( anchor ='top middle' self ='bottom middle' )
9191 span Voir la fiche agent
9292 q-chip(
@@ -95,19 +95,35 @@ q-page.container.q-pa-sm
9595 dense
9696 color ='grey-4'
9797 text-color ='dark'
98- :label ='props.row?.documentId || "N/A" '
98+ :label ='getDocumentLabel( props.row) '
9999 )
100100 template( #body-cell-author ='props' )
101101 q-td( :props ='props' )
102- span( v-text ='props.row?.agent?.name || "system" ' )
102+ span( v-text ='getAuthorLabel( props.row) ' )
103103 template( #body-cell-ip ='props' )
104104 q-td( :props ='props' )
105105 q-chip( size ='sm' dense color ='blue-1' text-color ='dark' : label= 'props.row?.ip || "N/A"' )
106106 template( #body-cell-changes ='props' )
107107 q-td( :props ='props' )
108108 .row.items-center.q-gutter-xs
109109 q-chip(
110- v-if ='!props.row?.changes?.length'
110+ v-if ='props.row?.op === "authentication"'
111+ size ='sm'
112+ dense
113+ color ='blue-grey-2'
114+ text-color ='dark'
115+ :label ='`IDENTIFIANT: ${props.row?.data?.username || "N/A"}`'
116+ )
117+ q-chip(
118+ v-if ='props.row?.op === "authentication"'
119+ size ='sm'
120+ dense
121+ color ='blue-grey-2'
122+ text-color ='dark'
123+ :label ='`RAISON: ${props.row?.data?.reason || "N/A"}`'
124+ )
125+ q-chip(
126+ v-else-if ='!props.row?.changes?.length'
111127 size ='sm'
112128 dense
113129 color ='grey-4'
@@ -289,7 +305,7 @@ export default defineNuxtComponent({
289305 },
290306 {
291307 name: ' changes' ,
292- label: ' Changements ' ,
308+ label: ' Informations ' ,
293309 align: ' left' ,
294310 field : (row ) => row ?.changes || [],
295311 sortable: false ,
@@ -380,6 +396,21 @@ export default defineNuxtComponent({
380396 break
381397 }
382398 },
399+ isUnknownAuthenticationAgent(row : any ): boolean {
400+ return row ?.coll === ' auth' && ` ${row ?.documentId || ' ' } ` === ' 000000000000000000000000'
401+ },
402+ canOpenDocument(row : any ): boolean {
403+ return !! row ?.documentId && ! this .isUnknownAuthenticationAgent (row )
404+ },
405+ getDocumentLabel(row : any ): string {
406+ if (this .isUnknownAuthenticationAgent (row )) return ' N/A'
407+ return row ?.documentId || ' N/A'
408+ },
409+ getAuthorLabel(row : any ): string {
410+ if (this .isUnknownAuthenticationAgent (row )) return ' N/A'
411+ if (row ?.coll === ' auth' && row ?.agent ?.name === ' N/A' ) return ' N/A'
412+ return row ?.agent ?.name || ' system'
413+ },
383414 getOperationLabel(row : any ): string {
384415 return getAuditOperationLabel (row ?.op , row ?.data ?.result )
385416 },
0 commit comments