" + "
" ;
v += "
" + "
" ;
variableBox = "
";
}else{
v+= "
" + "
";
variableBox = "
";
}
v += "
" + valBox + " " + addBtn + "
" +
"
Display as a variable
" + variableBox + "
" + "
";
cnt++;
}
htmlVal+= v + "
";
}
}
}
return htmlVal;
}
function getModuleName(){
var activeWorkspace=RED.view.getWorkspace();
var moduleName="";
RED.nodes.eachNode(function(n) {
if (n.z == activeWorkspace) {
if(n.type == 'service-logic'){
//console.log("getModuleName():<" + n.module + ">");
moduleName=n.module;
}
}
});
return moduleName;
}
var global_added_obj={};
var displayingRpcs = false;
function showRpcsValuesBox(editor,valuesObj){
displayingRpcs = true;
showValuesBox(editor,valuesObj);
}
function showValuesBox(editor,valuesObj){
var moduleName = getModuleName();
var obj = valuesObj[moduleName];
//console.dir(valuesObj);
//console.dir(obj);
var moduleObj ={};
if(obj == undefined){
moduleObj[moduleName] = ["No SLI values setup for this module " + moduleName + ".Upload the yang file for this module or if already uploaded ,load it from the Available Modules from the Menu."];
}else{
moduleObj[moduleName] = obj;
}
showValuesBoxForModule(editor,moduleObj,moduleName);
}
function showValuesBoxForModule(editor,valuesObj,moduleName){
global_editor=editor;
g_currValuesObj = valuesObj;
//console.log(editor.getText());
//populate the valid SLI values
var valuesHtml="
" ;
valuesHtml+=buildValuesHtml(valuesObj);
valuesHtml+="
";
global_added_obj={};
var title = "SLI Values for Module " + moduleName;
if(displayingRpcs){
title = "RPCs for Module " + moduleName;
}
$('#sli-values-dialog').dialog({
modal: false,
title: title,
width: 1200,
height: 500,
dialogClass: 'color-dialog',
open: function () {
$("#sli-values-dialog").dialog("widget").find(".ui-dialog-buttonpane").css({'background': 'aliceblue'});
$(this).html(valuesHtml);
},
buttons: {
Close: function () {
displayingRpcs = false;
//$(this).dialog("close");
$(this).dialog("destroy");
}
},
close: function(ev,ui){
displayingRpcs = false;
$(this).dialog("destroy");
}
}); // end dialog div
}
function showCommentsBox(){
var comments = $("#node-input-comments").val();
var commentsBoxHtml="
" ;
var nodeName=$("#node-input-name").val();
$('#comments-dialog').dialog({
modal: true,
title: "Add comments for Node " + nodeName,
width: 450,
height: 300,
/*
open: function () {
$(this).html(commentsBoxHtml);
},
*/
buttons: {
"Save Comments": function () {
var v=$("#taCommentId").val();
if(v != null){
v = v.trim();
if(v != ''){
$("#node-input-btnComments").html("
View Comments");
}else{
$("#node-input-btnComments").html("
Add Comments");
}
}
//console.log("value from text area" + v);
$("#node-input-comments").val(v);
$(this).dialog("close");
//$(this).dialog("destroy");
},
Cancel: function () {
var v=$("#taCommentId").val();
if(v != null){
v = v.trim();
if(v != ''){
$("#node-input-btnComments").html("
View Comments");
}else{
$("#node-input-btnComments").html("
Add Comments");
}
}
$(this).dialog("close");
//$(this).dialog("destroy");
}
},
close: function(ev,ui){
//console.log("closing..");
$(this).dialog("destroy");
}
}).html(commentsBoxHtml);
//console.log("done");
/*
function functionDialogResize(ev,ui) {
console.log("ui.size.height:" + ui.size.height);
$(this).css("height",(ui.size.height-275)+"px");
};
$( this ).on("dialogresize", functionDialogResize);
$( this ).one("dialogopen", function(ev) {
var size = $( "#sliValDiv" ).dialog('option','sizeCache-function');
if (size) {
functionDialogResize(null,{size:size});
}
});
*/
}
function selectText(objId,groupVal){
//console.log(objId + groupVal);
//console.log(objId + groupVal);
$(document).ready(function(){
//console.log("doc ready");
//console.dir($('#valAddDiv' + objId));
if ($('#valAddDiv' + objId).is(":visible")) {
$("#variableBoxDiv" + objId ).hide("slow");
//$("#a" + objId ).css({"background": "rgb(223, 191, 191)",
// "color": "rgb(32, 45, 87)"});
$("#a" + objId ).css({"background": "aliceblue",
"color": "rgb(32, 45, 87)"});
/*"color": "rgb(32, 45, 87)"});*/
$("#valAddDiv" + objId ).hide("slow");
$("#valueBoxDiv" +objId).css({"border-color": "aliceblue",
"border-width":"1px",
"background-color":"aliceblue",
"border-style":"solid"});
//$("#valAddDiv" + objId ).fadeOut("slow");
} else{
$("#variableBoxDiv" + objId ).show("slow");
$("#valAddDiv" + objId).show("slow");
/*$("#valueBoxDiv" +objId).css({"border-color": "rgb(75, 111, 147)",
"border-width":"5px",
"background-color": "rgb(223, 191, 191)",
"border-style":"solid",
"border-bottom": "5px solid rgb(75, 111, 147)"});
*/
$("#valueBoxDiv" +objId).css({"border-color": "rgb(75, 111, 147)",
"border-width":"3px",
"background-color": "aliceblue",
"border-style":"solid",
"border-bottom": "3px solid rgb(75, 111, 147)"});
/*$("#a" + objId ).css({"background": "rgb(223, 191, 191)",
"color": "rgb(75, 111, 147)"});
*/
$("#a" + objId ).css({"background": "aliceblue",
"color": "rgb(75, 111, 147)"});
}
$("#a" + objId).select();
});
//console.log("group-heading" + objId);
// var obj= document.getElementById("group-heading" + objId);
// obj.innerText = groupVal;
// obj.style.color = "blue";
// console.dir(obj);
}
function hidePrevGroup(objId){
// console.log("mouseout" );
// var obj= document.getElementById("group-heading" + objId);
// obj.innerText = "";
}
/*
function fixDiv() {
var $cache = $('#getFixed');
if ($(window).scrollTop() > 100)
$cache.css({
'position': 'fixed',
'top': '10px'
});
else
$cache.css({
'position': 'relative',
'top': 'auto'
});
}
$(window).scroll(fixDiv);
function isScrolledIntoView(elem)
{
var $elem = $(elem);
var $window = $(window);
var docViewTop = $window.scrollTop();
var docViewBottom = docViewTop + $window.height();
var elemTop = $elem.offset().top;
var elemBottom = elemTop + $elem.height();
return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
}
*/
function getCommits(filePath){
var urlPath="/getCommitsInfo";
$.get(urlPath,{"filePath" : filePath })
.done(function( data ) {
if(data != undefined && data != null){
//console.log(data.stdout);
var jsonObj = JSON.parse(data.stdout);
var codeCloudFilesHtmlStr = $( "#codecloud-browser-dialog" ).html();
var htmlStr = getCCFileHtmlStr(filePath,jsonObj,codeCloudFilesHtmlStr);
$( "#codecloud-browser-dialog" ).html(htmlStr);
/*
for(var i=0;i
";
var htmlStr="";
//console.dir(rows);
if(rows != null && rows.length >0){
var alertDialog = '';
htmlStr= alertDialog + "" + styleStr;
htmlStr += "
";
htmlStr += "" + filePath + "";
htmlStr += "";
htmlStr += "Commit ID | " ;
htmlStr += "Date | " ;
htmlStr += "Author | " ;
htmlStr += "Comment | " ;
htmlStr += "
";
if(rows != null && rows.length == 0){
htmlStr += "";
htmlStr += "No rows found | ";
htmlStr += "
";
return htmlStr;
}
for(var i=0;i";
htmlStr += "" + _commitId + " | ";
htmlStr += "" + dt + " | ";
htmlStr += "" + author + " | ";
htmlStr += "" + comment + " | ";
htmlStr += "";
}
htmlStr += "";
htmlStr += " ";
}
//console.log(htmlStr);
return htmlStr;
}
var gitLocalFlowFiles=[];
function filterGitLocalFlows(filterVal){
var matchedCnt =0;
var valuesObj = gitLocalFlowFiles;
//console.dir(codeCloudFlowFiles);
var updatedValuesObj =[];
var searchValues =[];
if(filterVal != null && filterVal != undefined){
filterVal=filterVal.trim();
}
searchValues = filterVal.split(/ /);
//console.log("filterVal:" + filterVal);
//console.dir(searchValues);
if(searchValues != null && searchValues != undefined){
var foundCount = 0;
for(var k=0;k