Skip to content

Commit

Permalink
Use consistent syncElement name
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Nov 26, 2024
1 parent 1e504d6 commit cfcf857
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/jlab/jaws/presentation/ajax/AddAlarm.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
String managedBy = request.getParameter("managedBy");
String maskedBy = request.getParameter("maskedBy");
String pv = request.getParameter("pv");
String elementName = request.getParameter("elementName");
String syncElementName = request.getParameter("syncElementName");
BigInteger syncRuleId = ParamConverter.convertBigInteger(request, "syncRuleId");
BigInteger elementId = ParamConverter.convertBigInteger(request, "elementId");
BigInteger syncElementId = ParamConverter.convertBigInteger(request, "syncElementId");

alarmFacade.addAlarm(
name,
Expand All @@ -62,9 +62,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
managedBy,
maskedBy,
pv,
elementName,
syncElementName,
syncRuleId,
elementId);
syncElementId);
} catch (UserFriendlyException e) {
stat = "fail";
error = "Unable to add Alarm: " + e.getUserMessage();
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/jlab/jaws/presentation/ajax/EditAlarm.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
String managedBy = request.getParameter("managedBy");
String maskedBy = request.getParameter("maskedBy");
String pv = request.getParameter("pv");
String elementName = request.getParameter("elementName");
String syncElementName = request.getParameter("syncElementName");
BigInteger syncRuleId = ParamConverter.convertBigInteger(request, "syncRuleId");
BigInteger elementId = ParamConverter.convertBigInteger(request, "elementId");
BigInteger syncElementId = ParamConverter.convertBigInteger(request, "syncElementId");

alarmFacade.editAlarm(
alarmId,
Expand All @@ -63,9 +63,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
managedBy,
maskedBy,
pv,
elementName,
syncElementName,
syncRuleId,
elementId);
syncElementId);
} catch (UserFriendlyException e) {
stat = "fail";
error = "Unable to edit Alarm: " + e.getUserMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@
</td>
</c:forEach>
</tr>
<tr>
<th>Location:</th>
<c:forEach items="${revisionList}" var="entity">
<td>
<c:out value="${entity.location}"/>
</td>
</c:forEach>
</tr>
<tr>
<th>Device:</th>
<c:forEach items="${revisionList}" var="entity">
Expand Down
12 changes: 6 additions & 6 deletions src/main/webapp/resources/js/alarms.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ jlab.editRow = function(removeSync) {
maskedBy = $("#row-masked-by").val(),
pv = $("#row-pv").val(),
syncRuleId = $("#row-sync-rule-id").val(),
elementName = $("#row-sync-element-name").val(),
elementId = $("#row-sync-element-id").val(),
syncElementName = $("#row-sync-element-name").val(),
syncElementId = $("#row-sync-element-id").val(),
alarmId = $(".editable-row-table tr.selected-row").attr("data-id"),
reloading = false;

if(removeSync) {
syncRuleId = "";
elementId = "";
elementName = "";
syncElementId = "";
syncElementName = "";

$("#remove-sync-button")
.height($("#remove-sync-button").height())
Expand Down Expand Up @@ -116,9 +116,9 @@ jlab.editRow = function(removeSync) {
managedBy: managedBy,
maskedBy: maskedBy,
pv: pv,
elementName: elementName,
syncElementName: syncElementName,
syncRuleId: syncRuleId,
elementId: elementId
syncElementId: syncElementId
},
dataType: "json"
});
Expand Down
24 changes: 12 additions & 12 deletions src/main/webapp/resources/js/sync-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jlab.addRow = function($tr, batch) {
maskedBy = $tr.attr("data-masked-by"),
pv = $tr.attr("data-pv"),
syncRuleId = $tr.attr("data-rule-id"),
elementName = $tr.attr("data-element-name"),
elementId = $tr.attr("data-element-id"),
syncElementName = $tr.attr("data-element-name"),
syncElementId = $tr.attr("data-element-id"),
$button = $tr.find("button.add");

let locationId = locationCsv.split(',');
Expand All @@ -37,8 +37,8 @@ jlab.addRow = function($tr, batch) {
maskedBy: maskedBy,
pv: pv,
syncRuleId: syncRuleId,
elementName: elementName,
elementId: elementId
syncElementName: syncElementName,
syncElementId: syncElementId
},
dataType: "json"
});
Expand Down Expand Up @@ -129,8 +129,8 @@ jlab.linkRow = function($tr, alarmId, batch) {
maskedBy = $tr.attr("data-masked-by"),
pv = $tr.attr("data-pv"),
syncRuleId = $tr.attr("data-rule-id"),
elementName = $tr.attr("data-element-name"),
elementId = $tr.attr("data-element-id"),
syncElementName = $tr.attr("data-element-name"),
syncElementId = $tr.attr("data-element-id"),
$button = $tr.find("button.link");

let locationId = locationCsv.split(',');
Expand All @@ -157,8 +157,8 @@ jlab.linkRow = function($tr, alarmId, batch) {
maskedBy: maskedBy,
pv: pv,
syncRuleId: syncRuleId,
elementName: elementName,
elementId: elementId
syncElementName: syncElementName,
syncElementId: syncElementId
},
dataType: "json"
});
Expand Down Expand Up @@ -203,8 +203,8 @@ jlab.updateRow = function($tr, batch) {
maskedBy = $tr.attr("data-masked-by"),
pv = $tr.attr("data-pv"),
syncRuleId = $tr.attr("data-rule-id"),
elementName = $tr.attr("data-element-name"),
elementId = $tr.attr("data-element-id"),
syncElementName = $tr.attr("data-element-name"),
syncElementId = $tr.attr("data-element-id"),
$button = $tr.find("button.update");

let locationId = locationCsv.split(',');
Expand All @@ -231,8 +231,8 @@ jlab.updateRow = function($tr, batch) {
maskedBy: maskedBy,
pv: pv,
syncRuleId: syncRuleId,
elementName: elementName,
elementId: elementId
syncElementName: syncElementName,
syncElementId: syncElementId
},
dataType: "json"
});
Expand Down

0 comments on commit cfcf857

Please sign in to comment.