2 /* $Id: column.js Panos $ */
4 var filtered_color = "grey";
5 var normal_color = "black";
7 //Descriptions overriding the default ones set in Accessors_site.py and configuration
9 var sourceComon = '<a target="source_window" href="http://comon.cs.princeton.edu/">CoMon</a>';
10 var sourceTophat = '<b><a target="source_window" href="http://www.top-hat.info/">TopHat</a></b>';
11 var sourceTophatAPI = '<b><a target="source_window" href="http://www.top-hat.info/API/">TopHat API</a></b>';
12 var sourceMySlice = '<b><a target="source_window" href="http://myslice.info/">MySlice</a></b>';
13 var sourceCymru = '<b><a target="source_window" href="http://www.team-cymru.org/">Team Cymru</a></b>';
14 var sourceMyPLC = '<b><a target="source_window" href="https://www.planet-lab.eu/db/doc/PLCAPI.php">MyPLC API</a></b>';
15 var sourceManiacs = '<b><a target="source_window" href="http://www.ece.gatech.edu/research/labs/MANIACS/as_taxonomy/">MANIACS</a></b>';
16 var sourceMaxmind = '<b><a target="source_window" href="http://www.maxmind.com/app/geolitecity">MaxMind</a></b>';
17 var sourceMonitor = '<b><a target="source_window" href="http://monitor.planet-lab.org/">Monitor</a></b>';
18 var hardwareReqs = 'current <b><a target="source_window" href="http://www.planet-lab.org/hardware">PlanetLab hardware requirement</a></b>';
19 var selectReferenceNode ='Select reference node: <select id="reference_node" onChange="updateReferenceNode(this.value)"><option value=planetlab-europe-07.ipv6.lip6.fr>planetlab-europe-07.ipv6.lip6.fr</option><option value=planetlab2.ipv6.lip6.fr>planetlab2.ipv6.lip6.fr</option></select>';
20 //var addButton = '<input id="addButton" type="button" value="Add" onclick=addColumnAjax(document.getElementById("list1").value)></input>';
21 //var deleteButton = '<input id="deleteButton" type="button" value="Delete" onclick=deleteColumn(window.document.getElementById("list1").value)></input>';
23 var descHOSTNAME = "test";
26 var titleAU = 'Authority';
27 var detailAU = '<i>The authority of the global PlanetLab federation that the site of the node belongs to.</i>';
28 var valuesAU = 'Values: <b>PLC</b> (PlanetLab Central), <b>PLE</b> (PlanetLab Europe)';
29 var sourceAU = 'Source: '+sourceMyPLC;
30 var descAU = '<span class="myslice title">'+titleAU+'</span><p>'+detailAU+'<p>'+valuesAU+'<p>'+sourceAU;
32 var titleST = 'Status';
33 var sourceST = 'Source: '+sourceMonitor;
34 var valuesST = 'Values: <b>online</b> (up and running), <b>good</b> (up and running recently), <b>offline</b> (unreachable today), <b>down</b> (node unreachable for more than one day), <b>failboot</b> (reachable, but only by administrators for debugging purposes).';
35 var descST = '<span class="myslice title">'+titleST+'</span><p>'+valuesST+'<p>'+sourceST;
37 var titleA = 'Architecture name';
38 var detailA = '<i>The node architecture.</i>';
39 var sourceA = 'Source: '+sourceMyPLC;
40 var valuesA = 'Values: <b>x86_64</b>, <b>i386</b>, <b>n/a</b>';
41 var descA = '<span class="myslice title">'+titleA+'</span><p>'+detailA+'<p>'+valuesA+'<p>'+sourceA;
43 var titleAS = 'Autonomous system ID';
44 var sourceAS = 'Source: '+sourceCymru+' (via '+sourceTophat+')';
45 var valuesAS = 'Values: <b>Integer between 0 and 65535</b>, <b>n/a</b>';
46 var descAS = '<span class="myslice title">'+titleAS+'</span><p>'+valuesAS+'<p>' + sourceAS;
48 var titleAST = 'Autonomous system type';
49 var sourceAST = 'Source: '+sourceManiacs;
50 var valuesAST = 'Values: <b>t1</b> (tier-1), <b>t2</b> (tier-2), <b>edu</b> (university), <b>comp</b> (company), <b>nic</b> (network information centre -- old name for a domain name registry operator), <b>ix</b> (IXP), <b>n/a</b>';
51 var descAST = '<span class="myslice title">'+titleAST+'</span><p>'+valuesAST+'<p>'+sourceAST;
53 var titleASN = 'Autonomous system name';
54 var sourceASN = 'Source: '+sourceTophat;
55 var descASN = '<span class="myslice title">'+titleASN+'</span><p>'+sourceASN;
57 var selectPeriodBU = 'Select period: <select id="selectperiodBU" onChange=updatePeriod("BU",this.value)><option value="">Latest</option><option value=w>Week</option><option value=m>Month</option><option value=y>Year</option></select>';
58 var titleBU = 'Bandwidth utilization ';
59 var sourceBU = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
60 var valuesBU ='Unit: <b>Kbps</b>';
61 var detailBU = '<i>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.</i>'
62 var descBU = '<span class="myslice title">'+titleBU+'</span><p>'+detailBU+'<p>'+selectPeriodBU+'<p>'+valuesBU+'<p>'+sourceBU;
64 var titleBW= 'Bandwidth limit';
65 var sourceBW = 'Source: '+sourceComon;
66 var valuesBW = 'Unit: <b>Kbps</b>';
67 var detailBW = '<i>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 <a targe="source_window" href="http://www.planet-lab.org/doc/BandwidthLimits">Bandwidth Limits (planet-lab.org)</a></i>.';
68 var descBW = '<span class="myslice title">'+titleBW+'</span><p>'+detailBW+'<p>'+valuesBW+'<p>'+sourceBW;
70 var titleCC = 'Number of CPU cores';
71 var sourceCC = 'Source: '+sourceComon;
72 var valuesCC = '<i>The number of CPU cores on the node. For reference, the '+hardwareReqs+' is <b>4 cores min.</b> <br> (Older nodes may have fewer cores)</i>.';
73 var descCC = '<span class="myslice title">'+titleCC+'</span><p>'+valuesCC+'<p>'+sourceCC;
75 var titleCN = 'Number of CPUs';
76 var sourceCN = 'Source: '+sourceComon;
77 var valuesCN = '<i>The number of CPUs on the node. For reference, the '+hardwareReqs+' is <b>1 (if quad core) or 2 (if dual core)</b>.</i>';
78 var descCN = '<span class="myslice title">'+titleCN+'</span><p>'+valuesCN+'<p>'+sourceCN;
80 var titleCR = 'CPU clock rate';
81 var detailCR = '<i>The clock rate for the CPUs on the node. For reference, the '+hardwareReqs+' is <b>2.4 GHz</b></i>.';
82 var sourceCR = 'Source: '+sourceComon;
83 var valuesCR = 'Unit: <b>GHz</b>';
84 var descCR = '<span class="myslice title">'+titleCR+'</span><p>'+detailCR+'<p>'+valuesCR+'<p>'+sourceCR;
86 var selectPeriodCF = 'Select period: <select id="selectperiodCF" onChange=updatePeriod("CF",this.value)><option value="">Latest</option><option value=w>Week</option><option value=m>Month</option><option value=y>Year</option></select>';
87 var titleCF = 'Free CPU';
88 var sourceCF = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
89 var valuesCF = 'Unit: <b>%</b>';
90 var detailCF = '<i> The average CPU percentage that gets allocated to a test slice named burb that is periodically run by CoMon.</i>';
91 var descCF = '<span class="myslice title">'+titleCF+'</span><p>'+detailCF+'<p>'+selectPeriodCF+'<p>'+valuesCF+'<p>'+sourceCF;
93 var titleDN = 'Toplevel domain name';
94 var sourceDN = 'Source: '+sourceMyPLC;
95 var descDN = '<span class="myslice title">'+titleDN+'</span><p>'+sourceDN;
97 var titleDA = 'Date added';
98 var sourceDA = 'Source: '+sourceMyPLC;
99 var detailDA = '<i> The date that the noded was added to PlanetLab.</i>';
100 var descDA = '<span class="myslice title">'+titleDA+'</span><p>'+detailDA+'<p>'+sourceDA;
102 var titleDS = 'Disk size';
103 var detailDS = '<i>The size of the hard disk available on the node. For reference, the '+hardwareReqs+' is <b>500 GB</b></i>.';
104 var sourceDS = 'Source: '+sourceComon;
105 var valuesDS = 'Unit: <b>GB</b>';
106 var descDS = '<span class="myslice title">'+titleDS+'</span><p>'+detailDS+'<p>'+valuesDS+'<p>'+sourceDS;
108 var titleDU = 'Current disk utilization';
109 var sourceDU = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
110 var valuesDU = 'Unit: <b>GB</b>';
111 var detailDU = '<i> The amount of disk space currently consumed (checked daily).</i>';
112 var descDU = '<span class="myslice title">'+titleDU+'</span><p>'+detailDU+'<p>'+valuesDU+'<p>'+sourceDU;
114 var titleDF = 'Disk space free';
115 var sourceDF = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
116 var valuesDF = 'Unit: <b>GB</b>';
117 var detailDF = '<i> The amount of disk space currently available (checked daily).</i>';
118 var descDF = '<span class="myslice title">'+titleDF+'</span><p>'+detailDF+'<p>'+valuesDF+'<p>'+sourceDF;
120 var titleHC = 'Hop count (pairwise)';
121 var sourceHC = 'Source: '+sourceTophat;
122 var detailHC = '<i>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</i>.';
123 var descHC = '<span class="myslice title">'+titleHC+'</span><p>'+detailHC+'<p>'+selectReferenceNode+'<p>'+sourceHC;
125 var titleIP = 'IP address';
126 var sourceIP = 'Source: '+sourceMyPLC;
127 var descIP = '<span class="myslice title">'+titleIP+'</span><p>'+sourceIP;
129 var selectPeriodL = 'Select period: <select id="selectperiodL" onChange=updatePeriod("L",this.value)><option value="">Latest</option><option value=w>Week</option><option value=m>Month</option><option value=y>Year</option></select>';
131 var sourceL = 'Source: '+sourceComon;
132 var valuesL = 'Unit: <b>5-minute load</b>';
133 var detailL = '<i>The average 5-minute load (as reported by the Unix uptime command) over the selected period.</i>';
134 var descL = '<span class="myslice title">'+titleL+'</span><p>'+detailL+'<p>'+selectPeriodL+'<p>'+valuesL+'<p>'+sourceL;
136 var titleLON= 'Longitude';
137 var sourceLON = 'Source: '+sourceTophat;
138 var descLON = '<span class="myslice title">'+titleLON+'</span><p>'+sourceLON;
140 var titleLAT= 'Latitude';
141 var sourceLAT = 'Source: '+sourceTophat;
142 var descLAT = '<span class="myslice title">'+titleLAT+'</span><p>'+sourceLAT;
144 var titleLCN= 'Location (Country)';
145 var sourceLCN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
146 var detailLCN = '<i>Based on the latitude and longitude information.</i>';
147 var descLCN = '<span class="myslice title">'+titleLCN+'</span><p>'+detailLCN+'<p>'+sourceLCN;
149 var titleLCT= 'Location (Continent)';
150 var sourceLCT = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
151 var detailLCT = '<i>Based on the latitude and longitude information.</i>';
152 var descLCT = '<span class="myslice title">'+titleLCT+'</span><p>'+detailLCT+'<p>'+sourceLCT;
154 var titleLCY= 'Location (City)';
155 var sourceLCY = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
156 var detailLCY = '<i>Based on the latitude and longitude information.</i>';
157 var descLCY = '<span class="myslice title">'+titleLCY+'</span><p>'+detailLCY+'<p>'+sourceLCY;
159 var titleLPR= 'Location precision radius';
160 var sourceLPR = 'Source: '+sourceTophat;
161 var valuesLPR = 'Unit: <b>float</b>.';
162 var detailLPR = '<i>The radius of the circle corresponding to the error in precision of the geolocalization estimate.</i>';
163 var descLPR = '<span class="myslice title">'+titleLPR+'</span><p>'+detailLPR+'<p>'+valuesLPR+'<p>'+sourceLPR;
165 var titleLRN= 'Location (Region)';
166 var sourceLRN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
167 var detailLRN = '<i>Based on the latitude and longitude information.</i>';
168 var descLRN = '<span class="myslice title">'+titleLRN+'</span><p>'+detailLRN+'<p>'+sourceLRN;
170 var titleMS= 'Memory size';
171 var detailMS = '<i>The memory size (RAM) available on the node. For reference, the '+hardwareReqs+' is <b>4 GB</b></i>.';
172 var sourceMS = 'Source: '+sourceComon;
173 var valuesMS = 'Unit: <b>GB</b>.';
174 var descMS = '<span class="myslice title">'+titleMS+'</span><p>'+valuesMS+'<p>'+sourceMS;
176 var selectPeriodMU = 'Select period: <select id="selectperiodMU" onChange=updatePeriod("MU",this.value)><option value="">Latest</option><option value=w>Week</option><option value=m>Month</option><option value=y>Year</option></select>';
177 var titleMU = 'Memory utilization';
178 var sourceMU = 'Source: '+sourceComon;
179 var valuesMU = '<p>Unit: <b>%</b>';
180 var detailMU = '<i>The average active memory utilization as reported by CoMon.</i>';
181 var descMU = '<span class="myslice title">'+titleMU+'</span><p>'+detailMU+'<p>'+selectPeriodMU+'<p>'+valuesMU+'<p>'+sourceMU;
183 var titleNEC= 'Network information (ETOMIC)';
184 var sourceNEC = 'Source: '+sourceTophat;
185 var valuesNEC = 'Values: <b>yes/no</b>';
186 var detailNEC = '<i>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+'.</i>';
187 var descNEC = '<span class="myslice title">'+titleNEC+'</span><p>'+detailNEC+'<p>'+valuesNEC+'<p>'+sourceNEC;
189 var titleNSN= 'Network information (SONoMA)';
190 var sourceNSN = 'Source: '+sourceTophat;
191 var valuesNSN = 'Values: <b>yes/no</b>';
192 var detailNSN = '<i>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+'.</i>';
193 var descNSN = '<span class="myslice title">'+titleNSN+'</span><p>'+detailNSN+'<p>'+valuesNSN+'<p>'+sourceNSN;
195 var titleNTH= 'Network information (TopHat)';
196 var sourceNTH = 'Source: '+sourceTophat;
197 var valuesNTH = 'Values: <b>yes/no</b>';
198 var detailNTH = '<i>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+'.</i>';
199 var descNTH = '<span class="myslice title">'+titleNTH+'</span><p>'+detailNTH+'<p>'+valuesNTH+'<p>'+sourceNTH;
201 var titleNDS= 'Network information (DIMES)';
202 var sourceNDS = 'Source: '+sourceTophat;
203 var valuesNDS = 'Values: <b>yes/no</b>';
204 var detailNDS = '<i>The existence of a colocated DIMES agent. When a DIMES agent is present, you have access to DIMES measurements through the '+sourceTophatAPI+'.</i>';
205 var descNDS = '<span class="myslice title">'+titleNDS+'</span><p>'+detailNDS+'<p>'+valuesNDS+'<p>'+sourceNDS;
207 var titleNSF= 'Network information (spoof)';
208 var sourceNSF = 'Source: '+sourceTophat;
209 var valuesNSF = '<p>Values: <b>yes/no</b>';
210 var detailNSF = '<i> Whether the node can send packets successfully (or not) with a spoofed IP source address.</i>';
211 var descNSF = '<span class="myslice title">'+titleNSF+'</span><p>'+detailNSF+'<p>'+valuesNSF+'<p>'+sourceNSF;
213 var titleNSR= 'Network information (source route)';
214 var sourceNSR = 'Source: '+sourceTophat;
215 var valuesNSR = '<p>Values: <b>yes/no</b>';
216 var detailNSR = '<i> Whether the node can send packets packets using the IP source route option. See <a target="info_window" href="http://www.networksorcery.com/enp/protocol/ip/option003.htm">here</a>for more info.</i>';
217 var descNSR = '<span class="myslice title">'+titleNSR+'</span><p>'+detailNSR+'<p>'+valuesNSR+'<p>'+sourceNSR;
219 var titleNTP= 'Network information (timestamp)';
220 var sourceNTP = 'Source: '+sourceTophat;
221 var valuesNTP = '<p>Values: <b>yes/no</b>';
222 var detailNTP = '<i> Whether the node can send packets packets using the IP timestamp option. See <a target="info_window" href="http://www.networksorcery.com/enp/protocol/ip/option004.htm">here</a>for more info.</i>';
223 var descNTP = '<span class="myslice title">'+titleNTP+'</span><p>'+detailNTP+'<p>'+valuesNTP+'<p>'+sourceNTP;
225 var titleNRR= 'Network information (record route)';
226 var sourceNRR = 'Source: '+sourceTophat;
227 var valuesNRR = '<p>Values: <b>yes/no</b>';
228 var detailNRR = '<i> Whether the node can send packets packets using the IP record route option. See <a target="info_window" href="http://www.networksorcery.com/enp/protocol/ip/option007.htm">here</a>for more info.</i>';
229 var descNRR = '<span class="myslice title">'+titleNRR+'</span><p>'+detailNRR+'<p>'+valuesNRR+'<p>'+sourceNRR;
231 var titleOS = 'Operating system';
232 var detailOS = '<i>Fedora or CentOS distribution to use for node or slivers.</i>';
233 var sourceOS = 'Source: '+sourceMyPLC;
234 var valuesOS = 'Values: <b>f8, f12, Cent/OS, other, n/a</b>';
235 var descOS = '<span class="myslice title">'+titleOS+'</span><p>'+valuesOS+'<p>'+sourceOS;
237 var selectPeriodR = 'Select period: <select id="selectperiodR" onChange=updatePeriod("R",this.value)><option value="">Latest</option><option value=w>Week</option><option value=m>Month</option><option value=y>Year</option></select>';
238 var titleR = 'Reliability';
239 var sourceR = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
240 var detailR = '<i>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.</i>';
241 var valuesR = 'Unit: <b>%</b>';
242 var descR = '<span class="myslice title">'+titleR+'</span><p>'+detailR+'<p>'+selectPeriodR+'<p>'+valuesR+'<p>'+sourceR;
244 var titleRES = 'Reservation capabilities';
245 var sourceRES = 'Source: '+sourceMyPLC;
246 //var valuesRES = 'Values: <b>yes/no</b>';
247 var valuesRES = 'Values: <b>-R-</b> (if yes)';
248 var detailRES = '<i> Whether the node can be reserved for a certain duration.<br>Your slivers will be available <span class=bold>only during timeslots where you have obtained leases (see tab above)</span></i>. <p>Please note that as of August 2010 this feature is experimental. Feedback is appreciated at <a href="mailto:devel@planet-lab.org">devel@planet-lab.org</a>';
249 var descRES = '<span class="myslice title">'+titleRES+'</span><p>'+detailRES+'<p>'+valuesRES+'<p>'+sourceRES;
251 var selectPeriodS = 'Select period: <select id="selectperiodS" onChange=updatePeriod("S",this.value)><option value="">Latest</option><option value=w>Week</option><option value=m>Month</option><option value=y>Year</option></select>';
252 var titleS = 'Active slices';
253 var sourceS = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
254 var valuesS = 'Unit: <b>%</b>';
255 var detailS = '<i>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.</i>';
256 var descS = '<span class="myslice title">'+titleS+'</span><p>'+detailS+'<p>'+selectPeriodS+'<p>'+valuesS+'<p>'+sourceS;
258 var titleSN = 'Site name';
259 var sourceSN = 'Source: '+sourceMyPLC;
260 var descSN = '<span class="myslice title">'+titleSN+'</span><p>'+sourceSN;
262 var selectPeriodSSH = 'Select period: <select id="selectperiodSSH" onChange=updatePeriod("SSH",this.value)><option value="">Latest</option><option value=w>Week</option><option value=m>Month</option><option value=y>Year</option></select>';
263 var titleSSH = 'Average SSH response delay';
264 var valuesSSH = 'Unit: <b>%</b>';
265 var detailSSH = '<i>The average response delay of the node to SSH logins 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.</i>';
266 var sourceSSH ='Source: '+sourceComon+' (via '+sourceMySlice+')';
267 var descSSH = '<span class="myslice title">'+titleSSH+'</span><p>'+detailSSH+'<p>'+selectPeriodSSH+'<p>'+valuesSSH+'<p>'+sourceSSH;
270 var titleUT = 'Uptime';
271 var sourceUT = 'Source: '+sourceComon;
272 var valuesUT = 'Unit: <b>days</b>';
273 var detailUT = 'The continuous uptime until the moment that the page is loaded, as reported by the CoMon html query API.';
274 var descUT = '<span class="myslice title">'+titleUT+'</span><p>'+detailUT+'<p>'+valuesUT+'<p>'+sourceUT;
277 //Categorization of columns in different types, useful for filtering
279 function inTypeA(header_name) {
280 var typeA = ['ST','SN','RES','OS','NRR','NTP','NSR','NSF','NDS','NTH','NEC','LRN','LCY','LPR','LCN','LAT','LON','IP','ASN','AST'];
281 return typeA.indexOf(header_name);
284 function inTypeB(header_name) {
285 var typeB = ['BW','DS','MS','CC','CR','AS','MU','DU','CN'];
286 return typeB.indexOf(header_name);
289 function inTypeC(header_name) {
290 var typeC = ['Rw','Rm','Ry','BWw','BWm','BWy','Lw','Lm','Ly','Sw','Sm','Sy','CFw','CFm','CFy','BUw','BUm','BUy','MUw','MUm','MUy','SSHw','SSHm','SSHy'];
291 return typeC.indexOf(header_name);
294 function inTypeD(header_name) {
296 return typeD.indexOf(header_name);
301 function debugfilter(s) {
302 document.getElementById('debug').innerHTML+=s;
306 //Called when a column is selected. It displays the detailed description
309 function highlightOption(divid) {
311 //debugfilter("highlighting option "+divid);
313 var columns = document.getElementsByName('columnlist');
314 for(var j = 0; j < columns.length; j++)
315 columns[j].className = 'out';
317 document.getElementById(divid).className = 'selected';
319 showDescription(divid);
322 if (document.getElementById('selectperiod'+divid))
323 document.getElementById('selectperiod'+divid).value = document.getElementById('period'+divid).value;
328 //Displays the detailed column description
330 function showDescription(h) {
332 //debugfilter("showing description "+h);
334 //Checks if the detailed description div exists
335 if (document.getElementById('selectdescr'))
337 //Checks if there is a detailed description defined
338 if (window['desc'+h])
339 document.getElementById('selectdescr').innerHTML = ""+window['desc'+h];
340 //else if (document.getElementById('fdesc'+h))
341 //document.getElementById('selectdescr').innerHTML = document.getElementById('fdesc'+h).value;
343 document.getElementById('selectdescr').innerHTML = "No detailed description provided";
348 //Overrides the titles of the columns as they are shown in the column selection panel.
349 //If no overriding variable exists the tag's description is used
350 function overrideTitles() {
352 var columns = document.getElementsByName('columnlist');
354 for(var j = 0; j < columns.length; j++)
356 var kk = columns[j].id;
357 if (window['title'+kk])
358 document.getElementById('htitle'+kk).innerHTML = window['title'+kk];
362 //When the checkbox is clicked. Adds/removes column respectively
363 function changeCheckStatus(column) {
365 var h = document.getElementById(column).value;
367 if (document.getElementById('selectdescr'))
370 //debugfilter("HERE: "+column+" - "+document.getElementById('type '+column).value);
371 //debugfilter("HERE: "+column);
374 if (document.getElementById(column).checked)
375 addColumn(h, true, document.getElementById('type'+h).value);
382 //This function is used when the alternative "quick" selection list is used
383 function changeSelectStatus(column) {
385 var optionClass = "";
386 var selected_index = document.getElementById('quicklist').selectedIndex;
388 if (document.getElementById('quicklist') && selected_index != 0)
391 optionClass = document.getElementById('quicklist').options[selected_index].className;
393 if (optionClass == "in")
395 deleteColumn(document.getElementById('quicklist').value);
396 document.getElementById('quicklist').options[selected_index].className = "out";
397 document.getElementById('quicklist').value="0";
401 addColumn(document.getElementById('quicklist').value, true);
402 document.getElementById('quicklist').options[selected_index].className = "in";
403 document.getElementById('quicklist').value="0";
408 function updateReferenceNode(new_ref_node) {
410 var old_ref_node = document.getElementById('selected_reference_node').value;
411 document.getElementById('selected_reference_node').value=new_ref_node;
413 //debugfilter("changed "+old_ref_node+" with "+new_ref_node);
415 if (document.getElementById('checkHC').checked)
417 addColumnAjax('HC', 'HC');
418 //debugfilter("replacing "+old_ref_node+" with "+new_ref_node);
419 replaceColumnConfiguration('HC:'+old_ref_node,'HC:'+new_ref_node);
425 //When the period of an already selected column is changed
426 function updatePeriod(h, new_period) {
428 var old_period = document.getElementById('period'+h).value;
429 document.getElementById('period'+h).value=new_period;
431 //debugfilter(h+''+old_period+'-'+h+''+new_period);
432 if (document.getElementById('check'+h).checked)
434 deleteColumnCells(h+''+old_period);
435 addColumnCells(h+''+new_period);
436 addColumnAjax(h, h+''+new_period);
438 replaceColumnConfiguration(h+''+old_period,h+''+new_period);
444 RESET/SAVE CONFIGURATION
447 function getHTTPObject()
449 if (typeof XMLHttpRequest != 'undefined')
450 { return new XMLHttpRequest(); }
453 { return new ActiveXObject("Msxml2.XMLHTTP"); }
456 try { return new ActiveXObject("Microsoft.XMLHTTP"); }
462 function closeMessage(tab)
464 var current_conf = document.getElementById('show_configuration').value;
467 if (current_conf != "")
470 if (tab == 'reservable') {
471 document.getElementById('note_reservable_div').style.display = "none";
472 if (current_conf.indexOf('reservable') != -1)
474 value = current_conf+'reservable';
477 if (tab == 'columns') {
478 document.getElementById('note_columns_div').style.display = "none";
479 if (current_conf.indexOf('columns') != -1)
481 value = current_conf+'columns';
484 var slice_id = document.getElementById('slice_id').value;
485 var person_id = document.getElementById('person_id').value;
486 var tag_id = document.getElementById('show_tag_id').value;
488 var url = "/plekit/php/updateConfiguration.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_name=showconf&tag_id="+tag_id;
489 //debugfilter("updating conf with "+url);
490 document.getElementById('show_configuration').value = value;
492 var req = getHTTPObject();
493 req.open('GET', url, true);
494 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
495 req.onreadystatechange =
497 if (req.readyState == 4)
498 { debugfilter(req.responseText); }
505 function updateColumnConfiguration(value, reload)
507 var person_id = document.getElementById('person_id').value;
508 var slice_id = document.getElementById('slice_id').value;
509 var tag_id = document.getElementById('conf_tag_id').value;
510 var full_column_configuration = document.getElementById('full_column_configuration').value;
512 //debugfilter("<br>OLD = "+full_column_configuration);
513 //debugfilter("<br>value = "+value);
516 var old_columns = full_column_configuration.split(";");
517 var new_columns = new Array();
519 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
520 new_columns.push(old_columns[column_index]);
521 if (old_columns[column_index] != slice_id)
522 new_columns.push(old_columns[++column_index]);
526 new_columns.push(value);
528 new_columns.push("default");
534 var new_configuration = new_columns.join(";");
535 //debugfilter("<br>NEW = "+new_configuration);
537 if (window.XMLHttpRequest)
538 {// code for IE7+, Firefox, Chrome, Opera, Safari
539 xmlhttp=new XMLHttpRequest();
542 {// code for IE6, IE5
543 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
545 xmlhttp.onreadystatechange=function()
547 if (xmlhttp.readyState==4) // && xmlhttp.status==200)
549 //value=xmlhttp.responseText;
550 //debugfilter(value+"-----"+new_configuration);
551 document.getElementById('column_configuration').value=value;
552 document.getElementById('full_column_configuration').value=new_configuration;
555 window.location.reload(true);
559 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);
560 //xmlhttp.open("GET","/plekit/php/updateConf.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tagName=Columnconf",true);
565 function logSortingAction(person_id, slice_id, value)
569 var req = getHTTPObject();
570 var url = "/plekit/php/logSorting.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id;
572 req.open('GET', url, true);
573 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
574 req.onreadystatechange =
576 if (req.readyState == 4)
577 { debugfilter(req.responseText); }
582 function sortCompleteCallback(tableid) {
584 var slice_id = document.getElementById('slice_id').value;
585 var person_id = document.getElementById('person_id').value;
587 var ths = document.getElementById(tableid).getElementsByTagName("th");
588 for(var i = 0, th; th = ths[i]; i++) {
589 if (th.className.indexOf("Sort") != -1)
591 //debugfilter("sorted"+th.getAttribute("name"));
593 var column_name = th.getAttribute("name");
594 var hclass = th.className;
595 var column = hclass.substr(hclass.indexOf("column"),hclass.indexOf("column")+1);
596 var sortdirection = "forward";
597 if (hclass.indexOf("reverse")!=-1)
598 sortdirection = "reverse";
600 if (column.indexOf("column-1")==-1 && column.indexOf("column-0")==-1)
601 logSortingAction(person_id, slice_id, tableid+"|"+column_name+"|"+sortdirection);
607 function addColumnToConfiguration(column) {
609 var old_configuration = document.getElementById('column_configuration').value;
611 var new_configuration = "";
613 if (old_configuration != "")
614 new_configuration = old_configuration += "|"+column;
616 new_configuration = column;
618 //debugfilter("new configuration = "+new_configuration);
620 updateColumnConfiguration(new_configuration, false);
624 function deleteColumnFromConfiguration(column) {
626 var old_configuration = document.getElementById('column_configuration').value;
628 var old_columns = old_configuration.split("|");
629 var new_columns = new Array();
631 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
632 var conf = old_columns[column_index].split(':');
633 if (conf[0] != column)
634 new_columns.push(old_columns[column_index]);
637 var new_configuration = new_columns.join("|");
638 updateColumnConfiguration(new_configuration, false);
642 function replaceColumnConfiguration(column_old, column_new) {
644 var old_configuration = document.getElementById('column_configuration').value;
646 var old_columns = old_configuration.split("|");
647 var new_columns = new Array();
649 var olds = column_old.split(':');
651 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
652 var conf = old_columns[column_index].split(':');
653 if (conf[0] != olds[0])
654 new_columns.push(old_columns[column_index]);
656 new_columns.push(column_new);
659 var new_configuration = new_columns.join("|");
661 updateColumnConfiguration(new_configuration);
671 function convert_data(value, data_source, data_type, tagname) {
673 //debugfilter("v["+tagname+"]="+value+"-");
675 if (value == "" || value == "n/a" || value == null || value == "NaN" || value == "None")
678 if (tagname == "uptime") {
679 return parseInt((parseFloat(value) / 86400));
682 if (data_type == "date") {
684 var date = new Date(value*1000);
686 var year = date.getFullYear();
687 var month = date.getMonth()+1;
690 var day = date.getDate();
694 return year + '-' + month + '-' + day;
701 function load_data(column, header, url, data_source, data_type, tagname) {
703 //debugfilter("<br>loading "+url);
704 var req = getHTTPObject();
706 req.open('GET', url, true);
707 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
708 req.onreadystatechange =
710 if (req.readyState == 4)
711 { updateColumnData(column, header, req.responseText, data_source, data_type, tagname); }
717 function updateColumnData(column, header, data, data_source, data_type, tagname) {
719 var headers = header.split("|");
720 var data_table = data.split("|");
722 //debugfilter("<p>headers[0] = "+headers[0]);
723 //debugfilter("<p>data[2] = "+data_table[2]);
725 //debugfilter("data = "+data + " with type "+data_type + " and source "+data_source);
730 //debugfilter("GOT SOME DATA");
734 var table_id1 = 'nodes';
735 var table=$(table_id1);
736 var css='#'+table_id1+'>tbody';
737 var rows = $$(css)[0].rows;
739 var data_array1 = new Array();
741 //debugfilter("COLUMN "+column+"<p>");
743 for (var node_index = 1; node_index < data_table.length; node_index++) {
744 if (data_table[node_index] == '---potential---')
746 node_data = data_table[node_index].split(':');
748 data_array1[node_data[0]] = new Array();
750 for (var h_index=0; h_index < headers.length; h_index++) {
752 if (node_data[h_index+1] == "" || node_data[h_index+1] == "None")
753 data_array1[node_data[0]][h_index] = "n/a";
755 data_array1[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
762 for (var row_index = 0; row_index < rows.length ; row_index++) {
763 var tr=rows[row_index];
765 for (var column_index=0; column_index < tr.cells.length; column_index++) {
766 //debugfilter("<p>node id = "+tr.cells[0].innerHTML+" - "+tr.cells[column_index].getAttribute('name'));
767 if (tr.cells[column_index].getAttribute('name'))
769 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
770 if (found_index != -1)
771 //debugfilter(tr.cells[0].innerHTML+"-"+found_index);
772 tr.cells[column_index].innerHTML = data_array1[tr.cells[0].innerHTML][found_index];
777 //tablePaginater.init(table_id1);
778 fdTableSort.init(table_id1);
781 if (data_table[node_index] == '---potential---')
784 var table_id2 = 'add_nodes';
785 var table2=$(table_id2);
786 var css2='#'+table_id2+'>tbody';
787 var rows2 = $$(css2)[0].rows;
789 var data_array2 = new Array();
791 //debugfilter("COLUMN "+column+"<p>");
793 for (; node_index < data_table.length; node_index++) {
794 if (data_table[node_index] == '')
796 node_data = data_table[node_index].split(':');
798 data_array2[node_data[0]] = new Array();
800 for (var h_index=0; h_index < headers.length; h_index++) {
802 if (node_data[h_index+1] == "")
803 data_array2[node_data[0]][h_index] = "n/a";
805 data_array2[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
810 for (var row_index = 0; row_index < rows2.length ; row_index++) {
811 var tr=rows2[row_index];
813 for (var column_index=0; column_index < tr.cells.length; column_index++) {
814 if (tr.cells[column_index].getAttribute('name'))
816 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
817 if (found_index != -1)
818 tr.cells[column_index].innerHTML = data_array2[tr.cells[0].innerHTML][found_index];
822 fdTableSort.init(table_id2);
823 //tablePaginater.init(table_id2);
827 //fdTableSort.removeTableCache(table_id2);
828 //document.getElementById('loading'+column).innerHTML = "";
829 //debugfilter("Reset sorting .....");
833 document.getElementById('loading'+column).innerHTML = "";
838 function addColumnCells(header) {
840 var cells = document.getElementsByName(header);
842 //debugfilter("got cells -"+cells+"- for "+header);
843 for(var j = 0; j < cells.length; j++)
844 cells[j].style.display = "table-cell";
847 function addSampleCells(column) {
849 var cellsheader = document.getElementsByName("confheader"+column);
850 for(var j = 0; j < cellsheader.length; j++)
851 cellsheader[j].style.display = "table-cell";
855 function addColumnAjax(column, header) {
857 //var t = document.getElementById('check'+column).name;
858 var t = document.getElementById('tagname'+header).value;
859 var slice_id = document.getElementById('slice_id').value;
861 var selectedperiod = document.getElementById('period'+column).value;
863 var fetched = document.getElementById('fetched'+column).value;
864 var data_source = document.getElementById('source'+column).value;
865 var data_type = document.getElementById('type'+column).value;
868 //debugfilter("<br>adding "+column+","+header+','+fetched+','+t);
870 if (fetched.indexOf("false")!=-1)
873 document.getElementById('fetched'+column).value = ','+selectedperiod+',true';
875 else if (fetched.indexOf(','+selectedperiod+',')==-1)
878 document.getElementById('fetched'+column).value = ','+selectedperiod+''+fetched;
883 document.getElementById('loading'+column).innerHTML = "<img width=10 src=/plekit/icons/ajax-loader.gif>";
884 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+t+"&data_type="+data_type+"&data_source="+data_source;
885 load_data(column, header, url, data_source, data_type, t);
891 function addColumn(column, fetch) {
893 var selectedperiod="";
898 if (inTypeC(column)!=-1)
900 column = column.substring(0,column.length-1);
903 selectedperiod = document.getElementById('period'+column).value;
904 header = column+""+selectedperiod;
906 if (inTypeD(column)!=-1)
908 conf = header+":"+document.getElementById('reference_node').value;
909 document.getElementById('selected_reference_node').value=document.getElementById('reference_node').value;
914 //debugfilter("adding column "+column+" and header "+header+" and conf = "+conf);
916 addColumnCells(header);
919 addColumnAjax(column, header);
921 addColumnToConfiguration(conf);
925 function deleteColumnCells(header) {
927 var cells = document.getElementsByName(header);
928 for(var j = 0; j < cells.length; j++)
929 cells[j].style.display = "none";
934 function deleteColumn(column) {
936 var selectedperiod="";
939 selectedperiod = document.getElementById('period'+column).value;
940 header = column+""+selectedperiod;
942 //debugfilter("deleting "+column+","+header);
944 deleteColumnCells(header);
946 deleteColumnFromConfiguration(header);
955 function removeSelectHandler(object)
958 object.onclick = null;
961 //to be used for scrolling the column list with down/up arrows
963 function scrollList() {
964 debugfilter("here "+document.getElementById('scrolldiv').focused);
965 if (event.keyCode == 40)
967 else if (event.keyCode == 38)
971 function resetColumns() {
973 for (var kk in column_table) {
975 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
977 else if (column_table[kk]['visible'] == false && column_table[kk]['fetch'] == true)
983 function resetCols(which_conf) {
985 var target_configuration = "|"+document.getElementById(which_conf).value+"|";
987 //debugfilter("<p>Target configuration = "+target_configuration);
989 for (var kk in column_table) {
990 //debugfilter("in "+kk+" ");
992 if (target_configuration.indexOf("|"+kk+"|")>=0)
994 if (document.getElementById('check'+kk))
995 if (document.getElementById('check'+kk).checked == false)
997 debugfilter("<p>Adding "+kk);
1003 if (document.getElementById('check'+kk))
1004 if (document.getElementById('check'+kk).checked == true)
1006 debugfilter("<p>Deleting "+kk);
1013 function filterByType(selectedtype) {
1015 var notselectedyet = true;
1017 for (var kk in column_headers) {
1019 if (document.getElementById(kk))
1021 if (window['type'+kk] == selectedtype)
1023 document.getElementById(kk).className = 'in';
1025 highlightOption(kk);
1026 notselectedyet = false;
1029 document.getElementById(kk).className = 'out';
1035 function deleteColumnSample() {
1036 var cellsheader = document.getElementsByName("confheader"+column);
1037 for(var j = 0; j < cellsheader.length; j++)
1038 cellsheader[j].style.display = "none";
1042 function checkDataToFetch() {
1044 var dataExist = false;
1046 for (var kk in column_table) {
1048 if (document.getElementById(kk))
1050 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
1052 document.getElementById('fetchbutton').disabled = false;
1053 document.getElementById('fetchbutton').style.color = 'red';
1061 document.getElementById('fetchbutton').disabled = true;
1062 document.getElementById('fetchbutton').style.color = 'grey';
1068 function fetchData() {
1073 for (var kk in column_table) {
1075 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
1078 tagnames = column_table[kk]['tagname'];
1083 tagnames += "|"+column_table[kk]['tagname'];
1088 //debugfilter("fetching these columns: "+tagnames+ "("+headers+")");
1090 var slice_id = document.getElementById('slice_id').value;
1091 document.getElementById('loadingDiv').innerHTML = " <img src=/plekit/icons/ajax-loader.gif> Loading data. Please wait ...";
1092 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+tagnames;
1093 load_data(headers, url);
1104 function updateColumnThreshold(column, minT, maxT) {
1106 debugfilter("updating threshold for "+column+" with "+minT+" and "+maxT);
1108 var cells = document.getElementsByName(column);
1110 for(var j = 0; j < cells.length; j++)
1112 var val = parseFloat(cells[j].innerHTML);
1114 if (val >= minT && val <= maxT)
1115 cells[j].style.color = filtered_color;
1117 cells[j].style.color = normal_color;
1120 var old_configuration = document.getElementById('column_configuration').value;
1121 var slice_id = document.getElementById('slice_id').value;
1123 var old_columns = old_configuration.split("|");
1124 var new_columns = new Array();
1126 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
1127 var conf = old_columns[column_index].split(':');
1128 if (conf[0] != column)
1129 new_columns.push(old_columns[column_index]);
1131 new_columns.push(column+":"+minT+","+maxT);
1134 var new_configuration = new_columns.join("|");
1136 updateColumnConfiguration(slice_id, new_configuration);
1140 function updateExcludeList(column, excludeList) {
1142 //debugfilter("updating list");
1143 debugfilter("updating list for "+column+" with "+excludeList);
1145 var cells = document.getElementsByName(column);
1147 for(var j = 1; j < cells.length; j++)
1149 var val = cells[j].innerHTML;
1151 if (excludeList == val)
1152 cells[j].style.color = filtered_color;
1154 cells[j].style.color = normal_color;
1157 var old_configuration = document.getElementById('column_configuration').value;
1158 var slice_id = document.getElementById('slice_id').value;
1160 var old_columns = old_configuration.split("|");
1161 var new_columns = new Array();
1163 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
1164 var conf = old_columns[column_index].split(':');
1165 if (conf[0] != column)
1166 new_columns.push(old_columns[column_index]);
1168 new_columns.push(column+":"+excludeList);
1171 var new_configuration = new_columns.join("|");
1173 updateColumnConfiguration(slice_id, new_configuration);
1184 function plekit_table_showAll (slicetable_id) {
1186 var table=$(slicetable_id);
1187 var css='#'+slicetable_id+'>tbody';
1188 var rows = $$(css)[0].rows;
1190 // scan rows, elaborate 'visible'
1191 for (var row_index = 0; row_index < rows.length ; row_index++) {
1192 var tr=rows[row_index];
1194 plekit_table_row_visible(tr,visible);
1197 plekit_table_count_filtered(slicetable_id);
1199 tablePaginater.init(slicetable_id);
1203 function plekit_table_count_filtered (slicetable_id) {
1204 var table=$(slicetable_id);
1205 var css='#'+slicetable_id+'>tbody';
1206 var rows = $$(css)[0].rows;
1210 // scan rows, elaborate 'visible'
1211 for (var row_index = 0; row_index < rows.length ; row_index++) {
1212 var tr=rows[row_index];
1213 var filtered = false;
1215 for (var column_index=0; column_index < tr.cells.length; column_index++)
1216 if (tr.cells[column_index].style.color == "red")
1224 debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
1228 function plekit_table_hide_filtered (slicetable_id) {
1229 var table=$(slicetable_id);
1230 var css='#'+slicetable_id+'>tbody';
1231 var rows = $$(css)[0].rows;
1233 var reg = /(^|\s)invisibleRow(\s|$)/;
1236 if (!document.getElementById('filtercheck').checked)
1238 plekit_table_showAll(slicetable_id);
1244 // scan rows, elaborate 'visible'
1245 for (var row_index = 0; row_index < rows.length ; row_index++) {
1246 var tr=rows[row_index];
1249 for (var column_index=0; column_index < tr.cells.length; column_index++) {
1250 if (tr.cells[column_index].style.color == filtered_color)
1256 plekit_table_row_visible(tr,visible);
1259 //debugfilter('hidden '+hidden+' nodes');
1260 debugfilter(hidden+' nodes do not satisfy the requested threshold (hidden)');
1262 tablePaginater.init(slicetable_id);
1268 function plekit_table_apply_config(slicetable_id, configuration) {
1270 var new_configuration = document.getElementById('new_conf').value;
1271 var all_columns = new_configuration.split("|");
1273 var min_values = new Array();
1274 var max_values = new Array();
1277 for (var column_index = 0; column_index < all_columns.length ; column_index++) {
1279 var conf = all_columns[column_index].split(':');
1281 if (inTypeB(conf[0]) != -1)
1283 var threshold = conf[1].split(',');
1284 if (threshold.length == 2)
1286 min_values.push(parseFloat(threshold[0]));
1287 max_values.push(parseFloat(threshold[1]));
1290 else if (inTypeC(conf[0]) == -1)
1292 var threshold = conf[2].split(',');
1293 if (threshold.length == 2)
1295 min_values.push(parseInt(threshold[0]));
1296 max_values.push(parseInt(threshold[1]));
1301 min_values.push(-1);
1302 max_values.push(-1);
1307 var table=$(slicetable_id);
1308 var css='#'+slicetable_id+'>tbody';
1309 var rows = $$(css)[0].rows;
1314 for (var row_index = 0; row_index < rows.length ; row_index++) {
1316 var tr=rows[row_index];
1318 var filtered = false;
1320 for (var column_index = 0; column_index < all_columns.length ; column_index++)
1321 if (min_values[column_index]!=-1)
1323 var val = parseFloat(tr.cells[3+column_index].innerHTML);
1325 if (val >= min_values[column_index] && val <= max_values[column_index])
1327 tr.cells[3+column_index].style.color = filtered_color;
1331 tr.cells[3+column_index].style.color = normal_color;
1334 if (tr.cells[3+column_index].style.color == filtered_color)
1342 debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
1344 //tablePaginater.init(slicetable_id);
1349 function reset_select () {
1350 var table=$(slicetable_id);
1351 var css='#'+slicetable_id+'>tbody';
1352 var rows = $$(css)[0].rows;
1354 var action = document.getElementById('onlyselected');
1355 action.checked=false;
1357 // scan rows, elaborate 'visible'
1358 for (var row_index = 0; row_index < rows.length ; row_index++) {
1359 var tr=rows[row_index];
1361 document.getElementById("check"+tr.id).checked=false;
1365 plekit_table_count_nodes();
1371 function plekit_table_select_filter () {
1372 var table=$(slicetable_id);
1373 var css='#'+slicetable_id+'>tbody';
1374 var rows = $$(css)[0].rows;
1376 var reg = /(^|\s)invisibleRow(\s|$)/;
1378 var action = document.getElementById('onlyselected');
1379 if (!action.checked)
1380 plekit_table_reset_filter();
1382 // scan rows, elaborate 'visible'
1383 for (var row_index = 0; row_index < rows.length ; row_index++) {
1384 var tr=rows[row_index];
1389 if(tr.className.search(reg) == -1)
1390 if(!document.getElementById("check"+tr.id).checked)
1394 if(tr.className.search(reg) != -1)
1397 plekit_table_row_visible(tr,visible);
1400 tablePaginater.init(slicetable_id);
1401 plekit_table_count_nodes();
1404 function plekit_table_select_filter2 () {
1405 var table=$(slicetable_id);
1406 var css='#'+slicetable_id+'>tbody';
1407 var rows = $$(css)[0].rows;
1409 var reg = /(^|\s)invisibleRow(\s|$)/;
1411 var action = document.getElementById('onlyselected');
1413 // scan rows, elaborate 'visible'
1414 for (var row_index = 0; row_index < rows.length ; row_index++) {
1415 var tr=rows[row_index];
1420 if(tr.className.search(reg) == -1)
1421 if(!document.getElementById("check"+tr.id).checked)
1425 if(tr.className.search(reg) != -1)
1428 plekit_table_row_visible(tr,visible);
1431 tablePaginater.init(slicetable_id);
1432 plekit_table_count_nodes();
1435 function CheckTopNodes(n) {
1436 var table=$(slicetable_id);
1437 var css='#'+slicetable_id+'>tbody';
1438 var rows = $$(css)[0].rows;
1439 var reg = /(^|\s)invisibleRow(\s|$)/;
1443 for (var row_index = 0; row_index < rows.length ; row_index++) {
1444 var tr=rows[row_index];
1446 if(tr.className.search(reg) == -1) {
1449 document.getElementById("check"+tr.id).checked=true;
1454 document.getElementById("check"+tr.id).checked=false;
1461 function CheckRandomNodes(n) {
1462 var table=$(slicetable_id);
1463 var css='#'+slicetable_id+'>tbody';
1464 var rows = $$(css)[0].rows;
1465 var reg = /(^|\s)invisibleRow(\s|$)/;
1467 var r = n/plekit_table_visible_count();
1470 for (var row_index = 0; row_index < rows.length ; row_index++) {
1471 var tr=rows[row_index];
1473 if(tr.className.search(reg) == -1) {
1474 if(Math.random() < r) {
1475 document.getElementById("check"+tr.id).checked=true;
1485 function plekit_table_visible_count() {
1486 var table=$(slicetable_id);
1487 var css='#'+slicetable_id+'>tbody';
1488 var rows = $$(css)[0].rows;
1489 var reg = /(^|\s)invisibleRow(\s|$)/;
1492 for (var row_index = 0; row_index < rows.length ; row_index++) {
1493 var tr=rows[row_index];
1495 if(tr.className.search(reg) == -1)
1505 function plekit_table_count_nodes() {
1506 var table=$(slicetable_id);
1507 var css='#'+slicetable_id+'>tbody';
1508 var rows = $$(css)[0].rows;
1509 var reg = /(^|\s)invisibleRow(\s|$)/;
1514 for (var row_index = 0; row_index < rows.length ; row_index++) {
1515 var tr=rows[row_index];
1518 var ch = document.getElementById("check"+tr.id);
1520 if(tr.className.search(reg) == -1)
1533 var dd = document.getElementById('node_statistics');
1534 dd.innerHTML = "Total: "+n+" - Shown: "+v+" - Selected: "+s;
1537 function AutoSelect()
1539 var a = document.getElementById('automatic').value;
1540 var n = parseInt(document.getElementById('no_nodes').value);
1546 CheckRandomNodes(n);
1547 else if (a == "top")
1550 plekit_table_select_filter2();
1551 plekit_table_count_nodes();