mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
Merge pull request #694 from hargata/Hargata/kiosk.token
more kiosk fixes.
This commit is contained in:
commit
82634e9e1b
@ -40,6 +40,15 @@
|
||||
errorToast('Location Services not Enabled');
|
||||
}
|
||||
}
|
||||
function setAccessToken(accessToken){
|
||||
//use this function to never worry about user session expiring.
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'Authorization': `Basic ${accessToken}`
|
||||
}
|
||||
});
|
||||
console.log("Access Token for Kiosk Mode Configured!");
|
||||
}
|
||||
function retrieveKioskContent(){
|
||||
clearInterval(refreshTimer);
|
||||
if (kioskMode != 'Cycle'){
|
||||
@ -93,9 +102,6 @@
|
||||
}, 100);
|
||||
}
|
||||
function addVehicleToExceptionList(vehicleId) {
|
||||
if (kioskMode == 'Cycle') {
|
||||
return;
|
||||
}
|
||||
Swal.fire({
|
||||
title: "Remove Vehicle from Dashboard?",
|
||||
text: "Removed vehicles can be restored by refreshing the page",
|
||||
@ -105,7 +111,13 @@
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
exceptionList.push(vehicleId);
|
||||
retrieveKioskContent();
|
||||
if (kioskMode == 'Cycle') {
|
||||
//remove the vehicle programmatically.
|
||||
$(`[data-vehicleId=${vehicleId}]`).remove();
|
||||
} else {
|
||||
//force a refresh
|
||||
retrieveKioskContent();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<div class="row row-cols-1 row-cols-md-3 g-4 mt-1 kiosk-content" data-masonry='{"percentPosition": true }'>
|
||||
@foreach (VehicleInfo vehicle in Model)
|
||||
{
|
||||
<div class="col">
|
||||
<div class="col" data-vehicleId="@vehicle.VehicleData.Id">
|
||||
<div class="card" onclick="addVehicleToExceptionList(@vehicle.VehicleData.Id)">
|
||||
<div class="card-body" style="padding-top:0.25rem; padding-bottom:0.25rem;">
|
||||
<h5 class="card-title">@($"{vehicle.VehicleData.Year} {vehicle.VehicleData.Make} {vehicle.VehicleData.Model} ({StaticHelper.GetVehicleIdentifier(vehicle.VehicleData)})")</h5>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user