Skip to content

Commit

Permalink
#2755 Signaling the Data Source that has a problem - corrected signal…
Browse files Browse the repository at this point in the history
…ing on graphical views
  • Loading branch information
Limraj committed Nov 6, 2023
1 parent e089221 commit a164318
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
9 changes: 9 additions & 0 deletions WebContent/WEB-INF/snippet/warningIcon.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<%@ include file="/WEB-INF/snippet/common.jsp" %>
<c:choose>
<c:when test="${!empty invalid || !empty disabled || pointRT.attributes.UNRELIABLE || pointRT.attributes.DP_UPDATE_ERROR}">
<tag:img png="exclamation" title="common.valueUnreliable"/>
</c:when>
<c:otherwise>
<tag:img png="warn" title="common.warning"/>
</c:otherwise>
</c:choose>
4 changes: 2 additions & 2 deletions WebContent/WEB-INF/tags/pointComponent.tag
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div style="position:absolute;left:-16px;top:0px;z-index:${vc.z+1};">
<div id="c${vc.id}Warning" style="display:none;" onmouseover="showMenu('c${vc.id}Messages', 16, 0);"
onmouseout="hideLayer('c${vc.id}Messages');">
<tag:img png="warn" title="common.warning"/>
<div id="c${vc.id}WarningIcon"></div>
<div id="c${vc.id}Messages" onmouseout="hideLayer(this);" class="controlContent"></div>
</div>
<div id="c${vc.id}Changing" style="display:none;"><tag:img png="icon_edit" title="common.settingValue"/></div>
Expand All @@ -74,7 +74,7 @@
<div style="position:absolute;left:-16px;top:0px;z-index:${vc.z+1};">
<div id="c${vc.id}Warning" style="display:none;" onmouseover="showMenu('c${vc.id}Messages', 16, 0);"
onmouseout="hideLayer('c${vc.id}Messages');">
<tag:img png="warn" title="common.warning"/>
<div id="c${vc.id}WarningIcon"><tag:img png="warn" title="common.warning"/></div>
<div id="c${vc.id}Messages" onmouseout="hideLayer(this);" class="controlContent"></div>
</div>
<div id="c${vc.id}Changing" style="display:none;"><tag:img png="icon_edit" title="common.settingValue"/></div>
Expand Down
1 change: 1 addition & 0 deletions WebContent/resources/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ mango.view.setMessages = function(state) {
var warningNode = $("c"+ state.id +"Warning");
if (warningNode && state.messages != null) {
$set("c"+ state.id +"Messages", state.messages);
$set("c"+ state.id +"WarningIcon", state.warningIcon);
if (state.messages)
show(warningNode);
else
Expand Down
1 change: 1 addition & 0 deletions src/com/serotonin/mango/web/dwr/ViewDwr.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ private ViewComponentState preparePointComponentState(PointComponent pointCompon
}

state.setInfo(generateContent(request, "infoContent.jsp", model));
state.setWarningIcon(generateContent(request, "warningIcon.jsp", model));
setMessages(state, request, "warningContent", model);

return state;
Expand Down
9 changes: 9 additions & 0 deletions src/com/serotonin/mango/web/dwr/beans/BasePointState.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ abstract public class BasePointState implements Cloneable {
private String change;
private String chart;
private String messages;
private String warningIcon;

public String getId() {
return id;
Expand Down Expand Up @@ -58,6 +59,14 @@ public void setMessages(String messages) {
this.messages = messages;
}

public String getWarningIcon() {
return warningIcon;
}

public void setWarningIcon(String warningIcon) {
this.warningIcon = warningIcon;
}

public void removeEqualValue(BasePointState that) {
if (StringUtils.isEqual(change, that.change))
change = null;
Expand Down

0 comments on commit a164318

Please sign in to comment.