Skip to content

Commit

Permalink
Merge pull request #2951 from SCADA-LTS/feature/#2746_Added_assignee_…
Browse files Browse the repository at this point in the history
…function_for_events

Feature/#2746 added assignee function for events
  • Loading branch information
Limraj authored Aug 6, 2024
2 parents ef71751 + 3931660 commit 43ac248
Show file tree
Hide file tree
Showing 57 changed files with 1,087 additions and 253 deletions.
1 change: 1 addition & 0 deletions WebContent/WEB-INF/jsp/events.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
<option value="<c:out value="<%= EventsDwr.STATUS_ACTIVE %>"/>"><fmt:message key="common.active"/></option>
<option value="<c:out value="<%= EventsDwr.STATUS_RTN %>"/>"><fmt:message key="event.rtn.rtn"/></option>
<option value="<c:out value="<%= EventsDwr.STATUS_NORTN %>"/>"><fmt:message key="common.nortn"/></option>
<option value="<c:out value="<%= EventsDwr.STATUS_ASSIGNEE %>"/>"><fmt:message key="common.assignee"/></option>
</select>
</td>
</tr>
Expand Down
13 changes: 12 additions & 1 deletion WebContent/WEB-INF/jsp/include/customEditor.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
<td class="formLabel"><fmt:message key="viewEdit.graphic.hideAckColumn"/></td>
<td class="formField"><input id="customEditorAlarmListAckColumn" type="checkbox"/></td>
</tr>
<c:if test="${isEventAssignEnabled}">
<tr>
<td class="formLabel"><fmt:message key="viewEdit.graphic.hideAssigneeColumn"/></td>
<td class="formField"><input id="customEditorAlarmListAssigneeColumn" type="checkbox"/></td>
</tr>
</c:if>
</tbody>

