fixed audit log image not appearing

This commit is contained in:
Godfrey M 2023-06-12 12:10:19 -07:00
parent d1ab139b0f
commit 6dd7181d09
3 changed files with 9 additions and 5 deletions

View file

@ -44,13 +44,13 @@ class AssetAuditPresenter extends Presenter
'visible' => true,
'formatter' => 'hardwareLinkFormatter',
], [
'field' => 'image',
'field' => 'file',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/hardware/table.image'),
'visible' => false,
'formatter' => 'imageFormatter',
'formatter' => 'auditImageFormatter',
], [
'field' => 'asset_tag',
'searchable' => true,

View file

@ -652,11 +652,15 @@
}
}
function auditImageFormatter(value){
if (value){
return '<a href="' + value.url + '" data-toggle="lightbox" data-type="image"><img src="' + value.url + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a>'
}
}
function imageFormatter(value, row) {
if (value) {
// This is a clunky override to handle unusual API responses where we're presenting a link instead of an array

View file

@ -34,7 +34,7 @@
<thead>
<tr>
<th class="col-sm-1" data-field="image" data-visible="false" data-formatter="imageFormatter">{{ trans('admin/hardware/table.image') }}</th>
<th class="col-sm-1" data-field="file" data-visible="false" data-formatter="auditImageFormatter">{{ trans('admin/hardware/table.image') }}</th>
<th class="col-sm-2" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.audit') }}</th>
<th class="col-sm-2" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-2" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>