diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index f92858ee10..1d0c00d804 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -3444,9 +3444,9 @@ 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/g," ").replace(/ /g," "):S,P}}).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 displayImage displayParentName useResourceName label resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "), +q.getAttribute("widgetType")||"LINK"===x&&"SIMPLE"===q.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(x)){x="type resourceType resourceId displayLabel displayImage displayParentName useResourceName label resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName resource2Id resource2Name modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "), C="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 displayPercent resourceName orientation useResourceName displayLabel displayParentName label".split(" "), -I="type modelId viewId imageName centreonImageId label displayLabel displayImage displayWeatherStatusBackgroundColor useBackgroundStatusColor".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(C));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"}), +I="type modelId viewId imageName centreonImageId label displayLabel displayImage displayWeatherStatusBackgroundColor useBackgroundStatusColor".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(C));void 0!==q.getAttribute("widgetType")&&(E=k(F));"CONTAINER"===q.getAttribute("type")&&(E=k(I));d._centreonEditCell=q;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(C){if(void 0!==q.getAttribute(C)){var F=q.getAttribute(C),I={};return I[C]="label"===C?F.replace(/
/g," ").replace(/ /g," "):F,I}}).filter(function(C){return void 0!==C})}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",function(){var k=d.getSelectionCell()||d.getModel().getRoot();null!==k&&(k.getAttribute("viewId")&&k.getAttribute("label")&&"CONTAINER"===k.getAttribute("type")?0==e.pages.filter(function(q){return q.getViewId()===k.getAttribute("viewId")}).length?parent.postMessage(JSON.stringify({event:"createDrawioPageFromContainer", @@ -11921,78 +11921,78 @@ mxResources.get("invalidOrMissingFile")),!ca){M=null!=Z?this.editor.extractGraph mxUtils.parseXml(J.xml).documentElement:null,ca=Editor.extractParserError(Z,mxResources.get("invalidOrMissingFile")),ca||(M=null!=Z?this.editor.extractGraphModel(Z,!0):null,null!=M&&(Z=M),null!=Z&&(this.editor.setGraphXml(Z),this.editor.setModified(!1)));else if("Save"==J.action)this.actions.get("save").funct();else if("Exit"==J.action)this.actions.get("exit").funct();else if("merge"==J.action){var ha=this.getCurrentFile();null!=ha&&(M=v(J.xml),null!=M&&""!=M&&ha.mergeFile(new LocalFile(this,M),function(){D.postMessage(JSON.stringify({event:"merge", message:J}),"*")},function(ba){D.postMessage(JSON.stringify({event:"merge",message:J,error:ba}),"*")}))}else if("remoteInvokeReady"==J.action)this.handleRemoteInvokeReady(D);else if("remoteInvoke"==J.action)this.handleRemoteInvoke(J,G.origin);else if("remoteInvokeResponse"==J.action)this.handleRemoteInvokeResponse(J);else if("setStyleProperties"===J.action){N=this.editor.graph;if("ResourcesAndContainer"===J.shapes){for(var Fa=["RESOURCE","CONTAINER"],Ba=N.getSelectionCells().filter(function(ba){ba= ba.getAttribute("type");return Fa.includes(ba)}),ya=$jscomp.makeIterator(Object.entries(J.data)),xa=ya.next();!xa.done;xa=ya.next()){var fa=$jscomp.makeIterator(xa.value),Oa=fa.next().value,Ka=fa.next().value;"style"===Oa&&N.handleCentreonStyleChangeForCells(Ba,Ka);N.setCellStyles(Oa,Ka,Ba)}return}for(var sa=N.getSelectionCell(),Da=N.getModel().getStyle(sa),na=$jscomp.makeIterator(Object.entries(J.data)),Ja=na.next();!Ja.done;Ja=na.next()){var qa=$jscomp.makeIterator(Ja.value),za=qa.next().value, -Aa=qa.next().value;if(Da.includes(za)){var La=new RegExp(za+"=(.+?);","g");"style"===za&&N.handleCentreonStyleChange(sa,Da,Aa);Da=Da.replace(La,za+"="+Aa+";")}}N.getModel().setStyle(sa,Da)}else if("setDataProperties"===J.action){N=this.editor.graph;sa=N.getSelectionCell();var ja=N.getModel().getValue(sa);ja=ja.cloneNode(!0);void 0!==J&&void 0!==J.data&&Object.entries(J.data).forEach(function(ba){var ia=$jscomp.makeIterator(ba);ba=ia.next().value;ia=ia.next().value;ja.setAttribute(ba,ia)});if("CONTAINER"=== -sa.getAttribute("type")&&0=ba.status&&"mxUtils.indexOf(y,na)&&y.push(na),G.fireEvent(new mxEventObject("cellsInserted","cells",[na])));l=null!=na;na=qa;if(!l)for(Ka=0;KamxUtils.indexOf(y,Ga)}; -this.executeLayout(function(){wa.execute(G.getDefaultParent());pa()},!0,W);W=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&oa.length==2*y.length-1&&1==ta.length){G.view.validate();var ba=new mxCompactTreeLayout(G,"horizontaltree"==ea);ba.levelDistance=O;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(G.getDefaultParent(),0mxUtils.indexOf(y,Ga)};this.executeLayout(function(){ka.execute(G.getDefaultParent()); -pa()},!0,W);W=null}else if("organic"==ea||"auto"==ea&&oa.length>y.length){G.view.validate();var Pa=new mxFastOrganicLayout(G);Pa.forceConstant=3*O;Pa.disableEdgeStyle=!1;Pa.resetEdges=!1;var Va=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Ga){return Va.apply(this,arguments)||0>mxUtils.indexOf(y,Ga)};this.executeLayout(function(){Pa.execute(G.getDefaultParent());pa()},!0,W);W=null}}this.hideDialog()}finally{G.model.endUpdate()}null!=W&&W()}}catch(Ga){this.handleError(Ga)}};EditorUi.prototype.getSearch= -function(d){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,q)&&null!=urlParams[q]&&(g+=l+q+"="+urlParams[q],l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var g=0mxUtils.indexOf(l,q)&&(d=0==g?d+"?":d+"&",null!=urlParams[q]&&(d+=q+"="+urlParams[q],g++))}return d};EditorUi.prototype.showLinkDialog=function(d,g,l,q,t){d=new LinkDialog(this,d,g,l,!0,q,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var g=1;null==this.drive&&"function"!==typeof window.DriveClient||g++;null==this.dropbox&&"function"!==typeof window.DropboxClient||g++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient|| -g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;d&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),g=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!l); -this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g); -this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(g);this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d), -null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d));this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var A=EditorUi.prototype.createSidebar; -EditorUi.prototype.createSidebar=function(d){var g=A.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){g.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){g.refresh()}));return g};var z=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){z.apply(this,arguments);var d=this.editor.graph,g=this.getCurrentFile(),l=this.getSelectionState(),q=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(q); -this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(q);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(q&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editImage").setEnabled(q&&l.image&&0';var y={};try{var D=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+ -"";else for(var J=0;Jt.oldVersion&&y.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo", -{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(D){null!=g&&g(D)}};q.onsuccess=mxUtils.bind(this,function(t){var y=q.result;this.database=y;EditorUi.migrateStorageFiles&&(StorageFile.migrate(y),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(D){if(!D||"1"==urlParams.forceMigration){var F=document.createElement("iframe");F.style.display= -"none";F.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(F);var G=!0,P=!1,J,n=0,v=mxUtils.bind(this,function(){P=!0;this.setDatabaseItem(".drawioMigrated3",!0);F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),E=mxUtils.bind(this,function(){n++;I()}),I=mxUtils.bind(this,function(){try{if(n>=J.length)v();else{var K=J[n];StorageFile.getFileContent(this,K,mxUtils.bind(this, -function(L){null==L||".scratchpad"==K&&L==this.emptyLibraryXml?F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[K]}),"*"):E()}),E)}}catch(L){console.log(L)}}),M=mxUtils.bind(this,function(K){try{this.setDatabaseItem(null,[{title:K.title,size:K.data.length,lastModified:Date.now(),type:K.isLib?"L":"F"},{title:K.title,data:K.data}],E,E,["filesInfo","files"])}catch(L){console.log(L)}});D=mxUtils.bind(this,function(K){try{if(K.source==F.contentWindow){var L= -{};try{L=JSON.parse(K.data)}catch(R){}"init"==L.event?(F.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=L.event||P||(G?null!=L.resp&&0"===q.substring(0,12);q=""===q.substring(0,11);(t||q)&&d.push(l)}}return d};EditorUi.prototype.getLocalStorageFile= -function(d){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var g=localStorage.getItem(d);return{title:d,data:g,isLib:""===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})(); +Aa=qa.next().value;if(Da.includes(za)){var La=new RegExp(za+"=(.+?);","g");"style"===za&&N.handleCentreonStyleChange(sa,Da,Aa);Da=Da.replace(La,za+"="+Aa+";")}}N.getModel().setStyle(sa,Da)}else if("setDataProperties"===J.action){N=this.editor.graph;sa=N.getSelectionCell()||N._centreonEditCell;N._centreonEditCell=null;var ja=N.getModel().getValue(sa);ja=ja.cloneNode(!0);void 0!==J&&void 0!==J.data&&Object.entries(J.data).forEach(function(ba){var ia=$jscomp.makeIterator(ba);ba=ia.next().value;ia=ia.next().value; +ja.setAttribute(ba,ia)});if("CONTAINER"===sa.getAttribute("type")&&0=ba.status&&"mxUtils.indexOf(y,na)&&y.push(na),G.fireEvent(new mxEventObject("cellsInserted","cells",[na])));l=null!=na;na=qa;if(!l)for(Ka=0;KamxUtils.indexOf(y,Ga)};this.executeLayout(function(){wa.execute(G.getDefaultParent());pa()},!0,W);W=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&oa.length==2*y.length-1&&1==ta.length){G.view.validate();var ba=new mxCompactTreeLayout(G,"horizontaltree"==ea);ba.levelDistance=O;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(G.getDefaultParent(), +0mxUtils.indexOf(y,Ga)};this.executeLayout(function(){ka.execute(G.getDefaultParent());pa()},!0,W);W=null}else if("organic"==ea||"auto"==ea&&oa.length>y.length){G.view.validate();var Pa=new mxFastOrganicLayout(G);Pa.forceConstant=3*O;Pa.disableEdgeStyle=!1;Pa.resetEdges=!1;var Va=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Ga){return Va.apply(this,arguments)||0>mxUtils.indexOf(y,Ga)};this.executeLayout(function(){Pa.execute(G.getDefaultParent()); +pa()},!0,W);W=null}}this.hideDialog()}finally{G.model.endUpdate()}null!=W&&W()}}catch(Ga){this.handleError(Ga)}};EditorUi.prototype.getSearch=function(d){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,q)&&null!=urlParams[q]&&(g+=l+q+"="+urlParams[q],l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var g=0mxUtils.indexOf(l,q)&&(d=0==g?d+"?":d+"&",null!=urlParams[q]&&(d+=q+"="+urlParams[q],g++))}return d};EditorUi.prototype.showLinkDialog=function(d,g,l,q,t){d=new LinkDialog(this,d,g,l,!0,q,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var g=1;null==this.drive&& +"function"!==typeof window.DriveClient||g++;null==this.dropbox&&"function"!==typeof window.DropboxClient||g++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;d&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),g=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g); +this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l)); +d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(g); +this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d));this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck= +function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var A=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=function(d){var g=A.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){g.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){g.refresh()}));return g};var z=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates= +function(){z.apply(this,arguments);var d=this.editor.graph,g=this.getCurrentFile(),l=this.getSelectionState(),q=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(q);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(q);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(q&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editImage").setEnabled(q&& +l.image&&0';var y={};try{var D=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"";else for(var J=0;Jt.oldVersion&&y.createObjectStore("objects",{keyPath:"key"}); +2>t.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(D){null!=g&&g(D)}};q.onsuccess=mxUtils.bind(this,function(t){var y=q.result;this.database=y;EditorUi.migrateStorageFiles&&(StorageFile.migrate(y),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(D){if(!D|| +"1"==urlParams.forceMigration){var F=document.createElement("iframe");F.style.display="none";F.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(F);var G=!0,P=!1,J,n=0,v=mxUtils.bind(this,function(){P=!0;this.setDatabaseItem(".drawioMigrated3",!0);F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),E=mxUtils.bind(this,function(){n++;I()}),I=mxUtils.bind(this,function(){try{if(n>= +J.length)v();else{var K=J[n];StorageFile.getFileContent(this,K,mxUtils.bind(this,function(L){null==L||".scratchpad"==K&&L==this.emptyLibraryXml?F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[K]}),"*"):E()}),E)}}catch(L){console.log(L)}}),M=mxUtils.bind(this,function(K){try{this.setDatabaseItem(null,[{title:K.title,size:K.data.length,lastModified:Date.now(),type:K.isLib?"L":"F"},{title:K.title,data:K.data}],E,E,["filesInfo","files"])}catch(L){console.log(L)}}); +D=mxUtils.bind(this,function(K){try{if(K.source==F.contentWindow){var L={};try{L=JSON.parse(K.data)}catch(R){}"init"==L.event?(F.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=L.event||P||(G?null!=L.resp&&0"===q.substring(0,12);q=""===q.substring(0,11);(t|| +q)&&d.push(l)}}return d};EditorUi.prototype.getLocalStorageFile=function(d){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var g=localStorage.getItem(d);return{title:d,data:g,isLib:""===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})(); var CommentsWindow=function(b,e,f,c,k,m){function u(){for(var E=D.getElementsByTagName("div"),I=0,M=0;M/g," ").replace(/ /g," "):O,M}}).filter(function(I){return void 0!==I})}var H=p.getSelectionCell()||p.getModel().getRoot();if(H&&H.value){var P=H.getAttribute("type");if(!("WIDGET"===P&&"LINK_LEGEND"=== -H.getAttribute("widgetType")||"LINK"===P&&"SIMPLE"===H.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(P)){P="type resourceType resourceId displayLabel displayImage displayParentName useResourceName label resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" ");var d="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "), +H.getAttribute("widgetType")||"LINK"===P&&"SIMPLE"===H.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(P)){P="type resourceType resourceId displayLabel displayImage displayParentName useResourceName label resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" ");var d="type linkType parentName parentType parentId resourceType resourceId resourceName resource2Id resource2Name modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "), f="type mediaType newTab elementUrl imageName centreonImageId label".split(" "),g="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 displayPercent resourceName orientation useResourceName displayLabel displayParentName label".split(" "), -y="type modelId viewId imageName centreonImageId label displayLabel displayImage displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" "),t=[];void 0!==H.getAttribute("resourceType")&&(t=D(P));void 0!==H.getAttribute("linkType")&&(t=D(d));void 0!==H.getAttribute("mediaType")&&(t=D(f));void 0!==H.getAttribute("widgetType")&&(t=D(g));"CONTAINER"===H.getAttribute("type")&&(t=D(y));parent.postMessage(JSON.stringify({mxObject:t,mxStyle:H.getStyle(),event:"setShowWizardShapeProperties"}), +y="type modelId viewId imageName centreonImageId label displayLabel displayImage displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" "),t=[];void 0!==H.getAttribute("resourceType")&&(t=D(P));void 0!==H.getAttribute("linkType")&&(t=D(d));void 0!==H.getAttribute("mediaType")&&(t=D(f));void 0!==H.getAttribute("widgetType")&&(t=D(g));"CONTAINER"===H.getAttribute("type")&&(t=D(y));p._centreonEditCell=H;parent.postMessage(JSON.stringify({mxObject:t,mxStyle:H.getStyle(),event:"setShowWizardShapeProperties"}), "*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var D=p.getSelectionCells()||p.getModel().getRoot();if(D){var H=["RESOURCE","CONTAINER"];D=D.filter(function(P){P=P.getAttribute("type");return H.includes(P)});1>D.length||(1===D.length?(D=p.getCellStyle(D[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:D||"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 D(d){return d.map(function(f){if(void 0!==H.getAttribute(f)){var g=H.getAttribute(f),y={};return y[f]="label"===f?g.replace(/
/g," ").replace(/ /g," "):g,y}}).filter(function(f){return void 0!==f})}var H=p.getSelectionCell()||p.getModel().getRoot(),P="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===H.getAttribute("type")&& (cellAttributes=D(P),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:H.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent",function(){var D=p.getSelectionCell()||p.getModel().getRoot();null!==D&&(D.getAttribute("viewId")&&D.getAttribute("label")&&"CONTAINER"===D.getAttribute("type")?0==m.pages.filter(function(H){return H.getViewId()===D.getAttribute("viewId")}).length?parent.postMessage(JSON.stringify({event:"createDrawioPageFromContainer", @@ -3840,9 +3840,9 @@ this.editor.modified=!1,this.editor.setStatus(""))}else if("loadFromContainer"== this.editor.graph.saveViewState(Ba.viewState,La);mxUtils.setTextContent(Ba.node,Graph.compressNode(La));this.insertPage(Ba)}}else if("refreshPageXml"==N.action)qa=null!=N.xml&&0/g," ").replace(/ /g," "):O,M}}).filter(function(I){return void 0!==I})}var H=p.getSelectionCell()||p.getModel().getRoot();if(H&&H.value){var P=H.getAttribute("type");if(!("WIDGET"===P&&"LINK_LEGEND"=== -H.getAttribute("widgetType")||"LINK"===P&&"SIMPLE"===H.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(P)){P="type resourceType resourceId displayLabel displayImage displayParentName useResourceName label resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" ");var d="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "), +H.getAttribute("widgetType")||"LINK"===P&&"SIMPLE"===H.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(P)){P="type resourceType resourceId displayLabel displayImage displayParentName useResourceName label resourceName modelId viewId parentName parentType parentId displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" ");var d="type linkType parentName parentType parentId resourceType resourceId resourceName resource2Id resource2Name modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "), f="type mediaType newTab elementUrl imageName centreonImageId label".split(" "),g="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 displayPercent resourceName orientation useResourceName displayLabel displayParentName label".split(" "), -y="type modelId viewId imageName centreonImageId label displayLabel displayImage displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" "),t=[];void 0!==H.getAttribute("resourceType")&&(t=D(P));void 0!==H.getAttribute("linkType")&&(t=D(d));void 0!==H.getAttribute("mediaType")&&(t=D(f));void 0!==H.getAttribute("widgetType")&&(t=D(g));"CONTAINER"===H.getAttribute("type")&&(t=D(y));parent.postMessage(JSON.stringify({mxObject:t,mxStyle:H.getStyle(),event:"setShowWizardShapeProperties"}), +y="type modelId viewId imageName centreonImageId label displayLabel displayImage displayWeatherStatusBackgroundColor useBackgroundStatusColor".split(" "),t=[];void 0!==H.getAttribute("resourceType")&&(t=D(P));void 0!==H.getAttribute("linkType")&&(t=D(d));void 0!==H.getAttribute("mediaType")&&(t=D(f));void 0!==H.getAttribute("widgetType")&&(t=D(g));"CONTAINER"===H.getAttribute("type")&&(t=D(y));p._centreonEditCell=H;parent.postMessage(JSON.stringify({mxObject:t,mxStyle:H.getStyle(),event:"setShowWizardShapeProperties"}), "*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var D=p.getSelectionCells()||p.getModel().getRoot();if(D){var H=["RESOURCE","CONTAINER"];D=D.filter(function(P){P=P.getAttribute("type");return H.includes(P)});1>D.length||(1===D.length?(D=p.getCellStyle(D[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:D||"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 D(d){return d.map(function(f){if(void 0!==H.getAttribute(f)){var g=H.getAttribute(f),y={};return y[f]="label"===f?g.replace(/
/g," ").replace(/ /g," "):g,y}}).filter(function(f){return void 0!==f})}var H=p.getSelectionCell()||p.getModel().getRoot(),P="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===H.getAttribute("type")&& (cellAttributes=D(P),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:H.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent",function(){var D=p.getSelectionCell()||p.getModel().getRoot();null!==D&&(D.getAttribute("viewId")&&D.getAttribute("label")&&"CONTAINER"===D.getAttribute("type")?0==m.pages.filter(function(H){return H.getViewId()===D.getAttribute("viewId")}).length?parent.postMessage(JSON.stringify({event:"createDrawioPageFromContainer", @@ -3840,9 +3840,9 @@ this.editor.modified=!1,this.editor.setStatus(""))}else if("loadFromContainer"== this.editor.graph.saveViewState(Ba.viewState,La);mxUtils.setTextContent(Ba.node,Graph.compressNode(La));this.insertPage(Ba)}}else if("refreshPageXml"==N.action)qa=null!=N.xml&&0