Skip to content

Commit

Permalink
Merge branch 'release/2.7.8' into feature/#2746_Added_assignee_functi…
Browse files Browse the repository at this point in the history
…on_for_events
  • Loading branch information
Patrykb0802 committed Jul 12, 2024
2 parents c7830f6 + 6791491 commit d99244f
Show file tree
Hide file tree
Showing 306 changed files with 2,988 additions and 43,785 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/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
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
75 changes: 70 additions & 5 deletions WebContent/WEB-INF/jsp/dataSourceEdit/editModbusIp.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
function initImpl() {
checkTransportType($get("transportType"));
changeRange("test_")
}
function scanImpl() {
Expand All @@ -55,13 +56,77 @@
DataSourceEditDwr.testModbusIpData($get("timeout"), $get("retries"), $get("transportType"), $get("host"),
$get("port"), $get("encapsulated"), slaveId, range, offset, length, dataTestCB);
}
function validateModbusConfig(temp){
let messages = [];
validateValue("updatePeriods", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.updatePeriods, messages);
validateValue("updatePeriodType", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.updatePeriodType, messages);
validateValue("timeout", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.timeout, messages);
validateValue("retries", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.retries, messages);
validateValue("maxReadBitCount", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.maxReadBitCount, messages);
validateValue("maxReadRegisterCount", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.maxReadRegisterCount, messages);
validateValue("maxWriteRegisterCount", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.maxWriteRegisterCount, messages);
validateValue("port", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.port, messages);
return messages;
}
function createModbusConfigTemp(){
let modbus = {};
modbus.dataSourceName = $get("dataSourceName");
modbus.dataSourceXid = $get("dataSourceXid");
modbus.updatePeriods = $get("updatePeriods");
modbus.updatePeriodType = $get("updatePeriodType");
modbus.quantize = $get("quantize");
modbus.timeout = $get("timeout");
modbus.retries = $get("retries");
modbus.contiguousBatches = $get("contiguousBatches");
modbus.createSlaveMonitorPoints = $get("createSlaveMonitorPoints");
modbus.maxReadBitCount = $get("maxReadBitCount");
modbus.maxReadRegisterCount = $get("maxReadRegisterCount");
modbus.maxWriteRegisterCount = $get("maxWriteRegisterCount");
modbus.transportType = $get("transportType");
modbus.host = $get("host");
modbus.port = $get("port");
modbus.encapsulated = $get("encapsulated");
modbus.createSocketMonitorPoint = $get("createSocketMonitorPoint");
return modbus;
}
function saveDataSourceImpl() {
DataSourceEditDwr.saveModbusIpDataSource($get("dataSourceName"), $get("dataSourceXid"), $get("updatePeriods"),
$get("updatePeriodType"), $get("quantize"), $get("timeout"), $get("retries"), $get("contiguousBatches"),
$get("createSlaveMonitorPoints"), $get("maxReadBitCount"), $get("maxReadRegisterCount"),
$get("maxWriteRegisterCount"), $get("transportType"), $get("host"), $get("port"), $get("encapsulated"), $get("createSocketMonitorPoint"),
saveDataSourceCB);
let temp = createModbusConfigTemp();
let messages = validateModbusConfig(temp);
if(messages.length > 0) {
stopImageFader("dsSaveImg");
showDwrMessages(messages);
} else {
let dataSourceName = temp.dataSourceName;
let dataSourceXid = temp.dataSourceXid;
let updatePeriods = parseInt(temp.updatePeriods);
let updatePeriodType = parseInt(temp.updatePeriodType);
let quantize = temp.quantize;
let timeout = parseInt(temp.timeout);
let retries = parseInt(temp.retries);
let contiguousBatches = temp.contiguousBatches;
let createSlaveMonitorPoints = temp.createSlaveMonitorPoints;
let maxReadBitCount = parseInt(temp.maxReadBitCount);
let maxReadRegisterCount = parseInt(temp.maxReadRegisterCount);
let maxWriteRegisterCount = parseInt(temp.maxWriteRegisterCount);
let transportType = temp.transportType;
let host = temp.host;
let port = parseInt(temp.port);
let encapsulated = temp.encapsulated;
let createSocketMonitorPoint = temp.createSocketMonitorPoint;
DataSourceEditDwr.saveModbusIpDataSource(dataSourceName, dataSourceXid, updatePeriods,
updatePeriodType, quantize, timeout, retries, contiguousBatches, createSlaveMonitorPoints, maxReadBitCount, maxReadRegisterCount,
maxWriteRegisterCount, transportType, host, port, encapsulated, createSocketMonitorPoint, saveDataSourceCB);
}
}
</script>

Expand Down
Loading

0 comments on commit d99244f

Please sign in to comment.