Skip to content

Commit

Permalink
add display label to container (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yassir-BenBOUBKER authored May 21, 2024
1 parent 9c3e8ef commit f1cde43
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/webapp/js/app.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3481,7 +3481,7 @@ function(k){d.orderCells(!1,null,!0)});this.addAction("sendBackward",function(k)
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".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(" "),
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
2 changes: 1 addition & 1 deletion src/main/webapp/js/grapheditor/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ Actions.prototype.init = function()
'metricsColorStart', 'metricsColorEnd', 'parentName', 'parentType', 'parentId',
'resourceName', 'orientation',
];
const containerProps = ['type', 'modelId', 'viewId', 'imageName', 'centreonImageId', 'label'];
const containerProps = ['type', 'modelId', 'viewId', 'imageName', 'centreonImageId', 'label', 'displayLabel'];

let cellAttributes = [];

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/integrate.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3481,7 +3481,7 @@ function(k){d.orderCells(!1,null,!0)});this.addAction("sendBackward",function(k)
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".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(" "),
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
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion src/main/webapp/js/viewer.min.js

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

0 comments on commit f1cde43

Please sign in to comment.