X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plekit%2Ftable%2Fcolumns.js;h=297a1c4f7ff8e02dba6c7336923218573f60564e;hb=HEAD;hp=bb225fcb4dd9a447159f20e478a87256f4771e89;hpb=98babcb7ca66f2369bc523c52e5e8efde0cb856b;p=plewww.git diff --git a/plekit/table/columns.js b/plekit/table/columns.js index bb225fc..2312e5e 100644 --- a/plekit/table/columns.js +++ b/plekit/table/columns.js @@ -1,264 +1,302 @@ -/* $Id: column.js Panos $ */ - var filtered_color = "grey"; var normal_color = "black"; //Descriptions overriding the default ones set in Accessors_site.py and configuration -var sourceComon = 'CoMon'; -var sourceTophat = 'TopHat'; -var sourceTophatAPI = 'TopHat API'; -var sourceMySlice = 'MySlice'; -var sourceCymru = 'Team Cymru'; -var sourceMyPLC = 'MyPLC API'; -var sourceManiacs = 'MANIACS'; -var sourceMaxmind = 'MaxMind'; -var sourceMonitor = 'Monitor'; -var selectReferenceNode ='Select reference node: '; -var addButton = ''; -var deleteButton = ''; +var sourceComon = 'CoMon'; +var sourceTophat = 'TopHat'; +var sourceTophatAPI = 'TopHat API'; +var sourceMySlice = 'MySlice'; +var sourceCymru = 'Team Cymru'; +var sourceSonoma = 'SONoMA'; +var sourceMyPLC = 'MyPLC API'; +var sourceManiacs = 'MANIACS'; +var sourceMaxmind = 'MaxMind'; +var sourceMonitor = 'Monitor'; +var hardwareReqs = 'current PlanetLab hardware requirement'; +var selectReferenceNode ='
'; +var selectReferenceNodeRTT =''; var descHOSTNAME = "test"; -var titleA = 'Architecture name'; -var detailA = 'The node architecture.'; -var sourceA = 'Source: '+sourceMyPLC; -var valuesA = 'Values: x86_64, i386'; -var descA = ''+titleA+''+detailA+'
'+valuesA+'
'+sourceA;
+var titleAU = 'Authority';
+var detailAU = 'The authority of the global PlanetLab federation that the site of the node belongs to.';
+var valuesAU = 'PLC (PlanetLab Central), PLE (PlanetLab Europe)';
+var sourceAU = 'Source: '+sourceMyPLC;
+var descAU = ''+titleAU+' '+detailAU+' Values: '+valuesAU+' Source: '+sourceMyPLC+'
'+detailf+'
'+sourcef;
+var titleST = 'Status';
+var sourceST = 'Source: '+sourceMonitor;
+var valuesST = 'Values: online (up and running), good (up and running recently), offline (unreachable today), down (node unreachable for more than one day), failboot (reachable, but only by administrators for debugging purposes).';
+var descST = ''+titleST+' '+valuesST+' '+sourceST+'
'+detailAU+'
'+valuesAU+'
'+sourceAU;
+var titleA = 'Architecture name';
+var detailA = 'The node architecture.';
+var sourceA = 'Source: '+sourceMyPLC;
+var valuesA = 'x86_64, i386, n/a';
+var descA = ''+titleA+' '+detailA+' Values: '+valuesA+' '+sourceA+'
'+valuesAS+'
' + sourceAS;
+var valuesAS = 'Values: Integer between 0 and 65535, n/a';
+var descAS = ''+titleAS+' '+valuesAS+' ' + sourceAS+'
'+valuesAST+'
'+sourceAST;
+var valuesAST = 'Values: t1 (tier-1), t2 (tier-2), edu (university), comp (company), nic (network information centre -- old name for a domain name registry operator), ix (IXP), n/a';
+var descAST = ''+titleAST+' '+valuesAST+' '+sourceAST+'
'+sourceASN;
+var descASN = ''+titleASN+' '+sourceASN+'
'+detailBU+'
'+selectPeriodBU+'
'+valuesBU+'
'+sourceBU;
+var valuesBU ='Unit: Kbps';
+var detailBU = 'The average transmited bandwidh over the selected period. The period is the most recent for which data is available, with CoMon data being collected by MySlice daily.'
+var descBU = ''+titleBU+' '+detailBU+' '+selectPeriodBU+' '+valuesBU+' '+sourceBU+'
'+detailBW+'
'+valuesBW+'
'+sourceBW;
+var valuesBW = 'Unit: Kbps';
+var detailBW = 'The bandwidth limit is a cap on the total outbound bandwidth usage of a node. It is set by the site administrator (PI). For more details see Bandwidth Limits (planet-lab.org).';
+var descBW = ''+titleBW+' '+detailBW+' '+valuesBW+' '+sourceBW+'
(Older nodes may have fewer cores).';
-var descCC = ''+titleCC+'
'+valuesCC+'
'+sourceCC;
+var detailCC = 'The number of CPU cores on the node. For reference, the '+hardwareReqs+' is 4 cores min. (Older nodes may have fewer cores).';
+var descCC = ''+titleCC+' '+detailCC+' '+sourceCC+'
'+valuesCN+'
'+sourceCN;
+var detailCN = 'The number of CPUs on the node. For eeference, the '+hardwareReqs+' is 1 (if quad core) or 2 (if dual core).';
+var descCN = ''+titleCN+' '+detailCN+' '+sourceCN+' '+detailCPC+' '+sourceCPC+'
Current PlanetLab hardware requirements: 2.4 GHz'; -var descCR = ''+titleCR+'
'+valuesCR+'
'+sourceCR;
+var valuesCR = 'Unit: GHz';
+var descCR = ''+titleCR+' '+detailCR+' '+valuesCR+' '+sourceCR+'
'+detailCF+'
'+selectPeriodCF+'
'+valuesCF+'
'+sourceCF;
+var valuesCF = 'Unit: %';
+var detailCF = 'The average CPU percentage that gets allocated to a test slice named burb that is periodically run by CoMon.';
+var descCF = ''+titleCF+' '+detailCF+' '+selectPeriodCF+' '+valuesCF+' '+sourceCF+'
'+sourceDN;
+var descDN = ''+titleDN+' '+sourceDN+' '+detailDA+' '+sourceDA+' '+detailDL+' '+valuesDL+' '+sourceDL+'
Current PlanetLab hardware requirements: 500 GB'; -var descDS = ''+titleDS+'
'+valuesDS+'
'+sourceDS;
+var valuesDS = 'Unit: GB';
+var descDS = ''+titleDS+' '+detailDS+' '+valuesDS+' '+sourceDS+'
'+detailDU+'
'+valuesDU+'
'+sourceDU;
+var sourceDU = 'Source: '+sourceComon;
+var valuesDU = 'Unit: GB';
+var detailDU = 'The amount of disk space currently consumed.';
+var descDU = ''+titleDU+' '+detailDU+' '+valuesDU+' '+sourceDU+'
'+detailDF+'
'+valuesDF+'
'+sourceDF;
+var sourceDF = 'Source: '+sourceComon;
+var valuesDF = 'Unit: GB.';
+var detailDF = 'The amount of disk space currently available.';
+var descDF = ''+titleDF+' '+detailDF+' '+valuesDF+' '+sourceDF+'
'+detailHC+'
'+selectReferenceNode+'
'+sourceHC;
+var detailHC = 'TopHat conducts traceroutes every five minutes in a full mesh between all PlanetLab nodes. The hop count is the length of the traceroute from the node to the reference node, based upon the most recently reported traceroute.';
+var descHC = ''+titleHC+' '+detailHC+' '+selectReferenceNode+' '+sourceHC+'
'+sourceIP;
+var descIP = ''+titleIP+' '+sourceIP+'
'+detailL+'
'+selectPeriodL+'
'+valuesL+'
'+sourceL;
+var valuesL = 'Unit: 5-minute load';
+var detailL = 'The average 5-minute load (as reported by the Unix uptime command) over the selected period.';
+var descL = ''+titleL+' '+detailL+' '+selectPeriodL+' '+valuesL+' '+sourceL+'
'+sourceLON;
+var descLON = ''+titleLON+' '+sourceLON+'
'+sourceLAT;
+var descLAT = ''+titleLAT+' '+sourceLAT+'
'+detailLCN+'
'+sourceLCN;
+var detailLCN = 'Based on the latitude and longitude information.';
+var descLCN = ''+titleLCN+' '+detailLCN+' '+sourceLCN+'
'+detailLCT+'
'+sourceLCT;
+var detailLCT = 'Based on the latitude and longitude information.';
+var descLCT = ''+titleLCT+' '+detailLCT+' '+sourceLCT+'
'+detailLCY+'
'+sourceLCY;
+var detailLCY = 'Based on the latitude and longitude information.';
+var descLCY = ''+titleLCY+' '+detailLCY+' '+sourceLCY+'
'+detailLPR+'
'+valuesLPR+'
'+sourceLPR;
+var valuesLPR = 'Unit: float.';
+var detailLPR = 'The radius of the circle corresponding to the error in precision of the geolocalization estimate.';
+var descLPR = ''+titleLPR+' '+detailLPR+' '+valuesLPR+' '+sourceLPR+'
'+detailLRN+'
'+sourceLRN;
+var detailLRN = 'Based on the latitude and longitude information.';
+var descLRN = ''+titleLRN+' '+detailLRN+' '+sourceLRN+'
Current PlanetLab hardware requirements: 4 GB.'; -var descMS = ''+titleMS+'
'+valuesMS+'
'+sourceMS;
+var valuesMS = 'Unit: GB.';
+var descMS = ''+titleMS+' '+detailMS+' '+valuesMS+' '+sourceMS+'
Unit: %'; -var detailMU = 'The average active memory utilization as reported by CoMon.'; -var descMU = ''+titleMU+'
'+detailMU+'
'+selectPeriodMU+'
'+valuesMU+'
'+sourceMU; - -var titleNEC= 'Network information (ETOMIC)'; -var sourceNEC = 'Source: '+sourceTophat; -var valuesNEC = 'Values: yes/no'; -var detailNEC = 'The existence of a colocated ETOMIC box. When an ETOMIC box is present, you have the possibility to conduct high-precision measurements through the '+sourceTophatAPI+'.'; -var descNEC = ''+titleNEC+'
'+detailNEC+'
'+valuesNEC+'
'+sourceNEC; - -var titleNSN= 'Network information (SONoMA)'; -var sourceNSN = 'Source: '+sourceTophat; -var valuesNSN = 'Values: yes/no'; -var detailNSN = 'The existence of a SONoMA agent. When an SONoMA is present, you have the possibility to have access to high-precision measurements through the '+sourceTophatAPI+'.'; -var descNSN = ''+titleNSN+'
'+detailNSN+'
'+valuesNSN+'
'+sourceNSN; - -var titleNTH= 'Network information (TopHat)'; -var sourceNTH = 'Source: '+sourceTophat; -var valuesNTH = 'Values: yes/no'; -var detailNTH = 'The existence of a colocated TDMI (TopHat Dedicated Measurement Infrastructure) agent. When a TDMI agent is present, you have access to a wide variety of network topology measurements through the '+sourceTophatAPI+'.'; -var descNTH = ''+titleNTH+'
'+detailNTH+'
'+valuesNTH+'
'+sourceNTH; - -var titleNDS= 'Network information (DIMES)'; -var sourceNDS = 'Source: '+sourceTophat; -var valuesNDS = 'Values: yes/no'; -var detailNDS = 'The existence of a colocated DIMES agent. When a DIMES agent is present, you have access to DIMES measurements through the '+sourceTophatAPI+'.'; -var descNDS = ''+titleNDS+'
'+detailNDS+'
'+valuesNDS+'
'+sourceNDS;
+var valuesMU = 'Unit: %';
+var detailMU = 'The average active memory utilization as reported by CoMon.';
+var descMU = ''+titleMU+' '+detailMU+' '+selectPeriodMU+' '+valuesMU+' '+sourceMU+' '+detailMA+' '+valuesMA+' '+sourceMA+' '+detailMAS+' '+valuesMAS+' '+sourceMAS+' '+detailMAE+' '+valuesMAE+' '+sourceMAE+' '+detailMAT+' '+valuesMAT+' '+sourceMAT+' '+detailMAD+' '+valuesMAD+' '+sourceMAD+'
Values: yes/no'; -var detailNSF = ' Whether the node can send packets successfully (or not) with a spoofed IP source address.'; -var descNSF = ''+titleNSF+'
'+detailNSF+'
'+valuesNSF+'
'+sourceNSF;
+var valuesNSF = 'Values: yes/no';
+var detailNSF = 'Whether the node can send packets successfully (or not) with a spoofed IP source address.';
+var descNSF = ''+titleNSF+' '+detailNSF+' '+valuesNSF+' '+sourceNSF+'
Values: yes/no'; -var detailNSR = ' Whether the node can send packets packets using the IP source route option. See herefor more info.'; -var descNSR = ''+titleNSR+'
'+detailNSR+'
'+valuesNSR+'
'+sourceNSR;
+var valuesNSR = 'Values: yes/no';
+var detailNSR = 'Whether the node can send packets packets using the IP source route option. See herefor more info.';
+var descNSR = ''+titleNSR+' '+detailNSR+' '+valuesNSR+' '+sourceNSR+'
Values: yes/no'; -var detailNTP = ' Whether the node can send packets packets using the IP timestamp option. See herefor more info.'; -var descNTP = ''+titleNTP+'
'+detailNTP+'
'+valuesNTP+'
'+sourceNTP;
+var valuesNTP = 'Values: yes/no';
+var detailNTP = 'Whether the node can send packets packets using the IP timestamp option. See herefor more info.';
+var descNTP = ''+titleNTP+' '+detailNTP+' '+valuesNTP+' '+sourceNTP+'
Values: yes/no'; -var detailNRR = ' Whether the node can send packets packets using the IP record route option. See herefor more info.'; -var descNRR = ''+titleNRR+'
'+detailNRR+'
'+valuesNRR+'
'+sourceNRR;
+var valuesNRR = 'Values: yes/no';
+var detailNRR = 'Whether the node can send packets packets using the IP record route option. See herefor more info.';
+var descNRR = ''+titleNRR+' '+detailNRR+' '+valuesNRR+' '+sourceNRR+'
'+valuesOS+'
'+sourceOS;
+var valuesOS = 'Values: f8, f12, Cent/OS, other, n/a';
+var descOS = ''+titleOS+' '+detailOS+' '+valuesOS+' '+sourceOS+' '+detailRTT+' '+selectReferenceNodeRTT+' '+sourceRTT+'
'+detailR+'
'+selectPeriodR+'
'+valuesR+'
'+sourceR;
+var detailR = 'CoMon queries nodes every 5 minutes, for 255 queries per day. The average reliability is the percentage of queries over the selected period for which CoMon reports a value. The period is the most recent for which data is available, with CoMon data being collected by MySlice daily.';
+var valuesR = 'Unit: %';
+var descR = ''+titleR+' '+detailR+' '+selectPeriodR+' '+valuesR+' '+sourceR+'
Your slivers will be available only during timeslots where you have obtained leases (see tab above).
Please note that as of August 2010 this feature is experimental. Feedback is appreciated at devel@planet-lab.org'; -var descRES = ''+titleRES+'
'+detailRES+'
'+valuesRES+'
'+sourceRES; +//var valuesRES = 'Values: yes/no'; +var valuesRES = 'Values: -R- (if yes)'; +var detailRES = 'Whether the node can be reserved for a certain duration. Your slivers will be available only during timeslots where you have obtained leases (see tab above).
Please note that as of August 2010 this feature is experimental. Feedback is appreciated at devel@planet-lab.org
'; +var descRES = ''+titleRES+''+detailRES+'
'+valuesRES+'
'+sourceRES+'
'; var selectPeriodS = 'Select period: '; var titleS = 'Active slices'; var sourceS = 'Source: '+sourceComon+' (via '+sourceMySlice+')'; -var valuesS = 'Unit: %'; -var detailS = 'Average number of active slices over the selected period for which CoMon reports a value. The period is the most recent for which data is available, with CoMon data being collected by MySlice daily.'; -var descS = ''+titleS+''+detailS+'
'+selectPeriodS+'
'+valuesS+'
'+sourceS;
+var valuesS = 'Unit: %';
+var detailS = 'Average number of active slices over the selected period for which CoMon reports a value. The period is the most recent for which data is available, with CoMon data being collected by MySlice daily.';
+var descS = ''+titleS+' '+detailS+' '+selectPeriodS+' '+valuesS+' '+sourceS+' '+detailSM+' '+sourceSM+'
'+sourceSN;
+var descSN = ''+titleSN+' '+sourceSN+'
'+detailSSH+'
'+selectPeriodSSH+'
'+valuesSSH+'
'+sourceSSH;
+var descSSH = ''+titleSSH+' '+detailSSH+' '+selectPeriodSSH+' '+valuesSSH+' '+sourceSSH+' '+detailUT+' '+valuesUT+' '+sourceUT+'
'+valuesST+'
'+sourceST;
//Categorization of columns in different types, useful for filtering
@@ -295,8 +333,6 @@ function debugfilter(s) {
function highlightOption(divid) {
- //debugfilter("highlighting option "+divid);
-
var columns = document.getElementsByName('columnlist');
for(var j = 0; j < columns.length; j++)
columns[j].className = 'out';
@@ -316,19 +352,20 @@ function highlightOption(divid) {
function showDescription(h) {
- //debugfilter("showing description "+h);
-
-//Checks if the detailed description div exists
if (document.getElementById('selectdescr'))
{
//Checks if there is a detailed description defined
if (window['desc'+h])
document.getElementById('selectdescr').innerHTML = ""+window['desc'+h];
- //else if (document.getElementById('fdesc'+h))
- //document.getElementById('selectdescr').innerHTML = document.getElementById('fdesc'+h).value;
else
document.getElementById('selectdescr').innerHTML = "No detailed description provided";
}
+
+ if (document.getElementById('refnodes_div'))
+ document.getElementById('refnodes_div').innerHTML = ref_nodes_select;
+
+ if (document.getElementById('refnodes_rtt_div'))
+ document.getElementById('refnodes_rtt_div').innerHTML = ref_nodes_select_rtt;
}
@@ -344,25 +381,28 @@ function overrideTitles() {
if (window['title'+kk])
document.getElementById('htitle'+kk).innerHTML = window['title'+kk];
}
+
+
}
//When the checkbox is clicked. Adds/removes column respectively
function changeCheckStatus(column) {
+ var h = document.getElementById(column).value;
+
if (document.getElementById('selectdescr'))
- showDescription(document.getElementById(column).value);
+ showDescription(h);
+
+ //debugfilter("HERE: "+column+" - "+document.getElementById('type '+column).value);
+ //debugfilter("HERE: "+column);
+
if (document.getElementById(column).checked)
- addColumn(document.getElementById(column).value, true);
+ addColumn(h, true, document.getElementById('type'+h).value);
else
- deleteColumn(document.getElementById(column).value);
+ deleteColumn(h);
}
-function removeSelectHandler(object)
-{
- debugfilter(object);
- object.onclick = null;
-}
//This function is used when the alternative "quick" selection list is used
@@ -391,6 +431,7 @@ function changeSelectStatus(column) {
}
}
+
//When the period of an already selected column is changed
function updatePeriod(h, new_period) {
@@ -411,6 +452,7 @@ function updatePeriod(h, new_period) {
/*
RESET/SAVE CONFIGURATION
+
*/
function getHTTPObject()
@@ -454,7 +496,7 @@ function closeMessage(tab)
var person_id = document.getElementById('person_id').value;
var tag_id = document.getElementById('show_tag_id').value;
- var url = "/plekit/php/updateConfiguration.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_id="+tag_id;
+ var url = "/plekit/php/updateConfiguration.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_name=showconf&tag_id="+tag_id;
//debugfilter("updating conf with "+url);
document.getElementById('show_configuration').value = value;
@@ -525,7 +567,7 @@ function updateColumnConfiguration(value, reload)
}
}
- xmlhttp.open("GET","/plekit/php/updateConfiguration.php?value="+new_configuration+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_id="+tag_id,true);
+ xmlhttp.open("GET","/plekit/php/updateConfiguration.php?value="+new_configuration+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_name=columnconf&tag_id="+tag_id,true);
//xmlhttp.open("GET","/plekit/php/updateConf.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tagName=Columnconf",true);
xmlhttp.send();
@@ -557,11 +599,17 @@ function sortCompleteCallback(tableid) {
for(var i = 0, th; th = ths[i]; i++) {
if (th.className.indexOf("Sort") != -1)
{
+ //debugfilter("sorted"+th.getAttribute("name"));
+
+ var column_name = th.getAttribute("name");
var hclass = th.className;
var column = hclass.substr(hclass.indexOf("column"),hclass.indexOf("column")+1);
- var sortdirection = hclass.substr(hclass.indexOf("Sort")-8,hclass.indexOf("Sort"));
+ var sortdirection = "forward";
+ if (hclass.indexOf("reverse")!=-1)
+ sortdirection = "reverse";
+
if (column.indexOf("column-1")==-1 && column.indexOf("column-0")==-1)
- logSortingAction(person_id, slice_id, tableid+"|"+column+"|"+sortdirection);
+ logSortingAction(person_id, slice_id, tableid+"|"+column_name+"|"+sortdirection);
}
}
}
@@ -609,9 +657,11 @@ function replaceColumnConfiguration(column_old, column_new) {
var old_columns = old_configuration.split("|");
var new_columns = new Array();
+ var olds = column_old.split(':');
+
for (var column_index = 0; column_index < old_columns.length ; column_index++) {
var conf = old_columns[column_index].split(':');
- if (conf[0] != column_old)
+ if (conf[0] != olds[0])
new_columns.push(old_columns[column_index]);
else
new_columns.push(column_new);
@@ -628,10 +678,37 @@ ADD/REMOVE COLUMNS
*/
+function convert_data(value, data_source, data_type, tagname) {
+
+ //debugfilter("v["+tagname+"]="+value+"-");
+ if (value == "" || value == "n/a" || value == null || value == "NaN" || value == "None")
+ return "n/a";
+ if (tagname == "uptime") {
+ return parseInt((parseFloat(value) / 86400));
+ }
+
+ if (data_type == "date") {
+
+ var date = new Date(value*1000);
-function load_data(column, header, url) {
+ var year = date.getFullYear();
+ var month = date.getMonth()+1;
+ if (month < 10)
+ month = "0"+month;
+ var day = date.getDate();
+ if (day < 10)
+ day = "0"+day;
+
+ return year + '-' + month + '-' + day;
+ }
+
+ return value;
+}
+
+
+function load_data(column, header, url, data_source, data_type, tagname) {
//debugfilter("
loading "+url);
var req = getHTTPObject();
@@ -641,13 +718,13 @@ function load_data(column, header, url) {
req.onreadystatechange =
function() {
if (req.readyState == 4)
- { updateColumnData(column, header, req.responseText); }
+ { updateColumnData(column, header, req.responseText, data_source, data_type, tagname); }
}
req.send(null);
}
-function updateColumnData(column, header, data) {
+function updateColumnData(column, header, data, data_source, data_type, tagname) {
var headers = header.split("|");
var data_table = data.split("|");
@@ -655,11 +732,12 @@ var data_table = data.split("|");
//debugfilter("
headers[0] = "+headers[0]); //debugfilter("
data[2] = "+data_table[2]); -//debugfilter("data = "+data); +//debugfilter("data = "+data + " with type "+data_type + " and source "+data_source); +//debugfilter("
data table length = "+data_table.length);
-if (data != "")
+if (data_table.length > 1)
{
-
+
var node_data;
var table_id1 = 'nodes';
@@ -680,10 +758,10 @@ if (data != "")
for (var h_index=0; h_index < headers.length; h_index++) {
- if (node_data[h_index+1] == "")
+ if (node_data[h_index+1] == "" || node_data[h_index+1] == "None")
data_array1[node_data[0]][h_index] = "n/a";
else
- data_array1[node_data[0]][h_index] = node_data[h_index+1];
+ data_array1[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
}
}
@@ -705,8 +783,9 @@ if (data != "")
}
}
+ //debugfilter("Reset sorting .....");
+ //tablePaginater.init(table_id1);
fdTableSort.init(table_id1);
- tablePaginater.init(table_id1);
//potential nodes
if (data_table[node_index] == '---potential---')
@@ -733,7 +812,7 @@ if (data_table[node_index] == '---potential---')
if (node_data[h_index+1] == "")
data_array2[node_data[0]][h_index] = "n/a";
else
- data_array2[node_data[0]][h_index] = node_data[h_index+1];
+ data_array2[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
}
}
@@ -750,14 +829,17 @@ if (data_table[node_index] == '---potential---')
}
}
}
-
- //fdTableSort.removeTableCache(table_id2);
fdTableSort.init(table_id2);
- tablePaginater.init(table_id2);
+ //tablePaginater.init(table_id2);
+
}
+ //fdTableSort.removeTableCache(table_id2);
+ //document.getElementById('loading'+column).innerHTML = "";
+
}
+
document.getElementById('loading'+column).innerHTML = "";
}
@@ -787,11 +869,12 @@ function addColumnAjax(column, header) {
var slice_id = document.getElementById('slice_id').value;
var selectedperiod = document.getElementById('period'+column).value;
-
var fetched = document.getElementById('fetched'+column).value;
+ var data_source = document.getElementById('source'+column).value;
+ var data_type = document.getElementById('type'+column).value;
var to_load = false;
- //debugfilter("
adding "+column+","+header+','+fetched+','+t);
+ //debugfilter("
adding "+column+","+header+','+fetched+','+t+','+data_source+','+data_type);
if (fetched.indexOf("false")!=-1)
{
@@ -806,8 +889,11 @@ function addColumnAjax(column, header) {
if (to_load)
{
- var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+t;
- load_data(column, header, url);
+ //debugfilter("ready to load ... ");
+ document.getElementById('loading'+column).innerHTML = "";
+ var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+t+"&data_type="+data_type+"&data_source="+data_source;
+ //debugfilter("calling "+url);
+ load_data(column, header, url, data_source, data_type, t);
}
}
@@ -817,8 +903,8 @@ function addColumn(column, fetch) {
var selectedperiod="";
var header=column;
+ var conf="";
- document.getElementById('loading'+column).innerHTML = "";
if (inTypeC(column)!=-1)
{
@@ -828,17 +914,16 @@ function addColumn(column, fetch) {
selectedperiod = document.getElementById('period'+column).value;
header = column+""+selectedperiod;
- //debugfilter("adding column "+column+" and header "+header);
+ conf = header;
+
+ //debugfilter("adding column "+column+" and header "+header+" and conf = "+conf);
addColumnCells(header);
if (fetch)
addColumnAjax(column, header);
- else
- document.getElementById('loading'+column).innerHTML = "";
- addColumnToConfiguration(header);
-
+ addColumnToConfiguration(conf);
}
@@ -851,7 +936,6 @@ function deleteColumnCells(header) {
}
-
function deleteColumn(column) {
var selectedperiod="";
@@ -865,606 +949,6 @@ function deleteColumn(column) {
deleteColumnCells(header);
deleteColumnFromConfiguration(header);
-
- //document.getElementById('check'+column).checked = false;
-}
-
-function scrollList() {
-debugfilter("here "+document.getElementById('scrolldiv').focused);
-if (event.keyCode == 40)
- debugfilter("down");
-else if (event.keyCode == 38)
- debugfilter("up");
-}
-
-/*
-
-EXTRA
-
-//to be used for scrolling the column list with down/up arrows
-
-
-function resetColumns() {
-
- for (var kk in column_table) {
-
- if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
- deleteColumn(kk);
- else if (column_table[kk]['visible'] == false && column_table[kk]['fetch'] == true)
- addColumn(kk, true);
- }
-
-}
-
-function resetCols(which_conf) {
-
- var target_configuration = "|"+document.getElementById(which_conf).value+"|";
-
- //debugfilter("
Target configuration = "+target_configuration); - - for (var kk in column_table) { - //debugfilter("in "+kk+" "); - - if (target_configuration.indexOf("|"+kk+"|")>=0) - { - if (document.getElementById('check'+kk)) - if (document.getElementById('check'+kk).checked == false) - { - debugfilter("
Adding "+kk); - addColumn(kk, true); - } - } - else - { - if (document.getElementById('check'+kk)) - if (document.getElementById('check'+kk).checked == true) - { - debugfilter("
Deleting "+kk);
- deleteColumn(kk);
- }
- }
- }
-}
-
-function filterByType(selectedtype) {
-
-var notselectedyet = true;
-
-for (var kk in column_headers) {
-
- if (document.getElementById(kk))
- {
- if (window['type'+kk] == selectedtype)
- {
- document.getElementById(kk).className = 'in';
- if (notselectedyet)
- highlightOption(kk);
- notselectedyet = false;
- }
- else
- document.getElementById(kk).className = 'out';
- }
-}
-}
-
-
-function deleteColumnSample() {
- var cellsheader = document.getElementsByName("confheader"+column);
- for(var j = 0; j < cellsheader.length; j++)
- cellsheader[j].style.display = "none";
-
-}
-
-function checkDataToFetch() {
-
-var dataExist = false;
-
-for (var kk in column_table) {
-
- if (document.getElementById(kk))
- {
- if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
- {
- document.getElementById('fetchbutton').disabled = false;
- document.getElementById('fetchbutton').style.color = 'red';
- dataExist = true;
- }
- }
-}
-
-if (!dataExist)
-{
- document.getElementById('fetchbutton').disabled = true;
- document.getElementById('fetchbutton').style.color = 'grey';
-}
-
-}
-
-
-function fetchData() {
-
-var tagnames = "";
-var headers = "";
-
-for (var kk in column_table) {
-
-if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
- if (tagnames == "")
- {
- tagnames = column_table[kk]['tagname'];
- headers = kk;
- }
- else
- {
- tagnames += "|"+column_table[kk]['tagname'];
- headers += "|"+kk;
- }
-}
-
-//debugfilter("fetching these columns: "+tagnames+ "("+headers+")");
-
- var slice_id = document.getElementById('slice_id').value;
- document.getElementById('loadingDiv').innerHTML = " Loading data. Please wait ...";
- var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+tagnames;
- load_data(headers, url);
-}
-
-
-/*
-
-
-HIGHLIGHTING
-
-
-
-function updateColumnThreshold(column, minT, maxT) {
-
-debugfilter("updating threshold for "+column+" with "+minT+" and "+maxT);
-
-var cells = document.getElementsByName(column);
-
-for(var j = 0; j < cells.length; j++)
-{
-var val = parseFloat(cells[j].innerHTML);
-
-if (val >= minT && val <= maxT)
- cells[j].style.color = filtered_color;
-else
- cells[j].style.color = normal_color;
-}
-
-var old_configuration = document.getElementById('column_configuration').value;
-var slice_id = document.getElementById('slice_id').value;
-
-var old_columns = old_configuration.split("|");
-var new_columns = new Array();
-
-for (var column_index = 0; column_index < old_columns.length ; column_index++) {
- var conf = old_columns[column_index].split(':');
- if (conf[0] != column)
- new_columns.push(old_columns[column_index]);
- else
- new_columns.push(column+":"+minT+","+maxT);
-}
-
-var new_configuration = new_columns.join("|");
-
-updateColumnConfiguration(slice_id, new_configuration);
-
-}
-
-function updateExcludeList(column, excludeList) {
-
-//debugfilter("updating list");
-debugfilter("updating list for "+column+" with "+excludeList);
-
-var cells = document.getElementsByName(column);
-
-for(var j = 1; j < cells.length; j++)
-{
-var val = cells[j].innerHTML;
-
-if (excludeList == val)
- cells[j].style.color = filtered_color;
-else
- cells[j].style.color = normal_color;
-}
-
-var old_configuration = document.getElementById('column_configuration').value;
-var slice_id = document.getElementById('slice_id').value;
-
-var old_columns = old_configuration.split("|");
-var new_columns = new Array();
-
-for (var column_index = 0; column_index < old_columns.length ; column_index++) {
- var conf = old_columns[column_index].split(':');
- if (conf[0] != column)
- new_columns.push(old_columns[column_index]);
- else
- new_columns.push(column+":"+excludeList);
-}
-
-var new_configuration = new_columns.join("|");
-
-updateColumnConfiguration(slice_id, new_configuration);
-
-}
-
-
-
-/*
-
-ROW FILTERING
-
-
-function plekit_table_showAll (slicetable_id) {
-
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
-
- // scan rows, elaborate 'visible'
- for (var row_index = 0; row_index < rows.length ; row_index++) {
- var tr=rows[row_index];
- var visible=true;
- plekit_table_row_visible(tr,visible);
- }
-
- plekit_table_count_filtered(slicetable_id);
-
- tablePaginater.init(slicetable_id);
-
-}
-
-function plekit_table_count_filtered (slicetable_id) {
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
-
- var no_filtered=0;
-
- // scan rows, elaborate 'visible'
- for (var row_index = 0; row_index < rows.length ; row_index++) {
- var tr=rows[row_index];
- var filtered = false;
-
- for (var column_index=0; column_index < tr.cells.length; column_index++)
- if (tr.cells[column_index].style.color == "red")
- filtered = true;
-
- if (filtered)
- no_filtered++;
-
- }
-
- debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
-}
-
-
-function plekit_table_hide_filtered (slicetable_id) {
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
-
- var reg = /(^|\s)invisibleRow(\s|$)/;
-
-
- if (!document.getElementById('filtercheck').checked)
- {
- plekit_table_showAll(slicetable_id);
- return;
- }
-
- var hidden=0;
-
- // scan rows, elaborate 'visible'
- for (var row_index = 0; row_index < rows.length ; row_index++) {
- var tr=rows[row_index];
- var visible=true;
-
- for (var column_index=0; column_index < tr.cells.length; column_index++) {
- if (tr.cells[column_index].style.color == filtered_color)
- visible = false;
- }
- if (!visible)
- hidden++;
-
- plekit_table_row_visible(tr,visible);
- }
-
- //debugfilter('hidden '+hidden+' nodes');
- debugfilter(hidden+' nodes do not satisfy the requested threshold (hidden)');
-
- tablePaginater.init(slicetable_id);
-}
-
-
-
-
-function plekit_table_apply_config(slicetable_id, configuration) {
-
-var new_configuration = document.getElementById('new_conf').value;
-var all_columns = new_configuration.split("|");
-
-var min_values = new Array();
-var max_values = new Array();
-
-
-for (var column_index = 0; column_index < all_columns.length ; column_index++) {
-
- var conf = all_columns[column_index].split(':');
-
- if (inTypeB(conf[0]) != -1)
- {
- var threshold = conf[1].split(',');
- if (threshold.length == 2)
- {
- min_values.push(parseFloat(threshold[0]));
- max_values.push(parseFloat(threshold[1]));
- }
- }
- else if (inTypeC(conf[0]) == -1)
- {
- var threshold = conf[2].split(',');
- if (threshold.length == 2)
- {
- min_values.push(parseInt(threshold[0]));
- max_values.push(parseInt(threshold[1]));
- }
- }
- else
- {
- min_values.push(-1);
- max_values.push(-1);
- }
-
-}
-
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
-
-
- var no_filtered=0;
-
- for (var row_index = 0; row_index < rows.length ; row_index++) {
-
- var tr=rows[row_index];
-
- var filtered = false;
-
- for (var column_index = 0; column_index < all_columns.length ; column_index++)
- if (min_values[column_index]!=-1)
- {
- var val = parseFloat(tr.cells[3+column_index].innerHTML);
-
- if (val >= min_values[column_index] && val <= max_values[column_index])
- {
- tr.cells[3+column_index].style.color = filtered_color;
- filtered = true;
- }
- else
- tr.cells[3+column_index].style.color = normal_color;
- }
- else
- if (tr.cells[3+column_index].style.color == filtered_color)
- filtered = true;
-
-
- if (filtered)
- no_filtered++;
- }
-
- debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
-
- //tablePaginater.init(slicetable_id);
-
-}
-
-
-function reset_select () {
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
-
-var action = document.getElementById('onlyselected');
-action.checked=false;
-
- // scan rows, elaborate 'visible'
- for (var row_index = 0; row_index < rows.length ; row_index++) {
- var tr=rows[row_index];
-
- document.getElementById("check"+tr.id).checked=false;
-
- }
-
- plekit_table_count_nodes();
-}
-
-}
-
-
-function plekit_table_select_filter () {
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
-
- var reg = /(^|\s)invisibleRow(\s|$)/;
-
- var action = document.getElementById('onlyselected');
- if (!action.checked)
- plekit_table_reset_filter();
-
- // scan rows, elaborate 'visible'
- for (var row_index = 0; row_index < rows.length ; row_index++) {
- var tr=rows[row_index];
- var visible=true;
-
- if (action.checked)
- {
- if(tr.className.search(reg) == -1)
- if(!document.getElementById("check"+tr.id).checked)
- visible=false;
- }
-
- if(tr.className.search(reg) != -1)
- visible=false;
-
- plekit_table_row_visible(tr,visible);
- }
-
- tablePaginater.init(slicetable_id);
- plekit_table_count_nodes();
-}
-
-function plekit_table_select_filter2 () {
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
-
- var reg = /(^|\s)invisibleRow(\s|$)/;
-
- var action = document.getElementById('onlyselected');
-
- // scan rows, elaborate 'visible'
- for (var row_index = 0; row_index < rows.length ; row_index++) {
- var tr=rows[row_index];
- var visible=true;
-
- if (action.checked)
- {
- if(tr.className.search(reg) == -1)
- if(!document.getElementById("check"+tr.id).checked)
- visible=false;
- }
-
- if(tr.className.search(reg) != -1)
- visible=false;
-
- plekit_table_row_visible(tr,visible);
- }
-
- tablePaginater.init(slicetable_id);
- plekit_table_count_nodes();
-}
-
-function CheckTopNodes(n) {
- var table=$(slicetable_id);
- var css='#'+slicetable_id+'>tbody';
- var rows = $$(css)[0].rows;
- var reg = /(^|\s)invisibleRow(\s|$)/;
-
- var checked=0;
-
- for (var row_index = 0; row_index < rows.length ; row_index++) {
- var tr=rows[row_index];
-
- if(tr.className.search(reg) == -1) {
- if (checked