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 class="source-url" target="source_window" href="http://comon.cs.princeton.edu/">CoMon</a>';
10 var sourceTophat = '<a class="source-url" target="source_window" href="http://www.top-hat.info/">TopHat</a>';
11 var sourceTophatAPI = '<a class="source-url" target="source_window" href="http://www.top-hat.info/API/">TopHat API</a>';
12 var sourceMySlice = '<a class="source-url" target="source_window" href="http://myslice.info/">MySlice</a>';
13 var sourceCymru = '<a class="source-url" target="source_window" href="http://www.team-cymru.org/">Team Cymru</a>';
14 var sourceSonoma = '<a class="source-url" target="source_window" href="http://sonoma.etomic.org/">SONoMA</a>';
15 var sourceMyPLC = '<a class="source-url" target="source_window" href="https://www.planet-lab.eu/db/doc/PLCAPI.php">MyPLC API</a>';
16 var sourceManiacs = '<a class="source-url" target="source_window" href="http://www.ece.gatech.edu/research/labs/MANIACS/as_taxonomy/">MANIACS</a>';
17 var sourceMaxmind = '<a class="source-url" target="source_window" href="http://www.maxmind.com/app/geolitecity">MaxMind</a>';
18 var sourceMonitor = '<a class="source-url" target="source_window" href="http://monitor.planet-lab.org/">Monitor</a>';
19 var hardwareReqs = 'current <a class="info-url" target="info_window" href="http://www.planet-lab.org/hardware">PlanetLab hardware requirement</a>';
20 var selectReferenceNode ='<div id="refnodes_div"></div>';
21 var selectReferenceNodeRTT ='<div id="refnodes_rtt_div"></div>';
23 var descHOSTNAME = "test";
25 var titleAU = 'Authority';
26 var detailAU = 'The authority of the global PlanetLab federation that the site of the node belongs to.';
27 var valuesAU = '<span class="bold">PLC</span> (PlanetLab Central), <span class="bold">PLE</span> (PlanetLab Europe)';
28 var sourceAU = 'Source: '+sourceMyPLC;
29 var descAU = '<span class="gray"><span class="column-title">'+titleAU+'</span><p><span class="column-detail">'+detailAU+'</span></p><p>Values: '+valuesAU+'</p><p>Source: '+sourceMyPLC+'</p></span>';
31 var titleST = 'Status';
32 var sourceST = 'Source: '+sourceMonitor;
33 var valuesST = 'Values: <span class="bold">online</span> (up and running), <span class="bold">good</span> (up and running recently), <span class="bold">offline</span> (unreachable today), <span class="bold">down</span> (node unreachable for more than one day), <span class="bold">failboot</span> (reachable, but only by administrators for debugging purposes).';
34 var descST = '<span class="gray"><span class="column-title">'+titleST+'</span><p>'+valuesST+'</p><p>'+sourceST+'</p></span>';
36 var titleA = 'Architecture name';
37 var detailA = 'The node architecture.';
38 var sourceA = 'Source: '+sourceMyPLC;
39 var valuesA = '<span class="bold">x86_64</span>, <span class="bold">i386</span>, <span class="bold">n/a</span>';
40 var descA = '<span class="gray"><span class="column-title">'+titleA+'</span><p><span class="column-detail">'+detailA+'</span></p><p>Values: '+valuesA+'</p><p>'+sourceA+'</p></span>';
42 var titleAS = 'Autonomous system ID';
43 var sourceAS = 'Source: '+sourceCymru+' (via '+sourceTophat+')';
44 var valuesAS = 'Values: <span class="bold">Integer between 0 and 65535</span>, <span class="bold">n/a</span>';
45 var descAS = '<span class="gray"><span class="column-title">'+titleAS+'</span><p>'+valuesAS+'</p><p>' + sourceAS+'</p></span>';
47 var titleAST = 'Autonomous system type';
48 var sourceAST = 'Source: '+sourceManiacs;
49 var valuesAST = 'Values: <span class="bold">t1</span> (tier-1), <span class="bold">t2</span> (tier-2), <span class="bold">edu</span> (university), <span class="bold">comp</span> (company), <span class="bold">nic</span> (network information centre -- old name for a domain name registry operator), <span class="bold">ix</span> (IXP), <span class="bold">n/a</span>';
50 var descAST = '<span class="gray"><span class="column-title">'+titleAST+'</span><p>'+valuesAST+'</p><p>'+sourceAST+'</p></span>';
52 var titleASN = 'Autonomous system name';
53 var sourceASN = 'Source: '+sourceTophat;
54 var descASN = '<span class="gray"><span class="column-title">'+titleASN+'</span><p>'+sourceASN+'</p></span>';
56 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>';
57 var titleBU = 'Bandwidth utilization ';
58 var sourceBU = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
59 var valuesBU ='Unit: <span class="bold">Kbps</span>';
60 var detailBU = 'The average transmited bandwidh over the selected period. The period is the most recent for which data is available, with CoMon data being collected by MySlice daily.'
61 var descBU = '<span class="gray"><span class="column-title">'+titleBU+'</span><p><span class="column-detail">'+detailBU+'</span></p><p>'+selectPeriodBU+'</p><p>'+valuesBU+'</p><p>'+sourceBU+'</p></span>';
63 var titleBW= 'Bandwidth limit';
64 var sourceBW = 'Source: '+sourceComon;
65 var valuesBW = 'Unit: <span class="bold">Kbps</span>';
66 var detailBW = 'The bandwidth limit is a cap on the total outbound bandwidth usage of a node. It is set by the site administrator (PI). For more details see <a targe="source_window" href="http://www.planet-lab.org/doc/BandwidthLimits">Bandwidth Limits (planet-lab.org)</a>.';
67 var descBW = '<span class="gray"><span class="column-title">'+titleBW+'</span><p><span class="column-detail">'+detailBW+'</span></p><p>'+valuesBW+'</p><p>'+sourceBW+'</p></span>';
69 var titleCC = 'Number of CPU cores';
70 var sourceCC = 'Source: '+sourceComon;
71 var detailCC = 'The number of CPU cores on the node. For reference, the '+hardwareReqs+' is <span class="bold">4 cores min.</span> (Older nodes may have fewer cores).';
72 var descCC = '<span class="gray"><span class="column-title">'+titleCC+'</span><p><span class="column-detail">'+detailCC+'</span></p><p>'+sourceCC+'</p></span>';
74 var titleCN = 'Number of CPUs';
75 var sourceCN = 'Source: '+sourceComon;
76 var detailCN = 'The number of CPUs on the node. For reference, the '+hardwareReqs+' is <span class="bold">1 (if quad core) or 2 (if dual core)</span>.';
77 var descCN = '<span class="gray"><span class="column-title">'+titleCN+'</span><p><span class="column-detail">'+detailCN+'</detail></p><p>'+sourceCN+'</p></span>';
79 var titleCPC = 'Number of cores per CPU';
80 var sourceCPC = 'Source: '+sourceComon;
81 var detailCPC = 'The number of cores per CPU on the node.';
82 var descCPC = '<span class="gray"><span class="column-title">'+titleCPC+'</span><p><span class="column-detail">'+detailCPC+'</span></p><p>'+sourceCPC+'</p></span>';
84 var titleCR = 'CPU clock rate';
85 var detailCR = 'The clock rate for the CPUs on the node. For reference, the '+hardwareReqs+' is <span class="bold">2.4 GHz</span>.';
86 var sourceCR = 'Source: '+sourceComon;
87 var valuesCR = 'Unit: <span class="bold">GHz</span>';
88 var descCR = '<span class="gray"><span class="column-title">'+titleCR+'</span><p><span class="column-detail">'+detailCR+'</span></p><p>'+valuesCR+'</p><p>'+sourceCR+'</p></span>';
90 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>';
91 var titleCF = 'Free CPU';
92 var sourceCF = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
93 var valuesCF = 'Unit: <span class="bold">%</span>';
94 var detailCF = 'The average CPU percentage that gets allocated to a test slice named burb that is periodically run by CoMon.';
95 var descCF = '<span class="gray"><span class="column-title">'+titleCF+'</span><p><span class="column-detail">'+detailCF+'</span></p><p>'+selectPeriodCF+'</p><p>'+valuesCF+'</p><p>'+sourceCF+'</p></span>';
97 var titleDN = 'Toplevel domain name';
98 var sourceDN = 'Source: '+sourceMyPLC;
99 var descDN = '<span class="gray"><span class="column-title">'+titleDN+'</span><p>'+sourceDN+'</p></span>';
101 var titleDA = 'Date added';
102 var sourceDA = 'Source: '+sourceMyPLC;
103 var detailDA = 'The date that the node was added to PlanetLab.';
104 var descDA = '<span class="gray"><span class="column-title">'+titleDA+'</span><p><span class="column-detail">'+detailDA+'</span></p><p>'+sourceDA+'</p></span>';
106 var titleDL = 'Deployment';
107 var detailDL = 'The deployment status.';
108 var valuesDL = 'Values: <span class="bold">alpha</span>, <span class="bold">beta</span>, <span class="bold">production</span>, <span class="bold">n/a</span>';
109 var sourceDL = 'Source: '+sourceMyPLC;
110 var descDL = '<span class="gray"><span class="column-title">'+titleDL+'</span><p><span class="column-detail">'+detailDL+'</span></p><p>'+valuesDL+'</p><p>'+sourceDL+'</p></span>';
112 var titleDS = 'Disk size';
113 var detailDS = 'The size of the hard disk available on the node. For reference, the '+hardwareReqs+' is <span class="bold">500 GB</span>.';
114 var sourceDS = 'Source: '+sourceComon;
115 var valuesDS = 'Unit: <span class="bold">GB</span>';
116 var descDS = '<span class="gray"><span class="column-title">'+titleDS+'</span><p><span class="column-detail">'+detailDS+'</span></p><p>'+valuesDS+'</p><p>'+sourceDS+'</p></span>';
118 var titleDU = 'Current disk utilization';
119 var sourceDU = 'Source: '+sourceComon;
120 var valuesDU = 'Unit: <span class="bold">GB</span>';
121 var detailDU = 'The amount of disk space currently consumed.';
122 var descDU = '<span class="gray"><span class="column-title">'+titleDU+'</span><p><span class="column-detail">'+detailDU+'</span></p><p>'+valuesDU+'</p><p>'+sourceDU+'</p></span>';
124 var titleDF = 'Disk space free';
125 var sourceDF = 'Source: '+sourceComon;
126 var valuesDF = 'Unit: <span class="bold">GB</span>.';
127 var detailDF = 'The amount of disk space currently available.';
128 var descDF = '<span class="gray"><span class="column-title">'+titleDF+'</span><p><span class="column-detail">'+detailDF+'</span></p><p>'+valuesDF+'</p><p>'+sourceDF+'</p></span>';
130 var titleHC = 'Hop count (pairwise)';
131 var sourceHC = 'Source: '+sourceTophat;
132 var detailHC = 'TopHat conducts traceroutes every five minutes in a full mesh between all PlanetLab nodes. The hop count is the length of the traceroute from the node to the reference node, based upon the most recently reported traceroute.';
133 var descHC = '<span class="gray"><span class="column-title">'+titleHC+'</span><p><span class="column-detail">'+detailHC+'</span></p><p>'+selectReferenceNode+'</p><p>'+sourceHC+'</p></span>';
135 var titleIP = 'IP address';
136 var sourceIP = 'Source: '+sourceMyPLC;
137 var descIP = '<span class="gray"><span class="column-title">'+titleIP+'</span><p>'+sourceIP+'</p></span>';
139 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>';
141 var sourceL = 'Source: '+sourceComon;
142 var valuesL = 'Unit: <span class="bold">5-minute load</span>';
143 var detailL = 'The average 5-minute load (as reported by the Unix uptime command) over the selected period.';
144 var descL = '<span class="gray"><span class="column-title">'+titleL+'</span><p><span class="column-detail">'+detailL+'</span></p><p>'+selectPeriodL+'</p><p>'+valuesL+'</p><p>'+sourceL+'</p></span>';
146 var titleLON= 'Longitude';
147 var sourceLON = 'Source: '+sourceTophat;
148 var descLON = '<span class="gray"><span class="column-title">'+titleLON+'</span><p>'+sourceLON+'</p></span>';
150 var titleLAT= 'Latitude';
151 var sourceLAT = 'Source: '+sourceTophat;
152 var descLAT = '<span class="gray"><span class="column-title">'+titleLAT+'</span><p>'+sourceLAT+'</p></span>';
154 var titleLCN= 'Location (Country)';
155 var sourceLCN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
156 var detailLCN = 'Based on the latitude and longitude information.';
157 var descLCN = '<span class="gray"><span class="column-title">'+titleLCN+'</span><p><span class="column-detail">'+detailLCN+'</span></p><p>'+sourceLCN+'</p></span>';
159 var titleLCT= 'Location (Continent)';
160 var sourceLCT = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
161 var detailLCT = 'Based on the latitude and longitude information.';
162 var descLCT = '<span class="gray"><span class="column-title">'+titleLCT+'</span><p><span class="column-detail">'+detailLCT+'</span></p><p>'+sourceLCT+'</p></span>';
164 var titleLCY= 'Location (City)';
165 var sourceLCY = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
166 var detailLCY = 'Based on the latitude and longitude information.';
167 var descLCY = '<span class="gray"><span class="column-title">'+titleLCY+'</span><p><span class="column-detail">'+detailLCY+'</span></p><p>'+sourceLCY+'</p></span>';
169 var titleLPR= 'Location precision radius';
170 var sourceLPR = 'Source: '+sourceTophat;
171 var valuesLPR = 'Unit: <span class="bold">float</span>.';
172 var detailLPR = 'The radius of the circle corresponding to the error in precision of the geolocalization estimate.';
173 var descLPR = '<span class="gray"><span class="column-title">'+titleLPR+'</span><p><span class="column-detail">'+detailLPR+'</span></p><p>'+valuesLPR+'</p><p>'+sourceLPR+'</p></span>';
175 var titleLRN= 'Location (Region)';
176 var sourceLRN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
177 var detailLRN = 'Based on the latitude and longitude information.';
178 var descLRN = '<span class="gray"><span class="column-title">'+titleLRN+'</span><p><span class="column-detail">'+detailLRN+'</span></p><p>'+sourceLRN+'</p></span>';
180 var titleMS= 'Memory size';
181 var detailMS = 'The memory size (RAM) available on the node. For reference, the '+hardwareReqs+' is <span class="bold">4 GB</span>.';
182 var sourceMS = 'Source: '+sourceComon;
183 var valuesMS = 'Unit: <span class="bold">GB</span>.';
184 var descMS = '<span class="gray"><span class="column-title">'+titleMS+'</span><p><span class="column-detail">'+detailMS+'</span></p><p>'+valuesMS+'</p><p>'+sourceMS+'</p></span>';
186 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>';
187 var titleMU = 'Memory utilization';
188 var sourceMU = 'Source: '+sourceComon;
189 var valuesMU = 'Unit: <span class="bold">%</span>';
190 var detailMU = 'The average active memory utilization as reported by CoMon.';
191 var descMU = '<span class="gray"><span class="column-title">'+titleMU+'</span><p><span class="column-detail">'+detailMU+'</span></p><p>'+selectPeriodMU+'</p><p>'+valuesMU+'</p><p>'+sourceMU+'</p></span>';
193 var titleMA= 'Measurement agents';
194 var sourceMA = 'Source: '+sourceTophat;
195 var valuesMA = 'Values: <span class="bold">ETOMIC</span>, <span class="bold">SONoMA</span>, <span class="bold">TDMI</span>, <span class="bold">DIMES</span>.';
196 var detailMA = 'Co-located measurement agents.';
197 var descMA = '<span class="gray"><span class="column-title">'+titleMA+'</span><p><span class="column-detail">'+detailMA+'</span></p><p>'+valuesMA+'</p><p>'+sourceMA+'</p></span>';
199 var titleMAS= 'Measurement agent SONoMA';
200 var sourceMAS = 'Source: '+sourceTophat;
201 var valuesMAS = 'Values: <span class="bold">Node type</span> (e.g., PLE, APE)';
202 var detailMAS = '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+'.';
203 var descMAS = '<span class="gray"><span class="column-title">'+titleMAS+'</span><p><span class="column-detail">'+detailMAS+'</span></p><p>'+valuesMAS+'</p><p>'+sourceMAS+'</p></span>';
205 var titleMAE= 'Measurement agent ETOMIC';
206 var sourceMAE = 'Source: '+sourceTophat;
207 var valuesMAE = 'Values: <span class="bold">yes/no</span>';
208 var detailMAE = '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+'.';
209 var descMAE = '<span class="gray"><span class="column-title">'+titleMAE+'</span><p><span class="column-detail">'+detailMAE+'</span></p><p>'+valuesMAE+'</p><p>'+sourceMAE+'</p></span>';
211 var titleMAT= 'Measurement agent TDMI';
212 var sourceMAT = 'Source: '+sourceTophat;
213 var valuesMAT = 'Values: <span class="bold">yes/no</span>';
214 var detailMAT = '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+'.';
215 var descMAT = '<span class="gray"><span class="column-title">'+titleMAT+'</span><p><span class="column-detail">'+detailMAT+'</span></p><p>'+valuesMAT+'</p><p>'+sourceMAT+'</p></span>';
217 var titleMAD= 'Measurement agent DIMES';
218 var sourceMAD = 'Source: '+sourceTophat;
219 var valuesMAD = 'Values: <span class="bold">yes/no</span>';
220 var detailMAD = 'The existence of a colocated DIMES agent. When a DIMES agent is present, you have access to DIMES measurements through the '+sourceTophatAPI+'.';
221 var descMAD = '<span class="gray"><span class="column-title">'+titleMAD+'</span><p><span class="column-detail">'+detailMAD+'</span></p><p>'+valuesMAD+'</p><p>'+sourceMAD+'</p></span>';
223 var titleNSF= 'Network information (spoof)';
224 var sourceNSF = 'Source: '+sourceTophat;
225 var valuesNSF = 'Values: <span class="bold">yes/no</span>';
226 var detailNSF = 'Whether the node can send packets successfully (or not) with a spoofed IP source address.';
227 var descNSF = '<span class="gray"><span class="column-title">'+titleNSF+'</span><p><span class="column-detail">'+detailNSF+'</span></p><p>'+valuesNSF+'</p><p>'+sourceNSF+'</p></span>';
229 var titleNSR= 'Network information (source route)';
230 var sourceNSR = 'Source: '+sourceTophat;
231 var valuesNSR = 'Values: <span class="bold">yes/no</span>';
232 var detailNSR = '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.';
233 var descNSR = '<span class="gray"><span class="column-title">'+titleNSR+'</span><p><span class="column-detail">'+detailNSR+'</span></p><p>'+valuesNSR+'</p><p>'+sourceNSR+'</p></span>';
235 var titleNTP= 'Network information (timestamp)';
236 var sourceNTP = 'Source: '+sourceTophat;
237 var valuesNTP = 'Values: <span class="bold">yes/no</span>';
238 var detailNTP = '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.';
239 var descNTP = '<span class="gray"><span class="column-title">'+titleNTP+'</span><p><span class="column-detail">'+detailNTP+'</span></p><p>'+valuesNTP+'</p><p>'+sourceNTP+'</p></span>';
241 var titleNRR= 'Network information (record route)';
242 var sourceNRR = 'Source: '+sourceTophat;
243 var valuesNRR = 'Values: <span class="bold">yes/no</span>';
244 var detailNRR = '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.';
245 var descNRR = '<span class="gray"><span class="column-title">'+titleNRR+'</span><p><span class="column-detail">'+detailNRR+'</span></p><p>'+valuesNRR+'</p><p>'+sourceNRR+'</p></span>';
247 var titleOS = 'Operating system';
248 var detailOS = 'Fedora or CentOS distribution to use for node or slivers.';
249 var sourceOS = 'Source: '+sourceMyPLC;
250 var valuesOS = 'Values: <span class="bold">f8, f12, Cent/OS, other, n/a</span>';
251 var descOS = '<span class="gray"><span class="column-title">'+titleOS+'</span><p><span class="column-detail">'+detailOS+'</span></p><p>'+valuesOS+'</p><p>'+sourceOS+'</p></span>';
253 var titleRTT = 'Round Trip Time (pairwise)';
254 var detailRTT = 'The round trip time between a selected SONoMA agent and PlanetLab nodes.';
255 var sourceRTT = 'Source: '+sourceSonoma+' (via '+sourceTophat+ ')';
256 var descRTT = '<span class="gray"><span class="column-title">'+titleRTT+'</span><p><span class="column-detail">'+detailRTT+'</span></p><p>'+selectReferenceNodeRTT+'</p><p>'+sourceRTT+'</p></span>';
258 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>';
259 var titleR = 'Reliability';
260 var sourceR = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
261 var detailR = 'CoMon queries nodes every 5 minutes, for 255 queries per day. The average reliability is the percentage of queries over the selected period for which CoMon reports a value. The period is the most recent for which data is available, with CoMon data being collected by MySlice daily.';
262 var valuesR = 'Unit: <span class="bold">%</span>';
263 var descR = '<span class="gray"><span class="column-title">'+titleR+'</span><p><span class="column-detail">'+detailR+'</span></p><p>'+selectPeriodR+'</p><p>'+valuesR+'</p><p>'+sourceR+'</p></span>';
265 var titleRES = 'Reservation capabilities';
266 var sourceRES = 'Source: '+sourceMyPLC;
267 //var valuesRES = 'Values: <span class="bold">yes/no</span>';
268 var valuesRES = 'Values: <span class="bold">-R-</span> (if yes)';
269 var detailRES = 'Whether the node can be reserved for a certain duration. Your slivers will be available <span class=bold>only during timeslots where you have obtained leases (see tab above)</span>. <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></p>';
270 var descRES = '<span class="gray"><span class="column-title">'+titleRES+'</span><p><span class="column-detail">'+detailRES+'</span></p><p>'+valuesRES+'</p><p>'+sourceRES+'</p></span>';
272 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>';
273 var titleS = 'Active slices';
274 var sourceS = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
275 var valuesS = 'Unit: <span class="bold">%</span>';
276 var detailS = 'Average number of active slices over the selected period for which CoMon reports a value. The period is the most recent for which data is available, with CoMon data being collected by MySlice daily.';
277 var descS = '<span class="gray"><span class="column-title">'+titleS+'</span><p><span class="column-detail">'+detailS+'</span></p><p>'+selectPeriodS+'</p><p>'+valuesS+'</p><p>'+sourceS+'</p></span>';
279 var titleSM= 'Slices in memory';
280 var detailSM = 'The total number of slices in memory (both active and inactive).';
281 var sourceSM = 'Source: '+sourceComon;
282 var descSM = '<span class="gray"><span class="column-title">'+titleSM+'</span><p><span class="column-detail">'+detailSM+'</span></p><p>'+sourceSM+'</p></span>';
284 var titleSN = 'Site name';
285 var sourceSN = 'Source: '+sourceMyPLC;
286 var descSN = '<span class="gray"><span class="column-title">'+titleSN+'</span><p>'+sourceSN+'</p></span>';
288 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>';
289 var titleSSH = 'Average SSH response delay';
290 var valuesSSH = 'Unit: <span class="bold">msecs</span>';
291 var detailSSH = '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.';
292 var sourceSSH ='Source: '+sourceComon+' (via '+sourceMySlice+')';
293 var descSSH = '<span class="gray"><span class="column-title">'+titleSSH+'</span><p><span class="column-detail">'+detailSSH+'</span></p><p>'+selectPeriodSSH+'</p><p>'+valuesSSH+'</p><p>'+sourceSSH+'</p></span>';
296 var titleUT = 'Uptime';
297 var sourceUT = 'Source: '+sourceComon;
298 var valuesUT = 'Unit: <span class="bold">days</span>';
299 var detailUT = 'The continuous uptime until the moment that the page is loaded, as reported by the CoMon html query API.';
300 var descUT = '<span class="gray"><span class="column-title">'+titleUT+'</span><p><span class="column-detail">'+detailUT+'</span></p><p>'+valuesUT+'</p><p>'+sourceUT+'</p></span>';
304 //Categorization of columns in different types, useful for filtering
306 function inTypeA(header_name) {
307 var typeA = ['ST','SN','RES','OS','NRR','NTP','NSR','NSF','NDS','NTH','NEC','LRN','LCY','LPR','LCN','LAT','LON','IP','ASN','AST'];
308 return typeA.indexOf(header_name);
311 function inTypeB(header_name) {
312 var typeB = ['BW','DS','MS','CC','CR','AS','MU','DU','CN'];
313 return typeB.indexOf(header_name);
316 function inTypeC(header_name) {
317 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'];
318 return typeC.indexOf(header_name);
321 function inTypeD(header_name) {
323 return typeD.indexOf(header_name);
328 function debugfilter(s) {
329 document.getElementById('debug').innerHTML+=s;
333 //Called when a column is selected. It displays the detailed description
336 function highlightOption(divid) {
338 var columns = document.getElementsByName('columnlist');
339 for(var j = 0; j < columns.length; j++)
340 columns[j].className = 'out';
342 document.getElementById(divid).className = 'selected';
344 showDescription(divid);
347 if (document.getElementById('selectperiod'+divid))
348 document.getElementById('selectperiod'+divid).value = document.getElementById('period'+divid).value;
353 //Displays the detailed column description
355 function showDescription(h) {
357 if (document.getElementById('selectdescr'))
359 //Checks if there is a detailed description defined
360 if (window['desc'+h])
361 document.getElementById('selectdescr').innerHTML = ""+window['desc'+h];
363 document.getElementById('selectdescr').innerHTML = "No detailed description provided";
366 if (document.getElementById('refnodes_div'))
367 document.getElementById('refnodes_div').innerHTML = ref_nodes_select;
369 if (document.getElementById('refnodes_rtt_div'))
370 document.getElementById('refnodes_rtt_div').innerHTML = ref_nodes_select_rtt;
374 //Overrides the titles of the columns as they are shown in the column selection panel.
375 //If no overriding variable exists the tag's description is used
376 function overrideTitles() {
378 var columns = document.getElementsByName('columnlist');
380 for(var j = 0; j < columns.length; j++)
382 var kk = columns[j].id;
383 if (window['title'+kk])
384 document.getElementById('htitle'+kk).innerHTML = window['title'+kk];
390 //When the checkbox is clicked. Adds/removes column respectively
391 function changeCheckStatus(column) {
393 var h = document.getElementById(column).value;
395 if (document.getElementById('selectdescr'))
398 //debugfilter("HERE: "+column+" - "+document.getElementById('type '+column).value);
399 //debugfilter("HERE: "+column);
402 if (document.getElementById(column).checked)
403 addColumn(h, true, document.getElementById('type'+h).value);
410 //This function is used when the alternative "quick" selection list is used
411 function changeSelectStatus(column) {
413 var optionClass = "";
414 var selected_index = document.getElementById('quicklist').selectedIndex;
416 if (document.getElementById('quicklist') && selected_index != 0)
419 optionClass = document.getElementById('quicklist').options[selected_index].className;
421 if (optionClass == "in")
423 deleteColumn(document.getElementById('quicklist').value);
424 document.getElementById('quicklist').options[selected_index].className = "out";
425 document.getElementById('quicklist').value="0";
429 addColumn(document.getElementById('quicklist').value, true);
430 document.getElementById('quicklist').options[selected_index].className = "in";
431 document.getElementById('quicklist').value="0";
436 function updateReferenceNode(select_id, new_ref_node) {
438 var old_ref_node = document.getElementById(select_id).value;
439 document.getElementById(select_id).value=new_ref_node;
441 //debugfilter("changed "+old_ref_node+" with "+new_ref_node+" and column is "+document.getElementById('checkHC').checked);
443 if (select_id == 'refnodeHC' && document.getElementById('checkHC').checked)
445 document.getElementById('fetchedHC').value = "false";
446 addColumnAjax('HC', 'HC');
447 //debugfilter("replacing "+old_ref_node+" with "+new_ref_node);
448 replaceColumnConfiguration('HC:'+old_ref_node,'HC:'+new_ref_node);
450 else if (select_id == 'refnodeRTT' && document.getElementById('checkRTT').checked)
452 document.getElementById('fetchedRTT').value = "false";
453 addColumnAjax('RTT', 'RTT');
454 //debugfilter("replacing "+old_ref_node+" with "+new_ref_node);
455 replaceColumnConfiguration('RTT:'+old_ref_node,'RTT:'+new_ref_node);
461 //When the period of an already selected column is changed
462 function updatePeriod(h, new_period) {
464 var old_period = document.getElementById('period'+h).value;
465 document.getElementById('period'+h).value=new_period;
467 //debugfilter(h+''+old_period+'-'+h+''+new_period);
468 if (document.getElementById('check'+h).checked)
470 deleteColumnCells(h+''+old_period);
471 addColumnCells(h+''+new_period);
472 addColumnAjax(h, h+''+new_period);
474 replaceColumnConfiguration(h+''+old_period,h+''+new_period);
480 RESET/SAVE CONFIGURATION
484 function getHTTPObject()
486 if (typeof XMLHttpRequest != 'undefined')
487 { return new XMLHttpRequest(); }
490 { return new ActiveXObject("Msxml2.XMLHTTP"); }
493 try { return new ActiveXObject("Microsoft.XMLHTTP"); }
499 function closeMessage(tab)
501 var current_conf = document.getElementById('show_configuration').value;
504 if (current_conf != "")
507 if (tab == 'reservable') {
508 document.getElementById('note_reservable_div').style.display = "none";
509 if (current_conf.indexOf('reservable') != -1)
511 value = current_conf+'reservable';
514 if (tab == 'columns') {
515 document.getElementById('note_columns_div').style.display = "none";
516 if (current_conf.indexOf('columns') != -1)
518 value = current_conf+'columns';
521 var slice_id = document.getElementById('slice_id').value;
522 var person_id = document.getElementById('person_id').value;
523 var tag_id = document.getElementById('show_tag_id').value;
525 var url = "/plekit/php/updateConfiguration.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_name=showconf&tag_id="+tag_id;
526 //debugfilter("updating conf with "+url);
527 document.getElementById('show_configuration').value = value;
529 var req = getHTTPObject();
530 req.open('GET', url, true);
531 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
532 req.onreadystatechange =
534 if (req.readyState == 4)
535 { debugfilter(req.responseText); }
542 function updateColumnConfiguration(value, reload)
544 var person_id = document.getElementById('person_id').value;
545 var slice_id = document.getElementById('slice_id').value;
546 var tag_id = document.getElementById('conf_tag_id').value;
547 var full_column_configuration = document.getElementById('full_column_configuration').value;
549 //debugfilter("<br>OLD = "+full_column_configuration);
550 //debugfilter("<br>value = "+value);
553 var old_columns = full_column_configuration.split(";");
554 var new_columns = new Array();
556 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
557 new_columns.push(old_columns[column_index]);
558 if (old_columns[column_index] != slice_id)
559 new_columns.push(old_columns[++column_index]);
563 new_columns.push(value);
565 new_columns.push("default");
571 var new_configuration = new_columns.join(";");
572 //debugfilter("<br>NEW = "+new_configuration);
574 if (window.XMLHttpRequest)
575 {// code for IE7+, Firefox, Chrome, Opera, Safari
576 xmlhttp=new XMLHttpRequest();
579 {// code for IE6, IE5
580 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
582 xmlhttp.onreadystatechange=function()
584 if (xmlhttp.readyState==4) // && xmlhttp.status==200)
586 //value=xmlhttp.responseText;
587 //debugfilter(value+"-----"+new_configuration);
588 document.getElementById('column_configuration').value=value;
589 document.getElementById('full_column_configuration').value=new_configuration;
592 window.location.reload(true);
596 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);
597 //xmlhttp.open("GET","/plekit/php/updateConf.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tagName=Columnconf",true);
602 function logSortingAction(person_id, slice_id, value)
606 var req = getHTTPObject();
607 var url = "/plekit/php/logSorting.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id;
609 req.open('GET', url, true);
610 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
611 req.onreadystatechange =
613 if (req.readyState == 4)
614 { debugfilter(req.responseText); }
619 function sortCompleteCallback(tableid) {
621 var slice_id = document.getElementById('slice_id').value;
622 var person_id = document.getElementById('person_id').value;
624 var ths = document.getElementById(tableid).getElementsByTagName("th");
625 for(var i = 0, th; th = ths[i]; i++) {
626 if (th.className.indexOf("Sort") != -1)
628 //debugfilter("sorted"+th.getAttribute("name"));
630 var column_name = th.getAttribute("name");
631 var hclass = th.className;
632 var column = hclass.substr(hclass.indexOf("column"),hclass.indexOf("column")+1);
633 var sortdirection = "forward";
634 if (hclass.indexOf("reverse")!=-1)
635 sortdirection = "reverse";
637 if (column.indexOf("column-1")==-1 && column.indexOf("column-0")==-1)
638 logSortingAction(person_id, slice_id, tableid+"|"+column_name+"|"+sortdirection);
644 function addColumnToConfiguration(column) {
646 var old_configuration = document.getElementById('column_configuration').value;
648 var new_configuration = "";
650 if (old_configuration != "")
651 new_configuration = old_configuration += "|"+column;
653 new_configuration = column;
655 //debugfilter("new configuration = "+new_configuration);
657 updateColumnConfiguration(new_configuration, false);
661 function deleteColumnFromConfiguration(column) {
663 var old_configuration = document.getElementById('column_configuration').value;
665 var old_columns = old_configuration.split("|");
666 var new_columns = new Array();
668 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
669 var conf = old_columns[column_index].split(':');
670 if (conf[0] != column)
671 new_columns.push(old_columns[column_index]);
674 var new_configuration = new_columns.join("|");
675 updateColumnConfiguration(new_configuration, false);
679 function replaceColumnConfiguration(column_old, column_new) {
681 var old_configuration = document.getElementById('column_configuration').value;
683 var old_columns = old_configuration.split("|");
684 var new_columns = new Array();
686 var olds = column_old.split(':');
688 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
689 var conf = old_columns[column_index].split(':');
690 if (conf[0] != olds[0])
691 new_columns.push(old_columns[column_index]);
693 new_columns.push(column_new);
696 var new_configuration = new_columns.join("|");
698 updateColumnConfiguration(new_configuration);
707 function convert_data(value, data_source, data_type, tagname) {
709 //debugfilter("v["+tagname+"]="+value+"-");
711 if (value == "" || value == "n/a" || value == null || value == "NaN" || value == "None")
714 if (tagname == "uptime") {
715 return parseInt((parseFloat(value) / 86400));
718 if (data_type == "date") {
720 var date = new Date(value*1000);
722 var year = date.getFullYear();
723 var month = date.getMonth()+1;
726 var day = date.getDate();
730 return year + '-' + month + '-' + day;
737 function load_data(column, header, url, data_source, data_type, tagname) {
739 //debugfilter("<br>loading "+url);
740 var req = getHTTPObject();
742 req.open('GET', url, true);
743 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
744 req.onreadystatechange =
746 if (req.readyState == 4)
747 { updateColumnData(column, header, req.responseText, data_source, data_type, tagname); }
753 function updateColumnData(column, header, data, data_source, data_type, tagname) {
755 var headers = header.split("|");
756 var data_table = data.split("|");
758 //debugfilter("<p>headers[0] = "+headers[0]);
759 //debugfilter("<p>data[2] = "+data_table[2]);
761 //debugfilter("data = "+data + " with type "+data_type + " and source "+data_source);
762 //debugfilter("<p>data table length = "+data_table.length);
764 if (data_table.length > 1)
769 var table_id1 = 'nodes';
770 var table=$(table_id1);
771 var css='#'+table_id1+'>tbody';
772 var rows = $$(css)[0].rows;
774 var data_array1 = new Array();
776 //debugfilter("COLUMN "+column+"<p>");
778 for (var node_index = 1; node_index < data_table.length; node_index++) {
779 if (data_table[node_index] == '---potential---')
781 node_data = data_table[node_index].split(':');
783 data_array1[node_data[0]] = new Array();
785 for (var h_index=0; h_index < headers.length; h_index++) {
787 if (node_data[h_index+1] == "" || node_data[h_index+1] == "None")
788 data_array1[node_data[0]][h_index] = "n/a";
790 data_array1[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
797 for (var row_index = 0; row_index < rows.length ; row_index++) {
798 var tr=rows[row_index];
800 for (var column_index=0; column_index < tr.cells.length; column_index++) {
801 //debugfilter("<p>node id = "+tr.cells[0].innerHTML+" - "+tr.cells[column_index].getAttribute('name'));
802 if (tr.cells[column_index].getAttribute('name'))
804 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
805 if (found_index != -1)
806 //debugfilter(tr.cells[0].innerHTML+"-"+found_index);
807 tr.cells[column_index].innerHTML = data_array1[tr.cells[0].innerHTML][found_index];
812 //debugfilter("Reset sorting .....");
813 //tablePaginater.init(table_id1);
814 fdTableSort.init(table_id1);
817 if (data_table[node_index] == '---potential---')
820 var table_id2 = 'add_nodes';
821 var table2=$(table_id2);
822 var css2='#'+table_id2+'>tbody';
823 var rows2 = $$(css2)[0].rows;
825 var data_array2 = new Array();
827 //debugfilter("COLUMN "+column+"<p>");
829 for (; node_index < data_table.length; node_index++) {
830 if (data_table[node_index] == '')
832 node_data = data_table[node_index].split(':');
834 data_array2[node_data[0]] = new Array();
836 for (var h_index=0; h_index < headers.length; h_index++) {
838 if (node_data[h_index+1] == "")
839 data_array2[node_data[0]][h_index] = "n/a";
841 data_array2[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
846 for (var row_index = 0; row_index < rows2.length ; row_index++) {
847 var tr=rows2[row_index];
849 for (var column_index=0; column_index < tr.cells.length; column_index++) {
850 if (tr.cells[column_index].getAttribute('name'))
852 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
853 if (found_index != -1)
854 tr.cells[column_index].innerHTML = data_array2[tr.cells[0].innerHTML][found_index];
858 fdTableSort.init(table_id2);
859 //tablePaginater.init(table_id2);
863 //fdTableSort.removeTableCache(table_id2);
864 //document.getElementById('loading'+column).innerHTML = "";
869 document.getElementById('loading'+column).innerHTML = "";
874 function addColumnCells(header) {
876 var cells = document.getElementsByName(header);
878 //debugfilter("got cells -"+cells+"- for "+header);
879 for(var j = 0; j < cells.length; j++)
880 cells[j].style.display = "table-cell";
883 function addSampleCells(column) {
885 var cellsheader = document.getElementsByName("confheader"+column);
886 for(var j = 0; j < cellsheader.length; j++)
887 cellsheader[j].style.display = "table-cell";
891 function addColumnAjax(column, header) {
893 //var t = document.getElementById('check'+column).name;
894 var t = document.getElementById('tagname'+header).value;
895 var slice_id = document.getElementById('slice_id').value;
897 var selectedperiod = document.getElementById('period'+column).value;
898 var fetched = document.getElementById('fetched'+column).value;
899 var data_source = document.getElementById('source'+column).value;
900 var data_type = document.getElementById('type'+column).value;
903 //debugfilter("<br>adding "+column+","+header+','+fetched+','+t+','+data_source+','+data_type);
905 if (fetched.indexOf("false")!=-1)
908 document.getElementById('fetched'+column).value = ','+selectedperiod+',true';
910 else if (fetched.indexOf(','+selectedperiod+',')==-1)
913 document.getElementById('fetched'+column).value = ','+selectedperiod+''+fetched;
918 //debugfilter("ready to load ... ");
919 document.getElementById('loading'+column).innerHTML = "<img width=10 src=/plekit/icons/ajax-loader.gif>";
920 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+t+"&data_type="+data_type+"&data_source="+data_source;
922 url = url+"&ref_node="+document.getElementById('selected_reference_node').value;
923 //debugfilter("calling "+url);
924 load_data(column, header, url, data_source, data_type, t);
930 function addColumn(column, fetch) {
932 var selectedperiod="";
937 if (inTypeC(column)!=-1)
939 column = column.substring(0,column.length-1);
942 selectedperiod = document.getElementById('period'+column).value;
943 header = column+""+selectedperiod;
945 if (inTypeD(column)!=-1)
947 //conf = header+":"+document.getElementById('reference_node').value;
948 //document.getElementById('selected_reference_node').value=document.getElementById('reference_node').value;
949 conf = header+":"+document.getElementById('refnodeHC').value;
950 document.getElementById('selected_reference_node').value=document.getElementById('refnodeHC').value;
955 //debugfilter("adding column "+column+" and header "+header+" and conf = "+conf);
957 addColumnCells(header);
960 addColumnAjax(column, header);
962 addColumnToConfiguration(conf);
966 function deleteColumnCells(header) {
968 var cells = document.getElementsByName(header);
969 for(var j = 0; j < cells.length; j++)
970 cells[j].style.display = "none";
975 function deleteColumn(column) {
977 var selectedperiod="";
980 selectedperiod = document.getElementById('period'+column).value;
981 header = column+""+selectedperiod;
983 //debugfilter("deleting "+column+","+header);
985 deleteColumnCells(header);
987 deleteColumnFromConfiguration(header);
996 function removeSelectHandler(object)
999 object.onclick = null;
1002 //to be used for scrolling the column list with down/up arrows
1004 function scrollList() {
1005 debugfilter("here "+document.getElementById('scrolldiv').focused);
1006 if (event.keyCode == 40)
1007 debugfilter("down");
1008 else if (event.keyCode == 38)
1012 function resetColumns() {
1014 for (var kk in column_table) {
1016 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
1018 else if (column_table[kk]['visible'] == false && column_table[kk]['fetch'] == true)
1019 addColumn(kk, true);
1024 function resetCols(which_conf) {
1026 var target_configuration = "|"+document.getElementById(which_conf).value+"|";
1028 //debugfilter("<p>Target configuration = "+target_configuration);
1030 for (var kk in column_table) {
1031 //debugfilter("in "+kk+" ");
1033 if (target_configuration.indexOf("|"+kk+"|")>=0)
1035 if (document.getElementById('check'+kk))
1036 if (document.getElementById('check'+kk).checked == false)
1038 debugfilter("<p>Adding "+kk);
1039 addColumn(kk, true);
1044 if (document.getElementById('check'+kk))
1045 if (document.getElementById('check'+kk).checked == true)
1047 debugfilter("<p>Deleting "+kk);
1054 function filterByType(selectedtype) {
1056 var notselectedyet = true;
1058 for (var kk in column_headers) {
1060 if (document.getElementById(kk))
1062 if (window['type'+kk] == selectedtype)
1064 document.getElementById(kk).className = 'in';
1066 highlightOption(kk);
1067 notselectedyet = false;
1070 document.getElementById(kk).className = 'out';
1076 function deleteColumnSample() {
1077 var cellsheader = document.getElementsByName("confheader"+column);
1078 for(var j = 0; j < cellsheader.length; j++)
1079 cellsheader[j].style.display = "none";
1083 function checkDataToFetch() {
1085 var dataExist = false;
1087 for (var kk in column_table) {
1089 if (document.getElementById(kk))
1091 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
1093 document.getElementById('fetchbutton').disabled = false;
1094 document.getElementById('fetchbutton').style.color = 'red';
1102 document.getElementById('fetchbutton').disabled = true;
1103 document.getElementById('fetchbutton').style.color = 'grey';
1109 function fetchData() {
1114 for (var kk in column_table) {
1116 if (column_table[kk]['visible'] == true && column_table[kk]['fetch'] == false)
1119 tagnames = column_table[kk]['tagname'];
1124 tagnames += "|"+column_table[kk]['tagname'];
1129 //debugfilter("fetching these columns: "+tagnames+ "("+headers+")");
1131 var slice_id = document.getElementById('slice_id').value;
1132 document.getElementById('loadingDiv').innerHTML = " <img src=/plekit/icons/ajax-loader.gif> Loading data. Please wait ...";
1133 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+tagnames;
1134 load_data(headers, url);
1145 function updateColumnThreshold(column, minT, maxT) {
1147 debugfilter("updating threshold for "+column+" with "+minT+" and "+maxT);
1149 var cells = document.getElementsByName(column);
1151 for(var j = 0; j < cells.length; j++)
1153 var val = parseFloat(cells[j].innerHTML);
1155 if (val >= minT && val <= maxT)
1156 cells[j].style.color = filtered_color;
1158 cells[j].style.color = normal_color;
1161 var old_configuration = document.getElementById('column_configuration').value;
1162 var slice_id = document.getElementById('slice_id').value;
1164 var old_columns = old_configuration.split("|");
1165 var new_columns = new Array();
1167 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
1168 var conf = old_columns[column_index].split(':');
1169 if (conf[0] != column)
1170 new_columns.push(old_columns[column_index]);
1172 new_columns.push(column+":"+minT+","+maxT);
1175 var new_configuration = new_columns.join("|");
1177 updateColumnConfiguration(slice_id, new_configuration);
1181 function updateExcludeList(column, excludeList) {
1183 //debugfilter("updating list");
1184 debugfilter("updating list for "+column+" with "+excludeList);
1186 var cells = document.getElementsByName(column);
1188 for(var j = 1; j < cells.length; j++)
1190 var val = cells[j].innerHTML;
1192 if (excludeList == val)
1193 cells[j].style.color = filtered_color;
1195 cells[j].style.color = normal_color;
1198 var old_configuration = document.getElementById('column_configuration').value;
1199 var slice_id = document.getElementById('slice_id').value;
1201 var old_columns = old_configuration.split("|");
1202 var new_columns = new Array();
1204 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
1205 var conf = old_columns[column_index].split(':');
1206 if (conf[0] != column)
1207 new_columns.push(old_columns[column_index]);
1209 new_columns.push(column+":"+excludeList);
1212 var new_configuration = new_columns.join("|");
1214 updateColumnConfiguration(slice_id, new_configuration);
1225 function plekit_table_showAll (slicetable_id) {
1227 var table=$(slicetable_id);
1228 var css='#'+slicetable_id+'>tbody';
1229 var rows = $$(css)[0].rows;
1231 // scan rows, elaborate 'visible'
1232 for (var row_index = 0; row_index < rows.length ; row_index++) {
1233 var tr=rows[row_index];
1235 plekit_table_row_visible(tr,visible);
1238 plekit_table_count_filtered(slicetable_id);
1240 tablePaginater.init(slicetable_id);
1244 function plekit_table_count_filtered (slicetable_id) {
1245 var table=$(slicetable_id);
1246 var css='#'+slicetable_id+'>tbody';
1247 var rows = $$(css)[0].rows;
1251 // scan rows, elaborate 'visible'
1252 for (var row_index = 0; row_index < rows.length ; row_index++) {
1253 var tr=rows[row_index];
1254 var filtered = false;
1256 for (var column_index=0; column_index < tr.cells.length; column_index++)
1257 if (tr.cells[column_index].style.color == "red")
1265 debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
1269 function plekit_table_hide_filtered (slicetable_id) {
1270 var table=$(slicetable_id);
1271 var css='#'+slicetable_id+'>tbody';
1272 var rows = $$(css)[0].rows;
1274 var reg = /(^|\s)invisibleRow(\s|$)/;
1277 if (!document.getElementById('filtercheck').checked)
1279 plekit_table_showAll(slicetable_id);
1285 // scan rows, elaborate 'visible'
1286 for (var row_index = 0; row_index < rows.length ; row_index++) {
1287 var tr=rows[row_index];
1290 for (var column_index=0; column_index < tr.cells.length; column_index++) {
1291 if (tr.cells[column_index].style.color == filtered_color)
1297 plekit_table_row_visible(tr,visible);
1300 //debugfilter('hidden '+hidden+' nodes');
1301 debugfilter(hidden+' nodes do not satisfy the requested threshold (hidden)');
1303 tablePaginater.init(slicetable_id);
1309 function plekit_table_apply_config(slicetable_id, configuration) {
1311 var new_configuration = document.getElementById('new_conf').value;
1312 var all_columns = new_configuration.split("|");
1314 var min_values = new Array();
1315 var max_values = new Array();
1318 for (var column_index = 0; column_index < all_columns.length ; column_index++) {
1320 var conf = all_columns[column_index].split(':');
1322 if (inTypeB(conf[0]) != -1)
1324 var threshold = conf[1].split(',');
1325 if (threshold.length == 2)
1327 min_values.push(parseFloat(threshold[0]));
1328 max_values.push(parseFloat(threshold[1]));
1331 else if (inTypeC(conf[0]) == -1)
1333 var threshold = conf[2].split(',');
1334 if (threshold.length == 2)
1336 min_values.push(parseInt(threshold[0]));
1337 max_values.push(parseInt(threshold[1]));
1342 min_values.push(-1);
1343 max_values.push(-1);
1348 var table=$(slicetable_id);
1349 var css='#'+slicetable_id+'>tbody';
1350 var rows = $$(css)[0].rows;
1355 for (var row_index = 0; row_index < rows.length ; row_index++) {
1357 var tr=rows[row_index];
1359 var filtered = false;
1361 for (var column_index = 0; column_index < all_columns.length ; column_index++)
1362 if (min_values[column_index]!=-1)
1364 var val = parseFloat(tr.cells[3+column_index].innerHTML);
1366 if (val >= min_values[column_index] && val <= max_values[column_index])
1368 tr.cells[3+column_index].style.color = filtered_color;
1372 tr.cells[3+column_index].style.color = normal_color;
1375 if (tr.cells[3+column_index].style.color == filtered_color)
1383 debugfilter(no_filtered+' nodes do not satisfy the requested threshold');
1385 //tablePaginater.init(slicetable_id);
1390 function reset_select () {
1391 var table=$(slicetable_id);
1392 var css='#'+slicetable_id+'>tbody';
1393 var rows = $$(css)[0].rows;
1395 var action = document.getElementById('onlyselected');
1396 action.checked=false;
1398 // scan rows, elaborate 'visible'
1399 for (var row_index = 0; row_index < rows.length ; row_index++) {
1400 var tr=rows[row_index];
1402 document.getElementById("check"+tr.id).checked=false;
1406 plekit_table_count_nodes();
1412 function plekit_table_select_filter () {
1413 var table=$(slicetable_id);
1414 var css='#'+slicetable_id+'>tbody';
1415 var rows = $$(css)[0].rows;
1417 var reg = /(^|\s)invisibleRow(\s|$)/;
1419 var action = document.getElementById('onlyselected');
1420 if (!action.checked)
1421 plekit_table_reset_filter();
1423 // scan rows, elaborate 'visible'
1424 for (var row_index = 0; row_index < rows.length ; row_index++) {
1425 var tr=rows[row_index];
1430 if(tr.className.search(reg) == -1)
1431 if(!document.getElementById("check"+tr.id).checked)
1435 if(tr.className.search(reg) != -1)
1438 plekit_table_row_visible(tr,visible);
1441 tablePaginater.init(slicetable_id);
1442 plekit_table_count_nodes();
1445 function plekit_table_select_filter2 () {
1446 var table=$(slicetable_id);
1447 var css='#'+slicetable_id+'>tbody';
1448 var rows = $$(css)[0].rows;
1450 var reg = /(^|\s)invisibleRow(\s|$)/;
1452 var action = document.getElementById('onlyselected');
1454 // scan rows, elaborate 'visible'
1455 for (var row_index = 0; row_index < rows.length ; row_index++) {
1456 var tr=rows[row_index];
1461 if(tr.className.search(reg) == -1)
1462 if(!document.getElementById("check"+tr.id).checked)
1466 if(tr.className.search(reg) != -1)
1469 plekit_table_row_visible(tr,visible);
1472 tablePaginater.init(slicetable_id);
1473 plekit_table_count_nodes();
1476 function CheckTopNodes(n) {
1477 var table=$(slicetable_id);
1478 var css='#'+slicetable_id+'>tbody';
1479 var rows = $$(css)[0].rows;
1480 var reg = /(^|\s)invisibleRow(\s|$)/;
1484 for (var row_index = 0; row_index < rows.length ; row_index++) {
1485 var tr=rows[row_index];
1487 if(tr.className.search(reg) == -1) {
1490 document.getElementById("check"+tr.id).checked=true;
1495 document.getElementById("check"+tr.id).checked=false;
1502 function CheckRandomNodes(n) {
1503 var table=$(slicetable_id);
1504 var css='#'+slicetable_id+'>tbody';
1505 var rows = $$(css)[0].rows;
1506 var reg = /(^|\s)invisibleRow(\s|$)/;
1508 var r = n/plekit_table_visible_count();
1511 for (var row_index = 0; row_index < rows.length ; row_index++) {
1512 var tr=rows[row_index];
1514 if(tr.className.search(reg) == -1) {
1515 if(Math.random() < r) {
1516 document.getElementById("check"+tr.id).checked=true;
1526 function plekit_table_visible_count() {
1527 var table=$(slicetable_id);
1528 var css='#'+slicetable_id+'>tbody';
1529 var rows = $$(css)[0].rows;
1530 var reg = /(^|\s)invisibleRow(\s|$)/;
1533 for (var row_index = 0; row_index < rows.length ; row_index++) {
1534 var tr=rows[row_index];
1536 if(tr.className.search(reg) == -1)
1546 function plekit_table_count_nodes() {
1547 var table=$(slicetable_id);
1548 var css='#'+slicetable_id+'>tbody';
1549 var rows = $$(css)[0].rows;
1550 var reg = /(^|\s)invisibleRow(\s|$)/;
1555 for (var row_index = 0; row_index < rows.length ; row_index++) {
1556 var tr=rows[row_index];
1559 var ch = document.getElementById("check"+tr.id);
1561 if(tr.className.search(reg) == -1)
1574 var dd = document.getElementById('node_statistics');
1575 dd.innerHTML = "Total: "+n+" - Shown: "+v+" - Selected: "+s;
1578 function AutoSelect()
1580 var a = document.getElementById('automatic').value;
1581 var n = parseInt(document.getElementById('no_nodes').value);
1587 CheckRandomNodes(n);
1588 else if (a == "top")
1591 plekit_table_select_filter2();
1592 plekit_table_count_nodes();