<tbody id="customEditor_button" style="display:none;">
Expand Down Expand Up @@ -103,6 +109,10 @@
$set("customEditorAlarmListInactivityColumn",comp.hideInactivityColumn);
$set("customEditorAlarmListAckColumn",comp.hideAckColumn);
if('${isEventAssignEnabled}' !== '') {
$set("customEditorAlarmListAssigneeColumn",comp.hideAssigneeColumn);
}
} else if(comp.typeName == "yourCustomComponent") {
}
Expand All @@ -120,13 +130,14 @@
this.save = function() {
//hideContextualMessages("graphicRendererEditorPopup");
let customEditorAlarmListAssigneeColumn = '${isEventAssignEnabled}' !== '' ? $get("customEditorAlarmListAssigneeColumn") : false;
if (customEditor.typeName == "alarmlist")
ViewDwr.saveAlarmListComponent(customEditor.componentId,
$get("customEditorAlarmListMinAlarmLevel"), $get("customEditorAlarmListMaxListSize"),
$get("customEditorAlarmListWidth"),$get("customEditorAlarmListIdColumn"),
$get("customEditorAlarmListAlarmLevelColumn"),$get("customEditorAlarmListTimestampColumn"),
$get("customEditorAlarmListInactivityColumn"),$get("customEditorAlarmListAckColumn"),
viewId, customEditor.saveCB);
viewId, customEditorAlarmListAssigneeColumn, customEditor.saveCB);
else if (customEditor.typeName == "yourCustomComponent")
alert('save your custom component component!');
Expand Down
8 changes: 8 additions & 0 deletions WebContent/WEB-INF/jsp/systemSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
setDisabled($("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>"), !settings.<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ENABLED %>"/>);
setDisabled($("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_LIMIT %>"/>"), !settings.<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ENABLED %>"/> || !settings.<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.EVENT_ASSIGN_ENABLED %>"/>", settings.<c:out value="<%= SystemSettingsDAO.EVENT_ASSIGN_ENABLED %>"/>);
var sel = $("<c:out value="<%= SystemSettingsDAO.LANGUAGE %>"/>");
<c:forEach items="${availableLanguages}" var="lang">
sel.options[sel.options.length] = new Option("${lang.value}", "${lang.key}");
Expand Down Expand Up @@ -308,6 +309,7 @@
$get("<c:out value="<%= SystemSettingsDAO.THREADS_NAME_ADDITIONAL_LENGTH %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.WEB_RESOURCE_GRAPHICS_PATH %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.EVENT_ASSIGN_ENABLED %>"/>"),
function(response) {
stopImageFader("saveMiscSettingsImg");
if (response.hasMessages)
Expand Down Expand Up @@ -961,6 +963,12 @@
</td>
<td colspan="2" id="graphicsPathMessage" class="formError"></td>
</tr>
<tr>
<td class="formLabelRequired"><fmt:message key="event.assign.enabled"/></td>
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.EVENT_ASSIGN_ENABLED %>"/>" type="checkbox" />
</td>
</tr>
<tr>
<td colspan="2" id="miscMessage" class="formError"></td>
</tr>
Expand Down
12 changes: 11 additions & 1 deletion WebContent/WEB-INF/snippet/alarmList.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<c:if test="${!hideTimestampColumn}"><td><fmt:message key="common.time"/></td></c:if>
<td><fmt:message key="events.msg"/></td>
<c:if test="${!hideInactivityColumn}"><td><fmt:message key="common.inactiveTime"/></td></c:if>
<c:if test="${isEventAssignEnabled and !hideAssigneeColumn}"><td><sst:i18n key="common.assignee"/></td></c:if>
<c:if test="${!hideAckColumn}"> <td>&nbsp;</td></c:if>
</tr>
<c:if test="${empty events}"><tr><td colspan="6"><b><fmt:message key="events.emptyList"/></b></td></tr></c:if>
Expand All @@ -33,7 +34,8 @@
<c:if test="${!hideAlarmLevelColumn}"><td align="center"><tag:eventIcon event="${event}"/></td></c:if>
<c:if test="${!hideTimestampColumn}"><td align="center">${sst:time(event.activeTimestamp)}</td></c:if>
<td onmouseover="this.style.whiteSpace='normal'" onmouseout="this.style.whiteSpace='nowrap'" style=" white-space: nowrap; max-width:100vh;">
<p style="margin:auto; overflow: hidden; text-overflow: ellipsis; font-weight: bold;"><sst:i18n message="${event.message}"/></p></td>
<p style="margin:auto; overflow: hidden; text-overflow: ellipsis; font-weight: bold;"><sst:i18n message="${event.message}"/></p>
</td>
<c:if test="${!hideInactivityColumn}">
<td>
<c:choose>
Expand All @@ -48,6 +50,14 @@
</c:choose>
</td>
</c:if>
<c:if test="${isEventAssignEnabled and !hideAssigneeColumn}">
<td>
<c:if test="${event.assignee}">
${sst:time(event.assigneeTimestamp)}
<sst:i18n message="${event.assigneeMessage}"/>
</c:if>
</td>
</c:if>
<c:if test="${!hideAckColumn}"> <td> <tag:alarmAck event="${event}"/></td></c:if>
</tr>
</c:forEach>
Expand Down
72 changes: 9 additions & 63 deletions WebContent/WEB-INF/snippet/eventList.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<td><sst:i18n key="events.msg"/></td>
<td><sst:i18n key="common.inactiveTime"/></td>
<c:if test="${!pendingEvents}"><td><sst:i18n key="events.acknowledged"/></td></c:if>
<c:if test="${isEventAssignEnabled}"><td><sst:i18n key="common.assignee"/></td></c:if>
<td></td>
</tr>
<c:if test="${empty events}"><tr><td colspan="6"><b><sst:i18n key="events.emptyList"/></b></td></tr></c:if>
Expand Down Expand Up @@ -103,71 +104,16 @@
</c:if>
</td>
</c:if>
<c:if test="${isEventAssignEnabled}">
<td>
<c:if test="${event.assignee}">
${sst:time(event.assigneeTimestamp)}
<sst:i18n message="${event.assigneeMessage}"/>
</c:if>
</td>
</c:if>
<td style="white-space:nowrap;">
<tag:alarmAck event="${event}"/>
<c:choose>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.DATA_POINT']}">
<a href="data_point_details.shtm?dpid=${event.eventType.dataPointId}"><tag:img png="icon_comp" title="events.pointDetails"/></a>
</c:when>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.DATA_SOURCE']}">
<a href="data_source_edit.shtm?dsid=${event.eventType.dataSourceId}"><tag:img png="icon_ds_edit" title="events.editDataSource"/></a>
</c:when>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.SYSTEM']}">
<c:choose>
<c:when test="${event.eventType.systemEventTypeId == applicationScope['constants.SystemEventType.TYPE_VERSION_CHECK']}">
<a href="http://mango.serotoninsoftware.com/download.jsp" target="_blank"><tag:img png="bullet_down" title="events.downloadMango"/></a>
</c:when>
<c:when test="${event.eventType.systemEventTypeId == applicationScope['constants.SystemEventType.TYPE_COMPOUND_DETECTOR_FAILURE']}">
<a href="compound_events.shtm?cedid=${event.eventType.referenceId2}"><tag:img png="multi_bell" title="events.editCompound"/></a>
</c:when>
<c:when test="${event.eventType.systemEventTypeId == applicationScope['constants.SystemEventType.TYPE_SET_POINT_HANDLER_FAILURE']}">
<a href="event_handlers.shtm?ehid=${event.eventType.referenceId2}"><tag:img png="cog" title="events.editEventHandler"/></a>
</c:when>
<c:when test="${event.eventType.systemEventTypeId == applicationScope['constants.SystemEventType.TYPE_POINT_LINK_FAILURE']}">
<a href="point_links.shtm?plid=${event.eventType.referenceId2}"><tag:img png="link" title="events.editPointLink"/></a>
</c:when>
</c:choose>
</c:when>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.COMPOUND']}">
<a href="compound_events.shtm?cedid=${event.eventType.compoundEventDetectorId}"><tag:img png="multi_bell" title="events.editCompound"/></a>
</c:when>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.SCHEDULED']}">
<a href="scheduled_events.shtm?seid=${event.eventType.scheduleId}"><tag:img png="clock" title="events.editScheduledEvent"/></a>
</c:when>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.PUBLISHER']}">
<a href="publisher_edit.shtm?pid=${event.eventType.publisherId}"><tag:img png="transmit_edit" title="events.editPublisher"/></a>
</c:when>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.AUDIT']}">
<c:choose>
<c:when test="${event.eventType.auditEventTypeId == applicationScope['constants.AuditEventType.TYPE_DATA_SOURCE']}">
<a href="data_source_edit.shtm?dsid=${event.eventType.referenceId2}"><tag:img png="icon_ds_edit" title="events.editDataSource"/></a>
</c:when>
<c:when test="${event.eventType.auditEventTypeId == applicationScope['constants.AuditEventType.TYPE_DATA_POINT']}">
<a href="data_point_edit.shtm?dpid=${event.eventType.referenceId2}"><tag:img png="icon_comp_edit" title="events.pointEdit"/></a>
<a href="data_source_edit.shtm?pid=${event.eventType.referenceId2}"><tag:img png="icon_ds_edit" title="events.editDataSource"/></a>
</c:when>
<c:when test="${event.eventType.auditEventTypeId == applicationScope['constants.AuditEventType.TYPE_POINT_EVENT_DETECTOR']}">
<a href="data_point_edit.shtm?pedid=${event.eventType.referenceId2}"><tag:img png="icon_comp_edit" title="events.pointEdit"/></a>
</c:when>
<c:when test="${event.eventType.auditEventTypeId == applicationScope['constants.AuditEventType.TYPE_COMPOUND_EVENT_DETECTOR']}">
<a href="compound_events.shtm?cedid=${event.eventType.referenceId2}"><tag:img png="multi_bell" title="events.editCompound"/></a>
</c:when>
<c:when test="${event.eventType.auditEventTypeId == applicationScope['constants.AuditEventType.TYPE_SCHEDULED_EVENT']}">
<a href="scheduled_events.shtm?seid=${event.eventType.referenceId2}"><tag:img png="clock" title="events.editScheduledEvent"/></a>
</c:when>
<c:when test="${event.eventType.auditEventTypeId == applicationScope['constants.AuditEventType.TYPE_EVENT_HANDLER']}">
<a href="event_handlers.shtm?ehid=${event.eventType.referenceId2}"><tag:img png="cog" title="events.editEventHandler"/></a>
</c:when>
<c:when test="${event.eventType.auditEventTypeId == applicationScope['constants.AuditEventType.TYPE_POINT_LINK']}">
<a href="point_links.shtm?plid=${event.eventType.referenceId2}"><tag:img png="link" title="events.editPointLink"/></a>
</c:when>
</c:choose>
</c:when>
<c:when test="${event.eventType.eventSourceId == applicationScope['constants.EventType.EventSources.MAINTENANCE']}">
<a href="maintenance_events.shtm?meid=${event.eventType.maintenanceId}"><tag:img png="hammer" title="events.editMaintenanceEvent"/></a>
</c:when>
<c:otherwise>(unknown event source id ${event.eventType.eventSourceId})</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
Expand Down
5 changes: 5 additions & 0 deletions WebContent/WEB-INF/spring-security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
<intercept-url pattern="/dwr/call/plaincall/MiscDwr.acknowledgeAllPendingEvents.dwr" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER', 'ROLE_PUBLIC')" />
<intercept-url pattern="/dwr/call/plaincall/MiscDwr.toggleSilence.dwr" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER', 'ROLE_PUBLIC')" />
<intercept-url pattern="/dwr/call/plaincall/MiscDwr.acknowledgeEvent.dwr" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER', 'ROLE_PUBLIC')" />
<intercept-url pattern="/dwr/call/plaincall/MiscDwr.assignEvent.dwr" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<intercept-url pattern="/dwr/call/plaincall/MiscDwr.unassignEvent.dwr" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />

<intercept-url pattern="/dwr/call/plaincall/MiscDwr.silenceAll.dwr" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<intercept-url pattern="/dwr/call/plaincall/MiscDwr.sendTestEmail.dwr" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
Expand Down Expand Up @@ -392,6 +394,9 @@
<intercept-url pattern="/api/events/search" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER', 'ROLE_PUBLIC')" method="POST" />
<intercept-url pattern="/api/events/highestUnsilencedLevelAlarm" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER', 'ROLE_PUBLIC')" method="GET" />
<intercept-url pattern="/api/events/datapoint/{id}" access="@guard.hasDataPointReadPermission(request,#id,false)" method="GET" />
<intercept-url pattern="/api/events/ack/{id}" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" method="PUT" />
<intercept-url pattern="/api/events/assign/{id}" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" method="PUT" />
<intercept-url pattern="/api/events/unassign/{id}" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" method="PUT" />

<!-- Alarm GET -->
<intercept-url pattern="/api/alarms/live/{offset}/{limit}" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER', 'ROLE_PUBLIC')" method="GET" />
Expand Down
Loading

0 comments on commit 43ac248

Please sign in to comment.