mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
move outdated gantt warning into connected list
This commit is contained in:
@@ -119,11 +119,9 @@ nav ul li a.active {
|
|||||||
color: var(--blender-selected-object, var(--nav-link-hover-color));
|
color: var(--blender-selected-object, var(--nav-link-hover-color));
|
||||||
}
|
}
|
||||||
|
|
||||||
.warning {
|
.warning,
|
||||||
|
.warning-icon {
|
||||||
color: var(--blender-info-warning, var(--warning-color));
|
color: var(--blender-info-warning, var(--warning-color));
|
||||||
margin-bottom: var(--margin-small);
|
|
||||||
padding: var(--padding-tiny);
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-description {
|
.table-description {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// keeps track of blenders connected in form of
|
// keeps track of blenders connected in form of
|
||||||
// shown:bool, workSchedule: {}, ganttTasks: {},
|
// shown:bool, workSchedule: {}, ganttTasks: {}, warning: bool
|
||||||
const connectedClients = {};
|
const connectedClients = {};
|
||||||
let socket;
|
let socket;
|
||||||
|
|
||||||
@@ -135,12 +135,14 @@ function handleGanttData(data) {
|
|||||||
ifc_file: filename,
|
ifc_file: filename,
|
||||||
ganttTasks: ganttTasks,
|
ganttTasks: ganttTasks,
|
||||||
workSchedule: ganttWorkSched,
|
workSchedule: ganttWorkSched,
|
||||||
|
warning: false,
|
||||||
};
|
};
|
||||||
addGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
|
addGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
|
||||||
} else {
|
} else {
|
||||||
updateGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
|
updateGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
|
||||||
connectedClients[blenderId].workSchedule = ganttWorkSched;
|
connectedClients[blenderId].workSchedule = ganttWorkSched;
|
||||||
connectedClients[blenderId].ganttTasks = ganttTasks;
|
connectedClients[blenderId].ganttTasks = ganttTasks;
|
||||||
|
connectedClients[blenderId].warning = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
connectedClients[blenderId] = {
|
connectedClients[blenderId] = {
|
||||||
@@ -148,6 +150,7 @@ function handleGanttData(data) {
|
|||||||
ifc_file: filename,
|
ifc_file: filename,
|
||||||
ganttTasks: ganttTasks,
|
ganttTasks: ganttTasks,
|
||||||
workSchedule: ganttWorkSched,
|
workSchedule: ganttWorkSched,
|
||||||
|
warning: false,
|
||||||
};
|
};
|
||||||
addGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
|
addGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
|
||||||
}
|
}
|
||||||
@@ -172,13 +175,6 @@ function addGanttElement(blenderId, tasks, workSched, filename) {
|
|||||||
.addClass("no-print")
|
.addClass("no-print")
|
||||||
.css("margin-bottom", "10px");
|
.css("margin-bottom", "10px");
|
||||||
|
|
||||||
const warning = $("<div></div>")
|
|
||||||
.attr("id", "warning-" + blenderId)
|
|
||||||
.html(
|
|
||||||
"⚠ Warning: This Gantt Chart may contain outdated data due to recent changes in Blender."
|
|
||||||
)
|
|
||||||
.addClass("warning no-print");
|
|
||||||
|
|
||||||
const workSchedDiv = $("<div></div>").attr("id", "workSched" + blenderId);
|
const workSchedDiv = $("<div></div>").attr("id", "workSched" + blenderId);
|
||||||
|
|
||||||
const scheduleTable = $("<table></table>")
|
const scheduleTable = $("<table></table>")
|
||||||
@@ -226,7 +222,6 @@ function addGanttElement(blenderId, tasks, workSched, filename) {
|
|||||||
workSchedDiv.append(scheduleTable);
|
workSchedDiv.append(scheduleTable);
|
||||||
|
|
||||||
ganttContainer.append(ganttTitle);
|
ganttContainer.append(ganttTitle);
|
||||||
ganttContainer.append(warning);
|
|
||||||
ganttContainer.append(workSchedDiv);
|
ganttContainer.append(workSchedDiv);
|
||||||
ganttContainer.append(ganttInfoDiv);
|
ganttContainer.append(ganttInfoDiv);
|
||||||
ganttContainer.append(ganttDiv);
|
ganttContainer.append(ganttDiv);
|
||||||
@@ -367,7 +362,7 @@ function removeGanttElement(blenderId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showWarning(blenderId, isDirty) {
|
function showWarning(blenderId, isDirty) {
|
||||||
$("#warning-" + blenderId).css("display", "block");
|
connectedClients[blenderId].warning = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utility function to create a tooltip for the gantt chars
|
// Utility function to create a tooltip for the gantt chars
|
||||||
@@ -462,12 +457,29 @@ function toggleClientList() {
|
|||||||
|
|
||||||
const clientDiv = $("<div>")
|
const clientDiv = $("<div>")
|
||||||
.addClass("client")
|
.addClass("client")
|
||||||
|
.addClass(`client-${id}`)
|
||||||
.text(client.ifc_file || "Blender " + counter);
|
.text(client.ifc_file || "Blender " + counter);
|
||||||
|
|
||||||
|
if (client.warning) {
|
||||||
|
warningIcon = $("<i>")
|
||||||
|
.addClass("fas fa-triangle-exclamation warning")
|
||||||
|
.css("margin-left", "0.5rem");
|
||||||
|
clientDiv.append(warningIcon);
|
||||||
|
}
|
||||||
|
|
||||||
clientDiv.append(dropdownIcon);
|
clientDiv.append(dropdownIcon);
|
||||||
|
|
||||||
const clientDetailsDiv = $("<div>").addClass("client-details");
|
const clientDetailsDiv = $("<div>").addClass("client-details");
|
||||||
|
|
||||||
|
if (client.warning) {
|
||||||
|
warningIcon = $("<i>").addClass("fa-solid fa-triangle-exclamation");
|
||||||
|
const clientWarning = $("<div>")
|
||||||
|
.addClass("client-detail warning")
|
||||||
|
.text(" Might have outdated data due to recent changes in Blender.");
|
||||||
|
clientWarning.prepend(warningIcon);
|
||||||
|
clientDetailsDiv.append(clientWarning);
|
||||||
|
}
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
const clientId = $("<div>")
|
const clientId = $("<div>")
|
||||||
.addClass("client-detail")
|
.addClass("client-detail")
|
||||||
@@ -519,5 +531,6 @@ function toggleClientList() {
|
|||||||
|
|
||||||
clientList.append(clientDiv);
|
clientList.append(clientDiv);
|
||||||
});
|
});
|
||||||
|
|
||||||
clientList.addClass("show");
|
clientList.addClass("show");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user