mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
fixed audit log image not appearing
This commit is contained in:
parent
d1ab139b0f
commit
6dd7181d09
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue