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