merge: agent session work
This commit is contained in:
commit
a7f3293689
@ -51,19 +51,26 @@ public function table(Table $table): Table
|
|||||||
->label('Assignments')
|
->label('Assignments')
|
||||||
->badge()
|
->badge()
|
||||||
->color('info')
|
->color('info')
|
||||||
->formatStateUsing(fn ($state) => is_array($state) ? count($state) : 0),
|
->getStateUsing(function (BackupItem $record): int {
|
||||||
|
$assignments = $record->policyVersion?->assignments ?? $record->assignments ?? [];
|
||||||
|
|
||||||
|
return is_array($assignments) ? count($assignments) : 0;
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('scope_tags')
|
Tables\Columns\TextColumn::make('scope_tags')
|
||||||
->label('Scope Tags')
|
->label('Scope Tags')
|
||||||
->badge()
|
|
||||||
->separator(',')
|
|
||||||
->default('—')
|
->default('—')
|
||||||
->formatStateUsing(function ($state, BackupItem $record) {
|
->getStateUsing(function (BackupItem $record): array {
|
||||||
// Get scope tags from PolicyVersion if available
|
$tags = $record->policyVersion?->scope_tags['names'] ?? [];
|
||||||
if ($record->policyVersion && ! empty($record->policyVersion->scope_tags)) {
|
|
||||||
$tags = $record->policyVersion->scope_tags;
|
return is_array($tags) ? $tags : [];
|
||||||
if (is_array($tags) && isset($tags['names'])) {
|
})
|
||||||
return implode(', ', $tags['names']);
|
->formatStateUsing(function ($state): string {
|
||||||
}
|
if (is_array($state)) {
|
||||||
|
return $state === [] ? '—' : implode(', ', $state);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_string($state) && $state !== '') {
|
||||||
|
return $state;
|
||||||
}
|
}
|
||||||
|
|
||||||
return '—';
|
return '—';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user