This commit is contained in:
Luna 2025-04-30 21:32:48 +02:00
parent 049a669186
commit c0a1da23ec
8 changed files with 18 additions and 9 deletions

View file

@ -26,6 +26,10 @@
"description": "URL where your Snipe-IT install will be available at.",
"value": "https://your-app-name.herokuapp.com"
},
"LABEL_URL": {
"description": "Labels",
"value": "https://your-app-name.herokuapp.com"
},
"APP_TIMEZONE": {
"description": "Which timezone do you want to use for your install? (http://php.net/manual/en/timezones.php)",
"value": "UTC"

View file

@ -142,6 +142,9 @@ class Label implements View
case 'location':
$barcode2DTarget = route('locations.show', $asset->location_id);
break;
case 'custom_url_hardware_id':
$barcode2DTarget = route('hardware.show', $asset);
break;
case 'hardware_id':
default:
$barcode2DTarget = route('hardware.show', $asset);

View file

@ -74,6 +74,7 @@ return [
*/
'url' => env('APP_URL', 'http://localhost'),
'label_url' => env('LABEL_URL', 'http://localhost'),
/*
|--------------------------------------------------------------------------

View file

@ -217,7 +217,7 @@
$.ajax({
type: 'GET',
url: "{{ config('app.url') }}/models/" + modelid + "/custom_fields",
url: "{{ config('app.label_url') }}/models/" + modelid + "/custom_fields",
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
@ -260,7 +260,7 @@
if (status_id != '') {
$(".status_spinner").css("display", "inline");
$.ajax({
url: "{{config('app.url') }}/api/v1/statuslabels/" + status_id + "/deployable",
url: "{{config('app.label_url') }}/api/v1/statuslabels/" + status_id + "/deployable",
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')

View file

@ -112,7 +112,7 @@ $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->label2_1d_type!=
@if ($settings->qr_code=='1')
<div class="qr_img">
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/qr_code" class="qr_img">
<img src="{{ config('app.label_url') }}/hardware/{{ $asset->id }}/qr_code" class="qr_img">
</div>
@endif
@ -158,7 +158,7 @@ $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->label2_1d_type!=
@if ((($settings->alt_barcode_enabled=='1') && $settings->label2_1d_type!=''))
<div class="barcode_container">
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/barcode" class="barcode">
<img src="{{ config('app.label_url') }}/hardware/{{ $asset->id }}/barcode" class="barcode">
</div>
@endif

View file

@ -276,7 +276,7 @@
function genericRowLinkFormatter(destination) {
return function (value,row) {
if (value) {
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '">' + value + '</a>';
return '<a href="{{ config('app.label_url') }}/' + destination + '/' + row.id + '">' + value + '</a>';
}
};
}
@ -318,7 +318,7 @@
text_help = '';
}
return '<nobr><a href="{{ config('app.url') }}/' + destination + '/' + value.id + '" data-tooltip="true" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';
return '<nobr><a href="{{ config('app.label_url') }}/' + destination + '/' + value.id + '" data-tooltip="true" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';
} else if ((value) && (value.name)) {
// Add some overrides for any funny urls we have
@ -328,7 +328,7 @@
var dpolymorphicItemFormatterest = 'fields/';
}
return '<nobr><a href="{{ config('app.url') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';
return '<nobr><a href="{{ config('app.label_url') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';
}
};
}
@ -341,7 +341,7 @@
function hardwareAuditFormatter(value, row) {
return '<a href="{{ config('app.url') }}/hardware/' + row.id + '/audit" class="btn btn-sm bg-yellow" data-tooltip="true" title="Audit this item">{{ trans('general.audit') }}</a>';
return '<a href="{{ config('app.label_url') }}/hardware/' + row.id + '/audit" class="btn btn-sm bg-yellow" data-tooltip="true" title="Audit this item">{{ trans('general.audit') }}</a>';
}

View file

@ -303,6 +303,7 @@
id="label2_2d_target"
:options="['hardware_id'=>'/hardware/{id} ('.trans('admin/settings/general.default').')',
'ht_tag'=>'/ht/{asset_tag}',
'custom_url_hardware_id'=>'/hardware/{id}',
'location' => '/location/{location_id}',
]"
:selected="old('label2_2d_target', $setting->label2_2d_target)"

View file

@ -91,7 +91,7 @@
function statuslabelsAssetLinkFormatter(value, row) {
if ((row) && (row.name)) {
return '<a href="{{ config('app.url') }}/hardware/?status_id=' + row.id + '"> ' + row.name + '</a>';
return '<a href="{{ config('app.label_url') }}/hardware/?status_id=' + row.id + '"> ' + row.name + '</a>';
}
}