Skip to content

Commit

Permalink
Add possibility to display status as bg color for resource in weathe…
Browse files Browse the repository at this point in the history
…r style
  • Loading branch information
Yassir-BenBOUBKER committed May 22, 2024
1 parent f1cde43 commit 24d7474
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/webapp/js/app.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3480,8 +3480,8 @@ null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){d.ente
function(k){d.orderCells(!1,null,!0)});this.addAction("sendBackward",function(k){d.orderCells(!0,null,!0)});this.addAction("group",function(){if(d.isEnabled()){var k=mxUtils.sortCells(d.getSelectionCells(),!0);1!=k.length||d.isTable(k[0])||d.isTableRow(k[0])?(k=d.getCellsForGroup(k),1<k.length&&d.setSelectionCell(d.groupCells(null,0,k))):d.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(d.isEnabled()){var k=d.getEditableCells(d.getSelectionCells());
d.model.beginUpdate();try{var q=d.ungroupCells();if(null!=k)for(var x=0;x<k.length;x++)d.model.contains(k[x])&&(0==d.model.getChildCount(k[x])&&d.model.isVertex(k[x])&&d.setCellStyles("container","0",[k[x]]),q.push(k[x]))}finally{d.model.endUpdate()}0<q.length&&d.setSelectionCells(q)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(d.isEnabled()){var k=d.getSelectionCells();if(null!=k){for(var q=[],x=0;x<k.length;x++)d.isTableRow(k[x])||d.isTableCell(k[x])||q.push(k[x]);
d.removeCellsFromParent(q)}}});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){function k(O){return O.map(function(T){if(void 0!==q.getAttribute(T)){var U=q.getAttribute(T),R={};return R[T]="label"===T?U.replace(/<br>/g," ").replace(/&nbsp;/g," "):U,R}}).filter(function(T){return void 0!==T})}var q=d.getSelectionCell()||d.getModel().getRoot();if(q&&q.value){var x=q.getAttribute("type");if(!("WIDGET"===x&&"LINK_LEGEND"===
q.getAttribute("widgetType")||"LINK"===x&&"SIMPLE"===q.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(x)){x="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),D="type mediaType newTab elementUrl imageName centreonImageId label".split(" "),
F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label displayLabel".split(" "),
q.getAttribute("widgetType")||"LINK"===x&&"SIMPLE"===q.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(x)){x="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),D="type mediaType newTab elementUrl imageName centreonImageId label".split(" "),
F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label displayLabel displayWeatherStatusBackgroundColor".split(" "),
E=[];void 0!==q.getAttribute("resourceType")&&(E=k(x));void 0!==q.getAttribute("linkType")&&(E=k(B));void 0!==q.getAttribute("mediaType")&&(E=k(D));void 0!==q.getAttribute("widgetType")&&(E=k(F));"CONTAINER"===q.getAttribute("type")&&(E=k(I));parent.postMessage(JSON.stringify({mxObject:E,mxStyle:q.getStyle(),event:"setShowWizardShapeProperties"}),"*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var k=d.getSelectionCells()||d.getModel().getRoot();if(k){var q=["RESOURCE",
"CONTAINER"];k=k.filter(function(x){x=x.getAttribute("type");return q.includes(x)});1>k.length||(1===k.length?(k=d.getCellStyle(k[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:k||"ICON",event:"setCentreonStyle"}),"*")):parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:"ICON",event:"setCentreonStyle"}),"*"))}},null,null,Editor.ctrlKey+"+E");this.addAction("createMapFromContainer",function(){function k(B){return B.map(function(D){if(void 0!==
q.getAttribute(D)){var F=q.getAttribute(D),I={};return I[D]="label"===D?F.replace(/<br>/g," ").replace(/&nbsp;/g," "):F,I}}).filter(function(D){return void 0!==D})}var q=d.getSelectionCell()||d.getModel().getRoot(),x="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===q.getAttribute("type")&&(cellAttributes=k(x),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:q.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent",
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/js/grapheditor/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ Actions.prototype.init = function()
}

const resourceCentreonProps = ['type', 'resourceType', 'resourceId', 'displayLabel',
'resourceName', 'modelId', 'viewId', 'parentName', 'parentType', 'parentId'];
'resourceName', 'modelId', 'viewId', 'parentName', 'parentType', 'parentId', 'displayWeatherStatusBackgroundColor'];
const linkProps = ['type', 'linkType', 'parentName', 'parentType', 'parentId',
'resourceType', 'resourceId', 'resourceName', 'modelId','metric1Min',
'metric1Max', 'metric2Min', 'metric2Max', 'metricName1', 'metricName2', 'displayPercent'];
Expand All @@ -741,7 +741,7 @@ Actions.prototype.init = function()
'metricsColorStart', 'metricsColorEnd', 'parentName', 'parentType', 'parentId',
'resourceName', 'orientation',
];
const containerProps = ['type', 'modelId', 'viewId', 'imageName', 'centreonImageId', 'label', 'displayLabel'];
const containerProps = ['type', 'modelId', 'viewId', 'imageName', 'centreonImageId', 'label', 'displayLabel', 'displayWeatherStatusBackgroundColor'];

