Skip to content

Commit

Permalink
Merge pull request #2683 from SCADA-LTS/release/2.7.6.1
Browse files Browse the repository at this point in the history
Release/2.7.6.1
  • Loading branch information
Limraj authored Oct 25, 2023
2 parents 3ec4bf9 + 4bc25b7 commit 10b3c97
Show file tree
Hide file tree
Showing 186 changed files with 8,286 additions and 1,564 deletions.
22 changes: 21 additions & 1 deletion WebContent/WEB-INF/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<constructor-arg value="org.scada_lts.quartz.ResetCacheHighestAlarmLevel" type="java.lang.Class"/>
</bean>

<bean id="resetHighestAlarmLevelScheduler" class="org.scada_lts.quartz.CronTriggerScheduler">
<bean id="resetHighestAlarmLevelScheduler" class="org.scada_lts.quartz.CronTriggerScheduler" destroy-method="stop">
<constructor-arg ref="schedulerFactory"/>
<constructor-arg ref="resetHighestAlarmLevelTrigger"/>
<constructor-arg ref="resetHighestAlarmLevelJob"/>
Expand Down Expand Up @@ -244,4 +244,24 @@
<constructor-arg ref="pointEventDetectorCache"/>
</bean>
<!-- -->

<bean id="loggedUsers" class="org.scada_lts.login.LoggedUsers" />

<bean id="everySecondTrigger" class="org.quartz.CronTrigger">
<constructor-arg value="Quartz - trigger-EverySecondTrigger"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="0/1 * * ? * *"/>
</bean>

<bean id="everySecondJobDetail" class="org.quartz.JobDetail">
<constructor-arg value="Quartz - job-EverySecond"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="org.scada_lts.quartz.EverySecond" type="java.lang.Class"/>
</bean>

