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 eeference, 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";
437 //When the period of an already selected column is changed
438 function updatePeriod(h, new_period) {
440 var old_period = document.getElementById('period'+h).value;
441 document.getElementById('period'+h).value=new_period;
443 //debugfilter(h+''+old_period+'-'+h+''+new_period);
444 if (document.getElementById('check'+h).checked)
446 deleteColumnCells(h+''+old_period);
447 addColumnCells(h+''+new_period);
448 addColumnAjax(h, h+''+new_period);
450 replaceColumnConfiguration(h+''+old_period,h+''+new_period);
456 RESET/SAVE CONFIGURATION
460 function getHTTPObject()
462 if (typeof XMLHttpRequest != 'undefined')
463 { return new XMLHttpRequest(); }
466 { return new ActiveXObject("Msxml2.XMLHTTP"); }
469 try { return new ActiveXObject("Microsoft.XMLHTTP"); }
475 function closeMessage(tab)
477 var current_conf = document.getElementById('show_configuration').value;
480 if (current_conf != "")
483 if (tab == 'reservable') {
484 document.getElementById('note_reservable_div').style.display = "none";
485 if (current_conf.indexOf('reservable') != -1)
487 value = current_conf+'reservable';
490 if (tab == 'columns') {
491 document.getElementById('note_columns_div').style.display = "none";
492 if (current_conf.indexOf('columns') != -1)
494 value = current_conf+'columns';
497 var slice_id = document.getElementById('slice_id').value;
498 var person_id = document.getElementById('person_id').value;
499 var tag_id = document.getElementById('show_tag_id').value;
501 var url = "/plekit/php/updateConfiguration.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_name=showconf&tag_id="+tag_id;
502 //debugfilter("updating conf with "+url);
503 document.getElementById('show_configuration').value = value;
505 var req = getHTTPObject();
506 req.open('GET', url, true);
507 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
508 req.onreadystatechange =
510 if (req.readyState == 4)
511 { debugfilter(req.responseText); }
518 function updateColumnConfiguration(value, reload)
520 var person_id = document.getElementById('person_id').value;
521 var slice_id = document.getElementById('slice_id').value;
522 var tag_id = document.getElementById('conf_tag_id').value;
523 var full_column_configuration = document.getElementById('full_column_configuration').value;
525 //debugfilter("<br>OLD = "+full_column_configuration);
526 //debugfilter("<br>value = "+value);
529 var old_columns = full_column_configuration.split(";");
530 var new_columns = new Array();
532 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
533 new_columns.push(old_columns[column_index]);
534 if (old_columns[column_index] != slice_id)
535 new_columns.push(old_columns[++column_index]);
539 new_columns.push(value);
541 new_columns.push("default");
547 var new_configuration = new_columns.join(";");
548 //debugfilter("<br>NEW = "+new_configuration);
550 if (window.XMLHttpRequest)
551 {// code for IE7+, Firefox, Chrome, Opera, Safari
552 xmlhttp=new XMLHttpRequest();
555 {// code for IE6, IE5
556 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
558 xmlhttp.onreadystatechange=function()
560 if (xmlhttp.readyState==4) // && xmlhttp.status==200)
562 //value=xmlhttp.responseText;
563 //debugfilter(value+"-----"+new_configuration);
564 document.getElementById('column_configuration').value=value;
565 document.getElementById('full_column_configuration').value=new_configuration;
568 window.location.reload(true);
572 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);
573 //xmlhttp.open("GET","/plekit/php/updateConf.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tagName=Columnconf",true);
578 function logSortingAction(person_id, slice_id, value)
582 var req = getHTTPObject();
583 var url = "/plekit/php/logSorting.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id;
585 req.open('GET', url, true);
586 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
587 req.onreadystatechange =
589 if (req.readyState == 4)
590 { debugfilter(req.responseText); }
595 function sortCompleteCallback(tableid) {
597 var slice_id = document.getElementById('slice_id').value;
598 var person_id = document.getElementById('person_id').value;
600 var ths = document.getElementById(tableid).getElementsByTagName("th");
601 for(var i = 0, th; th = ths[i]; i++) {
602 if (th.className.indexOf("Sort") != -1)
604 //debugfilter("sorted"+th.getAttribute("name"));
606 var column_name = th.getAttribute("name");
607 var hclass = th.className;
608 var column = hclass.substr(hclass.indexOf("column"),hclass.indexOf("column")+1);
609 var sortdirection = "forward";
610 if (hclass.indexOf("reverse")!=-1)
611 sortdirection = "reverse";
613 if (column.indexOf("column-1")==-1 && column.indexOf("column-0")==-1)
614 logSortingAction(person_id, slice_id, tableid+"|"+column_name+"|"+sortdirection);
620 function addColumnToConfiguration(column) {
622 var old_configuration = document.getElementById('column_configuration').value;
624 var new_configuration = "";
626 if (old_configuration != "")
627 new_configuration = old_configuration += "|"+column;
629 new_configuration = column;
631 //debugfilter("new configuration = "+new_configuration);
633 updateColumnConfiguration(new_configuration, false);
637 function deleteColumnFromConfiguration(column) {
639 var old_configuration = document.getElementById('column_configuration').value;
641 var old_columns = old_configuration.split("|");
642 var new_columns = new Array();
644 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
645 var conf = old_columns[column_index].split(':');
646 if (conf[0] != column)
647 new_columns.push(old_columns[column_index]);
650 var new_configuration = new_columns.join("|");
651 updateColumnConfiguration(new_configuration, false);
655 function replaceColumnConfiguration(column_old, column_new) {
657 var old_configuration = document.getElementById('column_configuration').value;
659 var old_columns = old_configuration.split("|");
660 var new_columns = new Array();
662 var olds = column_old.split(':');
664 for (var column_index = 0; column_index < old_columns.length ; column_index++) {
665 var conf = old_columns[column_index].split(':');
666 if (conf[0] != olds[0])
667 new_columns.push(old_columns[column_index]);
669 new_columns.push(column_new);
672 var new_configuration = new_columns.join("|");
674 updateColumnConfiguration(new_configuration);
683 function convert_data(value, data_source, data_type, tagname) {
685 //debugfilter("v["+tagname+"]="+value+"-");
687 if (value == "" || value == "n/a" || value == null || value == "NaN" || value == "None")
690 if (tagname == "uptime") {
691 return parseInt((parseFloat(value) / 86400));
694 if (data_type == "date") {
696 var date = new Date(value*1000);
698 var year = date.getFullYear();
699 var month = date.getMonth()+1;
702 var day = date.getDate();
706 return year + '-' + month + '-' + day;
713 function load_data(column, header, url, data_source, data_type, tagname) {
715 //debugfilter("<br>loading "+url);
716 var req = getHTTPObject();
718 req.open('GET', url, true);
719 req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
720 req.onreadystatechange =
722 if (req.readyState == 4)
723 { updateColumnData(column, header, req.responseText, data_source, data_type, tagname); }
729 function updateColumnData(column, header, data, data_source, data_type, tagname) {
731 var headers = header.split("|");
732 var data_table = data.split("|");
734 //debugfilter("<p>headers[0] = "+headers[0]);
735 //debugfilter("<p>data[2] = "+data_table[2]);
737 //debugfilter("data = "+data + " with type "+data_type + " and source "+data_source);
738 //debugfilter("<p>data table length = "+data_table.length);
740 if (data_table.length > 1)
745 var table_id1 = 'nodes';
746 var table=$(table_id1);
747 var css='#'+table_id1+'>tbody';
748 var rows = $$(css)[0].rows;
750 var data_array1 = new Array();
752 //debugfilter("COLUMN "+column+"<p>");
754 for (var node_index = 1; node_index < data_table.length; node_index++) {
755 if (data_table[node_index] == '---potential---')
757 node_data = data_table[node_index].split(':');
759 data_array1[node_data[0]] = new Array();
761 for (var h_index=0; h_index < headers.length; h_index++) {
763 if (node_data[h_index+1] == "" || node_data[h_index+1] == "None")
764 data_array1[node_data[0]][h_index] = "n/a";
766 data_array1[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
773 for (var row_index = 0; row_index < rows.length ; row_index++) {
774 var tr=rows[row_index];
776 for (var column_index=0; column_index < tr.cells.length; column_index++) {
777 //debugfilter("<p>node id = "+tr.cells[0].innerHTML+" - "+tr.cells[column_index].getAttribute('name'));
778 if (tr.cells[column_index].getAttribute('name'))
780 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
781 if (found_index != -1)
782 //debugfilter(tr.cells[0].innerHTML+"-"+found_index);
783 tr.cells[column_index].innerHTML = data_array1[tr.cells[0].innerHTML][found_index];
788 //debugfilter("Reset sorting .....");
789 //tablePaginater.init(table_id1);
790 fdTableSort.init(table_id1);
793 if (data_table[node_index] == '---potential---')
796 var table_id2 = 'add_nodes';
797 var table2=$(table_id2);
798 var css2='#'+table_id2+'>tbody';
799 var rows2 = $$(css2)[0].rows;
801 var data_array2 = new Array();
803 //debugfilter("COLUMN "+column+"<p>");
805 for (; node_index < data_table.length; node_index++) {
806 if (data_table[node_index] == '')
808 node_data = data_table[node_index].split(':');
810 data_array2[node_data[0]] = new Array();
812 for (var h_index=0; h_index < headers.length; h_index++) {
814 if (node_data[h_index+1] == "")
815 data_array2[node_data[0]][h_index] = "n/a";
817 data_array2[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
822 for (var row_index = 0; row_index < rows2.length ; row_index++) {
823 var tr=rows2[row_index];
825 for (var column_index=0; column_index < tr.cells.length; column_index++) {
826 if (tr.cells[column_index].getAttribute('name'))
828 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
829 if (found_index != -1)
830 tr.cells[column_index].innerHTML = data_array2[tr.cells[0].innerHTML][found_index];
834 fdTableSort.init(table_id2);
835 //tablePaginater.init(table_id2);
839 //fdTableSort.removeTableCache(table_id2);
840 //document.getElementById('loading'+column).innerHTML = "";
845 document.getElementById('loading'+column).innerHTML = "";
850 function addColumnCells(header) {
852 var cells = document.getElementsByName(header);
854 //debugfilter("got cells -"+cells+"- for "+header);
855 for(var j = 0; j < cells.length; j++)
856 cells[j].style.display = "table-cell";
859 function addSampleCells(column) {
861 var cellsheader = document.getElementsByName("confheader"+column);
862 for(var j = 0; j < cellsheader.length; j++)
863 cellsheader[j].style.display = "table-cell";
867 function addColumnAjax(column, header) {
869 //var t = document.getElementById('check'+column).name;
870 var t = document.getElementById('tagname'+header).value;
871 var slice_id = document.getElementById('slice_id').value;
873 var selectedperiod = document.getElementById('period'+column).value;
874 var fetched = document.getElementById('fetched'+column).value;
875 var data_source = document.getElementById('source'+column).value;
876 var data_type = document.getElementById('type'+column).value;
879 //debugfilter("<br>adding "+column+","+header+','+fetched+','+t+','+data_source+','+data_type);
881 if (fetched.indexOf("false")!=-1)
884 document.getElementById('fetched'+column).value = ','+selectedperiod+',true';
886 else if (fetched.indexOf(','+selectedperiod+',')==-1)
889 document.getElementById('fetched'+column).value = ','+selectedperiod+''+fetched;
894 //debugfilter("ready to load ... ");
895 document.getElementById('loading'+column).innerHTML = "<img width=10 src=/plekit/icons/ajax-loader.gif>";
896 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+t+"&data_type="+data_type+"&data_source="+data_source;
897 //debugfilter("calling "+url);
898 load_data(column, header, url, data_source, data_type, t);
904 function addColumn(column, fetch) {
906 var selectedperiod="";
911 if (inTypeC(column)!=-1)
913 column = column.substring(0,column.length-1);
916 selectedperiod = document.getElementById('period'+column).value;
917 header = column+""+selectedperiod;
921 //debugfilter("adding column "+column+" and header "+header+" and conf = "+conf);
923 addColumnCells(header);
926 addColumnAjax(column, header);
928 addColumnToConfiguration(conf);
932 function deleteColumnCells(header) {
934 var cells = document.getElementsByName(header);
935 for(var j = 0; j < cells.length; j++)
936 cells[j].style.display = "none";
941 function deleteColumn(column) {
943 var selectedperiod="";
946 selectedperiod = document.getElementById('period'+column).value;
947 header = column+""+selectedperiod;
949 //debugfilter("deleting "+column+","+header);
951 deleteColumnCells(header);
953 deleteColumnFromConfiguration(header);