let cellAttributes = [];

Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/js/integrate.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3480,8 +3480,8 @@ null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){d.ente
function(k){d.orderCells(!1,null,!0)});this.addAction("sendBackward",function(k){d.orderCells(!0,null,!0)});this.addAction("group",function(){if(d.isEnabled()){var k=mxUtils.sortCells(d.getSelectionCells(),!0);1!=k.length||d.isTable(k[0])||d.isTableRow(k[0])?(k=d.getCellsForGroup(k),1<k.length&&d.setSelectionCell(d.groupCells(null,0,k))):d.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(d.isEnabled()){var k=d.getEditableCells(d.getSelectionCells());
d.model.beginUpdate();try{var q=d.ungroupCells();if(null!=k)for(var x=0;x<k.length;x++)d.model.contains(k[x])&&(0==d.model.getChildCount(k[x])&&d.model.isVertex(k[x])&&d.setCellStyles("container","0",[k[x]]),q.push(k[x]))}finally{d.model.endUpdate()}0<q.length&&d.setSelectionCells(q)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(d.isEnabled()){var k=d.getSelectionCells();if(null!=k){for(var q=[],x=0;x<k.length;x++)d.isTableRow(k[x])||d.isTableCell(k[x])||q.push(k[x]);
d.removeCellsFromParent(q)}}});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){function k(O){return O.map(function(T){if(void 0!==q.getAttribute(T)){var U=q.getAttribute(T),R={};return R[T]="label"===T?U.replace(/<br>/g," ").replace(/&nbsp;/g," "):U,R}}).filter(function(T){return void 0!==T})}var q=d.getSelectionCell()||d.getModel().getRoot();if(q&&q.value){var x=q.getAttribute("type");if(!("WIDGET"===x&&"LINK_LEGEND"===
q.getAttribute("widgetType")||"LINK"===x&&"SIMPLE"===q.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(x)){x="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),D="type mediaType newTab elementUrl imageName centreonImageId label".split(" "),
F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label displayLabel".split(" "),
q.getAttribute("widgetType")||"LINK"===x&&"SIMPLE"===q.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(x)){x="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),D="type mediaType newTab elementUrl imageName centreonImageId label".split(" "),
F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label displayLabel displayWeatherStatusBackgroundColor".split(" "),
E=[];void 0!==q.getAttribute("resourceType")&&(E=k(x));void 0!==q.getAttribute("linkType")&&(E=k(B));void 0!==q.getAttribute("mediaType")&&(E=k(D));void 0!==q.getAttribute("widgetType")&&(E=k(F));"CONTAINER"===q.getAttribute("type")&&(E=k(I));parent.postMessage(JSON.stringify({mxObject:E,mxStyle:q.getStyle(),event:"setShowWizardShapeProperties"}),"*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var k=d.getSelectionCells()||d.getModel().getRoot();if(k){var q=["RESOURCE",
"CONTAINER"];k=k.filter(function(x){x=x.getAttribute("type");return q.includes(x)});1>k.length||(1===k.length?(k=d.getCellStyle(k[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:k||"ICON",event:"setCentreonStyle"}),"*")):parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:"ICON",event:"setCentreonStyle"}),"*"))}},null,null,Editor.ctrlKey+"+E");this.addAction("createMapFromContainer",function(){function k(B){return B.map(function(D){if(void 0!==
q.getAttribute(D)){var F=q.getAttribute(D),I={};return I[D]="label"===D?F.replace(/<br>/g," ").replace(/&nbsp;/g," "):F,I}}).filter(function(D){return void 0!==D})}var q=d.getSelectionCell()||d.getModel().getRoot(),x="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===q.getAttribute("type")&&(cellAttributes=k(x),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:q.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent",
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/js/viewer-static.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 24d7474

Please sign in to comment.