remove long dead svn magic lines
[plewww.git] / plekit / table / columns.js
1
2 var filtered_color = "grey";
3 var normal_color = "black";
4
5 //Descriptions overriding the default ones set in Accessors_site.py and configuration 
6
7 var sourceComon = '<a class="source-url" target="source_window" href="http://comon.cs.princeton.edu/">CoMon</a>';
8 var sourceTophat = '<a class="source-url" target="source_window" href="http://www.top-hat.info/">TopHat</a>';
9 var sourceTophatAPI = '<a class="source-url" target="source_window" href="http://www.top-hat.info/API/">TopHat API</a>';
10 var sourceMySlice = '<a class="source-url" target="source_window" href="http://myslice.info/">MySlice</a>';
11 var sourceCymru = '<a class="source-url" target="source_window" href="http://www.team-cymru.org/">Team Cymru</a>';
12 var sourceSonoma = '<a class="source-url" target="source_window" href="http://sonoma.etomic.org/">SONoMA</a>';
13 var sourceMyPLC = '<a class="source-url" target="source_window" href="https://www.planet-lab.eu/db/doc/PLCAPI.php">MyPLC API</a>';
14 var sourceManiacs = '<a class="source-url" target="source_window" href="http://www.ece.gatech.edu/research/labs/MANIACS/as_taxonomy/">MANIACS</a>';
15 var sourceMaxmind = '<a class="source-url" target="source_window" href="http://www.maxmind.com/app/geolitecity">MaxMind</a>';
16 var sourceMonitor = '<a class="source-url" target="source_window" href="http://monitor.planet-lab.org/">Monitor</a>';
17 var hardwareReqs = 'current <a class="info-url" target="info_window" href="http://www.planet-lab.org/hardware">PlanetLab hardware requirement</a>';
18 var selectReferenceNode ='<div id="refnodes_div"></div>';
19 var selectReferenceNodeRTT ='<div id="refnodes_rtt_div"></div>';
20
21 var descHOSTNAME = "test";
22
23 var titleAU = 'Authority';
24 var detailAU = 'The authority of the global PlanetLab federation that the site of the node belongs to.';
25 var valuesAU = '<span class="bold">PLC</span> (PlanetLab Central), <span class="bold">PLE</span> (PlanetLab Europe)';
26 var sourceAU = 'Source: '+sourceMyPLC;
27 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>';
28
29 var titleST = 'Status';
30 var sourceST = 'Source: '+sourceMonitor;
31 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).';
32 var descST = '<span class="gray"><span class="column-title">'+titleST+'</span><p>'+valuesST+'</p><p>'+sourceST+'</p></span>';
33
34 var titleA = 'Architecture name';
35 var detailA = 'The node architecture.';
36 var sourceA = 'Source: '+sourceMyPLC;
37 var valuesA = '<span class="bold">x86_64</span>, <span class="bold">i386</span>, <span class="bold">n/a</span>';
38 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>';
39
40 var titleAS = 'Autonomous system ID';
41 var sourceAS = 'Source: '+sourceCymru+' (via '+sourceTophat+')';
42 var valuesAS = 'Values: <span class="bold">Integer between 0 and 65535</span>, <span class="bold">n/a</span>';
43 var descAS = '<span class="gray"><span class="column-title">'+titleAS+'</span><p>'+valuesAS+'</p><p>' + sourceAS+'</p></span>';
44
45 var titleAST = 'Autonomous system type';
46 var sourceAST = 'Source: '+sourceManiacs;
47 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>';
48 var descAST = '<span class="gray"><span class="column-title">'+titleAST+'</span><p>'+valuesAST+'</p><p>'+sourceAST+'</p></span>';
49
50 var titleASN = 'Autonomous system name';
51 var sourceASN = 'Source: '+sourceTophat;
52 var descASN = '<span class="gray"><span class="column-title">'+titleASN+'</span><p>'+sourceASN+'</p></span>';
53
54 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>';
55 var titleBU = 'Bandwidth utilization ';
56 var sourceBU = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
57 var valuesBU ='Unit: <span class="bold">Kbps</span>';
58 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.'
59 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>'; 
60
61 var titleBW= 'Bandwidth limit';
62 var sourceBW = 'Source: '+sourceComon;
63 var valuesBW = 'Unit: <span class="bold">Kbps</span>';
64 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>.';
65 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>';
66
67 var titleCC = 'Number of CPU cores';
68 var sourceCC = 'Source: '+sourceComon;
69 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).';
70 var descCC = '<span class="gray"><span class="column-title">'+titleCC+'</span><p><span class="column-detail">'+detailCC+'</span></p><p>'+sourceCC+'</p></span>';
71
72 var titleCN = 'Number of CPUs';
73 var sourceCN = 'Source: '+sourceComon;
74 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>.';
75 var descCN = '<span class="gray"><span class="column-title">'+titleCN+'</span><p><span class="column-detail">'+detailCN+'</detail></p><p>'+sourceCN+'</p></span>';
76
77 var titleCPC = 'Number of cores per CPU';
78 var sourceCPC = 'Source: '+sourceComon;
79 var detailCPC = 'The number of cores per CPU on the node.'; 
80 var descCPC = '<span class="gray"><span class="column-title">'+titleCPC+'</span><p><span class="column-detail">'+detailCPC+'</span></p><p>'+sourceCPC+'</p></span>';
81
82 var titleCR = 'CPU clock rate';
83 var detailCR = 'The clock rate for the CPUs on the node. For reference, the '+hardwareReqs+' is <span class="bold">2.4 GHz</span>.';
84 var sourceCR = 'Source: '+sourceComon;
85 var valuesCR = 'Unit: <span class="bold">GHz</span>';
86 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>';
87
88 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>';
89 var titleCF = 'Free CPU';
90 var sourceCF = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
91 var valuesCF = 'Unit: <span class="bold">%</span>';
92 var detailCF = 'The average CPU percentage that gets allocated to a test slice named burb that is periodically run by CoMon.';
93 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>'; 
94
95 var titleDN = 'Toplevel domain name';
96 var sourceDN = 'Source: '+sourceMyPLC;
97 var descDN = '<span class="gray"><span class="column-title">'+titleDN+'</span><p>'+sourceDN+'</p></span>';
98
99 var titleDA = 'Date added';
100 var sourceDA = 'Source: '+sourceMyPLC;
101 var detailDA = 'The date that the node was added to PlanetLab.';
102 var descDA = '<span class="gray"><span class="column-title">'+titleDA+'</span><p><span class="column-detail">'+detailDA+'</span></p><p>'+sourceDA+'</p></span>';
103
104 var titleDL = 'Deployment';
105 var detailDL = 'The deployment status.';
106 var valuesDL = 'Values: <span class="bold">alpha</span>, <span class="bold">beta</span>, <span class="bold">production</span>, <span class="bold">n/a</span>';
107 var sourceDL = 'Source: '+sourceMyPLC;
108 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>';
109
110 var titleDS = 'Disk size';
111 var detailDS = 'The size of the hard disk available on the node. For reference, the '+hardwareReqs+' is <span class="bold">500 GB</span>.';
112 var sourceDS = 'Source: '+sourceComon;
113 var valuesDS = 'Unit: <span class="bold">GB</span>';
114 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>';
115
116 var titleDU = 'Current disk utilization';
117 var sourceDU = 'Source: '+sourceComon;
118 var valuesDU = 'Unit: <span class="bold">GB</span>';
119 var detailDU = 'The amount of disk space currently consumed.';
120 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>';
121
122 var titleDF = 'Disk space free';
123 var sourceDF = 'Source: '+sourceComon;
124 var valuesDF = 'Unit: <span class="bold">GB</span>.';
125 var detailDF = 'The amount of disk space currently available.';
126 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>';
127
128 var titleHC = 'Hop count (pairwise)';
129 var sourceHC = 'Source: '+sourceTophat;
130 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.';
131 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>';
132
133 var titleIP = 'IP address';
134 var sourceIP = 'Source: '+sourceMyPLC;
135 var descIP = '<span class="gray"><span class="column-title">'+titleIP+'</span><p>'+sourceIP+'</p></span>';
136
137 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>';
138 var titleL= 'Load ';
139 var sourceL = 'Source: '+sourceComon;
140 var valuesL = 'Unit: <span class="bold">5-minute load</span>';
141 var detailL = 'The average 5-minute load (as reported by the Unix uptime command) over the selected period.';
142 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>'; 
143
144 var titleLON= 'Longitude';
145 var sourceLON = 'Source: '+sourceTophat;
146 var descLON = '<span class="gray"><span class="column-title">'+titleLON+'</span><p>'+sourceLON+'</p></span>';
147
148 var titleLAT= 'Latitude';
149 var sourceLAT = 'Source: '+sourceTophat;
150 var descLAT = '<span class="gray"><span class="column-title">'+titleLAT+'</span><p>'+sourceLAT+'</p></span>';
151
152 var titleLCN= 'Location (Country)';
153 var sourceLCN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
154 var detailLCN = 'Based on the latitude and longitude information.';
155 var descLCN = '<span class="gray"><span class="column-title">'+titleLCN+'</span><p><span class="column-detail">'+detailLCN+'</span></p><p>'+sourceLCN+'</p></span>';
156
157 var titleLCT= 'Location (Continent)';
158 var sourceLCT = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
159 var detailLCT = 'Based on the latitude and longitude information.';
160 var descLCT = '<span class="gray"><span class="column-title">'+titleLCT+'</span><p><span class="column-detail">'+detailLCT+'</span></p><p>'+sourceLCT+'</p></span>';
161
162 var titleLCY= 'Location (City)';
163 var sourceLCY = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
164 var detailLCY = 'Based on the latitude and longitude information.';
165 var descLCY = '<span class="gray"><span class="column-title">'+titleLCY+'</span><p><span class="column-detail">'+detailLCY+'</span></p><p>'+sourceLCY+'</p></span>';
166
167 var titleLPR= 'Location precision radius';
168 var sourceLPR = 'Source: '+sourceTophat;
169 var valuesLPR = 'Unit: <span class="bold">float</span>.';
170 var detailLPR = 'The radius of the circle corresponding to the error in precision of the geolocalization estimate.';
171 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>';
172
173 var titleLRN= 'Location (Region)';
174 var sourceLRN = 'Source: '+sourceMaxmind+' (via '+sourceTophat+')';
175 var detailLRN = 'Based on the latitude and longitude information.';
176 var descLRN = '<span class="gray"><span class="column-title">'+titleLRN+'</span><p><span class="column-detail">'+detailLRN+'</span></p><p>'+sourceLRN+'</p></span>';
177
178 var titleMS= 'Memory size';
179 var detailMS = 'The memory size (RAM) available on the node. For reference, the '+hardwareReqs+' is <span class="bold">4 GB</span>.';
180 var sourceMS = 'Source: '+sourceComon;
181 var valuesMS = 'Unit: <span class="bold">GB</span>.';
182 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>';
183
184 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>';
185 var titleMU = 'Memory utilization';
186 var sourceMU = 'Source: '+sourceComon;
187 var valuesMU = 'Unit: <span class="bold">%</span>';
188 var detailMU = 'The average active memory utilization as reported by CoMon.';
189 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>'; 
190
191 var titleMA= 'Measurement agents';
192 var sourceMA = 'Source: '+sourceTophat;
193 var valuesMA = 'Values: <span class="bold">ETOMIC</span>, <span class="bold">SONoMA</span>, <span class="bold">TDMI</span>, <span class="bold">DIMES</span>.';
194 var detailMA = 'Co-located measurement agents.';
195 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>';
196
197 var titleMAS= 'Measurement agent SONoMA';
198 var sourceMAS = 'Source: '+sourceTophat;
199 var valuesMAS = 'Values: <span class="bold">Node type</span> (e.g., PLE, APE)';
200 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+'.';
201 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>';
202
203 var titleMAE= 'Measurement agent ETOMIC';
204 var sourceMAE = 'Source: '+sourceTophat;
205 var valuesMAE = 'Values: <span class="bold">yes/no</span>';
206 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+'.';
207 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>';
208
209 var titleMAT= 'Measurement agent TDMI';
210 var sourceMAT = 'Source: '+sourceTophat;
211 var valuesMAT = 'Values: <span class="bold">yes/no</span>';
212 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+'.';
213 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>';
214
215 var titleMAD= 'Measurement agent DIMES';
216 var sourceMAD = 'Source: '+sourceTophat;
217 var valuesMAD = 'Values: <span class="bold">yes/no</span>';
218 var detailMAD = 'The existence of a colocated DIMES agent. When a DIMES agent is present, you have access to DIMES measurements through the '+sourceTophatAPI+'.';
219 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>';
220
221 var titleNSF= 'Network information (spoof)';
222 var sourceNSF = 'Source: '+sourceTophat;
223 var valuesNSF = 'Values: <span class="bold">yes/no</span>';
224 var detailNSF = 'Whether the node can send packets successfully (or not) with a spoofed IP source address.';
225 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>';
226
227 var titleNSR= 'Network information (source route)';
228 var sourceNSR = 'Source: '+sourceTophat;
229 var valuesNSR = 'Values: <span class="bold">yes/no</span>';
230 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.';
231 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>';
232
233 var titleNTP= 'Network information (timestamp)';
234 var sourceNTP = 'Source: '+sourceTophat;
235 var valuesNTP = 'Values: <span class="bold">yes/no</span>';
236 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.';
237 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>';
238
239 var titleNRR= 'Network information (record route)';
240 var sourceNRR = 'Source: '+sourceTophat;
241 var valuesNRR = 'Values: <span class="bold">yes/no</span>';
242 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.';
243 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>';
244
245 var titleOS = 'Operating system';
246 var detailOS = 'Fedora or CentOS distribution to use for node or slivers.';
247 var sourceOS = 'Source: '+sourceMyPLC;
248 var valuesOS = 'Values: <span class="bold">f8, f12, Cent/OS, other, n/a</span>';
249 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>';
250
251 var titleRTT = 'Round Trip Time (pairwise)';
252 var detailRTT = 'The round trip time between a selected SONoMA agent and PlanetLab nodes.';
253 var sourceRTT = 'Source: '+sourceSonoma+' (via '+sourceTophat+ ')';
254 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>';
255
256 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>';
257 var titleR = 'Reliability';
258 var sourceR = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
259 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.';
260 var valuesR = 'Unit: <span class="bold">%</span>';
261 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>'; 
262
263 var titleRES = 'Reservation capabilities';
264 var sourceRES = 'Source: '+sourceMyPLC;
265 //var valuesRES = 'Values: <span class="bold">yes/no</span>';
266 var valuesRES = 'Values: <span class="bold">-R-</span> (if yes)';
267 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>';
268 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>';
269
270 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>';
271 var titleS = 'Active slices';
272 var sourceS = 'Source: '+sourceComon+' (via '+sourceMySlice+')';
273 var valuesS = 'Unit: <span class="bold">%</span>';
274 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.';
275 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>'; 
276
277 var titleSM= 'Slices in memory';
278 var detailSM = 'The total number of slices in memory (both active and inactive).';
279 var sourceSM = 'Source: '+sourceComon;
280 var descSM = '<span class="gray"><span class="column-title">'+titleSM+'</span><p><span class="column-detail">'+detailSM+'</span></p><p>'+sourceSM+'</p></span>';
281
282 var titleSN = 'Site name';
283 var sourceSN = 'Source: '+sourceMyPLC;
284 var descSN = '<span class="gray"><span class="column-title">'+titleSN+'</span><p>'+sourceSN+'</p></span>';
285
286 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>';
287 var titleSSH = 'Average SSH response delay';
288 var valuesSSH = 'Unit: <span class="bold">msecs</span>';
289 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.';
290 var sourceSSH ='Source: '+sourceComon+' (via '+sourceMySlice+')';
291 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>'; 
292
293
294 var titleUT = 'Uptime';
295 var sourceUT = 'Source: '+sourceComon;
296 var valuesUT = 'Unit: <span class="bold">days</span>';
297 var detailUT = 'The continuous uptime until the moment that the page is loaded, as reported by the CoMon html query API.';
298 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>';
299
300
301
302 //Categorization of columns in different types, useful for filtering 
303
304 function inTypeA(header_name) {
305         var typeA = ['ST','SN','RES','OS','NRR','NTP','NSR','NSF','NDS','NTH','NEC','LRN','LCY','LPR','LCN','LAT','LON','IP','ASN','AST'];
306         return typeA.indexOf(header_name);
307 }
308
309 function inTypeB(header_name) {
310         var typeB = ['BW','DS','MS','CC','CR','AS','MU','DU','CN'];
311         return typeB.indexOf(header_name);
312 }
313
314 function inTypeC(header_name) {
315         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'];
316         return typeC.indexOf(header_name);
317 }
318
319 function inTypeD(header_name) {
320         var typeD = ['HC'];
321         return typeD.indexOf(header_name);
322 }
323
324
325 //Debugging
326 function debugfilter(s) {
327         document.getElementById('debug').innerHTML+=s;
328 }
329
330
331 //Called when a column is selected. It displays the detailed description
332 //on the right panel
333
334 function highlightOption(divid) {
335
336         var columns = document.getElementsByName('columnlist');
337         for(var j = 0; j < columns.length; j++)
338                 columns[j].className = 'out'; 
339
340         document.getElementById(divid).className = 'selected';
341
342         showDescription(divid);
343
344 //panos: to IMPROVE 
345         if (document.getElementById('selectperiod'+divid))
346                 document.getElementById('selectperiod'+divid).value = document.getElementById('period'+divid).value;
347
348 }
349
350
351 //Displays the detailed column description 
352
353 function showDescription(h) {
354
355         if (document.getElementById('selectdescr'))
356         {
357                 //Checks if there is a detailed description defined
358                 if (window['desc'+h])
359                         document.getElementById('selectdescr').innerHTML = ""+window['desc'+h];
360                 else 
361                         document.getElementById('selectdescr').innerHTML = "No detailed description provided";
362         }
363
364         if (document.getElementById('refnodes_div'))
365                 document.getElementById('refnodes_div').innerHTML = ref_nodes_select;
366
367         if (document.getElementById('refnodes_rtt_div'))
368                 document.getElementById('refnodes_rtt_div').innerHTML = ref_nodes_select_rtt;
369 }
370
371
372 //Overrides the titles of the columns as they are shown in the column selection panel.
373 //If no overriding variable exists the tag's description is used
374 function overrideTitles() {
375
376         var columns = document.getElementsByName('columnlist');
377
378         for(var j = 0; j < columns.length; j++)
379         {
380                 var kk = columns[j].id;
381                 if (window['title'+kk])
382                         document.getElementById('htitle'+kk).innerHTML = window['title'+kk];
383         }
384
385
386 }
387
388 //When the checkbox is clicked. Adds/removes column respectively
389 function changeCheckStatus(column) {
390
391         var h = document.getElementById(column).value;
392
393         if (document.getElementById('selectdescr'))
394                 showDescription(h);
395
396         //debugfilter("HERE: "+column+" - "+document.getElementById('type '+column).value);
397         //debugfilter("HERE: "+column);
398
399
400         if (document.getElementById(column).checked)
401                 addColumn(h, true, document.getElementById('type'+h).value);
402         else
403                 deleteColumn(h);
404 }
405
406
407
408 //This function is used when the alternative "quick" selection list is used
409 function changeSelectStatus(column) {
410
411         var optionClass = "";
412         var selected_index = document.getElementById('quicklist').selectedIndex;
413
414         if (document.getElementById('quicklist') && selected_index != 0)
415         {
416
417                 optionClass = document.getElementById('quicklist').options[selected_index].className;
418
419                 if (optionClass == "in")
420                 {
421                         deleteColumn(document.getElementById('quicklist').value);
422                         document.getElementById('quicklist').options[selected_index].className = "out";
423                         document.getElementById('quicklist').value="0";
424                 }
425                 else
426                 {
427                         addColumn(document.getElementById('quicklist').value, true);
428                         document.getElementById('quicklist').options[selected_index].className = "in";
429                         document.getElementById('quicklist').value="0";
430                 }
431         }
432 }
433
434
435 //When the period of an already selected column is changed
436 function updatePeriod(h, new_period) {
437
438         var old_period = document.getElementById('period'+h).value;
439         document.getElementById('period'+h).value=new_period;
440
441         //debugfilter(h+''+old_period+'-'+h+''+new_period);
442         if (document.getElementById('check'+h).checked)
443         {
444                 deleteColumnCells(h+''+old_period);
445                 addColumnCells(h+''+new_period);
446                 addColumnAjax(h, h+''+new_period);
447
448                 replaceColumnConfiguration(h+''+old_period,h+''+new_period);
449         }
450 }
451
452 /*
453  
454 RESET/SAVE CONFIGURATION
455
456 */
457
458 function getHTTPObject()
459 {
460         if (typeof XMLHttpRequest != 'undefined')
461         { return new XMLHttpRequest(); }
462
463         try
464         { return new ActiveXObject("Msxml2.XMLHTTP"); }
465         catch (e)
466         {
467                 try { return new ActiveXObject("Microsoft.XMLHTTP"); }
468                 catch (e) {}
469         }
470         return false;
471 }
472
473 function closeMessage(tab)
474 {
475         var current_conf = document.getElementById('show_configuration').value;
476         var value = '';
477
478         if (current_conf != "")
479                 current_conf += ";";
480
481         if (tab == 'reservable') {      
482         document.getElementById('note_reservable_div').style.display = "none";
483         if (current_conf.indexOf('reservable') != -1)
484                 return;
485         value = current_conf+'reservable';
486         }
487
488         if (tab == 'columns') { 
489         document.getElementById('note_columns_div').style.display = "none";
490         if (current_conf.indexOf('columns') != -1)
491                 return;
492         value = current_conf+'columns';
493         }
494
495         var slice_id = document.getElementById('slice_id').value;
496         var person_id = document.getElementById('person_id').value;
497         var tag_id = document.getElementById('show_tag_id').value;
498         
499         var url = "/plekit/php/updateConfiguration.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tag_name=showconf&tag_id="+tag_id;
500         //debugfilter("updating conf with "+url);
501         document.getElementById('show_configuration').value = value;
502
503         var req = getHTTPObject();
504         req.open('GET', url, true);
505         req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
506         req.onreadystatechange =
507         function() {
508                 if (req.readyState == 4)
509                 { debugfilter(req.responseText); }
510         }
511         req.send(null);
512
513 }
514
515
516 function updateColumnConfiguration(value, reload)
517 {
518         var person_id = document.getElementById('person_id').value;
519         var slice_id = document.getElementById('slice_id').value;
520         var tag_id = document.getElementById('conf_tag_id').value;
521         var full_column_configuration = document.getElementById('full_column_configuration').value;
522
523         //debugfilter("<br>OLD = "+full_column_configuration);
524         //debugfilter("<br>value = "+value);
525         //
526         
527         var old_columns = full_column_configuration.split(";");
528         var new_columns = new Array();
529
530         for (var column_index = 0; column_index < old_columns.length ; column_index++) {
531                 new_columns.push(old_columns[column_index]);
532                 if (old_columns[column_index] != slice_id)
533                         new_columns.push(old_columns[++column_index]);
534                 else
535                 {
536                         if (value != "")
537                                 new_columns.push(value);
538                         else
539                                 new_columns.push("default");
540                                 
541                         column_index++;
542                 }
543         }
544
545         var new_configuration = new_columns.join(";");
546         //debugfilter("<br>NEW = "+new_configuration);
547
548         if (window.XMLHttpRequest)
549           {// code for IE7+, Firefox, Chrome, Opera, Safari
550           xmlhttp=new XMLHttpRequest();
551           }
552         else
553           {// code for IE6, IE5
554           xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
555           }
556         xmlhttp.onreadystatechange=function()
557           {
558           if (xmlhttp.readyState==4) // && xmlhttp.status==200)
559             {
560                 //value=xmlhttp.responseText;
561                 //debugfilter(value+"-----"+new_configuration);
562                 document.getElementById('column_configuration').value=value;
563                 document.getElementById('full_column_configuration').value=new_configuration;
564
565                 if (reload)
566                         window.location.reload(true);
567             }
568           }
569
570         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);
571         //xmlhttp.open("GET","/plekit/php/updateConf.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id+"&tagName=Columnconf",true);
572
573         xmlhttp.send();
574 }
575
576 function logSortingAction(person_id, slice_id, value)
577 {
578
579
580         var req = getHTTPObject();
581         var url = "/plekit/php/logSorting.php?value="+value+"&slice_id="+slice_id+"&person_id="+person_id;
582
583         req.open('GET', url, true);
584         req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
585         req.onreadystatechange =
586         function() {
587                 if (req.readyState == 4)
588                 { debugfilter(req.responseText); }
589         }
590         req.send(null);
591 }
592
593 function sortCompleteCallback(tableid) {
594
595         var slice_id = document.getElementById('slice_id').value;
596         var person_id = document.getElementById('person_id').value;
597
598         var ths = document.getElementById(tableid).getElementsByTagName("th");
599         for(var i = 0, th; th = ths[i]; i++) {
600         if (th.className.indexOf("Sort") != -1)
601         {
602                 //debugfilter("sorted"+th.getAttribute("name"));
603
604                 var column_name = th.getAttribute("name");
605                 var hclass = th.className;
606                 var column = hclass.substr(hclass.indexOf("column"),hclass.indexOf("column")+1);
607                 var sortdirection = "forward";
608                 if (hclass.indexOf("reverse")!=-1)
609                         sortdirection = "reverse";
610
611                 if (column.indexOf("column-1")==-1 && column.indexOf("column-0")==-1)
612                         logSortingAction(person_id, slice_id, tableid+"|"+column_name+"|"+sortdirection);
613         }
614         }
615 }
616
617
618 function addColumnToConfiguration(column) {
619
620         var old_configuration = document.getElementById('column_configuration').value;
621
622         var new_configuration = "";
623
624         if (old_configuration != "")
625                 new_configuration = old_configuration += "|"+column;
626         else
627                 new_configuration = column;
628
629         //debugfilter("new configuration = "+new_configuration);
630
631         updateColumnConfiguration(new_configuration, false);
632 }
633
634
635 function deleteColumnFromConfiguration(column) {
636
637         var old_configuration = document.getElementById('column_configuration').value;
638
639         var old_columns = old_configuration.split("|");
640         var new_columns = new Array();
641
642         for (var column_index = 0; column_index < old_columns.length ; column_index++) {
643                 var conf = old_columns[column_index].split(':');
644                 if (conf[0] != column)
645                         new_columns.push(old_columns[column_index]);
646         }
647
648         var new_configuration = new_columns.join("|");
649         updateColumnConfiguration(new_configuration, false);
650
651 }
652
653 function replaceColumnConfiguration(column_old, column_new) {
654
655         var old_configuration = document.getElementById('column_configuration').value;
656
657         var old_columns = old_configuration.split("|");
658         var new_columns = new Array();
659
660         var olds = column_old.split(':');
661
662         for (var column_index = 0; column_index < old_columns.length ; column_index++) {
663                 var conf = old_columns[column_index].split(':');
664                 if (conf[0] != olds[0])
665                         new_columns.push(old_columns[column_index]);
666                 else
667                         new_columns.push(column_new);
668         }
669
670         var new_configuration = new_columns.join("|");
671         
672         updateColumnConfiguration(new_configuration);
673 }
674
675 /*
676  
677 ADD/REMOVE COLUMNS
678
679 */
680
681 function convert_data(value, data_source, data_type, tagname) {
682
683         //debugfilter("v["+tagname+"]="+value+"-");
684
685         if (value == "" || value == "n/a" || value == null || value == "NaN" || value == "None")
686                 return "n/a";
687
688         if (tagname == "uptime") {
689                 return parseInt((parseFloat(value) / 86400));
690         }
691         
692         if (data_type == "date") {
693
694                 var date = new Date(value*1000);
695
696                 var year = date.getFullYear();
697                 var month = date.getMonth()+1;
698                 if (month < 10)
699                         month = "0"+month;
700                 var day = date.getDate();
701                 if (day < 10)
702                         day = "0"+day;
703         
704                 return year + '-' + month + '-' + day;
705         }
706
707         return value;
708 }
709
710
711 function load_data(column, header, url, data_source, data_type, tagname) {
712
713         //debugfilter("<br>loading "+url);
714         var req = getHTTPObject();
715         var res;
716         req.open('GET', url, true);
717         req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
718         req.onreadystatechange =
719         function() {
720                 if (req.readyState == 4)
721                 { updateColumnData(column, header, req.responseText, data_source, data_type, tagname); }
722         }
723         req.send(null);
724 }
725
726
727 function updateColumnData(column, header, data, data_source, data_type, tagname) {
728
729 var headers = header.split("|");
730 var data_table = data.split("|"); 
731
732 //debugfilter("<p>headers[0] = "+headers[0]);
733 //debugfilter("<p>data[2] = "+data_table[2]);
734
735 //debugfilter("data = "+data + " with type "+data_type + " and source "+data_source);
736 //debugfilter("<p>data table length = "+data_table.length);
737
738 if (data_table.length > 1)
739 {
740   
741   var node_data;
742
743   var table_id1 = 'nodes';
744   var table=$(table_id1);
745   var css='#'+table_id1+'>tbody';
746   var rows = $$(css)[0].rows;
747
748   var data_array1 = new Array();
749
750   //debugfilter("COLUMN "+column+"<p>");
751
752   for (var node_index = 1; node_index < data_table.length; node_index++) {
753         if (data_table[node_index] == '---potential---')        
754                 break;
755         node_data = data_table[node_index].split(':');
756
757         data_array1[node_data[0]] = new Array();
758
759         for (var h_index=0; h_index < headers.length; h_index++) {
760                 
761                 if (node_data[h_index+1] == "" || node_data[h_index+1] == "None")
762                         data_array1[node_data[0]][h_index] = "n/a";
763                 else
764                         data_array1[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
765         }
766
767   }
768         
769
770   if (rows)
771   for (var row_index = 0; row_index < rows.length ; row_index++) {
772     var tr=rows[row_index];
773
774     for (var column_index=0; column_index < tr.cells.length; column_index++) {
775                 //debugfilter("<p>node id = "+tr.cells[0].innerHTML+" - "+tr.cells[column_index].getAttribute('name'));
776                 if (tr.cells[column_index].getAttribute('name'))
777                 {
778                 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
779                 if (found_index != -1)
780                         //debugfilter(tr.cells[0].innerHTML+"-"+found_index);
781                         tr.cells[column_index].innerHTML = data_array1[tr.cells[0].innerHTML][found_index];
782                 }
783     }
784   }
785
786   //debugfilter("Reset sorting .....");
787   //tablePaginater.init(table_id1);
788   fdTableSort.init(table_id1);
789
790 //potential nodes
791 if (data_table[node_index] == '---potential---')        
792 {
793
794   var table_id2 = 'add_nodes';
795   var table2=$(table_id2);
796   var css2='#'+table_id2+'>tbody';
797   var rows2 = $$(css2)[0].rows;
798
799   var data_array2 = new Array();
800
801   //debugfilter("COLUMN "+column+"<p>");
802
803   for (; node_index < data_table.length; node_index++) {
804         if (data_table[node_index] == '')       
805                 continue;
806         node_data = data_table[node_index].split(':');
807
808         data_array2[node_data[0]] = new Array();
809
810         for (var h_index=0; h_index < headers.length; h_index++) {
811                 
812                 if (node_data[h_index+1] == "")
813                         data_array2[node_data[0]][h_index] = "n/a";
814                 else
815                         data_array2[node_data[0]][h_index] = convert_data(node_data[h_index+1], data_source, data_type, tagname);
816         }
817   }
818         
819   if (rows)
820   for (var row_index = 0; row_index < rows2.length ; row_index++) {
821     var tr=rows2[row_index];
822
823     for (var column_index=0; column_index < tr.cells.length; column_index++) {
824                 if (tr.cells[column_index].getAttribute('name'))
825                 {
826                 var found_index = headers.indexOf(tr.cells[column_index].getAttribute('name'));
827                 if (found_index != -1)
828                         tr.cells[column_index].innerHTML = data_array2[tr.cells[0].innerHTML][found_index];
829                 }
830     }
831   }
832   fdTableSort.init(table_id2);
833   //tablePaginater.init(table_id2);
834
835 }
836
837   //fdTableSort.removeTableCache(table_id2);
838   //document.getElementById('loading'+column).innerHTML = "";
839   
840 }
841
842
843 document.getElementById('loading'+column).innerHTML = "";
844
845 }
846
847
848 function addColumnCells(header) {
849
850         var cells = document.getElementsByName(header);
851
852         //debugfilter("got cells -"+cells+"- for "+header);
853         for(var j = 0; j < cells.length; j++) 
854                 cells[j].style.display = "table-cell";
855 }
856
857 function addSampleCells(column) {
858
859         var cellsheader = document.getElementsByName("confheader"+column);
860         for(var j = 0; j < cellsheader.length; j++) 
861                 cellsheader[j].style.display = "table-cell";
862
863 }
864
865 function addColumnAjax(column, header) {
866
867         //var t = document.getElementById('check'+column).name;
868         var t = document.getElementById('tagname'+header).value;
869         var slice_id = document.getElementById('slice_id').value;
870
871         var selectedperiod = document.getElementById('period'+column).value;
872         var fetched = document.getElementById('fetched'+column).value;
873         var data_source = document.getElementById('source'+column).value;
874         var data_type = document.getElementById('type'+column).value;
875         var to_load = false;
876
877         //debugfilter("<br>adding "+column+","+header+','+fetched+','+t+','+data_source+','+data_type);
878
879         if (fetched.indexOf("false")!=-1)
880         {
881                 to_load = true;
882                 document.getElementById('fetched'+column).value = ','+selectedperiod+',true';
883         }
884         else if (fetched.indexOf(','+selectedperiod+',')==-1)
885         {
886                         to_load = true;
887                         document.getElementById('fetched'+column).value = ','+selectedperiod+''+fetched;
888         }
889
890         if (to_load)
891         {
892                 //debugfilter("ready to load ... ");
893                 document.getElementById('loading'+column).innerHTML = "<img width=10 src=/plekit/icons/ajax-loader.gif>";
894                 var url = "/plekit/php/updateColumn.php?slice_id="+slice_id+"&tagName="+t+"&data_type="+data_type+"&data_source="+data_source;
895                 //debugfilter("calling "+url);
896                 load_data(column, header, url, data_source, data_type, t);
897         }
898 }
899
900
901
902 function addColumn(column, fetch) {
903
904         var selectedperiod="";
905         var header=column;
906         var conf="";
907
908
909         if (inTypeC(column)!=-1)
910         {
911                 column = column.substring(0,column.length-1);
912         }
913
914         selectedperiod = document.getElementById('period'+column).value;
915         header = column+""+selectedperiod;
916
917         conf = header;
918
919         //debugfilter("adding column "+column+" and header "+header+" and conf = "+conf);
920
921         addColumnCells(header);
922
923         if (fetch)
924                 addColumnAjax(column, header);
925
926         addColumnToConfiguration(conf);
927 }
928
929
930 function deleteColumnCells(header) {
931
932         var cells = document.getElementsByName(header);
933         for(var j = 0; j < cells.length; j++) 
934                 cells[j].style.display = "none";
935
936 }
937
938
939 function deleteColumn(column) {
940
941         var selectedperiod="";
942         var header=column;
943
944         selectedperiod = document.getElementById('period'+column).value;
945         header = column+""+selectedperiod;
946
947         //debugfilter("deleting "+column+","+header);
948
949         deleteColumnCells(header);
950
951         deleteColumnFromConfiguration(header);
952 }
953
954