more kiosk fixes.
This commit is contained in:
@@ -40,6 +40,15 @@
|
|||||||
errorToast('Location Services not Enabled');
|
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(){
|
function retrieveKioskContent(){
|
||||||
clearInterval(refreshTimer);
|
clearInterval(refreshTimer);
|
||||||
if (kioskMode != 'Cycle'){
|
if (kioskMode != 'Cycle'){
|
||||||
@@ -93,9 +102,6 @@
|
|||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
function addVehicleToExceptionList(vehicleId) {
|
function addVehicleToExceptionList(vehicleId) {
|
||||||
if (kioskMode == 'Cycle') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: "Remove Vehicle from Dashboard?",
|
title: "Remove Vehicle from Dashboard?",
|
||||||
text: "Removed vehicles can be restored by refreshing the page",
|
text: "Removed vehicles can be restored by refreshing the page",
|
||||||
@@ -105,7 +111,13 @@
|
|||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
exceptionList.push(vehicleId);
|
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 }'>
|
<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)
|
@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" onclick="addVehicleToExceptionList(@vehicle.VehicleData.Id)">
|
||||||
<div class="card-body" style="padding-top:0.25rem; padding-bottom:0.25rem;">
|
<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>
|
<h5 class="card-title">@($"{vehicle.VehicleData.Year} {vehicle.VehicleData.Make} {vehicle.VehicleData.Model} ({StaticHelper.GetVehicleIdentifier(vehicle.VehicleData)})")</h5>
|
||||||
|
|||||||
Reference in New Issue
Block a user