mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -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,
|
'visible' => true,
|
||||||
'formatter' => 'hardwareLinkFormatter',
|
'formatter' => 'hardwareLinkFormatter',
|
||||||
], [
|
], [
|
||||||
'field' => 'image',
|
'field' => 'file',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'switchable' => true,
|
'switchable' => true,
|
||||||
'title' => trans('admin/hardware/table.image'),
|
'title' => trans('admin/hardware/table.image'),
|
||||||
'visible' => false,
|
'visible' => false,
|
||||||
'formatter' => 'imageFormatter',
|
'formatter' => 'auditImageFormatter',
|
||||||
], [
|
], [
|
||||||
'field' => 'asset_tag',
|
'field' => 'asset_tag',
|
||||||
'searchable' => true,
|
'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) {
|
function imageFormatter(value, row) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
||||||
// This is a clunky override to handle unusual API responses where we're presenting a link instead of an array
|
// 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>
|
<thead>
|
||||||
<tr>
|
<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="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="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
|
||||||
<th class="col-sm-2" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
<th class="col-sm-2" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
||||||
|
|
Loading…
Reference in a new issue