<commit_before>//function called when pressed set credential
var resetParams = function() {
	writeCookie();
	location.reload(true);
}


// TODO: not on document ready but on main ready
var onCreate=function() {
    //get the username, password and endpoint value in the inputs
    var userName = document.getElementById("ekbUser").value;
    var passWord = document.getElementById("ekbPassword").value;
    var endPoint = document.getElementById("ekbEndpoint").value;
    
    //build an http get to request the list of ingestion in CSV format
	$.ajax({
        type: 'GET',
		url: endPoint + "/activities",
        headers: {
				Accept : "text/csv",
				Authorization: 'Basic ' + btoa(userName + ":" + passWord)
		},
		cache:false,
		success: function(data ){
				var tableRows=CSV.parse(data);
				for(var i in tableRows ){
					var row=tableRows[i];
					document.getElementById("ingestionTable").innerHTML+=
                        "<tr>" +
                            "<td>"+row[0]+"</td>" +
                            "<td>"+row[1]+"</td>" +
                            "<td>"+row[2]+"</td>" +
                            "<td>"+row[3]+"</td>" +
                            "<td>"+row[4]+"</td>" +
                            "<td>"+row[5]+"</td>" +
                            "<td>" +
                                "<a href='"+endPoint+"/activity/"+row[0]+"' target='_blank'><button class=\"glyphicon glyphicon-italic\"><b></b></button></a>"//ingestion report link
                            "</td>" +
                        "</tr>";
						//decide to use the I or the Link symbol (glyphicon glyphicon-link)
				}
			},
		error: function (xhr, ajaxOptions, thrownError) {
			alert("Error loading activities " + xhr.status + " " + thrownError);
			
		}
	});
	
	$("#formIngestion").submit(function (event) {
		event.preventDefault();
		submitPressed();
	})

};

//sent a new injestion to the endpoint<commit_msg>Correct header of ingestion table<commit_after>//function called when pressed set credential
var resetParams = function() {
	writeCookie();
	location.reload(true);
}


// TODO: not on document ready but on main ready
var onCreate=function() {
    //get the username, password and endpoint value in the inputs
    var userName = document.getElementById("ekbUser").value;
    var passWord = document.getElementById("ekbPassword").value;
    var endPoint = document.getElementById("ekbEndpoint").value;
    
    //build an http get to request the list of ingestion in CSV format
	$.ajax({
        type: 'GET',
		url: endPoint + "/activities",
        headers: {
				Accept : "text/csv",
				Authorization: 'Basic ' + btoa(userName + ":" + passWord)
		},
		cache:false,
		success: function(data ){
				var tableRows=CSV.parse(data);
				for(var i in tableRows ){
					var row=tableRows[i];
					if (i > 0) {
						document.getElementById("ingestionTable").innerHTML+=
							"<tr id="+i+">" +
								"<td style=\"vertical-align: middle;\">"+row[0]+"</td>" +
								"<td style=\"vertical-align: middle;\">"+row[1]+"</td>" +
								"<td style=\"vertical-align: middle;\">"+row[2]+"</td>" +
								"<td style=\"vertical-align: middle;\">"+row[3]+"</td>" +
								"<td style=\"vertical-align: middle;\">"+row[4]+"</td>" +
								"<td style=\"vertical-align: middle;\">"+row[5]+"</td>" +
								"<td style=\"vertical-align: middle;\">" +
									"<a href='"+endPoint+"/activity/"+row[0]+"' target='_blank'><button class=\"btn btn-default glyphicon glyphicon-link\"><b></b></button></a>"//ingestion report link
								"</td>" +
							"</tr>";
						//assign color to this row if status is 
						// var classRow = document.getElementById(i);
						// if (row[2] == "completed") {
							// classRow.className += "success";
						// }
					}
				}
			},
		error: function (xhr, ajaxOptions, thrownError) {
			alert("Error loading activities " + xhr.status + " " + thrownError);
			
		}
	});
	
	$("#formIngestion").submit(function (event) {
		event.preventDefault();
		submitPressed();
	})

};

//sent a new injestion to the endpoint
{'fraction_non_alphanumeric': 0.1782983970406905, 'fraction_numerical': 0.003945745992601726, 'mean_word_length': 2.4875322441960446, 'pattern_counts': {'":': 2, '<': 47, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '901063', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1206, 'n_words': 284}