Skip to content

Commit

Permalink
Merge pull request #2897 from SCADA-LTS/release/2.7.8
Browse files Browse the repository at this point in the history
Release/2.7.8
  • Loading branch information
Limraj authored Jul 10, 2024
2 parents a9a0db7 + 6791491 commit 385e8b0
Show file tree
Hide file tree
Showing 229 changed files with 6,546 additions and 1,187 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Limraj @SoftQ
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Test JUnit Scada Application
run: gradle test
- name: Show JUnit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: Java JUnit Test Results
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
working-directory: ./scadalts-ui
run: npm run-script test:unit
- name: Show Mocha Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: Java Script Mocha Unit Test Results
Expand Down Expand Up @@ -177,6 +177,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Load WAR file to cache
uses: actions/cache@v3
with:
Expand All @@ -193,17 +197,19 @@ jobs:
with:
images: scadalts/scadalts
- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push nightly Docker image
if: ${{ startsWith(github.base_ref, 'release') || startsWith(github.base_ref, 'preview') }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: scadalts/scadalts:nightly
labels: ${{ steps.meta.outputs.labels }}
7 changes: 6 additions & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Load WAR file to cache
uses: actions/cache@v3
with:
Expand All @@ -178,9 +182,10 @@ jobs:
with:
images: scadalts/scadalts
- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion WebContent/WEB-INF/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
<bean id="updatePendingEventsJobDetail" class="org.quartz.JobDetail">
<constructor-arg value="Quartz - job-UpdatePendingEvents"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="org.scada_lts.quartz.UpdatePointHierarchyCache" type="java.lang.Class"/>
<constructor-arg value="org.scada_lts.quartz.UpdatePendingEvents" type="java.lang.Class"/>
</bean>

<bean id="updatePendingEventsScheduler" class="org.scada_lts.quartz.SimpleTriggerScheduler" destroy-method="stop">
Expand Down
2 changes: 1 addition & 1 deletion WebContent/WEB-INF/jsp/app.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset=utf-8>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel=icon href=/favicon.ico>
<link rel=icon href="images/favicon.ico">
<title>SCADA-LTS</title>
<link href=resources/js-ui/app/css/app.css rel=preload as=style>
<link href=resources/js-ui/app/css/chunk-vendors.css rel=preload as=style>
Expand Down
24 changes: 15 additions & 9 deletions WebContent/WEB-INF/jsp/dataSourceEdit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,14 @@
if (typeof appendPointListColumnFunctions == 'function')
appendPointListColumnFunctions(pointListColumnHeaders, pointListColumnFunctions);
pointListColumnHeaders.push("");
pointListColumnHeaders.push(function(td) {
td.width = "10%";
});
pointListColumnFunctions.push(function(p) {
return writeImage("editImg"+ p.id, null, "icon_ds_edit", "<fmt:message key="pointDetails.editPoint"/>", "editPoint("+ p.id +")");
});
pointListColumnHeaders.push("");
pointListColumnFunctions.push(function(p) {
return writeImage("editImg"+ p.id, null, "icon_comp_edit", "<fmt:message key="pointEdit.props.props"/>", "window.location='data_point_edit.shtm?dpid="+ p.id +"'");
return writeImage("editImg" + p.id, null, "icon_ds_edit", "<fmt:message key='pointDetails.editPoint'/>", "editPoint(" + p.id + ")") +
writeImage("editImg" + p.id, null, "icon_comp_edit", "<fmt:message key='pointEdit.props.props'/>", "window.location='data_point_edit.shtm?dpid=" + p.id + "'") +
writeImage("editImg" + p.id, null, "icon_ds_add", "<fmt:message key='common.copy'/>", "copyDataPoint(" + ${dataSource.id} + ", " + p.id + ");");
});
var headers = $("pointListHeaders");
Expand All @@ -73,7 +71,7 @@
rowCreator: function(options) {
var tr = document.createElement("tr");
tr.mangoId = "p"+ options.rowData.id;
tr.className = ""+ (options.rowIndex % 2 == 0 ? "" : "rowAlt");
tr.className = (options.rowIndex % 2 == 0 ? "" : "rowAlt");
return tr;
},
cellCreator: function(options) {
Expand Down Expand Up @@ -119,6 +117,7 @@
else {
showMessage("dataSourceMessage", "<fmt:message key="dsEdit.saved"/>");
DataSourceEditDwr.getPoints(writePointList);
window.location = "data_source_edit.shtm?dsid=" + response.data.id;
}
getAlarms();
console.log("dataSourceEdit.jsp::saveDataSourceCB - done");
Expand Down Expand Up @@ -328,6 +327,13 @@
stopImageFader($("enableAllImg"));
writePointList(points);
}
function copyDataPoint(fromDataSourceId, dataPointId) {
return DataSourceEditDwr.copyDataPoint(fromDataSourceId, dataPointId, function(response) {
writePointList(response.data.points);
editPoint(response.data.id);
});
}
</script>

<table class="borderDiv marB subPageHeader" id="alarmsTable" style="display: block; max-height: 300px; overflow-y: auto; width: 59%;">
Expand Down
4 changes: 4 additions & 0 deletions WebContent/WEB-INF/jsp/dataSourceEdit/editMeta.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
pointsArray[pointsArray.length] = {
id : ${dp.id},
name : '${sst:quotEncode(dp.extendedName)}',
xid : '${dp.xid}',
type : '<sst:i18n message="${dp.dataTypeMessage}"/>'
};
</c:forEach>
Expand Down Expand Up @@ -110,6 +111,7 @@
contextArray[contextArray.length] = {
pointId : pointId,
pointName : data.name,
xid : data.xid,
pointType : data.type,
scriptVarName : scriptVarName
};
Expand All @@ -136,6 +138,7 @@
dwr.util.addRows("contextTable", contextArray,
[
function(data) { return data.pointName; },
function(data) { return data.xid; },
function(data) { return data.pointType; },
function(data) {
return "<input type='text' value='"+ data.scriptVarName +"' class='formShort' "+
Expand Down Expand Up @@ -247,6 +250,7 @@
<tbody id="contextTableHeaders" style="display:none;">
<tr class="smRowHeader">
<td><fmt:message key="dsEdit.meta.pointName"/></td>
<td><fmt:message key="pointHierarchySLTS.xid"/></td>
<td><fmt:message key="dsEdit.pointDataType"/></td>
<td><fmt:message key="dsEdit.meta.var"/></td>
<td></td>
Expand Down
125 changes: 109 additions & 16 deletions WebContent/WEB-INF/jsp/dataSourceEdit/editModbus.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,72 @@
setDisabled("scanBtn", scanning);
setDisabled("scanCancelBtn", !scanning);
}
function validateLocatorTest(locator){
let messages = [];
validateValue("test_slaveId", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, locator.slaveId, messages);
validateValue("test_range", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, locator.range, messages);
validateValue("test_modbusDataType", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, locator.modbusDataType, messages);
validateValue("test_offset", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, locator.offset, messages);
validateValue("test_bit", "<fmt:message key='validate.invalidValue'/>", isPositiveByte, locator.bit, messages);
validateValue("test_registerCount", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, locator.registerCount, messages);
return messages;
}
function validateValue(htmlId, messageText, validate, value, messages) {
if(!validate(value)) {
let message = createValidationMessage(htmlId, messageText);
messages.push(message);
}
}
function createLocatorConfigTemp(){
let temp = {};
temp.slaveId = $get("test_slaveId");
temp.range = $get("test_range");
temp.modbusDataType = $get("test_modbusDataType");
temp.offset = $get("test_offset");
temp.bit = $get("test_bit");
temp.registerCount = $get("test_registerCount");
temp.charset = $get("test_charset");
return temp;
}
function locatorTest() {
setDisabled("locatorTestBtn", true);
var locator = {};
locator.slaveId = $get("test_slaveId");
locator.range = $get("test_range");
locator.modbusDataType = $get("test_modbusDataType");
locator.offset = $get("test_offset");
locator.bit = $get("test_bit");
locator.registerCount = $get("test_registerCount");
locator.charset = $get("test_charset");
locatorTestImpl(locator);
let locatorConfigTemp = createLocatorConfigTemp();
let modbusConfigTemp = createModbusConfigTemp();
hideGenericMessages("locatorTestGeneric");
hideContextualMessages("locatorTestDiv");
hideContextualMessages("dataSourceProperties");
let modbusMessages = validateModbusConfig(modbusConfigTemp);
let messagesLocator = validateLocatorTest(locatorConfigTemp);
let messages = modbusMessages.concat(messagesLocator);
if(messages.length > 0) {
stopImageFader("dsSaveImg");
showDwrMessages(messages);
} else {
let locator = {};
locator.slaveId = parseInt(locatorConfigTemp.slaveId);
locator.range = parseInt(locatorConfigTemp.range);
locator.modbusDataType = parseInt(locatorConfigTemp.modbusDataType);
locator.offset = parseInt(locatorConfigTemp.offset);
locator.bit = parseInt(locatorConfigTemp.bit);
locator.registerCount = parseInt(locatorConfigTemp.registerCount);
locator.charset = locatorConfigTemp.charset;
locatorTestImpl(locator);
}
}
function locatorTestCB(response) {
Expand All @@ -99,9 +151,50 @@
}
function dataTest() {
setDisabled("dataTestBtn", true);
dataTestImpl($get("dataTest_slaveId"), $get("dataTest_range"), $get("dataTest_offset"), $get("dataTest_length"));
hideGenericMessages("dataTestGeneric");
let dataTestConfigTemp = createTestDataTemp();
let modbusConfigTemp = createModbusConfigTemp();
hideContextualMessages("dataTestDiv");
let testDataMessages = validateTestData(dataTestConfigTemp);
let modbusMessages = validateModbusConfig(modbusConfigTemp);
let messages = modbusMessages.concat(testDataMessages);
if(messages.length > 0) {
showDwrMessages(messages);
} else {
let slaveId = parseInt(dataTestConfigTemp.slaveId);
let range = parseInt(dataTestConfigTemp.range);
let offset = parseInt(dataTestConfigTemp.offset);
let length = parseInt(dataTestConfigTemp.length);
dataTestImpl(slaveId, range, offset, length);
hideGenericMessages("dataTestGeneric");
}
}
function validateTestData(testData){
let messages = [];
validateValue("dataTest_slaveId", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, testData.slaveId, messages);
validateValue("dataTest_range", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, testData.range, messages);
validateValue("dataTest_offset", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, testData.offset, messages);
validateValue("dataTest_length", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, testData.length, messages);
return messages;
}
function createTestDataTemp(){
let temp = {};
temp.slaveId = $get("dataTest_slaveId");
temp.range = $get("dataTest_range");
temp.offset = $get("dataTest_offset");
temp.length = $get("dataTest_length");
return temp;
}
function dataTestCB(response) {
Expand Down Expand Up @@ -367,7 +460,7 @@
</table>
</div>

<div class="borderDiv marB marR" style="float:left;">
<div class="borderDiv marB marR" style="float:left;" id="dataTestDiv">
<table>
<tr><td colspan="2" class="smallTitle"><fmt:message key="dsEdit.modbus.dataTest"/></td></tr>

Expand Down
Loading

0 comments on commit 385e8b0

Please sign in to comment.