mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 18:44:46 +02:00
Fix deleted users being shown as "System" in activity log (#1010)
* Show deleted users as "Deleted user" * Update shown icon * Apply suggestions from code review Co-authored-by: Boy132 <Boy132@users.noreply.github.com> * Update app/Models/ActivityLog.php Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com> --------- Co-authored-by: Boy132 <Boy132@users.noreply.github.com> Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com>
This commit is contained in:
parent
b355830db4
commit
206cc76a8b
@ -42,7 +42,7 @@ class ListActivities extends ListRecords
|
||||
TextColumn::make('user')
|
||||
->state(function (ActivityLog $activityLog) use ($server) {
|
||||
if (!$activityLog->actor instanceof User) {
|
||||
return 'System';
|
||||
return $activityLog->actor_id === null ? 'System' : 'Deleted user';
|
||||
}
|
||||
|
||||
$user = $activityLog->actor->username;
|
||||
@ -72,7 +72,7 @@ class ListActivities extends ListRecords
|
||||
TextInput::make('user')
|
||||
->formatStateUsing(function (ActivityLog $activityLog) use ($server) {
|
||||
if (!$activityLog->actor instanceof User) {
|
||||
return 'System';
|
||||
return $activityLog->actor_id === null ? 'System' : 'Deleted user';
|
||||
}
|
||||
|
||||
$user = $activityLog->actor->username;
|
||||
|
@ -153,7 +153,11 @@ class ActivityLog extends Model implements HasIcon, HasLabel
|
||||
return 'tabler-api';
|
||||
}
|
||||
|
||||
return $this->actor instanceof User ? 'tabler-user' : 'tabler-device-desktop';
|
||||
if ($this->actor instanceof User) {
|
||||
return 'tabler-user';
|
||||
}
|
||||
|
||||
return $this->actor_id === null ? 'tabler-device-desktop' : 'tabler-user-off';
|
||||
}
|
||||
|
||||
public function getLabel(): string
|
||||
|
Loading…
x
Reference in New Issue
Block a user