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 titleCPC = 'Number of cores per CPU';
81 var sourceCPC = 'Source: '+sourceComon;
82 var valuesCPC = '<i>The number of cores per CPU on the node.</i>';
83 var descCPC = '<span class="myslice title">'+titleCPC+'</span><p>'+valuesCPC+'<p>'+sourceCPC;
85 var titleCR = 'CPU clock rate';
86 var detailCR = '<i>The clock rate for the CPUs on the node. For reference, the '+hardwareReqs+' is <b>2.4 GHz</b></i>.';
87 var sourceCR = 'Source: '+sourceComon;
88 var valuesCR = 'Unit: <b>GHz</b>';
89 var descCR = '<span class="myslice title">'+titleCR+'</span><p>'+detailCR+'<p>'+valuesCR+'<p>'+sourceCR;
91 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>';
92 var titleCF = 'Free CPU';
93 var sourceCF = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
94 var valuesCF = 'Unit: <b>%</b>';
95 var detailCF = '<i> The average CPU percentage that gets allocated to a test slice named burb that is periodically run by CoMon.</i>';
96 var descCF = '<span class="myslice title">'+titleCF+'</span><p>'+detailCF+'<p>'+selectPeriodCF+'<p>'+valuesCF+'<p>'+sourceCF;
98 var titleDN = 'Toplevel domain name';
99 var sourceDN = 'Source: '+sourceMyPLC;
100 var descDN = '<span class="myslice title">'+titleDN+'</span><p>'+sourceDN;
102 var titleDA = 'Date added';
103 var sourceDA = 'Source: '+sourceMyPLC;
104 var detailDA = '<i> The date that the noded was added to PlanetLab.</i>';
105 var descDA = '<span class="myslice title">'+titleDA+'</span><p>'+detailDA+'<p>'+sourceDA;
107 var titleDL = 'Deployment';
108 var detailDL = '<i>The deployment status.</i>';
109 var valuesDL = 'Values: <b>alpha</b>, <b>beta</b>, <b>production</b>, <b>n/a</b>';
110 var sourceDL = 'Source: '+sourceMyPLC;
111 var descDL = '<span class="myslice title">'+titleDL+'</span><p>'+detailDL+'<p>'+valuesDL+'<p>'+sourceDL;
113 var titleDS = 'Disk size';
114 var detailDS = '<i>The size of the hard disk available on the node. For reference, the '+hardwareReqs+' is <b>500 GB</b></i>.';
115 var sourceDS = 'Source: '+sourceComon;
116 var valuesDS = 'Unit: <b>GB</b>';
117 var descDS = '<span class="myslice title">'+titleDS+'</span><p>'+detailDS+'<p>'+valuesDS+'<p>'+sourceDS;
119 var titleDU = 'Current disk utilization';
120 var sourceDU = 'Source: '+sourceComon;
121 var valuesDU = 'Unit: <b>GB</b>';
122 var detailDU = '<i> The amount of disk space currently consumed.</i>';
123 var descDU = '<span class="myslice title">'+titleDU+'</span><p>'+detailDU+'<p>'+valuesDU+'<p>'+sourceDU;
125 var titleDF = 'Disk space free';
126 var sourceDF = 'Source: '+sourceComon;
127 var valuesDF = 'Unit: <b>GB</b>.';
128 var detailDF = '<i> The amount of disk space currently available.</i>';
129 var descDF = '<span class="myslice title">'+titleDF+'</span><p>'+detailDF+'<p>'+valuesDF+'<p>'+sourceDF;
131 var titleHC = 'Hop count (pairwise)';
132 var sourceHC = 'Source: '+sourceTophat;
133 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>.';
134 var descHC = '<span class="myslice title">'+titleHC+'</span><p>'+detailHC+'<p>'+selectReferenceNode+'<p>'+sourceHC;
136 var titleIP = 'IP address';
137 var sourceIP = 'Source: '+sourceMyPLC;
138 var descIP = '<span class="myslice title">'+titleIP+'</span><p>'+sourceIP;
140 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>';
142 var sourceL = 'Source: '+sourceComon;
143 var valuesL = 'Unit: <b>5-minute load</b>';
144 var detailL = '<i>The average 5-minute load (as reported by the Unix uptime command) over the selected period.</i>';
145 var descL = '<span class="myslice title">'+titleL+'</span><p>'+detailL+'<p>'+selectPeriodL+'<p>'+valuesL+'<p>'+sourceL;
147 var titleLON= 'Longitude';
148 var sourceLON = 'Source: '+sourceTophat;
149 var descLON = '<span class="myslice title">'+titleLON+'</span><p>'+sourceLON;
151 var titleLAT= 'Latitude';
152 var sourceLAT = 'Source: '+sourceTophat;
153 var descLAT = '<span class="myslice title">'+titleLAT+'</span><p>'+sourceLAT;
155 var titleLCN= 'Location (Country)';
156 var sourceLCN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
157 var detailLCN = '<i>Based on the latitude and longitude information.</i>';
158 var descLCN = '<span class="myslice title">'+titleLCN+'</span><p>'+detailLCN+'<p>'+sourceLCN;
160 var titleLCT= 'Location (Continent)';
161 var sourceLCT = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
162 var detailLCT = '<i>Based on the latitude and longitude information.</i>';
163 var descLCT = '<span class="myslice title">'+titleLCT+'</span><p>'+detailLCT+'<p>'+sourceLCT;
165 var titleLCY= 'Location (City)';
166 var sourceLCY = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
167 var detailLCY = '<i>Based on the latitude and longitude information.</i>';
168 var descLCY = '<span class="myslice title">'+titleLCY+'</span><p>'+detailLCY+'<p>'+sourceLCY;
170 var titleLPR= 'Location precision radius';
171 var sourceLPR = 'Source: '+sourceTophat;
172 var valuesLPR = 'Unit: <b>float</b>.';
173 var detailLPR = '<i>The radius of the circle corresponding to the error in precision of the geolocalization estimate.</i>';
174 var descLPR = '<span class="myslice title">'+titleLPR+'</span><p>'+detailLPR+'<p>'+valuesLPR+'<p>'+sourceLPR;
176 var titleLRN= 'Location (Region)';
177 var sourceLRN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
178 var detailLRN = '<i>Based on the latitude and longitude information.</i>';
179 var descLRN = '<span class="myslice title">'+titleLRN+'</span><p>'+detailLRN+'<p>'+sourceLRN;
181 var titleMS= 'Memory size';
182 var detailMS = '<i>The memory size (RAM) available on the node. For reference, the '+hardwareReqs+' is <b>4 GB</b></i>.';
183 var sourceMS = 'Source: '+sourceComon;
184 var valuesMS = 'Unit: <b>GB</b>.';
185 var descMS = '<span class="myslice title">'+titleMS+'</span><p>'+detailMS+'<p>'+valuesMS+'<p>'+sourceMS;
187 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>';
188 var titleMU = 'Memory utilization';
189 var sourceMU = 'Source: '+sourceComon;
190 var valuesMU = '<p>Unit: <b>%</b>';
191 var detailMU = '<i>The average active memory utilization as reported by CoMon.</i>';
192 var descMU = '<span class="myslice title">'+titleMU+'</span><p>'+detailMU+'<p>'+selectPeriodMU+'<p>'+valuesMU+'<p>'+sourceMU;
194 var titleNEC= 'Network information (ETOMIC)';
195 var sourceNEC = 'Source: '+sourceTophat;
196 var valuesNEC = 'Values: <b>yes/no</b>';
197 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>';
198 var descNEC = '<span class="myslice title">'+titleNEC+'</span><p>'+detailNEC+'<p>'+valuesNEC+'<p>'+sourceNEC;
200 var titleNSN= 'Network information (SONoMA)';
201 var sourceNSN = 'Source: '+sourceTophat;
202 var valuesNSN = 'Values: <b>yes/no</b>';
203 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>';
204 var descNSN = '<span class="myslice title">'+titleNSN+'</span><p>'+detailNSN+'<p>'+valuesNSN+'<p>'+sourceNSN;
206 var titleNTH= 'Network information (TopHat)';
207 var sourceNTH = 'Source: '+sourceTophat;
208 var valuesNTH = 'Values: <b>yes/no</b>';
209 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>';
210 var descNTH = '<span class="myslice title">'+titleNTH+'</span><p>'+detailNTH+'<p>'+valuesNTH+'<p>'+sourceNTH;
212 var titleNDS= 'Network information (DIMES)';
213 var sourceNDS = 'Source: '+sourceTophat;
214 var valuesNDS = 'Values: <b>yes/no</b>';
215 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>';
216 var descNDS = '<span class="myslice title">'+titleNDS+'</span><p>'+detailNDS+'<p>'+valuesNDS+'<p>'+sourceNDS;
218 var titleNSF= 'Network information (spoof)';
219 var sourceNSF = 'Source: '+sourceTophat;
220 var valuesNSF = '<p>Values: <b>yes/no</b>';
221 var detailNSF = '<i> Whether the node can send packets successfully (or not) with a spoofed IP source address.</i>';
222 var descNSF = '<span class="myslice title">'+titleNSF+'</span><p>'+detailNSF+'<p>'+valuesNSF+'<p>'+sourceNSF;
224 var titleNSR= 'Network information (source route)';
225 var sourceNSR = 'Source: '+sourceTophat;
226 var valuesNSR = '<p>Values: <b>yes/no</b>';
227 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>';
228 var descNSR = '<span class="myslice title">'+titleNSR+'</span><p>'+detailNSR+'<p>'+valuesNSR+'<p>'+sourceNSR;
230 var titleNTP= 'Network information (timestamp)';
231 var sourceNTP = 'Source: '+sourceTophat;
232 var valuesNTP = '<p>Values: <b>yes/no</b>';
233 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>';
234 var descNTP = '<span class="myslice title">'+titleNTP+'</span><p>'+detailNTP+'<p>'+valuesNTP+'<p>'+sourceNTP;
236 var titleNRR= 'Network information (record route)';
237 var sourceNRR = 'Source: '+sourceTophat;
238 var valuesNRR = '<p>Values: <b>yes/no</b>';
239 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>';
240 var descNRR = '<span class="myslice title">'+titleNRR+'</span><p>'+detailNRR+'<p>'+valuesNRR+'<p>'+sourceNRR;
242 var titleOS = 'Operating system';
243 var detailOS = '<i>Fedora or CentOS distribution to use for node or slivers.</i>';
244 var sourceOS = 'Source: '+sourceMyPLC;
245 var valuesOS = 'Values: <b>f8, f12, Cent/OS, other, n/a</b>';
246 var descOS = '<span class="myslice title">'+titleOS+'</span><p>'+valuesOS+'<p>'+sourceOS;
248 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>';
249 var titleR = 'Reliability';
250 var sourceR = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
251 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>';
252 var valuesR = 'Unit: <b>%</b>';
253 var descR = '<span class="myslice title">'+titleR+'</span><p>'+detailR+'<p>'+selectPeriodR+'<p>'+valuesR+'<p>'+sourceR;
255 var titleRES = 'Reservation capabilities';
256 var sourceRES = 'Source: '+sourceMyPLC;
257 //var valuesRES = 'Values: <b>yes/no</b>';
258 var valuesRES = 'Values: <b>-R-</b> (if yes)';
259 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>';
260 var descRES = '<span class="myslice title">'+titleRES+'</span><p>'+detailRES+'<p>'+valuesRES+'<p>'+sourceRES;
262 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>';
263 var titleS = 'Active slices';
264 var sourceS = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
265 var valuesS = 'Unit: <b>%</b>';
266 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>';
267 var descS = '<span class="myslice title">'+titleS+'</span><p>'+detailS+'<p>'+selectPeriodS+'<p>'+valuesS+'<p>'+sourceS;
269 var titleSM= 'Slices in memory';
270 var detailSM = '<i>The total number of slices in memory (both active and inactive).</i>';
271 var sourceSM = 'Source: '+sourceComon;
272 var descSM = '<span class="myslice title">'+titleSM+'</span><p>'+detailSM+'<p>'+sourceSM;
274 var titleSN = 'Site name';
275 var sourceSN = 'Source: '+sourceMyPLC;
276 var descSN = '<span class="myslice title">'+titleSN+'</span><p>'+sourceSN;
278 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>';
279 var titleSSH = 'Average SSH response delay';
280 var valuesSSH = 'Unit: <b>%</b>';
281 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>';
282 var sourceSSH ='Source: '+sourceComon+' (via '+sourceMySlice+')';
283 var descSSH = '<span class="myslice title">'+titleSSH+'</span><p>'+detailSSH+'<p>'+selectPeriodSSH+'<p>'+valuesSSH+'<p>'+sourceSSH;
286 var titleUT = 'Uptime';
287 var sourceUT = 'Source: '+sourceComon;
288 var valuesUT = 'Unit: <b>days</b>';
289 var detailUT = 'The continuous uptime until the moment that the page is loaded, as reported by the CoMon html query API.';
290 var descUT = '<span class="myslice title">'+titleUT+'</span><p>'+detailUT+'<p>'+valuesUT+'<p>'+sourceUT;
293 //Categorization of columns in different types, useful for filtering
295 function inTypeA(header_name) {
296 var typeA = ['ST','SN','RES','OS','NRR','NTP','NSR','NSF','NDS','NTH','NEC','LRN','LCY','LPR','LCN','LAT','LON','IP','ASN','AST'];
297 return typeA.indexOf(header_name);
300 function inTypeB(header_name) {
301 var typeB = ['BW','DS','MS','CC','CR','AS','MU','DU','CN'];
302 return typeB.indexOf(header_name);
305 function inTypeC(header_name) {
306 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'];
307 return typeC.indexOf(header_name);
310 function inTypeD(header_name) {
312 return typeD.indexOf(header_name);
317 function debugfilter(s) {
318 document.getElementById('debug').innerHTML+=s;
322 //Called when a column is selected. It displays the detailed description
325 function highlightOption(divid) {
327 //debugfilter("highlighting option "+divid);
329 var columns = document.getElementsByName('columnlist');
330 for(var j = 0; j < columns.length; j++)
331 columns[j].className = 'out';
333 document.getElementById(divid).className = 'selected';
335 showDescription(divid);
338 if (document.getElementById('selectperiod'+divid))
339 document.getElementById('selectperiod'+divid).value = document.getElementById('period'+divid).value;
344 //Displays the detailed column description
346 function showDescription(h) {
348 //debugfilter("showing description "+h);
350 //Checks if the detailed description div exists
351 if (document.getElementById('selectdescr'))
353 //Checks if there is a detailed description defined
354 if (window['desc'+h])
355 document.getElementById('selectdescr').innerHTML = ""+window['desc'+h];
356 //else if (document.getElementById('fdesc'+h))
357 //document.getElementById('selectdescr').innerHTML = document.getElementById('fdesc'+h).value;
359 document.getElementById('selectdescr').innerHTML = "No detailed description provided";
364 //Overrides the titles of the columns as they are shown in the column selection panel.
365 //If no overriding variable exists the tag's description is used
366 function overrideTitles() {
368 var columns = document.getElementsByName('columnlist');
370 for(var j = 0; j < columns.length; j++)
372 var kk = columns[j].id;
373 if (window['title'+kk])
374 document.getElementById('htitle'+kk).innerHTML = window['title'+kk];
378 //When the checkbox is clicked. Adds/removes column respectively
379 function changeCheckStatus(column) {
381 var h = document.getElementById(column).value;
383 if (document.getElementById('selectdescr'))
386 //debugfilter("HERE: "+column+" - "+document.getElementById('type '+column).value);
387 //debugfilter("HERE: "+column);
390 if (document.getElementById(column).checked)
391 addColumn(h, true, document.getElementById('type'+h).value);
398 //This function is used when the alternative "quick" selection list is used
399 function changeSelectStatus(column) {
401 var optionClass = "";
402 var selected_index = document.getElementById('quicklist').selectedIndex;
404 if (document.getElementById('quicklist') && selected_index != 0)
407 optionClass = document.getElementById('quicklist').options[selected_index].className;
409 if (optionClass == "in")
411 deleteColumn(document.getElementById('quicklist').value);
412 document.getElementById('quicklist').options[selected_index].className = "out";
413 document.getElementById('quicklist').value="0";
417 addColumn(document.getElementById('quicklist').value, true);
418 document.getElementById('quicklist').options[selected_index].className = "in";
419 document.getElementById('quicklist').value="0";
424 function updateReferenceNode(new_ref_node) {
426 var old_ref_node = document.getElementById('selected_reference_node').value;
427 document.getElementById('selected_reference_node').value=new_ref_node;
429 //debugfilter("changed "+old_ref_node+" with "+new_ref_node);
431 if (document.getElementById('checkHC').checked)
433 addColumnAjax('HC', 'HC');
434 //debugfilter("replacing "+old_ref_node+" with "+new_ref_node);
435 replaceColumnConfiguration('HC:'+old_ref_node,'HC:'+new_ref_node);
441 //When the period of an already selected column is changed
442 function updatePeriod(h, new_period) {
444 var old_period = document.getElementById('period'+h).value;
445 document.getElementById('period'+h).value=new_period;
447 //debugfilter(h+''+old_period+'-'+h+''+new_period);
448 if (document.getElementById('check'+h).checked)
450 deleteColumnCells(h+''+old_period);
451 addColumnCells(h+''+new_period);
452 addColumnAjax(h, h+''+new_period);
454 replaceColumnConfiguration(h+''+old_period,h+''+new_period);
460 RESET/SAVE CONFIGURATION
463 function getHTTPObject()
465 if (typeof XMLHttpRequest != 'undefined')
466 { return new XMLHttpRequest(); }
469 { return new ActiveXObject("Msxml2.XMLHTTP"); }
472 try { return new ActiveXObject("Microsoft.XMLHTTP"); }
478 function closeMessage(tab)
480 var current_conf = document.getElementById('show_configuration').value;
483 if (current_conf != "")
486 if (tab == 'reservable') {
487 document.getElementById('note_reservable_div').style.display = "none";
488 if (current_conf.indexOf('reservable') != -1)
490 value = current_conf+'reservable';
493 if (tab == 'columns') {
494 document.getElementById('note_columns_div').style.display = "none";
495 if (current_conf.indexOf('columns') != -1)
497 value = current_conf+'columns';
500 var slice_id = document.getElementById('slice_id').value;
501 var person_id = document.getElementById('person_id').value;
502 var tag_id = document.getElementById('show_tag_id').value;
504 var url = "/plekit/php/updateConfiguration.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_name=showconf&tag_id="+tag_id;
505 //debugfilter("updating conf with "+url);
506 document.getElementById('show_configuration').value = value;
508 var req = getHTTPObject();
509 req.open('GET', url, true);
510 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
511 req.onreadystatechange =
513 if (req.readyState == 4)
514 { debugfilter(req.responseText); }
521 function updateColumnConfiguration(value, reload)
523 var person_id = document.getElementById('person_id').value;
524 var slice_id = document.getElementById('slice_id').value;
525 var tag_id = document.getElementById('conf_tag_id').value;
526 var full_column_configuration = document.getElementById('full_column_configuration').value;
528 //debugfilter("<br>OLD = "+full_column_configuration);
529 //debugfilter("<br>value = "+value);
532 var old_columns = full_column_configuration.split(";");
533 var new_columns = new Array();
535 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
536 new_columns.push(old_columns[column_index]);
537 if (old_columns[column_index] != slice_id)
538 new_columns.push(old_columns[++column_index]);
542 new_columns.push(value);
544 new_columns.push("default");
550 var new_configuration = new_columns.join(";");
551 //debugfilter("<br>NEW = "+new_configuration);
553 if (window.XMLHttpRequest)
554 {// code for IE7+, Firefox, Chrome, Opera, Safari
555 xmlhttp=new XMLHttpRequest();
558 {// code for IE6, IE5
559 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
561 xmlhttp.onreadystatechange=function()
563 if (xmlhttp.readyState==4) // && xmlhttp.status==200)
565 //value=xmlhttp.responseText;
566 //debugfilter(value+"-----"+new_configuration);
567 document.getElementById('column_configuration').value=value;
568 document.getElementById('full_column_configuration').value=new_configuration;
571 window.location.reload(true);
575 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);
576 //xmlhttp.open("GET","/plekit/php/updateConf.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tagName=Columnconf",true);
581 function logSortingAction(person_id, slice_id, value)
585 var req = getHTTPObject();
586 var url = "/plekit/php/logSorting.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id;
588 req.open('GET', url, true);
589 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
590 req.onreadystatechange =
592 if (req.readyState == 4)
593 { debugfilter(req.responseText); }
598 function sortCompleteCallback(tableid) {
600 var slice_id = document.getElementById('slice_id').value;
601 var person_id = document.getElementById('person_id').value;
603 var ths = document.getElementById(tableid).getElementsByTagName("th");
604 for(var i = 0, th; th = ths[i]; i++) {
605 if (th.className.indexOf("Sort") != -1)
607 //debugfilter("sorted"+th.getAttribute("name"));
609 var column_name = th.getAttribute("name");
610 var hclass = th.className;
611 var column = hclass.substr(hclass.indexOf("column"),hclass.indexOf("column")+1);
612 var sortdirection = "forward";
613 if (hclass.indexOf("reverse")!=-1)
614 sortdirection = "reverse";
616 if (column.indexOf("column-1")==-1 && column.indexOf("column-0")==-1)
617 logSortingAction(person_id, slice_id, tableid+"|"+column_name+"|"+sortdirection);
623 function addColumnToConfiguration(column) {
625 var old_configuration = document.getElementById('column_configuration').value;
627 var new_configuration = "";
629 if (old_configuration != "")
630 new_configuration = old_configuration += "|"+column;
632 new_configuration = column;
634 //debugfilter("new configuration = "+new_configuration);
636 updateColumnConfiguration(new_configuration, false);
640 function deleteColumnFromConfiguration(column) {
642 var old_configuration = document.getElementById('column_configuration').value;
644 var old_columns = old_configuration.split("|");
645 var new_columns = new Array();
647 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
648 var conf = old_columns[column_index].split(':');
649 if (conf[0] != column)
650 new_columns.push(old_columns[column_index]);
653 var new_configuration = new_columns.join("|");
654 updateColumnConfiguration(new_configuration, false);
658 function replaceColumnConfiguration(column_old, column_new) {
660 var old_configuration = document.getElementById('column_configuration').value;
662 var old_columns = old_configuration.split("|");
663 var new_columns = new Array();
665 var olds = column_old.split(':');
667 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
668 var conf = old_columns[column_index].split(':');
669 if (conf[0] != olds[0])
670 new_columns.push(old_columns[column_index]);
672 new_columns.push(column_new);
675 var new_configuration = new_columns.join("|");
677 updateColumnConfiguration(new_configuration);
687 function convert_data(value, data_source, data_type, tagname) {
689 //debugfilter("v["+tagname+"]="+value+"-");
691 if (value == "" || value == "n/a" || value == null || value == "NaN" || value == "None")
694 if (tagname == "uptime") {
695 return parseInt((parseFloat(value) / 86400));
698 if (data_type == "date") {
700 var date = new Date(value*1000);
702 var year = date.getFullYear();
703 var month = date.getMonth()+1;
706 var day = date.getDate();
710 return year + '-' + month + '-' + day;
717 function load_data(column, header, url, data_source, data_type, tagname) {
719 //debugfilter("<br>loading "+url);
720 var req = getHTTPObject();
722 req.open('GET', url, true);
723 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
724 req.onreadystatechange =
726 if (req.readyState == 4)
727 { updateColumnData(column, header, req.responseText, data_source, data_type, tagname); }
733 function updateColumnData(column, header, data, data_source, data_type, tagname) {
735 var headers = header.split("|");
736 var data_table = data.split("|");
738 //debugfilter("<p>headers[0] = "+headers[0]);
739 //debugfilter("<p>data[2] = "+data_table[2]);
741 //debugfilter("data = "+data + " with type "+data_type + " and source "+data_source);
746 //debugfilter("GOT SOME DATA");
750 var table_id1 = 'nodes';
751 var table=$(table_id1);
752 var css='#'+table_id1+'>tbody';
753 var rows = $$(css)[0].rows;
755 var data_array1 = new Array();
757 //debugfilter("COLUMN "+column+"<p>");
759 for (var node_index = 1; node_index < data_table.length; node_index++) {
760 if (data_table[node_index] == '---potential---')
762 node_data = data_table[node_index].split(':');
764 data_array1[node_data[0]] = new Array();
766 for (var h_index=0; h_index < headers.length; h_index++) {
768 if (node_data[h_index+1] == "" || node_data[h_index+1] == "None")
769 data_array1[node_data[0]][h_index] = "n/a";
771 data_array1[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
778 for (var row_index = 0; row_index < rows.length ; row_index++) {
779 var tr=rows[row_index];
781 for (var column_index=0; column_index < tr.cells.length; column_index++) {
782 //debugfilter("<p>node id = "+tr.cells[0].innerHTML+" - "+tr.cells[column_index].getAttribute('name'));
783 if (tr.cells[column_index].getAttribute('name'))
785 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
786 if (found_index != -1)
787 //debugfilter(tr.cells[0].innerHTML+"-"+found_index);
788 tr.cells[column_index].innerHTML = data_array1[tr.cells[0].innerHTML][found_index];
793 //tablePaginater.init(table_id1);
794 fdTableSort.init(table_id1);
797 if (data_table[node_index] == '---potential---')
800 var table_id2 = 'add_nodes';
801 var table2=$(table_id2);
802 var css2='#'+table_id2+'>tbody';
803 var rows2 = $$(css2)[0].rows;
805 var data_array2 = new Array();
807 //debugfilter("COLUMN "+column+"<p>");
809 for (; node_index < data_table.length; node_index++) {
810 if (data_table[node_index] == '')
812 node_data = data_table[node_index].split(':');
814 data_array2[node_data[0]] = new Array();
816 for (var h_index=0; h_index < headers.length; h_index++) {
818 if (node_data[h_index+1] == "")
819 data_array2[node_data[0]][h_index] = "n/a";
821 data_array2[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
826 for (var row_index = 0; row_index < rows2.length ; row_index++) {
827 var tr=rows2[row_index];
829 for (var column_index=0; column_index < tr.cells.length; column_index++) {
830 if (tr.cells[column_index].getAttribute('name'))
832 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
833 if (found_index != -1)
834 tr.cells[column_index].innerHTML = data_array2[tr.cells[0].innerHTML][found_index];
838 fdTableSort.init(table_id2);
839 //tablePaginater.init(table_id2);
843 //fdTableSort.removeTableCache(table_id2);
844 //document.getElementById('loading'+column).innerHTML = "";
845 //debugfilter("Reset sorting .....");
849 document.getElementById('loading'+column).innerHTML = "";
854 function addColumnCells(header) {
856 var cells = document.getElementsByName(header);
858 //debugfilter("got cells -"+cells+"- for "+header);
859 for(var j = 0; j < cells.length; j++)
860 cells[j].style.display = "table-cell";
863 function addSampleCells(column) {
865 var cellsheader = document.getElementsByName("confheader"+column);
866 for(var j = 0; j < cellsheader.length; j++)
867 cellsheader[j].style.display = "table-cell";
871 function addColumnAjax(column, header) {
873 //var t = document.getElementById('check'+column).name;
874 var t = document.getElementById('tagname'+header).value;
875 var slice_id = document.getElementById('slice_id').value;
877 var selectedperiod = document.getElementById('period'+column).value;
879 var fetched = document.getElementById('fetched'+column).value;
880 var data_source = document.getElementById('source'+column).value;
881 var data_type = document.getElementById('type'+column).value;
884 //debugfilter("<br>adding "+column+","+header+','+fetched+','+t);
886 if (fetched.indexOf("false")!=-1)
889 document.getElementById('fetched'+column).value = ','+selectedperiod+',true';
891 else if (fetched.indexOf(','+selectedperiod+',')==-1)
894 document.getElementById('fetched'+column).value = ','+selectedperiod+''+fetched;
899 document.getElementById('loading'+column).innerHTML = "<img width=10 src=/plekit/icons/ajax-loader.gif>";
900 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+t+"&data_type="+data_type+"&data_source="+data_source;
901 load_data(column, header, url, data_source, data_type, t);
907 function addColumn(column, fetch) {
909 var selectedperiod="";
914 if (inTypeC(column)!=-1)
916 column = column.substring(0,column.length-1);
919 selectedperiod = document.getElementById('period'+column).value;
920 header = column+""+selectedperiod;
922 if (inTypeD(column)!=-1)
924 conf = header+":"+document.getElementById('reference_node').value;
925 document.getElementById('selected_reference_node').value=document.getElementById('reference_node').value;
930 //debugfilter("adding column "+column+" and header "+header+" and conf = "+conf);
932 addColumnCells(header);
935 addColumnAjax(column, header);
937 addColumnToConfiguration(conf);
941 function deleteColumnCells(header) {
943 var cells = document.getElementsByName(header);
944 for(var j = 0; j < cells.length; j++)
945 cells[j].style.display = "none";
950 function deleteColumn(column) {
952 var selectedperiod="";
955 selectedperiod = document.getElementById('period'+column).value;
956 header = column+""+selectedperiod;
958 //debugfilter("deleting "+column+","+header);
960 deleteColumnCells(header);
962 deleteColumnFromConfiguration(header);
971 function removeSelectHandler(object)
974 object.onclick = null;
977 //to be used for scrolling the column list with down/up arrows
979 function scrollList() {
980 debugfilter("here "+document.getElementById('scrolldiv').focused);
981 if (event.keyCode == 40)
983 else if (event.keyCode == 38)
987 function resetColumns() {
989 for (var kk in column_table) {
991 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
993 else if (column_table[kk]['visible'] == false && column_table[kk]['fetch'] == true)
999 function resetCols(which_conf) {
1001 var target_configuration = "|"+document.getElementById(which_conf).value+"|";
1003 //debugfilter("<p>Target configuration = "+target_configuration);
1005 for (var kk in column_table) {
1006 //debugfilter("in "+kk+" ");
1008 if (target_configuration.indexOf("|"+kk+"|")>=0)
1010 if (document.getElementById('check'+kk))
1011 if (document.getElementById('check'+kk).checked == false)
1013 debugfilter("<p>Adding "+kk);
1014 addColumn(kk, true);
1019 if (document.getElementById('check'+kk))
1020 if (document.getElementById('check'+kk).checked == true)
1022 debugfilter("<p>Deleting "+kk);
1029 function filterByType(selectedtype) {
1031 var notselectedyet = true;
1033 for (var kk in column_headers) {
1035 if (document.getElementById(kk))
1037 if (window['type'+kk] == selectedtype)
1039 document.getElementById(kk).className = 'in';
1041 highlightOption(kk);
1042 notselectedyet = false;
1045 document.getElementById(kk).className = 'out';
1051 function deleteColumnSample() {
1052 var cellsheader = document.getElementsByName("confheader"+column);
1053 for(var j = 0; j < cellsheader.length; j++)
1054 cellsheader[j].style.display = "none";
1058 function checkDataToFetch() {
1060 var dataExist = false;
1062 for (var kk in column_table) {
1064 if (document.getElementById(kk))
1066 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
1068 document.getElementById('fetchbutton').disabled = false;
1069 document.getElementById('fetchbutton').style.color = 'red';
1077 document.getElementById('fetchbutton').disabled = true;
1078 document.getElementById('fetchbutton').style.color = 'grey';
1084 function fetchData() {
1089 for (var kk in column_table) {
1091 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
1094 tagnames = column_table[kk]['tagname'];
1099 tagnames += "|"+column_table[kk]['tagname'];
1104 //debugfilter("fetching these columns: "+tagnames+ "("+headers+")");
1106 var slice_id = document.getElementById('slice_id').value;
1107 document.getElementById('loadingDiv').innerHTML = " <img src=/plekit/icons/ajax-loader.gif> Loading data. Please wait ...";
1108 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+tagnames;
1109 load_data(headers, url);
1120 function updateColumnThreshold(column, minT, maxT) {
1122 debugfilter("updating threshold for "+column+" with "+minT+" and "+maxT);
1124 var cells = document.getElementsByName(column);
1126 for(var j = 0; j < cells.length; j++)
1128 var val = parseFloat(cells[j].innerHTML);
1130 if (val >= minT && val <= maxT)
1131 cells[j].style.color = filtered_color;
1133 cells[j].style.color = normal_color;
1136 var old_configuration = document.getElementById('column_configuration').value;
1137 var slice_id = document.getElementById('slice_id').value;
1139 var old_columns = old_configuration.split("|");
1140 var new_columns = new Array();
1142 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
1143 var conf = old_columns[column_index].split(':');
1144 if (conf[0] != column)
1145 new_columns.push(old_columns[column_index]);
1147 new_columns.push(column+":"+minT+","+maxT);
1150 var new_configuration = new_columns.join("|");
1152 updateColumnConfiguration(slice_id, new_configuration);
1156 function updateExcludeList(column, excludeList) {
1158 //debugfilter("updating list");
1159 debugfilter("updating list for "+column+" with "+excludeList);
1161 var cells = document.getElementsByName(column);
1163 for(var j = 1; j < cells.length; j++)
1165 var val = cells[j].innerHTML;
1167 if (excludeList == val)
1168 cells[j].style.color = filtered_color;
1170 cells[j].style.color = normal_color;
1173 var old_configuration = document.getElementById('column_configuration').value;
1174 var slice_id = document.getElementById('slice_id').value;
1176 var old_columns = old_configuration.split("|");
1177 var new_columns = new Array();
1179 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
1180 var conf = old_columns[column_index].split(':');
1181 if (conf[0] != column)
1182 new_columns.push(old_columns[column_index]);
1184 new_columns.push(column+":"+excludeList);
1187 var new_configuration = new_columns.join("|");
1189 updateColumnConfiguration(slice_id, new_configuration);
1200 function plekit_table_showAll (slicetable_id) {
1202 var table=$(slicetable_id);
1203 var css='#'+slicetable_id+'>tbody';
1204 var rows = $$(css)[0].rows;
1206 // scan rows, elaborate 'visible'
1207 for (var row_index = 0; row_index < rows.length ; row_index++) {
1208 var tr=rows[row_index];
1210 plekit_table_row_visible(tr,visible);
1213 plekit_table_count_filtered(slicetable_id);
1215 tablePaginater.init(slicetable_id);
1219 function plekit_table_count_filtered (slicetable_id) {
1220 var table=$(slicetable_id);
1221 var css='#'+slicetable_id+'>tbody';
1222 var rows = $$(css)[0].rows;
1226 // scan rows, elaborate 'visible'
1227 for (var row_index = 0; row_index < rows.length ; row_index++) {
1228 var tr=rows[row_index];
1229 var filtered = false;
1231 for (var column_index=0; column_index < tr.cells.length; column_index++)
1232 if (tr.cells[column_index].style.color == "red")
1240 debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
1244 function plekit_table_hide_filtered (slicetable_id) {
1245 var table=$(slicetable_id);
1246 var css='#'+slicetable_id+'>tbody';
1247 var rows = $$(css)[0].rows;
1249 var reg = /(^|\s)invisibleRow(\s|$)/;
1252 if (!document.getElementById('filtercheck').checked)
1254 plekit_table_showAll(slicetable_id);
1260 // scan rows, elaborate 'visible'
1261 for (var row_index = 0; row_index < rows.length ; row_index++) {
1262 var tr=rows[row_index];
1265 for (var column_index=0; column_index < tr.cells.length; column_index++) {
1266 if (tr.cells[column_index].style.color == filtered_color)
1272 plekit_table_row_visible(tr,visible);
1275 //debugfilter('hidden '+hidden+' nodes');
1276 debugfilter(hidden+' nodes do not satisfy the requested threshold (hidden)');
1278 tablePaginater.init(slicetable_id);
1284 function plekit_table_apply_config(slicetable_id, configuration) {
1286 var new_configuration = document.getElementById('new_conf').value;
1287 var all_columns = new_configuration.split("|");
1289 var min_values = new Array();
1290 var max_values = new Array();
1293 for (var column_index = 0; column_index < all_columns.length ; column_index++) {
1295 var conf = all_columns[column_index].split(':');
1297 if (inTypeB(conf[0]) != -1)
1299 var threshold = conf[1].split(',');
1300 if (threshold.length == 2)
1302 min_values.push(parseFloat(threshold[0]));
1303 max_values.push(parseFloat(threshold[1]));
1306 else if (inTypeC(conf[0]) == -1)
1308 var threshold = conf[2].split(',');
1309 if (threshold.length == 2)
1311 min_values.push(parseInt(threshold[0]));
1312 max_values.push(parseInt(threshold[1]));
1317 min_values.push(-1);
1318 max_values.push(-1);
1323 var table=$(slicetable_id);
1324 var css='#'+slicetable_id+'>tbody';
1325 var rows = $$(css)[0].rows;
1330 for (var row_index = 0; row_index < rows.length ; row_index++) {
1332 var tr=rows[row_index];
1334 var filtered = false;
1336 for (var column_index = 0; column_index < all_columns.length ; column_index++)
1337 if (min_values[column_index]!=-1)
1339 var val = parseFloat(tr.cells[3+column_index].innerHTML);
1341 if (val >= min_values[column_index] && val <= max_values[column_index])
1343 tr.cells[3+column_index].style.color = filtered_color;
1347 tr.cells[3+column_index].style.color = normal_color;
1350 if (tr.cells[3+column_index].style.color == filtered_color)
1358 debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
1360 //tablePaginater.init(slicetable_id);
1365 function reset_select () {
1366 var table=$(slicetable_id);
1367 var css='#'+slicetable_id+'>tbody';
1368 var rows = $$(css)[0].rows;
1370 var action = document.getElementById('onlyselected');
1371 action.checked=false;
1373 // scan rows, elaborate 'visible'
1374 for (var row_index = 0; row_index < rows.length ; row_index++) {
1375 var tr=rows[row_index];
1377 document.getElementById("check"+tr.id).checked=false;
1381 plekit_table_count_nodes();
1387 function plekit_table_select_filter () {
1388 var table=$(slicetable_id);
1389 var css='#'+slicetable_id+'>tbody';
1390 var rows = $$(css)[0].rows;
1392 var reg = /(^|\s)invisibleRow(\s|$)/;
1394 var action = document.getElementById('onlyselected');
1395 if (!action.checked)
1396 plekit_table_reset_filter();
1398 // scan rows, elaborate 'visible'
1399 for (var row_index = 0; row_index < rows.length ; row_index++) {
1400 var tr=rows[row_index];
1405 if(tr.className.search(reg) == -1)
1406 if(!document.getElementById("check"+tr.id).checked)
1410 if(tr.className.search(reg) != -1)
1413 plekit_table_row_visible(tr,visible);
1416 tablePaginater.init(slicetable_id);
1417 plekit_table_count_nodes();
1420 function plekit_table_select_filter2 () {
1421 var table=$(slicetable_id);
1422 var css='#'+slicetable_id+'>tbody';
1423 var rows = $$(css)[0].rows;
1425 var reg = /(^|\s)invisibleRow(\s|$)/;
1427 var action = document.getElementById('onlyselected');
1429 // scan rows, elaborate 'visible'
1430 for (var row_index = 0; row_index < rows.length ; row_index++) {
1431 var tr=rows[row_index];
1436 if(tr.className.search(reg) == -1)
1437 if(!document.getElementById("check"+tr.id).checked)
1441 if(tr.className.search(reg) != -1)
1444 plekit_table_row_visible(tr,visible);
1447 tablePaginater.init(slicetable_id);
1448 plekit_table_count_nodes();
1451 function CheckTopNodes(n) {
1452 var table=$(slicetable_id);
1453 var css='#'+slicetable_id+'>tbody';
1454 var rows = $$(css)[0].rows;
1455 var reg = /(^|\s)invisibleRow(\s|$)/;
1459 for (var row_index = 0; row_index < rows.length ; row_index++) {
1460 var tr=rows[row_index];
1462 if(tr.className.search(reg) == -1) {
1465 document.getElementById("check"+tr.id).checked=true;
1470 document.getElementById("check"+tr.id).checked=false;
1477 function CheckRandomNodes(n) {
1478 var table=$(slicetable_id);
1479 var css='#'+slicetable_id+'>tbody';
1480 var rows = $$(css)[0].rows;
1481 var reg = /(^|\s)invisibleRow(\s|$)/;
1483 var r = n/plekit_table_visible_count();
1486 for (var row_index = 0; row_index < rows.length ; row_index++) {
1487 var tr=rows[row_index];
1489 if(tr.className.search(reg) == -1) {
1490 if(Math.random() < r) {
1491 document.getElementById("check"+tr.id).checked=true;
1501 function plekit_table_visible_count() {
1502 var table=$(slicetable_id);
1503 var css='#'+slicetable_id+'>tbody';
1504 var rows = $$(css)[0].rows;
1505 var reg = /(^|\s)invisibleRow(\s|$)/;
1508 for (var row_index = 0; row_index < rows.length ; row_index++) {
1509 var tr=rows[row_index];
1511 if(tr.className.search(reg) == -1)
1521 function plekit_table_count_nodes() {
1522 var table=$(slicetable_id);
1523 var css='#'+slicetable_id+'>tbody';
1524 var rows = $$(css)[0].rows;
1525 var reg = /(^|\s)invisibleRow(\s|$)/;
1530 for (var row_index = 0; row_index < rows.length ; row_index++) {
1531 var tr=rows[row_index];
1534 var ch = document.getElementById("check"+tr.id);
1536 if(tr.className.search(reg) == -1)
1549 var dd = document.getElementById('node_statistics');
1550 dd.innerHTML = "Total: "+n+" - Shown: "+v+" - Selected: "+s;
1553 function AutoSelect()
1555 var a = document.getElementById('automatic').value;
1556 var n = parseInt(document.getElementById('no_nodes').value);
1562 CheckRandomNodes(n);
1563 else if (a == "top")
1566 plekit_table_select_filter2();
1567 plekit_table_count_nodes();