Add PC-machine relationships API and report, fix shopfloor dashboard
- Add getPCMachineRelationships API endpoint for PC-to-machine mappings - Add pcmachinerelationships.asp report page with copy table/CSV/JSON export - Fix shopfloor dashboard to immediately hide deactivated notifications - Add Firewall (machinetypeid 46) support to network device pages - Add model migration warning banner to networkdevices.asp - Create SQL script for hybrid model/machine type view Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1186,15 +1186,40 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Fallback timeout for pendingDataRender
|
||||
let pendingDataTimeout = null;
|
||||
|
||||
// Render events on the page (with smart delay during transitions)
|
||||
function renderEvents(data) {
|
||||
// If any carousel is mid-transition, delay the render
|
||||
if (isTransitioning || isNonIncidentTransitioning || isRecognitionTransitioning) {
|
||||
console.log('Carousel: Transition in progress, delaying render by 800ms');
|
||||
console.log('Carousel: Transition in progress, delaying render');
|
||||
pendingDataRender = data;
|
||||
|
||||
// Fallback: if pendingDataRender isn't processed within 1 second, force render
|
||||
if (pendingDataTimeout) clearTimeout(pendingDataTimeout);
|
||||
pendingDataTimeout = setTimeout(() => {
|
||||
if (pendingDataRender) {
|
||||
console.log('Carousel: Fallback timeout - forcing render of pending data');
|
||||
// Reset all transition flags in case they're stuck
|
||||
isTransitioning = false;
|
||||
isNonIncidentTransitioning = false;
|
||||
isRecognitionTransitioning = false;
|
||||
const dataToRender = pendingDataRender;
|
||||
pendingDataRender = null;
|
||||
renderEvents(dataToRender);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear fallback timeout since we're rendering now
|
||||
if (pendingDataTimeout) {
|
||||
clearTimeout(pendingDataTimeout);
|
||||
pendingDataTimeout = null;
|
||||
}
|
||||
|
||||
const container = document.getElementById('eventsContainer');
|
||||
let html = '';
|
||||
|
||||
@@ -1539,6 +1564,14 @@
|
||||
currentItem.classList.remove('exit-up');
|
||||
currentItem.classList.add('enter-down');
|
||||
isNonIncidentTransitioning = false;
|
||||
|
||||
// If there's pending data to render, render it now
|
||||
if (pendingDataRender) {
|
||||
console.log('Non-Incident Carousel: Transition complete, rendering pending data');
|
||||
const dataToRender = pendingDataRender;
|
||||
pendingDataRender = null;
|
||||
renderEvents(dataToRender);
|
||||
}
|
||||
}, 800);
|
||||
|
||||
currentNonIncidentIndex = nextIndex;
|
||||
@@ -1681,6 +1714,14 @@
|
||||
currentItem.classList.remove('exit-up');
|
||||
currentItem.classList.add('enter-down');
|
||||
isRecognitionTransitioning = false;
|
||||
|
||||
// If there's pending data to render, render it now
|
||||
if (pendingDataRender) {
|
||||
console.log('Recognition Carousel: Transition complete, rendering pending data');
|
||||
const dataToRender = pendingDataRender;
|
||||
pendingDataRender = null;
|
||||
renderEvents(dataToRender);
|
||||
}
|
||||
}, 800);
|
||||
|
||||
currentRecognitionIndex = nextIndex;
|
||||
@@ -1853,6 +1894,10 @@
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
// Debug: log recognition count
|
||||
const recCount = data.current ? data.current.filter(e => e.typecolor === 'recognition').length : 0;
|
||||
console.log(`Fetch: Got ${recCount} recognitions, ${data.current ? data.current.length : 0} total current events`);
|
||||
|
||||
renderEvents(data);
|
||||
updateLastUpdateTime();
|
||||
setConnectionStatus(true);
|
||||
|
||||
Reference in New Issue
Block a user