var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.divHeader { background:var(--group-header-background); height:var(--resgui-1row); width:100%; display:flex; flex-direction: row; align-items:center; cursor:pointer; border-box; -moz-box-sizing: border-box;-webkit-box-sizing: border-box; border-bottom: 1px solid var(--group-header-border-color); }'; document.getElementsByTagName('head')[0].appendChild(style); style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.divHeader:hover { background: var(--group-header-background-hover); transition: background-color 0.3s linear; }'; document.getElementsByTagName('head')[0].appendChild(style); style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.button-application-disabled { position: relative; display: flex; justify-content: center; align-items: center; float: left; clear: both; height: var(--resgui-button-height); overflow: hidden; text-overflow: ellipsis; border: none; border: 1px solid var(--decor-border-light-color); min-width: var(--resgui-2column); padding-left: var(--resgui-1vw); padding-right: var(--resgui-1vw); background: transparent; border-radius: 4px; }'; document.getElementsByTagName('head')[0].appendChild(style); function TMWArgo() { this.LambdaFunctionDictionary = { "GetSitesByKey" : { "SMARTGRID" : "ArgoMWApplication-GetSitesIdByPIva-QLfWeSZMvJv7" }, "LogicDelete" : { "SMARTGRID" : "ArgoMWApplication-DeleteLogic-dUMDGu7P6aUr" }, "GetLinksNavigateTo" : { "SMARTGRID" : "ArgoMWApplication-GetLinksNavigateTo-BGUxh9V5PAkR" } } this.EndPoints = ["SMARTGRID"]; this.EndPointsWS = [{"EndPoint":"SMARTGRID", "EndPointWS": "MOSAICOWORLD"}]; this.ScopesType = {"0":"Empty", "1":"Refrigerazione"}; this.SourcesType = {"0":"Email", "1": "IT"}; this.BrowserName = {"0":"Google Chrome", "1": "Mozilla Firefox", "3":"Internet Explorer"}; this.ConnectionsMode = {"0":"Public", "1":"Anywhere"}; this.DataTypes = {}; this.AssetTypes = {}; this.S3Bucket = { "SMARTGRID": "smartgrid-repository" } this.OperatorsSiteManagerOwnerSqsUrls = { "SMARTGRID": "https://sqs.eu-west-1.amazonaws.com/924763843243/Argo_Operators_SitesOwner.fifo" }; this.EndPointsData = {}; this.EndPointsDataMostInWarning = {}; /* { "SMARTGRID":{ //endpoint come proprietà dell'oggetto "Events":[{}] //tutte le informazioni relative all'endpoint } } */ this.SiteIdsInManageByMe = []; var Me = this; if(parent.$MWArgo!=null) { if(parent.$MWArgo!=this) { this.EndPointsData = parent.$MWArgo.EndPointsData; this.EndPointsDataMostInWarning = parent.$MWArgo.EndPointsDataMostInWarning; this.SiteIdsInManageByMe = parent.$MWArgo.SiteIdsInManageByMe; } } else { } $MWGUI.RegisterLanguageString("ErrorMsgTitle", {"en":"Error","it":"Errore"}); $MWGUI.RegisterLanguageString("ErrorMsgBody", {"en":"There is an error on the function","it":"C'è un errore nella funzione"}); $MWGUI.RegisterLanguageString("LinksUrlsSource", {"en":"Aviable connections","it":"Connessioni disponibili"}); $MWGUI.RegisterLanguageString("CopyLinkNavigation", {"en":"Copy in clipboard the link's url","it":"Copia il link del collegamento"}); $MWGUI.RegisterLanguageString("OpenLinkNavigation", {"en":"Open the link's url","it":"Apri il link del collegamento"}); $MWGUI.RegisterLanguageString("Copy", {"en":"Copy","it":"Copia"}); $MWGUI.RegisterLanguageString("Open", {"en":"Open","it":"Apri"}); $MWGUI.RegisterLanguageString("Name", {"en":"Name","it":"Nome"}); $MWGUI.RegisterLanguageString("Type", {"en":"Type","it":"Tipo"}); $MWGUI.RegisterLanguageString("Statistics", {"en":"Statistics","it":"Statistiche"}); $MWGUI.RegisterLanguageString("ManageEvent", {"en":"Manage events","it":"Gestisci eventi"}); $MWGUI.RegisterLanguageString("AnomalyDetections", {"en":"Anomaly detections","it":"Rilevamento anomalie"}); $MWGUI.RegisterLanguageString("Username", {"en":"Username","it":"Username"}); $MWGUI.RegisterLanguageString("Password", {"en":"Password","it":"Password"}); $MWGUI.RegisterLanguageString("Browsers", {"en":"Browsers","it":"Browsers"}); //pages $MWGUI.RegisterLanguageString("StatisticsGeneralPage", {"en":"General statistics","it":"Statistiche generali"}); $MWGUI.RegisterLanguageString("StatisticsDataTypePage", {"en":"Data types statistics","it":"Statistiche per tipi di data"}); $MWGUI.RegisterLanguageString("StatisticsDataTypePagePV", {"en":"Data types statistics PV","it":"Statistiche per tipi di data e PV"}); $MWGUI.RegisterLanguageString("StatisticsPriorityPage", {"en":"Priority statistics","it":"Statisctiche per priorita'"}); $MWGUI.RegisterLanguageString("ManageEventsPageDemo", {"en":"Manage active events Demo","it":"Gestione eventi attivi Demo"}); $MWGUI.RegisterLanguageString("ManageEventsPageDevelopment", {"en":"Manage active events development","it":"Gestione eventi attivi Sviluppo"}); $MWGUI.RegisterLanguageString("Tools", {"en":"Tools","it":"Strumenti"}); $MWGUI.RegisterLanguageString("ProcesDesignerPage", {"en":"Process designer","it":"Process designer"}); $MWGUI.RegisterLanguageString("AnomalyDetectionsEventRepeatedPage", {"en":"Anomaly detection repeated event","it":"Rilevamento anomalia evento ripetuto"}); $MWGUI.RegisterLanguageString("EventsArchived", {"en":"Events Archived","it":"Archivio Eventi"}); $MWGUI.RegisterLanguageString("SiteStory", {"en":"Site detail story ","it":"Storia dettaglio sito "}); this.LoadBaseData = function() { function Private_RumLoadBaseData(Index, List) { if(Index < List.length) { var ParamDataType = { "database" : "DataProvider", "Assembly" : "DataProvider", "ClassReference" : "TDataType", "Collection" : "DataProvider_TDataType", "TQueryParameter" : { "JsonQuery" : "{}" } } $MW.ExeLambda(LambdaFunctionsDictionary["GetInstances"]["Argo"][List[Index]], ParamDataType, function(Answer, OriginalMessage) { if(Answer != null) { Me.DataTypes[List[Index]] = Answer.Instances; var ParamAssetType = { "database" : "DataProvider", "Assembly" : "DataProvider", "ClassReference" : "TNodeTree", "Collection" : "DataProvider_TNodeTree", "TQueryParameter" : { "JsonQuery" : "{}" } } $MW.ExeLambda(LambdaFunctionsDictionary["GetInstances"]["Argo"][List[Index]], ParamAssetType, function(Answer, OriginalMessage) { if(Answer != null) { Me.AssetTypes[List[Index]] = Answer.Instances; Private_RumLoadBaseData(parseInt(Index) + 1, List) } else { console.error(OriginalMessage); $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); } }, function(Error, ErrorStack) { console.error(Error, ErrorStack); $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); } , "Argo", true); } else { console.error(OriginalMessage); $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); } }, function(Error, ErrorStack) { console.error(Error, ErrorStack); $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); } , "Argo", true); } else console.log(Me.AssetTypes, Me.DataTypes) } Private_RumLoadBaseData(0, Me.EndPoints); } this.GetSitesByKeys = function(ArgoKeys, CallBack) { function Run_GetSitesByKey(Index, Result, ArgoKeys, CallBack) { if(Index < ArgoKeys.length) { var Param = { "Keys" : ArgoKeys[Index].SecondaryKey } $MW.ExeLambda(Me.LambdaFunctionDictionary["GetSitesByKey"][ArgoKeys[Index].PrimaryKey], Param, function(Answer,OriginalMessage) { if(Answer != null) { Result[ArgoKeys[Index].PrimaryKey] = Answer.Instances; Run_GetSitesByKey(parseInt(Index)+1, Result, ArgoKeys, CallBack) } else $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); }, function(Error,ErrorStack) { $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); } , "Argo"); } else { if(CallBack) CallBack(Result); } } if(ArgoKeys.length > 0) { Run_GetSitesByKey(0, {}, ArgoKeys, function(Result) { CallBack(Result); }) } } this.AddElementToSiteIdsInManageByMe = function(Object) { if(this.SiteIdsInManageByMe.findIndex(x => x.SiteElement._id == Object.SiteElement._id) == -1) this.SiteIdsInManageByMe.push(Object); if (parent.$MWArgo != null) { if (parent.$MWArgo != this ) { parent.$MWArgo.AddElementToSiteIdsInManageByMe(Object); return; } } } this.UpdateToSiteIdsInManageByMe = function(Updated) { this.SiteIdsInManageByMe = Updated; if (parent.$MWArgo != null) { if (parent.$MWArgo != this ) { parent.$MWArgo.UpdateToSiteIdsInManageByMe(Updated); return; } } } //this.NavigateTo = this.Navigation = {}; this.Navigation.GetLinks = function(SubOption, SiteId, SourceId, Callback) { if(SubOption && SiteId && SourceId) if(SubOption != null) { var Param = { "SiteId" : SiteId, "SourceId" : SourceId } $MW.ExeLambda(Me.LambdaFunctionDictionary["GetLinksNavigateTo"][SubOption.EndPoint], Param, function(Answer,OriginalMessage) { if(Callback) { Callback(Answer); } else { if(Answer != null) { Me.Navigation.OpenPopupNavigation(Answer); } else Me.Navigation.OpenPopupNavigation(Answer); } }, function(Error,ErrorStack) { $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); } , "Argo"); } else { console.Error("Gestire GetLinksNavigateTo") } } this.Navigation.OpenPopupNavigation = function(LinkUrls, CallBackAtLink = null, CallBackAtCopyLink = null) { var CustomBox = new TMWGUICustomBox(11, 15); Me.CustomBox = CustomBox; var spanTitle = document.createElement("span"); spanTitle.style.marginLeft = "var(--resgui-halfcolumn)"; spanTitle.innerHTML = $MWGUI.GetLanguageString("LinksUrlsSource"); CustomBox.SpanTitle = spanTitle; var spanClose = document.createElement("span"); spanClose.innerHTML = "×"; spanClose.style.fontSize = "var(--resgui-font-height-xl)"; spanClose.style.cursor = "pointer"; spanClose.style.marginRight = "var(--resgui-quartercolumn)"; spanClose.CustomBox = CustomBox; spanClose.onclick = function () {this.CustomBox.Close()} CustomBox.Title.className += " justify-content-space-between"; CustomBox.Title.appendChild(spanTitle); CustomBox.Title.appendChild(spanClose); if(LinkUrls != null) { if(LinkUrls.findIndex(x => x._id != undefined) > -1) { var ContainerLinksMain = document.createElement("div"); ContainerLinksMain.className = "resgui-10row relative-full-width overflow-y-auto column-direction"; CustomBox.Body.appendChild(ContainerLinksMain); for(var Index in LinkUrls) { var FirstRow = document.createElement("div"); FirstRow.className = "resgui-1row relative-full-width row-direction justify-content-flex-start align-items-center divHeader"; FirstRow.addEventListener("click", function() { if(this.ImgArrow.style.transform == "rotate(-90deg)") { this.ContainerOptions.style.display = "none"; this.ImgArrow.style.transform = "rotate(-180deg)" } else { this.ContainerOptions.style.display = "flex"; this.ImgArrow.style.transform = "rotate(-90deg)" } }); ContainerLinksMain.appendChild(FirstRow); var ImgArrow = document.createElement("img"); ImgArrow.src = "../../../../../../../../../images/icons/ArrowIcon.png"; ImgArrow.className = "icon-image"; ImgArrow.style.transform = "rotate(-90deg)"; ImgArrow.style.marginLeft = "var(--resgui-quarter-column)"; FirstRow.ImgArrow = ImgArrow; FirstRow.appendChild(ImgArrow); var NameLink = document.createElement("span"); if(LinkUrls[Index]._id != undefined && LinkUrls[Index].SourceType != undefined && LinkUrls[Index].SystemName!= undefined ) { let innerHTML = Me.SourcesType[LinkUrls[Index].SourceType.toString()] + " - " + LinkUrls[Index].SystemName + " ["+LinkUrls[Index]._id+"]"; NameLink.innerHTML = innerHTML; } NameLink.style.marginLeft = "var(--resgui-quarter-column)"; FirstRow.appendChild(NameLink); var ContainerLinks = document.createElement("div"); ContainerLinks.className = "relative-full-width overflow-y-auto column-direction"; ContainerLinksMain.appendChild(ContainerLinks); FirstRow.ContainerOptions = ContainerLinks; Me.Navigation.CreateRowNavigation(LinkUrls[Index].LinkUrls, ContainerLinks, true); } } else { var ContainerLinks = document.createElement("div"); ContainerLinks.className = "resgui-10row relative-full-width overflow-y-auto column-direction"; CustomBox.Body.appendChild(ContainerLinks); Me.Navigation.CreateRowNavigation(LinkUrls, ContainerLinks, false, CallBackAtLink, CallBackAtCopyLink); } } CustomBox.Open(); } this.Navigation.CreateRowNavigation = function(LinkUrls, ContainerLinks, marginLeft = false, CallBackAtLink = null, CallBackAtCopyLink = null) { for(var Index in LinkUrls) { var FirstRow = document.createElement("div"); FirstRow.className = "resgui-1row relative-full-width row-direction justify-content-flex-start align-items-center divHeader"; FirstRow.addEventListener("click", function() { if(this.ImgArrow.style.transform == "rotate(-90deg)") { this.ContainerOptions.style.display = "none"; this.ImgArrow.style.transform = "rotate(-180deg)" } else { this.ContainerOptions.style.display = "flex"; this.ImgArrow.style.transform = "rotate(-90deg)" } }); ContainerLinks.appendChild(FirstRow); var ImgArrow = document.createElement("img"); ImgArrow.src = "../../../../../../../../../images/icons/ArrowIcon.png"; ImgArrow.className = "icon-image"; ImgArrow.style.transform = "rotate(-90deg)"; if(marginLeft) ImgArrow.style.marginLeft = "var(--resgui-quartercolumn)"; FirstRow.ImgArrow = ImgArrow; FirstRow.appendChild(ImgArrow); var NameLink = document.createElement("span"); if(LinkUrls[Index].Name) NameLink.innerHTML = LinkUrls[Index].Name; NameLink.style.marginLeft = "var(--resgui-quarter-column)"; FirstRow.appendChild(NameLink); var ContainerOptions = document.createElement("div"); ContainerOptions.className = "resgui-6row relative-full-width column-direction"; if(LinkUrls[Index].Browsers) if(LinkUrls[Index].Browsers.length > 0) ContainerOptions.className = "relative-full-width column-direction"; ContainerLinks.appendChild(ContainerOptions); FirstRow.ContainerOptions = ContainerOptions; var ContainerNameAndMode = document.createElement("div"); ContainerNameAndMode.className = "resgui-4row relative-full-width justify-content-center"; if(LinkUrls[Index].Browsers) if(LinkUrls[Index].Browsers.length > 0) ContainerNameAndMode.className = "relative-full-width justify-content-center"; ContainerOptions.appendChild(ContainerNameAndMode); var ContainerNameAndModeWithBorder = document.createElement("div"); ContainerNameAndModeWithBorder.style.width = "calc(100% - var(--resgui-halfcolumn))"; ContainerNameAndModeWithBorder.style.maxWidth = "calc(100% - var(--resgui-halfcolumn))"; ContainerNameAndModeWithBorder.style.minWidth = "calc(100% - var(--resgui-halfcolumn))"; ContainerNameAndModeWithBorder.className = "relative-full-height justify-content-flex-start decor-solid-border-bottom-light column-direction"; if(LinkUrls[Index].Browsers) if(LinkUrls[Index].Browsers.length > 0) ContainerNameAndModeWithBorder.className = "justify-content-flex-start decor-solid-border-bottom-light column-direction"; ContainerNameAndMode.appendChild(ContainerNameAndModeWithBorder); var RowName = document.createElement("div"); RowName.className = "resgui-1row relative-full-width row-direction"; ContainerNameAndModeWithBorder.appendChild(RowName); var RowNamePropName = document.createElement("div"); RowNamePropName.className = "resgui-2column relative-full-height justify-content-flex-end align-items-center"; RowName.appendChild(RowNamePropName); var SpanPropName = document.createElement("div"); SpanPropName.innerHTML = $MWGUI.GetLanguageString("Name") + " :"; RowNamePropName.appendChild(SpanPropName); var RowNameValueName = document.createElement("div"); RowNameValueName.className = "resgui-12column relative-full-height justify-content-flex-start align-items-center"; var SpanValueName = document.createElement("span"); RowNamePropName.style.marginLeft = "var(--resgui-quartercolumn)"; SpanValueName.className = "TextReadOnly"; if(LinkUrls[Index].Name) { SpanValueName.innerHTML = LinkUrls[Index].Name; SpanValueName.title = LinkUrls[Index].Name; } RowNameValueName.appendChild(SpanValueName); RowName.appendChild(RowNameValueName); var RowMode = document.createElement("div"); RowMode.className = "resgui-1row relative-full-width row-direction"; ContainerNameAndModeWithBorder.appendChild(RowMode); var RowNamePropMode = document.createElement("div"); RowNamePropMode.className = "resgui-2column relative-full-height justify-content-flex-end align-items-center"; RowMode.appendChild(RowNamePropMode); var SpanPropMode = document.createElement("div"); SpanPropMode.innerHTML = $MWGUI.GetLanguageString("Type") + " :"; RowNamePropMode.appendChild(SpanPropMode); var RowNameValueMode = document.createElement("div"); RowNameValueMode.className = "resgui-12column relative-full-height justify-content-flex-start align-items-center"; var SpanValueMode = document.createElement("span"); RowNamePropMode.style.marginLeft = "var(--resgui-quartercolumn)"; SpanValueMode.className = "TextReadOnly"; if(LinkUrls[Index].Mode != undefined) SpanValueMode.innerHTML = $MWArgo.ConnectionsMode[LinkUrls[Index].Mode.toString()]; RowNameValueMode.appendChild(SpanValueMode); RowMode.appendChild(RowNameValueMode); if(LinkUrls[Index].Browsers) if(LinkUrls[Index].Browsers.length > 0) { var RowBrowsers = document.createElement("div"); RowBrowsers.className = "relative-full-width row-direction resgui-"+ LinkUrls[Index].Browsers.length + "row"; ContainerNameAndModeWithBorder.appendChild(RowBrowsers); var RowNamePropBrowsers = document.createElement("div"); RowNamePropBrowsers.className = "resgui-2column relative-full-height justify-content-flex-end align-items-center"; RowNamePropBrowsers.style.marginLeft = "var(--resgui-quartercolumn)"; RowBrowsers.appendChild(RowNamePropBrowsers); var SpanPropBrowsers = document.createElement("div"); SpanPropBrowsers.innerHTML = $MWGUI.GetLanguageString("Browsers") + " :"; RowNamePropBrowsers.appendChild(SpanPropBrowsers); let RowValuePropBrowsers = document.createElement("div"); RowValuePropBrowsers.className = "resgui-12column justify-content-flex-start column-direction"; for(let IndexBrowser in LinkUrls[Index].Browsers) { let ContainerValue = document.createElement("div"); ContainerValue.className = "resgui-1row resgui-12column justify-content-flex-start align-items-center"; RowValuePropBrowsers.appendChild(ContainerValue) var SpanValueBrowser = document.createElement("span"); SpanValueBrowser.className = "TextReadOnly"; SpanValueBrowser.innerHTML = Me.BrowserName[LinkUrls[Index].Browsers[IndexBrowser].toString()]; ContainerValue.appendChild(SpanValueBrowser); } RowBrowsers.appendChild(RowValuePropBrowsers); } var RowUser = document.createElement("div"); RowUser.className = "resgui-1row relative-full-width row-direction"; ContainerNameAndModeWithBorder.appendChild(RowUser); var RowNamePropUser = document.createElement("div"); RowNamePropUser.className = "resgui-2column relative-full-height justify-content-flex-end align-items-center"; RowUser.appendChild(RowNamePropUser); var SpanPropUser = document.createElement("div"); SpanPropUser.innerHTML = $MWGUI.GetLanguageString("Username") + " :"; RowNamePropUser.appendChild(SpanPropUser); var RowNameValueUser = document.createElement("div"); RowNameValueUser.className = "resgui-12column relative-full-height justify-content-flex-start align-items-center row-direction"; var SpanValueUser = document.createElement("span"); RowNamePropUser.style.marginLeft = "var(--resgui-quartercolumn)"; SpanValueUser.className = "TextReadOnly"; if(LinkUrls[Index].Username != undefined) SpanValueUser.innerHTML = LinkUrls[Index].Username; RowNameValueUser.appendChild(SpanValueUser); RowUser.appendChild(RowNameValueUser); if(LinkUrls[Index].Username != undefined) { var ImgCopyUser = document.createElement("img"); ImgCopyUser.src = "../../../../../../../../../../../images/icons/cloneIcon.png"; ImgCopyUser.className = "icon-image-button"; ImgCopyUser.Username = LinkUrls[Index].Username; ImgCopyUser.addEventListener("click",function(){ navigator.clipboard.writeText(this.Username); }); RowNameValueUser.appendChild(ImgCopyUser); } var RowPsw = document.createElement("div"); RowPsw.className = "resgui-1row relative-full-width row-direction"; ContainerNameAndModeWithBorder.appendChild(RowPsw); var RowNamePropPsw = document.createElement("div"); RowNamePropPsw.className = "resgui-2column relative-full-height justify-content-flex-end align-items-center"; RowPsw.appendChild(RowNamePropPsw); var SpanPropPsw = document.createElement("div"); SpanPropPsw.innerHTML = $MWGUI.GetLanguageString("Password") + " :"; RowNamePropPsw.appendChild(SpanPropPsw); var RowNameValuePsw = document.createElement("div"); RowNameValuePsw.className = "resgui-12column relative-full-height justify-content-flex-start align-items-center"; var SpanValuePsw = document.createElement("span"); RowNamePropPsw.style.marginLeft = "var(--resgui-quartercolumn)"; SpanValuePsw.className = "TextReadOnly"; // SpanValuePsw.className = "TextReadOnly"; if(LinkUrls[Index].Password != undefined) SpanValuePsw.innerHTML = LinkUrls[Index].Password; RowNameValuePsw.appendChild(SpanValuePsw); RowPsw.appendChild(RowNameValuePsw); if(LinkUrls[Index].Password != undefined) { SpanValuePsw.style.filter = "blur(0.2rem)"; var ImgCopyPsw = document.createElement("img"); ImgCopyPsw.src = "../../../../../../../../../../../images/icons/cloneIcon.png"; ImgCopyPsw.className = "icon-image-button"; ImgCopyPsw.Password = LinkUrls[Index].Password ImgCopyPsw.addEventListener("click",function() { navigator.clipboard.writeText(this.Password); }) RowNameValuePsw.appendChild(ImgCopyPsw); } var ContainerCopy = document.createElement("div"); ContainerCopy.className = "relative-full-width resgui-1row row-direction justify-content-flex-end align-items-center"; ContainerOptions.appendChild(ContainerCopy); var SpanCopy = document.createElement("span"); SpanCopy.innerHTML = $MWGUI.GetLanguageString("CopyLinkNavigation"); SpanCopy.style.marginRight = "var(--resgui-quartercolumn)"; ContainerCopy.appendChild(SpanCopy); var DivButtonCopy = document.createElement("div"); DivButtonCopy.style.marginRight = "var(--resgui-quartercolumn)"; DivButtonCopy.className = "button-application"; DivButtonCopy.CallBackAtCopyLink = CallBackAtCopyLink; if(LinkUrls[Index].Url) DivButtonCopy.Link = LinkUrls[Index].Url; // DivButtonCopy.DivButton = DivButton; DivButtonCopy.addEventListener("click", function() { if(this.Link) navigator.clipboard.writeText(this.Link); if(this.CallBackAtCopyLink != null) this.CallBackAtCopyLink(function(){ if( Me.CustomBox) Me.CustomBox.Close() }); //this.DivButton.Enable(); }) ContainerCopy.appendChild(DivButtonCopy); var SpanButton = document.createElement("span"); SpanButton.innerHTML = $MWGUI.GetLanguageString("Copy"); DivButtonCopy.appendChild(SpanButton); var ContainerOpen = document.createElement("div"); ContainerOpen.className = "relative-full-width resgui-1row row-direction justify-content-flex-end align-items-center"; ContainerOptions.appendChild(ContainerOpen); var SpanOpen = document.createElement("span"); SpanOpen.innerHTML = $MWGUI.GetLanguageString("OpenLinkNavigation"); SpanOpen.style.marginRight = "var(--resgui-quartercolumn)"; ContainerOpen.appendChild(SpanOpen); var DivButtonOpen = document.createElement("div"); DivButtonOpen.style.marginRight = "var(--resgui-quartercolumn)"; DivButtonOpen.className = "button-application"; DivButtonOpen.CallBackAtLink = CallBackAtLink; if(LinkUrls[Index].Mode != undefined) DivButtonOpen.Mode = LinkUrls[Index].Mode ; if(LinkUrls[Index].Url) DivButtonOpen.Link = LinkUrls[Index].Url; //DivButtonOpen.DivButton = DivButton; DivButtonOpen.addEventListener("click", function() { if(this.Mode == 0) if(this.Link) window.open(this.Link, '_blank').focus(); if(this.CallBackAtLink != null) this.CallBackAtLink(function(){ if( Me.CustomBox) Me.CustomBox.Close() }); //this.DivButton.Enable(); }); ContainerOpen.appendChild(DivButtonOpen); var SpanButtonOpen = document.createElement("span"); SpanButtonOpen.innerHTML = $MWGUI.GetLanguageString("Open"); DivButtonOpen.appendChild(SpanButtonOpen); } } /*this.Navigation.GetAllSitesLinks = function(EndPoints, SiteId, CallBack) { let Result = []; PrivateRecursive_GetAllSitesLinks(0, EndPoints, Result, null, function(Result) { if(CallBack) CallBack(Result); }); } function PrivateRecursive_GetAllSitesLinks(Index, EndPoint, Result, CallBack) { if(Index < EndPoint.length) { var Param = { "SiteId" : SiteId, "SourceId" : "All" } $MW.ExeLambda(Me.LambdaFunctionDictionary["GetLinksNavigateTo"][EndPoint[Index]], Param, function(Answer,OriginalMessage) { if(Answer != null) { Result.push({"EndPoint": EndPoint[Index], "Value": Answer}) } else { Result.push({"EndPoint": EndPoint[Index], "Value": []}); } PrivateRecursive_GetAllSitesLinks(parseInt(Index) + 1, EndPoint, Result, CallBack); }, function(Error,ErrorStack) { $MWGUI.MessageBoxShow($MWGUI.GetLanguageString("ErrorMsgTitle"),$MWGUI.GetLanguageString("ErrorMsgBody"),"error",[{"text":$MWGUI.GetLanguageString("MessageButtonOK"),"Callback":function(){}}]); } , "Argo"); } else { if(CallBack) CallBack(Result); } }*/ this.ConvertStringToDate = function(stringDate, Format) { var DateTime = new Date(); var CharArray = stringDate.split(''); switch(Format) { case "yyyyMMdd'T'HHmmsszzzzz":{ var NewStringDate = CharArray[0] + CharArray[1] + CharArray[2] + CharArray[3] + "-"+ CharArray[4] + CharArray[5] + "-" + CharArray[6] + CharArray[7] +"T"+CharArray[9] + CharArray[10] + ":" + CharArray[11] + CharArray[12] + ":" + CharArray[13] + CharArray[14] + "Z"; DateTime = new Date(NewStringDate); DateTime = new Date(DateTime.getTime() + DateTime.getTimezoneOffset() * 60000); break; } default: { var NewStringDate = stringDate.replace(/\+0000/gi,"Z"); DateTime = new Date(NewStringDate); DateTime = new Date(DateTime.getTime() + DateTime.getTimezoneOffset() * 60000); break; } } return DateTime; } this.ConvertStringToTimeSpan = function(TimeSpan) { var Result = {} var SplitterForDays = TimeSpan.split('.'); var TimeSpanTime = ""; if(SplitterForDays.length > 0) { if(parseInt(SplitterForDays[0]) > 0) Result.Days = parseInt(SplitterForDays[0]); TimeSpanTime = SplitterForDays[1]; } else TimeSpanTime = TimeSpan; var SplitterForHours = TimeSpanTime.split(':'); if(SplitterForHours.length > 0) { var Hours = parseInt(SplitterForHours[0]); var Minutes = parseInt(SplitterForHours[1]); var Seconds = parseInt(SplitterForHours[2]); if(Hours > 0) Result.Hours = Hours; if(Minutes > 0) Result.Minutes = Minutes; if(Seconds > 0) Result.Seconds = Seconds; } return Result; } this.AddTimeSpanArgoToDate = function(TimeSpan, DateTimeNew) { var DateTime = $MWArgo.ConvertStringToDate(DateTimeNew, "yyyyMMdd'T'HHmmsszzzzz"); //var DateTime = FirstDate; if(TimeSpan.Days) DateTime.setDate(DateTime.getDate() + TimeSpan.Days); if(TimeSpan.Hours) DateTime.setHours(DateTime.getHours() + TimeSpan.Hours); if(TimeSpan.Minutes) DateTime.setMinutes(DateTime.getMinutes() + TimeSpan.Minutes); if(TimeSpan.Seconds) DateTime.setSeconds(DateTime.getSeconds() + TimeSpan.Seconds); return DateTime; } this.LoadMenu = function() { var MainMenuOptions = {}; MainMenuOptions.Pages = {}; MainMenuOptions.Pages["Events"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/AlarmsIcon.png", "Label":$MWGUI.GetLanguageString("ManageEventsPageDemo"), "PageTitle":$MWGUI.GetLanguageString("ManageEventsPageDemo"), "CustomFunction":function(){ $MWGUI.ChangePage($MWGUI.GetLanguageString("ManageEventsPageDemo"), "../../../../../../../../../../Argo/Events/EventsListDemo.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["Tools"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/ToolsIcon2.png", "Label":$MWGUI.GetLanguageString("Tools"), "PageTitle":$MWGUI.GetLanguageString("Tools"), "Children":{} }; MainMenuOptions.Pages["Tools"]["Children"]["ProcesDesignerPage"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/gridIcon.png", "Label":$MWGUI.GetLanguageString("ProcesDesignerPage"), "PageTitle":$MWGUI.GetLanguageString("ProcesDesignerPage"), "CustomFunction":function() { $MWGUI.ChangePage($MWGUI.GetLanguageString("ProcesDesignerPage"), "../../../../../../../../../../Argo/Frameworks/ProcessDesigner/index.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["Statistics"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/statisticsIcon.png", "Label":$MWGUI.GetLanguageString("Statistics"), "PageTitle":$MWGUI.GetLanguageString("Statistics"), "Children":{} }; MainMenuOptions.Pages["Statistics"]["Children"]["General"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/statisticsIcon.png", "Label":$MWGUI.GetLanguageString("StatisticsGeneralPage"), "PageTitle":$MWGUI.GetLanguageString("StatisticsGeneralPage"), "CustomFunction":function() { $MWGUI.ChangePage($MWGUI.GetLanguageString("StatisticsGeneralPage"), "../../../../../../../../../../Argo/Statistics/General/StatisticsGeneral.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["Statistics"]["Children"]["DataType"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/statisticsIcon.png", "Label":$MWGUI.GetLanguageString("StatisticsDataTypePage"), "PageTitle":$MWGUI.GetLanguageString("StatisticsDataTypePage"), "CustomFunction":function() { $MWGUI.ChangePage($MWGUI.GetLanguageString("StatisticsDataTypePage"), "../../../../../../../../../../Argo/Statistics/DataType/StatisticsDataType.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["Statistics"]["Children"]["DataTypePV"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/statisticsIcon.png", "Label":$MWGUI.GetLanguageString("StatisticsDataTypePagePV"), "PageTitle":$MWGUI.GetLanguageString("StatisticsDataTypePagePV"), "CustomFunction":function() { $MWGUI.ChangePage($MWGUI.GetLanguageString("StatisticsDataTypePagePV"), "../../../../../../../../../../Argo/Statistics/DataTypePV/StatisticDataTypePV.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["Statistics"]["Children"]["Priority"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/statisticsIcon.png", "Label":$MWGUI.GetLanguageString("StatisticsPriorityPage"), "PageTitle":$MWGUI.GetLanguageString("StatisticsPriorityPage"), "CustomFunction":function() { $MWGUI.ChangePage($MWGUI.GetLanguageString("StatisticsPriorityPage"), "../../../../../../../../../../Argo/Statistics/Priority/StatisticsPriority.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["AnomalyDetections"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/anomalyDetectionIcon.png", "Label":$MWGUI.GetLanguageString("AnomalyDetections"), "PageTitle":$MWGUI.GetLanguageString("AnomalyDetections"), "Children":{} }; MainMenuOptions.Pages["AnomalyDetections"]["Children"]["RepeatedEvent"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/anomalyDetectionRepeatedEventIcon.png", "Label":$MWGUI.GetLanguageString("AnomalyDetectionsEventRepeatedPage"), "PageTitle":$MWGUI.GetLanguageString("AnomalyDetectionsEventRepeatedPage"), "CustomFunction":function() { $MWGUI.ChangePage($MWGUI.GetLanguageString("AnomalyDetectionsEventRepeatedPage"), "../../../../../../../../../../Argo/Statistics/AnomalyDetections/RepeatedEvent/RepeatedEvent.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["EventsNew"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/AlarmsIcon.png", "Label":$MWGUI.GetLanguageString("ManageEventsPageDevelopment"), "PageTitle":$MWGUI.GetLanguageString("ManageEventsPageDevelopment"), "CustomFunction":function(){ $MWGUI.ChangePage($MWGUI.GetLanguageString("ManageEventsPageDevelopment"), "../../../../../../../../../../Argo/Events/EventsList.html"); $MWGUI.HiddenMainMenu(); } }; MainMenuOptions.Pages["ArchiveEvents"] = { "Location":"", "Icon":"../../../../../../../../../../../../../../../../images/icons/ProtocolsIcon.png", "Label":$MWGUI.GetLanguageString("EventsArchived"), "PageTitle":$MWGUI.GetLanguageString("EventsArchived"), "CustomFunction":function(){ $MWGUI.ChangePage($MWGUI.GetLanguageString("EventsArchived"), "../../../../../../../../../../Argo/ArchivedEvents/ArchivedEvents.html"); $MWGUI.HiddenMainMenu(); } }; $MWGUI.InitMainMenu(MainMenuOptions); } if(parent.$MWArgo!=null) { if(parent.$MWArgo!=this) { this.DataTypes = parent.$MWArgo.DataTypes; this.AssetTypes = parent.$MWArgo.AssetTypes; } } else { this.LoadBaseData(); } this.LoadBaseData(); } var $MWArgo = new TMWArgo();