<bean id="everySecondScheduler" class="org.scada_lts.quartz.CronTriggerScheduler" destroy-method="stop">
<constructor-arg ref="schedulerFactory"/>
<constructor-arg ref="everySecondTrigger"/>
<constructor-arg ref="everySecondJobDetail"/>
</bean>
</beans>
54 changes: 54 additions & 0 deletions WebContent/WEB-INF/jsp/systemSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@
$set("<c:out value="<%= SystemSettingsDAO.EVENT_PENDING_LIMIT %>"/>", settings.<c:out value="<%= SystemSettingsDAO.EVENT_PENDING_LIMIT %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.EVENT_PENDING_CACHE_ENABLED %>"/>", settings.<c:out value="<%= SystemSettingsDAO.EVENT_PENDING_CACHE_ENABLED %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ENABLED %>"/>", settings.<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ENABLED %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>", settings.<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_LIMIT %>"/>", settings.<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_LIMIT %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.THREADS_NAME_ADDITIONAL_LENGTH %>"/>", settings.<c:out value="<%= SystemSettingsDAO.THREADS_NAME_ADDITIONAL_LENGTH %>"/>);
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 %>"/>);
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 @@ -264,6 +273,23 @@
setDisabled($("<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_USERNAME %>"/>"), !proxy);
setDisabled($("<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_PASSWORD %>"/>"), !proxy);
}
function workItemsReportingEnabledChange() {
var workItemsReportingEnabled = $("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ENABLED %>"/>").checked;
if(!workItemsReportingEnabled) {
$set("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>", false);
workItemsReportingItemsPerSecondEnabledChange();
}
setDisabled($("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>"), !workItemsReportingEnabled);
}
function workItemsReportingItemsPerSecondEnabledChange() {
var workItemsReportingItemsPerSecondEnabled = $("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>").checked;
if(!workItemsReportingItemsPerSecondEnabled) {
$set("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_LIMIT %>"/>", 0);
}
setDisabled($("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_LIMIT %>"/>"), !workItemsReportingItemsPerSecondEnabled);
}
function saveMiscSettings() {
SystemSettingsDwr.saveMiscSettings(
Expand All @@ -273,6 +299,10 @@
$get("<c:out value="<%= SystemSettingsDAO.VIEW_HIDE_SHORTCUT_DISABLE_FULL_SCREEN %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.EVENT_PENDING_LIMIT %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.EVENT_PENDING_CACHE_ENABLED %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ENABLED %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_LIMIT %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.THREADS_NAME_ADDITIONAL_LENGTH %>"/>"),
function(response) {
stopImageFader("saveMiscSettingsImg");
if (response.hasMessages)
Expand Down Expand Up @@ -888,6 +918,30 @@
<input id="<c:out value="<%= SystemSettingsDAO.EVENT_PENDING_LIMIT %>"/>" type="number" class="formShort"/>
</td>
</tr>
<tr>
<td class="formLabelRequired"><fmt:message key="systemsettings.workitems.reporting.enabled"/></td>
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ENABLED %>"/>" type="checkbox" onchange="workItemsReportingEnabledChange()"/>
</td>
</tr>
<tr>
<td class="formLabelRequired"><fmt:message key="systemsettings.workitems.reporting.itemspersecond.enabled"/></td>
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_ENABLED %>"/>" type="checkbox" onchange="workItemsReportingItemsPerSecondEnabledChange()"/>
</td>
</tr>
<tr>
<td class="formLabelRequired"><fmt:message key="systemsettings.workitems.reporting.itemspersecond.limit"/></td>
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.WORK_ITEMS_REPORTING_ITEMS_PER_SECOND_LIMIT %>"/>" type="number" class="formShort"/>
</td>
</tr>
<tr>
<td class="formLabelRequired"><fmt:message key="systemsettings.threads.name.additional.length"/></td>
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.THREADS_NAME_ADDITIONAL_LENGTH %>"/>" type="number" class="formShort"/>
</td>
</tr>
<tr>
<td colspan="2" id="miscMessage" class="formError"></td>
</tr>
Expand Down
46 changes: 44 additions & 2 deletions WebContent/WEB-INF/spring-security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,50 @@
<session-management session-fixation-protection="none"/>
</http>

<http use-expressions="true" disable-url-rewriting="true" pattern="/api/secure/work-items/**"
authentication-manager-ref="authenticationManager" entry-point-ref="basicAuthenticationEntryPoint">
<headers>
<cache-control disabled="true"/>
<content-type-options disabled="true"/>
<hsts/>
<frame-options policy="SAMEORIGIN"/>
<xss-protection/>
<header ref="headersFromSystemSettingsWriter"/>
</headers>
<csrf disabled="true"/>

<!-- Only Admin -->
<intercept-url pattern="/**" access="hasRole('ROLE_ADMIN')" method="DELETE" requires-channel="https"/>

<!-- Other -->
<intercept-url pattern="/**" access="hasAnyRole('ROLE_ADMIN')" requires-channel="https"/>

<custom-filter position="BASIC_AUTH_FILTER" ref="basicAuthFilter"/>
<session-management session-fixation-protection="none"/>
</http>

<http use-expressions="true" disable-url-rewriting="true" pattern="/api/secure/threads/**"
authentication-manager-ref="authenticationManager" entry-point-ref="basicAuthenticationEntryPoint">
<headers>
<cache-control disabled="true"/>
<content-type-options disabled="true"/>
<hsts/>
<frame-options policy="SAMEORIGIN"/>
<xss-protection/>
<header ref="headersFromSystemSettingsWriter"/>
</headers>
<csrf disabled="true"/>

<!-- Only Admin -->
<intercept-url pattern="/**" access="hasRole('ROLE_ADMIN')" method="DELETE" requires-channel="https"/>

<!-- Other -->
<intercept-url pattern="/**" access="hasAnyRole('ROLE_ADMIN')" requires-channel="https"/>

<custom-filter position="BASIC_AUTH_FILTER" ref="basicAuthFilter"/>
<session-management session-fixation-protection="none"/>
</http>

<http use-expressions="true" disable-url-rewriting="true"
authentication-manager-ref="authenticationManager">
<headers>
Expand Down Expand Up @@ -190,7 +234,6 @@
<intercept-url pattern="/export/**" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<intercept-url pattern="/eventExport/**" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<intercept-url pattern="/userCommentExport/**" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<intercept-url pattern="/userCommentExport/**" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<intercept-url pattern="/reportImageChart/**" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
<intercept-url pattern="/reportChart.shtm" access="@guard.hasReportInstanceReadPermission(request,false,'instanceId')" />
<intercept-url pattern="/reports.shtm" access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')" />
Expand Down Expand Up @@ -225,7 +268,6 @@
<!-- DataSources and DataPoints -->
<intercept-url pattern="/dwr/call/plaincall/DataSourceEditDwr.*.dwr" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/dwr/call/plaincall/DataPointEditDwr.*.dwr" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/dwr/call/plaincall/DataPointDetailsDwr.*.dwr" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/data_source_edit.shtm" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/data_sources.shtm" access="hasRole('ROLE_ADMIN')" />

Expand Down
2 changes: 1 addition & 1 deletion WebContent/WEB-INF/tags/alarmAck.tag
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<c:choose>
<c:when test="${event.acknowledged}"><tag:img png="tick_off" title="events.acknowledged" style="display:inline;"/></c:when>
<c:otherwise>
<tag:img png="tick" id="ackImg${event.id}" onclick="ackEvent(${event.id})" title="events.acknowledge" style="display:inline;"/>
<c:if test="${not event.active}"><tag:img png="tick" id="ackImg${event.id}" onclick="ackEvent(${event.id})" title="events.acknowledge" style="display:inline;"/></c:if>
<c:choose>
<c:when test="${event.silenced}">
<tag:img png="sound_mute" id="silenceImg${event.id}" onclick="toggleSilence(${event.id})" title="events.unsilence" style="display:inline;"/>
Expand Down
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ plugins {
id 'java'
}

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

sourceCompatibility = 1.11
targetCompatibility = 1.11
Expand Down Expand Up @@ -197,5 +199,10 @@ test {
includeTestsMatching "org.scada_lts.dao.IsEventDetectorXidUniqueTest"
includeTestsMatching "com.serotonin.mango.view.export.CsvWriterTest"
includeTestsMatching "com.serotonin.mango.util.EmailValidatorTest"
includeTestsMatching "com.serotonin.mango.vo.LoggedUserTestsSuite"
includeTestsMatching "org.scada_lts.utils.ThreadUtilsTest"
includeTestsMatching "com.serotonin.mango.rt.maint.work.CreateWorkItemToStringTest"
includeTestsMatching "com.serotonin.util.SerializationHelperTest"
includeTestsMatching "org.scada_lts.web.mvc.api.json.WorkItemInfoListTest"
}
}
Loading

0 comments on commit 10b3c97

Please sign in to comment.