Subversion Repositories ALCASAR

Rev

Rev 3037 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3037 Rev 3100
1
var langxml = [], langarr = [], current_language = "", plugins = [], blocks = [], plugin_liste = [],
1
var langxml = [], langarr = [], current_language = "", plugins = [], blocks = [], plugin_liste = [],
2
     showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, oldnetwork = [], refrTimer;
2
     showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, oldnetwork = [], refrTimer;
3
 
3
 
4
/**
4
/**
5
 * generate a cookie, if not exist, and add an entry to it<br><br>
5
 * generate a cookie, if not exist, and add an entry to it<br><br>
6
 * inspired by <a href="http://www.quirksmode.org/js/cookies.html">http://www.quirksmode.org/js/cookies.html</a>
6
 * inspired by <a href="http://www.quirksmode.org/js/cookies.html">http://www.quirksmode.org/js/cookies.html</a>
7
 * @param {String} name name that holds the value
7
 * @param {String} name name that holds the value
8
 * @param {String} value value that needs to be stored
8
 * @param {String} value value that needs to be stored
9
 * @param {Number} days how many days the entry should be valid in the cookie
9
 * @param {Number} days how many days the entry should be valid in the cookie
10
 */
10
 */
11
function createCookie(name, value, days) {
11
function createCookie(name, value, days) {
12
    var date = new Date(), expires = "";
12
    var date = new Date(), expires = "";
13
    if (days) {
13
    if (days) {
14
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
14
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
15
        if (typeof(date.toUTCString)==="function") {
15
        if (typeof(date.toUTCString)==="function") {
16
            expires = "; expires=" + date.toUTCString();
16
            expires = "; expires=" + date.toUTCString();
17
        } else {
17
        } else {
18
            //deprecated
18
            //deprecated
19
            expires = "; expires=" + date.toGMTString();
19
            expires = "; expires=" + date.toGMTString();
20
        }
20
        }
21
    } else {
21
    } else {
22
        expires = "";
22
        expires = "";
23
    }
23
    }
24
    document.cookie = name + "=" + value + expires + "; path=/; samesite=strict";
24
    document.cookie = name + "=" + value + expires + "; path=/; samesite=strict";
25
}
25
}
26
 
26
 
27
/**
27
/**
28
 * read a value out of a cookie and return the value<br><br>
28
 * read a value out of a cookie and return the value<br><br>
29
 * inspired by <a href="http://www.quirksmode.org/js/cookies.html">http://www.quirksmode.org/js/cookies.html</a>
29
 * inspired by <a href="http://www.quirksmode.org/js/cookies.html">http://www.quirksmode.org/js/cookies.html</a>
30
 * @param {String} name name of the value that should be retrieved
30
 * @param {String} name name of the value that should be retrieved
31
 * @return {String}
31
 * @return {String}
32
 */
32
 */
33
function readCookie(name) {
33
function readCookie(name) {
34
    var nameEQ = "", ca = [], c = '';
34
    var nameEQ = "", ca = [], c = '';
35
    nameEQ = name + "=";
35
    nameEQ = name + "=";
36
    ca = document.cookie.split(';');
36
    ca = document.cookie.split(';');
37
    for (var i = 0; i < ca.length; i++) {
37
    for (var i = 0; i < ca.length; i++) {
38
        c = ca[i];
38
        c = ca[i];
39
        while (c.charAt(0) === ' ') {
39
        while (c.charAt(0) === ' ') {
40
            c = c.substring(1, c.length);
40
            c = c.substring(1, c.length);
41
        }
41
        }
42
        if (!c.indexOf(nameEQ)) {
42
        if (!c.indexOf(nameEQ)) {
43
            return c.substring(nameEQ.length, c.length);
43
            return c.substring(nameEQ.length, c.length);
44
        }
44
        }
45
    }
45
    }
46
    return null;
46
    return null;
47
}
47
}
48
 
48
 
49
/**
49
/**
50
 * activates a given style and disables the old one in the document
50
 * activates a given style and disables the old one in the document
51
 * @param {String} template template that should be activated
51
 * @param {String} template template that should be activated
52
 */
52
 */
53
function switchStyle(template) {
53
function switchStyle(template) {
54
    $("#PSI_Template")[0].setAttribute('href', 'templates/' + template + "_bootstrap.css");
54
    $("#PSI_Template")[0].setAttribute('href', 'templates/' + template + "_bootstrap.css");
55
}
55
}
56
 
56
 
57
/**
57
/**
58
 * load the given translation an translate the entire page<br><br>retrieving the translation is done through a
58
 * load the given translation an translate the entire page<br><br>retrieving the translation is done through a
59
 * ajax call
59
 * ajax call
60
 * @private
60
 * @private
61
 * @param {String} plugin if plugin is given, the plugin translation file will be read instead of the main translation file
61
 * @param {String} plugin if plugin is given, the plugin translation file will be read instead of the main translation file
62
 * @param {String} langarrId internal plugin name
62
 * @param {String} langarrId internal plugin name
63
 * @return {jQuery} translation jQuery-Object
63
 * @return {jQuery} translation jQuery-Object
64
 */
64
 */
65
function getLanguage(plugin, langarrId) {
65
function getLanguage(plugin, langarrId) {
66
    var getLangUrl = "";
66
    var getLangUrl = "";
67
    if (current_language) {
67
    if (current_language) {
68
        getLangUrl = 'language/language.php?lang=' + current_language;
68
        getLangUrl = 'language/language.php?lang=' + current_language;
69
        if (plugin) {
69
        if (plugin) {
70
            getLangUrl += "&plugin=" + plugin;
70
            getLangUrl += "&plugin=" + plugin;
71
        }
71
        }
72
    } else {
72
    } else {
73
        getLangUrl = 'language/language.php';
73
        getLangUrl = 'language/language.php';
74
        if (plugin) {
74
        if (plugin) {
75
            getLangUrl += "?plugin=" + plugin;
75
            getLangUrl += "?plugin=" + plugin;
76
        }
76
        }
77
    }
77
    }
78
    $.ajax({
78
    $.ajax({
79
        url: getLangUrl,
79
        url: getLangUrl,
80
        type: 'GET',
80
        type: 'GET',
81
        dataType: 'xml',
81
        dataType: 'xml',
82
        timeout: 100000,
82
        timeout: 100000,
83
        error: function error() {
83
        error: function error() {
84
            $("#errors").append("<li><b>Error loading language</b> - " + getLangUrl + "</li><br>");
84
            $("#errors").append("<li><b>Error loading language</b> - " + getLangUrl + "</li><br>");
85
            $("#errorbutton").attr('data-toggle', 'modal');
85
            $("#errorbutton").attr('data-toggle', 'modal');
86
            $("#errorbutton").css('cursor', 'pointer');
86
            $("#errorbutton").css('cursor', 'pointer');
87
            $("#errorbutton").css("visibility", "visible");
87
            $("#errorbutton").css("visibility", "visible");
88
        },
88
        },
89
        success: function buildblocks(xml) {
89
        success: function buildblocks(xml) {
90
            var idexp;
90
            var idexp;
91
            langxml[langarrId] = xml;
91
            langxml[langarrId] = xml;
92
            if (langarr[langarrId] === undefined) {
92
            if (langarr[langarrId] === undefined) {
93
                langarr.push(langarrId);
93
                langarr.push(langarrId);
94
                langarr[langarrId] = [];
94
                langarr[langarrId] = [];
95
            }
95
            }
96
            $("expression", langxml[langarrId]).each(function langstore(id) {
96
            $("expression", langxml[langarrId]).each(function langstore(id) {
97
                idexp = $("expression", xml).get(id);
97
                idexp = $("expression", xml).get(id);
98
                langarr[langarrId][this.getAttribute('id')] = $("exp", idexp).text().toString().replace(/\//g, "/<wbr>");
98
                langarr[langarrId][this.getAttribute('id')] = $("exp", idexp).text().toString().replace(/\//g, "/<wbr>");
99
            });
99
            });
100
            changeSpanLanguage(plugin);
100
            changeSpanLanguage(plugin);
101
        }
101
        }
102
    });
102
    });
103
}
103
}
104
 
104
 
105
/**
105
/**
106
 * generate a span tag
106
 * generate a span tag
107
 * @param {Number} id translation id in the xml file
107
 * @param {Number} id translation id in the xml file
108
 * @param {String} [plugin] name of the plugin for which the tag should be generated
108
 * @param {String} [plugin] name of the plugin for which the tag should be generated
109
 * @param {String} [defaultvalue] default value
109
 * @param {String} [defaultvalue] default value
110
 * @return {String} string which contains generated span tag for translation string
110
 * @return {String} string which contains generated span tag for translation string
111
 */
111
 */
112
function genlang(id, plugin, defaultvalue) {
112
function genlang(id, plugin, defaultvalue) {
113
    var html = "", idString = "", plugname = "",
113
    var html = "", idString = "", plugname = "",
114
        langarrId = current_language + "_";
114
        langarrId = current_language + "_";
115
 
115
 
116
    if (plugin === undefined) {
116
    if (plugin === undefined) {
117
        plugname = "";
117
        plugname = "";
118
        langarrId += "phpSysInfo";
118
        langarrId += "phpSysInfo";
119
    } else {
119
    } else {
120
        plugname = plugin.toLowerCase();
120
        plugname = plugin.toLowerCase();
121
        langarrId += plugname;
121
        langarrId += plugname;
122
    }
122
    }
123
 
123
 
124
    if (id < 100) {
124
    if (id < 100) {
125
        if (id < 10) {
125
        if (id < 10) {
126
            idString = "00" + id.toString();
126
            idString = "00" + id.toString();
127
        } else {
127
        } else {
128
            idString = "0" + id.toString();
128
            idString = "0" + id.toString();
129
        }
129
        }
130
    } else {
130
    } else {
131
        idString = id.toString();
131
        idString = id.toString();
132
    }
132
    }
133
    if (plugin) {
133
    if (plugin) {
134
        idString = "plugin_" + plugname + "_" + idString;
134
        idString = "plugin_" + plugname + "_" + idString;
135
    }
135
    }
136
 
136
 
137
    html += "<span class=\"lang_" + idString + "\">";
137
    html += "<span class=\"lang_" + idString + "\">";
138
 
138
 
139
    if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) {
139
    if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) {
140
        html += langarr[langarrId][idString];
140
        html += langarr[langarrId][idString];
141
    } else if (defaultvalue !== undefined) {
141
    } else if (defaultvalue !== undefined) {
142
        html += defaultvalue;
142
        html += defaultvalue;
143
    }
143
    }
144
 
144
 
145
    html += "</span>";
145
    html += "</span>";
146
 
146
 
147
    return html;
147
    return html;
148
}
148
}
149
 
149
 
150
/**
150
/**
151
 * translates all expressions based on the translation xml file<br>
151
 * translates all expressions based on the translation xml file<br>
152
 * translation expressions must be in the format &lt;span class="lang_???"&gt;&lt;/span&gt;, where ??? is
152
 * translation expressions must be in the format &lt;span class="lang_???"&gt;&lt;/span&gt;, where ??? is
153
 * the number of the translated expression in the xml file<br><br>if a translated expression is not found in the xml
153
 * the number of the translated expression in the xml file<br><br>if a translated expression is not found in the xml
154
 * file nothing would be translated, so the initial value which is inside the span tag is displayed
154
 * file nothing would be translated, so the initial value which is inside the span tag is displayed
155
 * @param {String} [plugin] name of the plugin
155
 * @param {String} [plugin] name of the plugin
156
 */
156
 */
157
function changeLanguage(plugin) {
157
function changeLanguage(plugin) {
158
    var langarrId = current_language + "_";
158
    var langarrId = current_language + "_";
159
 
159
 
160
    if (plugin === undefined) {
160
    if (plugin === undefined) {
161
        langarrId += "phpSysInfo";
161
        langarrId += "phpSysInfo";
162
    } else {
162
    } else {
163
        langarrId += plugin;
163
        langarrId += plugin;
164
    }
164
    }
165
 
165
 
166
    if (langxml[langarrId] !== undefined) {
166
    if (langxml[langarrId] !== undefined) {
167
        changeSpanLanguage(plugin);
167
        changeSpanLanguage(plugin);
168
    } else {
168
    } else {
169
        langxml.push(langarrId);
169
        langxml.push(langarrId);
170
        getLanguage(plugin, langarrId);
170
        getLanguage(plugin, langarrId);
171
    }
171
    }
172
}
172
}
173
 
173
 
174
function changeSpanLanguage(plugin) {
174
function changeSpanLanguage(plugin) {
175
    var langId = "", langStr = "", langarrId = current_language + "_";
175
    var langId = "", langStr = "", langarrId = current_language + "_";
176
 
176
 
177
    if (plugin === undefined) {
177
    if (plugin === undefined) {
178
        langarrId += "phpSysInfo";
178
        langarrId += "phpSysInfo";
179
        $('span[class*=lang_]').each(function translate(i) {
179
        $('span[class*=lang_]').each(function translate(i) {
180
            langId = this.className.substring(5);
180
            langId = this.className.substring(5);
181
            if (langId.indexOf('plugin_') !== 0) { //does not begin with plugin_
181
            if (langId.indexOf('plugin_') !== 0) { //does not begin with plugin_
182
                langStr = langarr[langarrId][langId];
182
                langStr = langarr[langarrId][langId];
183
                if (langStr !== undefined) {
183
                if (langStr !== undefined) {
184
                    if (langStr.length > 0) {
184
                    if (langStr.length > 0) {
185
                        this.innerHTML = langStr;
185
                        this.innerHTML = langStr;
186
                    }
186
                    }
187
                }
187
                }
188
            }
188
            }
189
        });
189
        });
190
        $("#select").css( "display", "table-cell" ); //show if any language loaded
190
        $("#select").css( "display", "table-cell" ); //show if any language loaded
191
        $("#output").show();
191
        $("#output").show();
192
    } else {
192
    } else {
193
        langarrId += plugin;
193
        langarrId += plugin;
194
        $('span[class*=lang_plugin_'+plugin.toLowerCase()+'_]').each(function translate(i) {
194
        $('span[class*=lang_plugin_'+plugin.toLowerCase()+'_]').each(function translate(i) {
195
            langId = this.className.substring(5);
195
            langId = this.className.substring(5);
196
            langStr = langarr[langarrId][langId];
196
            langStr = langarr[langarrId][langId];
197
            if (langStr !== undefined) {
197
            if (langStr !== undefined) {
198
                if (langStr.length > 0) {
198
                if (langStr.length > 0) {
199
                    this.innerHTML = langStr;
199
                    this.innerHTML = langStr;
200
                }
200
                }
201
            }
201
            }
202
        });
202
        });
203
        $('#panel_'+plugin.toLowerCase()).show(); //show plugin if any language loaded
203
        $('#panel_'+plugin.toLowerCase()).show(); //show plugin if any language loaded
204
    }
204
    }
205
}
205
}
206
 
206
 
207
function reload(initiate) {
207
function reload(initiate) {
208
    $("#errorbutton").css("visibility", "hidden");
208
    $("#errorbutton").css("visibility", "hidden");
209
    $("#errorbutton").css('cursor', 'default');
209
    $("#errorbutton").css('cursor', 'default');
210
    $("#errorbutton").attr('data-toggle', '');
210
    $("#errorbutton").attr('data-toggle', '');
211
    $("#errors").empty();
211
    $("#errors").empty();
212
    $.ajax({
212
    $.ajax({
213
        dataType: "json",
213
        dataType: "json",
214
        url: "xml.php?json",
214
        url: "xml.php?json",
215
        error: function(jqXHR, status, thrownError) {
215
        error: function(jqXHR, status, thrownError) {
216
            if ((status === "parsererror") && (typeof(xmlDoc = $.parseXML(jqXHR.responseText)) === "object")) {
216
            if ((status === "parsererror") && (typeof(xmlDoc = $.parseXML(jqXHR.responseText)) === "object")) {
217
                var errs = 0;
217
                var errs = 0;
218
                try {
218
                try {
219
                    $(xmlDoc).find("Error").each(function() {
219
                    $(xmlDoc).find("Error").each(function() {
220
                        $("#errors").append("<li><b>"+$(this)[0].attributes.Function.nodeValue+"</b> - "+$(this)[0].attributes.Message.nodeValue.replace(/\n/g, "<br>")+"</li><br>");
220
                        $("#errors").append("<li><b>"+$(this)[0].attributes.Function.nodeValue+"</b> - "+$(this)[0].attributes.Message.nodeValue.replace(/\n/g, "<br>")+"</li><br>");
221
                        errs++;
221
                        errs++;
222
                    });
222
                    });
223
                }
223
                }
224
                catch (err) {
224
                catch (err) {
225
                }
225
                }
226
                if (errs > 0) {
226
                if (errs > 0) {
227
                    $("#errorbutton").attr('data-toggle', 'modal');
227
                    $("#errorbutton").attr('data-toggle', 'modal');
228
                    $("#errorbutton").css('cursor', 'pointer');
228
                    $("#errorbutton").css('cursor', 'pointer');
229
                    $("#errorbutton").css("visibility", "visible");
229
                    $("#errorbutton").css("visibility", "visible");
230
                }
230
                }
231
            }
231
            }
232
        },
232
        },
233
        success: function (data) {
233
        success: function (data) {
234
//            console.log(data);
234
//            console.log(data);
235
//            data_dbg = data;
235
//            data_dbg = data;
236
            if ((typeof(initiate) === 'boolean') && (data.Options !== undefined) && (data.Options["@attributes"] !== undefined) && ((refrtime = data.Options["@attributes"].refresh) !== undefined) && (refrtime !== "0")) {
236
            if ((typeof(initiate) === 'boolean') && (data.Options !== undefined) && (data.Options["@attributes"] !== undefined) && ((refrtime = data.Options["@attributes"].refresh) !== undefined) && (refrtime !== "0")) {
237
                    if ((initiate === false) && (typeof(refrTimer) === 'number')) {
237
                    if ((initiate === false) && (typeof(refrTimer) === 'number')) {
238
                        clearInterval(refrTimer);
238
                        clearInterval(refrTimer);
239
                    }
239
                    }
240
                    refrTimer = setInterval(reload, refrtime);
240
                    refrTimer = setInterval(reload, refrtime);
241
            }
241
            }
242
            renderErrors(data);
242
            renderErrors(data);
243
            renderVitals(data);
243
            renderVitals(data);
244
            renderHardware(data);
244
            renderHardware(data);
245
            renderMemory(data);
245
            renderMemory(data);
246
            renderFilesystem(data);
246
            renderFilesystem(data);
247
            renderNetwork(data);
247
            renderNetwork(data);
248
            renderVoltage(data);
248
            renderVoltage(data);
249
            renderTemperature(data);
249
            renderTemperature(data);
250
            renderFans(data);
250
            renderFans(data);
251
            renderPower(data);
251
            renderPower(data);
252
            renderCurrent(data);
252
            renderCurrent(data);
253
            renderOther(data);
253
            renderOther(data);
254
            renderUPS(data);
254
            renderUPS(data);
255
            changeLanguage();
255
            changeLanguage();
256
        }
256
        }
257
    });
257
    });
258
 
258
 
259
    for (var i = 0; i < plugins.length; i++) {
259
    for (var i = 0; i < plugins.length; i++) {
260
        plugin_request(plugins[i]);
260
        plugin_request(plugins[i]);
261
        if ($("#reload_"+plugins[i]).length > 0) {
261
        if ($("#reload_"+plugins[i]).length > 0) {
262
            $("#reload_"+plugins[i]).attr("title", "reload");
262
            $("#reload_"+plugins[i]).attr("title", "reload");
263
        }
263
        }
264
 
264
 
265
    }
265
    }
266
 
266
 
267
    if ((typeof(initiate) === 'boolean') && (initiate === true)) {
267
    if ((typeof(initiate) === 'boolean') && (initiate === true)) {
268
        for (var j = 0; j < plugins.length; j++) {
268
        for (var j = 0; j < plugins.length; j++) {
269
            if ($("#reload_"+plugins[j]).length > 0) {
269
            if ($("#reload_"+plugins[j]).length > 0) {
270
                $("#reload_"+plugins[j]).click(clickfunction());
270
                $("#reload_"+plugins[j]).click(clickfunction());
271
            }
271
            }
272
        }
272
        }
273
    }
273
    }
274
}
274
}
275
 
275
 
276
function clickfunction(){
276
function clickfunction(){
277
    return function(){
277
    return function(){
278
        plugin_request(this.id.substring(7)); //cut "reload_" from name
278
        plugin_request(this.id.substring(7)); //cut "reload_" from name
279
        $(this).attr("title", datetime());
279
        $(this).attr("title", datetime());
280
    };
280
    };
281
}
281
}
282
 
282
 
283
/**
283
/**
284
 * load the plugin json via ajax
284
 * load the plugin json via ajax
285
 */
285
 */
286
function plugin_request(pluginname) {
286
function plugin_request(pluginname) {
287
 
287
 
288
    $.ajax({
288
    $.ajax({
289
         dataType: "json",
289
         dataType: "json",
290
         url: "xml.php?plugin=" + pluginname + "&json",
290
         url: "xml.php?plugin=" + pluginname + "&json",
291
         pluginname: pluginname,
291
         pluginname: pluginname,
292
         success: function (data) {
292
         success: function (data) {
293
            try {
293
            try {
294
                for (var propertyName in data.Plugins) {
294
                for (var propertyName in data.Plugins) {
295
                    if ((data.Plugins[propertyName]["@attributes"] !== undefined) && 
295
                    if ((data.Plugins[propertyName]["@attributes"] !== undefined) && 
296
                       ((hostname = data.Plugins[propertyName]["@attributes"]["Hostname"]) !== undefined)) {
296
                       ((hostname = data.Plugins[propertyName]["@attributes"]["Hostname"]) !== undefined)) {
297
                        $('span[class=hostname_' + pluginname + ']').html(hostname);
297
                        $('span[class=hostname_' + pluginname + ']').html(hostname);
298
                    }
298
                    }
299
                    break;
299
                    break;
300
                }
300
                }
301
                // dynamic call
301
                // dynamic call
302
                window['renderPlugin_' + this.pluginname](data);
302
                window['renderPlugin_' + this.pluginname](data);
303
                changeLanguage(this.pluginname);
303
                changeLanguage(this.pluginname);
304
                plugin_liste.pushIfNotExist(this.pluginname);
304
                plugin_liste.pushIfNotExist(this.pluginname);
305
            }
305
            }
306
            catch (err) {
306
            catch (err) {
307
            }
307
            }
308
            renderErrors(data);
308
            renderErrors(data);
309
        }
309
        }
310
    });
310
    });
311
}
311
}
312
 
312
 
313
 
313
 
314
$(document).ready(function () {
314
$(document).ready(function () {
315
    var old_template = null, cookie_template = null, cookie_language = null, plugtmp = "", blocktmp = "", ua = null, useragent = navigator.userAgent;
315
    var old_template = null, cookie_template = null, cookie_language = null, plugtmp = "", blocktmp = "", ua = null, useragent = navigator.userAgent;
316
 
316
 
317
    if ($("#hideBootstrapLoader").val().toString()!=="true") {
317
    if ($("#hideBootstrapLoader").val().toString()!=="true") {
318
        $(document).ajaxStart(function () {
318
        $(document).ajaxStart(function () {
319
            $("#loader").css("visibility", "visible");
319
            $("#loader").css("visibility", "visible");
320
        });
320
        });
321
        $(document).ajaxStop(function () {
321
        $(document).ajaxStop(function () {
322
            $("#loader").css("visibility", "hidden");
322
            $("#loader").css("visibility", "hidden");
323
        });
323
        });
324
    }
324
    }
325
 
325
 
326
    if ((ua=useragent.match(/Version\/(\d+)\.[\d\.]+ (Mobile\/\S+ )?Safari\//)) !== null) {
326
    if ((ua=useragent.match(/Version\/(\d+)\.[\d\.]+ (Mobile\/\S+ )?Safari\//)) !== null) {
327
        if (ua[1]<=5) {
327
        if (ua[1]<=5) {
328
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari5.css');
328
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari5.css');
329
        } else if (ua[1]<=8) {
329
        } else if (ua[1]<=8) {
330
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari8.css');
330
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari8.css');
331
        }
331
        }
332
    } else if ((ua=useragent.match(/Firefox\/(\d+)\.[\d\.]+/))  !== null) {
332
    } else if ((ua=useragent.match(/Firefox\/(\d+)\.[\d\.]+/))  !== null) {
333
        if (ua[1]<=15) {
333
        if (ua[1]<=15) {
334
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox15.css');
334
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox15.css');
335
        } else if (ua[1]<=20) {
335
        } else if (ua[1]<=20) {
336
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox20.css');
336
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox20.css');
337
        } else if (ua[1]<=27) {
337
        } else if (ua[1]<=27) {
338
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox27.css');
338
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox27.css');
339
        } else if (ua[1]==28) {
339
        } else if (ua[1]==28) {
340
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox28.css');
340
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox28.css');
341
        }
341
        }
342
    } else if ((ua=useragent.match(/Midori\/(\d+)\.?(\d+)?/))  !== null) {
342
    } else if ((ua=useragent.match(/Midori\/(\d+)\.?(\d+)?/))  !== null) {
343
        if ((ua[1]==0) && (ua.length==3) && (ua[2]<=4)) {
343
        if ((ua[1]==0) && (ua.length==3) && (ua[2]<=4)) {
344
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori04.css');
344
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori04.css');
345
        } else if ((ua[1]==0) && (ua.length==3) && (ua[2]==5)) {
345
        } else if ((ua[1]==0) && (ua.length==3) && (ua[2]==5)) {
346
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori05.css');
346
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori05.css');
347
        }
347
        }
348
    } else if ((ua=useragent.match(/Chrome\/(\d+)\.[\d\.]+/))  !== null) {
348
    } else if ((ua=useragent.match(/Chrome\/(\d+)\.[\d\.]+/))  !== null) {
349
        if (ua[1]<=25) {
349
        if (ua[1]<=25) {
350
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome25.css');
350
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome25.css');
351
        } else if (ua[1]<=28) {
351
        } else if (ua[1]<=28) {
352
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome28.css');
352
            $("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome28.css');
353
        }
353
        }
354
    }
354
    }
355
 
355
 
356
    $(window).resize();
356
    $(window).resize();
357
 
357
 
358
    sorttable.init();
358
    sorttable.init();
359
 
359
 
360
    showCPUListExpanded = $("#showCPUListExpanded").val().toString()==="true";
360
    showCPUListExpanded = $("#showCPUListExpanded").val().toString()==="true";
361
    showCPUInfoExpanded = $("#showCPUInfoExpanded").val().toString()==="true";
361
    showCPUInfoExpanded = $("#showCPUInfoExpanded").val().toString()==="true";
362
    showNetworkInfosExpanded = $("#showNetworkInfosExpanded").val().toString()==="true";
362
    showNetworkInfosExpanded = $("#showNetworkInfosExpanded").val().toString()==="true";
363
    showCPULoadCompact = $("#showCPULoadCompact").val().toString()==="true";
363
    showCPULoadCompact = $("#showCPULoadCompact").val().toString()==="true";
364
    switch ($("#showNetworkActiveSpeed").val().toString()) {
364
    switch ($("#showNetworkActiveSpeed").val().toString()) {
365
        case "bps":  showNetworkActiveSpeed = 2;
365
        case "bps":  showNetworkActiveSpeed = 2;
366
                      break;
366
                      break;
367
        case "true": showNetworkActiveSpeed = 1;
367
        case "true": showNetworkActiveSpeed = 1;
368
                      break;
368
                      break;
369
        default:     showNetworkActiveSpeed = 0;
369
        default:     showNetworkActiveSpeed = 0;
370
    }
370
    }
371
 
371
 
372
    blocktmp = $("#blocks").val().toString();
372
    blocktmp = $("#blocks").val().toString();
373
    if (blocktmp.length >0 ){
373
    if (blocktmp.length >0 ){
374
        if (blocktmp === "true") {
374
        if (blocktmp === "true") {
375
            blocks[0] = "true";
375
            blocks[0] = "true";
376
        } else {
376
        } else {
377
            blocks = blocktmp.split(',');
377
            blocks = blocktmp.split(',');
378
            var j = 0;
378
            var j = 0;
379
            for (var i = 0; i < blocks.length; i++) {
379
            for (var i = 0; i < blocks.length; i++) {
380
                if ($("#block_"+blocks[i]).length > 0) {
380
                if ($("#block_"+blocks[i]).length > 0) {
381
                    $("#output").children().eq(j).before($("#block_"+blocks[i]));
381
                    $("#output").children().eq(j).before($("#block_"+blocks[i]));
382
                    j++;
382
                    j++;
383
                }
383
                }
384
            }
384
            }
385
        }
385
        }
386
    }
386
    }
387
 
387
 
388
    plugtmp = $("#plugins").val().toString();
388
    plugtmp = $("#plugins").val().toString();
389
    if (plugtmp.length >0 ){
389
    if (plugtmp.length >0 ){
390
        plugins = plugtmp.split(',');
390
        plugins = plugtmp.split(',');
391
    }
391
    }
392
 
392
 
393
 
393
 
394
    if ($("#language option").length < 2) {
394
    if ($("#language option").length < 2) {
395
        current_language = $("#language").val().toString();
395
        current_language = $("#language").val().toString();
396
/* not visible any objects
396
/* not visible any objects
397
        changeLanguage();
397
        changeLanguage();
398
*/
398
*/
399
/* plugin_liste not initialized yet
399
/* plugin_liste not initialized yet
400
        for (var i = 0; i < plugin_liste.length; i++) {
400
        for (var i = 0; i < plugin_liste.length; i++) {
401
            changeLanguage(plugin_liste[i]);
401
            changeLanguage(plugin_liste[i]);
402
        }
402
        }
403
*/
403
*/
404
    } else {
404
    } else {
405
        cookie_language = readCookie("psi_language");
405
        cookie_language = readCookie("psi_language");
406
        if (cookie_language !== null) {
406
        if (cookie_language !== null) {
407
            current_language = cookie_language;
407
            current_language = cookie_language;
408
            $("#language").val(current_language);
408
            $("#language").val(current_language);
409
        } else {
409
        } else {
410
            current_language = $("#language").val().toString();
410
            current_language = $("#language").val().toString();
411
        }
411
        }
412
/* not visible any objects
412
/* not visible any objects
413
        changeLanguage();
413
        changeLanguage();
414
*/
414
*/
415
/* plugin_liste not initialized yet
415
/* plugin_liste not initialized yet
416
        for (var i = 0; i < plugin_liste.length; i++) {
416
        for (var i = 0; i < plugin_liste.length; i++) {
417
            changeLanguage(plugin_liste[i]);
417
            changeLanguage(plugin_liste[i]);
418
        }
418
        }
419
*/
419
*/
420
        $("#langblock").css( "display", "inline-block" );
420
        $("#langblock").css( "display", "inline-block" );
421
 
421
 
422
        $("#language").change(function changeLang() {
422
        $("#language").change(function changeLang() {
423
            current_language = $("#language").val().toString();
423
            current_language = $("#language").val().toString();
424
            createCookie('psi_language', current_language, 365);
424
            createCookie('psi_language', current_language, 365);
425
            changeLanguage();
425
            changeLanguage();
426
            for (var i = 0; i < plugin_liste.length; i++) {
426
            for (var i = 0; i < plugin_liste.length; i++) {
427
                changeLanguage(plugin_liste[i]);
427
                changeLanguage(plugin_liste[i]);
428
            }
428
            }
429
            return false;
429
            return false;
430
        });
430
        });
431
    }
431
    }
432
    if ($("#template option").length < 2) {
432
    if ($("#template option").length < 2) {
433
        switchStyle($("#template").val().toString());
433
        switchStyle($("#template").val().toString());
434
    } else {
434
    } else {
435
        cookie_template = readCookie("psi_bootstrap_template");
435
        cookie_template = readCookie("psi_bootstrap_template");
436
        if (cookie_template !== null) {
436
        if (cookie_template !== null) {
437
            old_template = $("#template").val();
437
            old_template = $("#template").val();
438
            $("#template").val(cookie_template);
438
            $("#template").val(cookie_template);
439
            if ($("#template").val() === null) {
439
            if ($("#template").val() === null) {
440
                $("#template").val(old_template);
440
                $("#template").val(old_template);
441
            }
441
            }
442
        }
442
        }
443
        switchStyle($("#template").val().toString());
443
        switchStyle($("#template").val().toString());
444
 
444
 
445
        $("#tempblock").css( "display", "inline-block" );
445
        $("#tempblock").css( "display", "inline-block" );
446
 
446
 
447
        $("#template").change(function changeTemplate() {
447
        $("#template").change(function changeTemplate() {
448
            switchStyle($("#template").val().toString());
448
            switchStyle($("#template").val().toString());
449
            createCookie('psi_bootstrap_template', $("#template").val().toString(), 365);
449
            createCookie('psi_bootstrap_template', $("#template").val().toString(), 365);
450
            return false;
450
            return false;
451
        });
451
        });
452
    }
452
    }
453
 
453
 
454
    reload(true);
454
    reload(true);
455
 
455
 
456
    $(".logo").click(function () {
456
    $(".logo").click(function () {
457
        reload(false);
457
        reload(false);
458
    });
458
    });
459
});
459
});
460
 
460
 
461
Array.prototype.push_attrs=function(element) {
461
Array.prototype.push_attrs=function(element) {
462
    for (var i = 0; i < element.length ; i++) {
462
    for (var i = 0; i < element.length ; i++) {
463
        this.push(element[i]["@attributes"]);
463
        this.push(element[i]["@attributes"]);
464
    }
464
    }
465
    return i;
465
    return i;
466
};
466
};
467
 
467
 
468
function full_addr(ip_string) {
468
function full_addr(ip_string) {
469
    var wrongvalue = false;
469
    var wrongvalue = false;
470
    ip_string = $.trim(ip_string).toLowerCase();
470
    ip_string = $.trim(ip_string).toLowerCase();
471
    // ipv4 notation
471
    // ipv4 notation
472
    if (ip_string.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/)) {
472
    if (ip_string.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/)) {
473
        ip_string ='::ffff:' + ip_string;
473
        ip_string ='::ffff:' + ip_string;
474
    }
474
    }
475
    // replace ipv4 address if any
475
    // replace ipv4 address if any
476
    var ipv4 = ip_string.match(/(.*:)([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/);
476
    var ipv4 = ip_string.match(/(.*:)([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/);
477
    if (ipv4) {
477
    if (ipv4) {
478
        ip_string = ipv4[1];
478
        ip_string = ipv4[1];
479
        ipv4 = ipv4[2].match(/[0-9]+/g);
479
        ipv4 = ipv4[2].match(/[0-9]+/g);
480
        for (var i = 0;i < 4;i ++) {
480
        for (var i = 0;i < 4;i ++) {
481
            var byte = parseInt(ipv4[i], 10);
481
            var byte = parseInt(ipv4[i], 10);
482
            if (byte<256) {
482
            if (byte<256) {
483
                ipv4[i] = ("0" + byte.toString(16)).substr(-2);
483
                ipv4[i] = ("0" + byte.toString(16)).substr(-2);
484
            } else {
484
            } else {
485
                wrongvalue = true;
485
                wrongvalue = true;
486
                break;
486
                break;
487
            }
487
            }
488
        }
488
        }
489
        if (wrongvalue) {
489
        if (wrongvalue) {
490
            ip_string = '';
490
            ip_string = '';
491
        } else {
491
        } else {
492
            ip_string += ipv4[0] + ipv4[1] + ':' + ipv4[2] + ipv4[3];
492
            ip_string += ipv4[0] + ipv4[1] + ':' + ipv4[2] + ipv4[3];
493
        }
493
        }
494
    }
494
    }
495
 
495
 
496
    if (ip_string === '') {
496
    if (ip_string === '') {
497
        return '';
497
        return '';
498
    }
498
    }
499
    // take care of leading and trailing ::
499
    // take care of leading and trailing ::
500
    ip_string = ip_string.replace(/^:|:$/g, '');
500
    ip_string = ip_string.replace(/^:|:$/g, '');
501
 
501
 
502
    var ipv6 = ip_string.split(':');
502
    var ipv6 = ip_string.split(':');
503
 
503
 
504
    for (var li = 0; li < ipv6.length; li ++) {
504
    for (var li = 0; li < ipv6.length; li ++) {
505
        var hex = ipv6[li];
505
        var hex = ipv6[li];
506
        if (hex !== "") {
506
        if (hex !== "") {
507
            if (!hex.match(/^[0-9a-f]{1,4}$/)) {
507
            if (!hex.match(/^[0-9a-f]{1,4}$/)) {
508
                wrongvalue = true;
508
                wrongvalue = true;
509
                break;
509
                break;
510
            }
510
            }
511
            // normalize leading zeros
511
            // normalize leading zeros
512
            ipv6[li] = ("0000" + hex).substr(-4);
512
            ipv6[li] = ("0000" + hex).substr(-4);
513
        }
513
        }
514
        else {
514
        else {
515
            // normalize grouped zeros ::
515
            // normalize grouped zeros ::
516
            hex = [];
516
            hex = [];
517
            for (var j = ipv6.length; j <= 8; j ++) {
517
            for (var j = ipv6.length; j <= 8; j ++) {
518
                hex.push('0000');
518
                hex.push('0000');
519
            }
519
            }
520
            ipv6[li] = hex.join(':');
520
            ipv6[li] = hex.join(':');
521
        }
521
        }
522
    }
522
    }
523
    if (!wrongvalue) {
523
    if (!wrongvalue) {
524
        var out = ipv6.join(':');
524
        var out = ipv6.join(':');
525
        if (out.length == 39) {
525
        if (out.length == 39) {
526
            return out;
526
            return out;
527
        } else {
527
        } else {
528
            return '';
528
            return '';
529
        }
529
        }
530
    } else {
530
    } else {
531
        return '';
531
        return '';
532
    }
532
    }
533
}
533
}
534
 
534
 
535
sorttable.sort_ip=function(a,b) {
535
sorttable.sort_ip=function(a,b) {
536
    var x = full_addr(a[0]);
536
    var x = full_addr(a[0]);
537
    var y = full_addr(b[0]);
537
    var y = full_addr(b[0]);
538
    if ((x === '') || (y === '')) {
538
    if ((x === '') || (y === '')) {
539
        x = a[0];
539
        x = a[0];
540
        y = b[0];
540
        y = b[0];
541
    }
541
    }
542
    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
542
    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
543
};
543
};
544
 
544
 
545
function items(data) {
545
function items(data) {
546
    if (data !== undefined) {
546
    if (data !== undefined) {
547
        if ((data.length > 0) &&  (data[0] !== undefined) && (data[0]["@attributes"] !== undefined)) {
547
        if ((data.length > 0) &&  (data[0] !== undefined) && (data[0]["@attributes"] !== undefined)) {
548
            return data;
548
            return data;
549
        } else if (data["@attributes"] !== undefined ) {
549
        } else if (data["@attributes"] !== undefined ) {
550
            return [data];
550
            return [data];
551
        } else {
551
        } else {
552
            return [];
552
            return [];
553
        }
553
        }
554
    } else {
554
    } else {
555
        return [];
555
        return [];
556
    }
556
    }
557
}
557
}
558
 
558
 
559
function renderVitals(data) {
559
function renderVitals(data) {
560
    var hostname = "", ip = "";
560
    var hostname = "", ip = "";
561
 
561
 
562
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('vitals', blocks) < 0))) {
562
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('vitals', blocks) < 0))) {
563
        $("#block_vitals").remove();
563
        $("#block_vitals").remove();
564
        if ((data.Vitals !== undefined) && (data.Vitals["@attributes"] !== undefined) && ((hostname = data.Vitals["@attributes"].Hostname) !== undefined) && ((ip = data.Vitals["@attributes"].IPAddr) !== undefined)) {
564
        if ((data.Vitals !== undefined) && (data.Vitals["@attributes"] !== undefined) && ((hostname = data.Vitals["@attributes"].Hostname) !== undefined) && ((ip = data.Vitals["@attributes"].IPAddr) !== undefined)) {
565
            document.title = "System information: " + hostname + " (" + ip + ")";
565
            document.title = "System information: " + hostname + " (" + ip + ")";
566
        }
566
        }
567
        return;
567
        return;
568
    }
568
    }
569
 
569
 
570
    var directives = {
570
    var directives = {
571
        Uptime: {
571
        Uptime: {
572
            html: function () {
572
            html: function () {
573
                return formatUptime(this.Uptime);
573
                return formatUptime(this.Uptime);
574
            }
574
            }
575
        },
575
        },
576
        LastBoot: {
576
        LastBoot: {
577
            text: function () {
577
            text: function () {
578
                var lastboot;
578
                var lastboot;
579
                var timestamp = 0;
579
                var timestamp = 0;
580
                var datetimeFormat;
580
                var datetimeFormat;
581
                if ((data.Generation !== undefined) && (data.Generation["@attributes"] !== undefined) && (data.Generation["@attributes"].timestamp !== undefined) ) {
581
                if ((data.Generation !== undefined) && (data.Generation["@attributes"] !== undefined) && (data.Generation["@attributes"].timestamp !== undefined) ) {
582
                    timestamp = parseInt(data.Generation["@attributes"].timestamp, 10) * 1000; //server time
582
                    timestamp = parseInt(data.Generation["@attributes"].timestamp, 10) * 1000; //server time
583
                    if (isNaN(timestamp)) timestamp = Number(new Date()); //client time
583
                    if (isNaN(timestamp)) timestamp = Number(new Date()); //client time
584
                } else {
584
                } else {
585
                    timestamp = Number(new Date()); //client time
585
                    timestamp = Number(new Date()); //client time
586
                }
586
                }
587
                lastboot = new Date(timestamp - (parseInt(this.Uptime, 10) * 1000));
587
                lastboot = new Date(timestamp - (parseInt(this.Uptime, 10) * 1000));
588
                if (((datetimeFormat = data.Options["@attributes"].datetimeFormat) !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
588
                if (((datetimeFormat = data.Options["@attributes"].datetimeFormat) !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
589
                    return lastboot.toLocaleString();
589
                    return lastboot.toLocaleString();
590
                } else {
590
                } else {
591
                    if (typeof(lastboot.toUTCString) === "function") {
591
                    if (typeof(lastboot.toUTCString) === "function") {
592
                        return lastboot.toUTCString();
592
                        return lastboot.toUTCString();
593
                    } else {
593
                    } else {
594
                    //deprecated
594
                    //deprecated
595
                        return lastboot.toGMTString();
595
                        return lastboot.toGMTString();
596
                    }
596
                    }
597
                }
597
                }
598
            }
598
            }
599
        },
599
        },
600
        Distro: {
600
        Distro: {
601
            html: function () {
601
            html: function () {
602
                return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.Distroicon + '" alt="" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.Distro + '</td></tr></table>';
602
                return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.Distroicon + '" alt="" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.Distro + '</td></tr></table>';
603
            }
603
            }
604
        },
604
        },
605
        OS: {
605
        OS: {
606
            html: function () {
606
            html: function () {
607
                return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.OS + '.png" alt="" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.OS + '</td></tr></table>';
607
                return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.OS + '.png" alt="" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.OS + '</td></tr></table>';
608
            }
608
            }
609
        },
609
        },
610
        LoadAvg: {
610
        LoadAvg: {
611
            html: function () {
611
            html: function () {
612
                if (this.CPULoad !== undefined) {
612
                if (this.CPULoad !== undefined) {
613
                    return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:50%;">'+this.LoadAvg + '</td><td><div class="progress">' +
613
                    return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:50%;">'+this.LoadAvg + '</td><td><div class="progress">' +
614
                        '<div class="progress-bar progress-bar-info" style="width:' + round(this.CPULoad,0) + '%;"></div>' +
614
                        '<div class="progress-bar progress-bar-info" style="width:' + round(this.CPULoad,0) + '%;"></div>' +
615
                        '</div><div class="percent">' + round(this.CPULoad,0) + '%</div></td></tr></table>';
615
                        '</div><div class="percent">' + round(this.CPULoad,0) + '%</div></td></tr></table>';
616
                } else {
616
                } else {
617
                    return this.LoadAvg;
617
                    return this.LoadAvg;
618
                }
618
                }
619
            }
619
            }
620
        },
620
        },
621
        Processes: {
621
        Processes: {
622
            html: function () {
622
            html: function () {
623
                var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0;
623
                var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0;
624
                var not_first = false;
624
                var not_first = false;
625
                processes = parseInt(this.Processes, 10);
625
                processes = parseInt(this.Processes, 10);
626
                if (processes > 0) {
626
                if (processes > 0) {
627
                    if (this.ProcessesRunning !== undefined) {
627
                    if (this.ProcessesRunning !== undefined) {
628
                        p111 = parseInt(this.ProcessesRunning, 10);
628
                        p111 = parseInt(this.ProcessesRunning, 10);
629
                    }
629
                    }
630
                    if (this.ProcessesSleeping !== undefined) {
630
                    if (this.ProcessesSleeping !== undefined) {
631
                        p112 = parseInt(this.ProcessesSleeping, 10);
631
                        p112 = parseInt(this.ProcessesSleeping, 10);
632
                    }
632
                    }
633
                    if (this.ProcessesStopped !== undefined) {
633
                    if (this.ProcessesStopped !== undefined) {
634
                        p113 = parseInt(this.ProcessesStopped, 10);
634
                        p113 = parseInt(this.ProcessesStopped, 10);
635
                    }
635
                    }
636
                    if (this.ProcessesZombie !== undefined) {
636
                    if (this.ProcessesZombie !== undefined) {
637
                        p114 = parseInt(this.ProcessesZombie, 10);
637
                        p114 = parseInt(this.ProcessesZombie, 10);
638
                    }
638
                    }
639
                    if (this.ProcessesWaiting !== undefined) {
639
                    if (this.ProcessesWaiting !== undefined) {
640
                        p115 = parseInt(this.ProcessesWaiting, 10);
640
                        p115 = parseInt(this.ProcessesWaiting, 10);
641
                    }
641
                    }
642
                    if (this.ProcessesOther !== undefined) {
642
                    if (this.ProcessesOther !== undefined) {
643
                        p116 = parseInt(this.ProcessesOther, 10);
643
                        p116 = parseInt(this.ProcessesOther, 10);
644
                    }
644
                    }
645
                    if (p111 || p112 || p113 || p114 || p115 || p116) {
645
                    if (p111 || p112 || p113 || p114 || p115 || p116) {
646
                        processes += " (";
646
                        processes += " (";
647
                        for (var proc_type in {111:0,112:1,113:2,114:3,115:4,116:5}) {
647
                        for (var proc_type in {111:0,112:1,113:2,114:3,115:4,116:5}) {
648
                            if (eval("p" + proc_type)) {
648
                            if (eval("p" + proc_type)) {
649
                                if (not_first) {
649
                                if (not_first) {
650
                                    processes += ", ";
650
                                    processes += ", ";
651
                                }
651
                                }
652
                                processes += eval("p" + proc_type) + String.fromCharCode(160) + genlang(proc_type);
652
                                processes += eval("p" + proc_type) + String.fromCharCode(160) + genlang(proc_type);
653
                                not_first = true;
653
                                not_first = true;
654
                            }
654
                            }
655
                        }
655
                        }
656
                        processes += ")";
656
                        processes += ")";
657
                    }
657
                    }
658
                }
658
                }
659
                return processes;
659
                return processes;
660
            }
660
            }
661
        }
661
        }
662
    };
662
    };
663
 
663
 
-
 
664
    if ((data.Vitals["@attributes"].LoadAvg === '') && (data.Vitals["@attributes"].CPULoad === undefined)) {
-
 
665
        $("#tr_LoadAvg").hide();
-
 
666
    }
664
    if (data.Vitals["@attributes"].SysLang === undefined) {
667
    if (data.Vitals["@attributes"].SysLang === undefined) {
665
        $("#tr_SysLang").hide();
668
        $("#tr_SysLang").hide();
666
    }
669
    }
667
    if (data.Vitals["@attributes"].CodePage === undefined) {
670
    if (data.Vitals["@attributes"].CodePage === undefined) {
668
        $("#tr_CodePage").hide();
671
        $("#tr_CodePage").hide();
669
    }
672
    }
670
    if (data.Vitals["@attributes"].Processes === undefined) {
673
    if (data.Vitals["@attributes"].Processes === undefined) {
671
        $("#tr_Processes").hide();
674
        $("#tr_Processes").hide();
672
    }
675
    }
673
    $('#vitals').render(data.Vitals["@attributes"], directives);
676
    $('#vitals').render(data.Vitals["@attributes"], directives);
674
 
677
 
675
    if ((data.Vitals !== undefined) && (data.Vitals["@attributes"] !== undefined) && ((hostname = data.Vitals["@attributes"].Hostname) !== undefined) && ((ip = data.Vitals["@attributes"].IPAddr) !== undefined)) {
678
    if ((data.Vitals !== undefined) && (data.Vitals["@attributes"] !== undefined) && ((hostname = data.Vitals["@attributes"].Hostname) !== undefined) && ((ip = data.Vitals["@attributes"].IPAddr) !== undefined)) {
676
        document.title = "System information: " + hostname + " (" + ip + ")";
679
        document.title = "System information: " + hostname + " (" + ip + ")";
677
    }
680
    }
678
 
681
 
679
    $("#block_vitals").show();
682
    $("#block_vitals").show();
680
}
683
}
681
 
684
 
682
function renderHardware(data) {
685
function renderHardware(data) {
683
    var hw_type, datas, proc_param, i;
686
    var hw_type, datas, proc_param, i;
684
 
687
 
685
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('hardware', blocks) < 0))) {
688
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('hardware', blocks) < 0))) {
686
        $("#block_hardware").remove();
689
        $("#block_hardware").remove();
687
        return;
690
        return;
688
    }
691
    }
689
 
692
 
690
    var directives = {
693
    var directives = {
691
        Model: {
694
        Model: {
692
            text: function () {
695
            text: function () {
693
                return this.Model;
696
                return this.Model;
694
            }
697
            }
695
        },
698
        },
696
        CpuSpeed: {
699
        CpuSpeed: {
697
            html: function () {
700
            html: function () {
698
                return formatHertz(this.CpuSpeed);
701
                return formatHertz(this.CpuSpeed);
699
            }
702
            }
700
        },
703
        },
701
        CpuSpeedMax: {
704
        CpuSpeedMax: {
702
            html: function () {
705
            html: function () {
703
                return formatHertz(this.CpuSpeedMax);
706
                return formatHertz(this.CpuSpeedMax);
704
            }
707
            }
705
        },
708
        },
706
        CpuSpeedMin: {
709
        CpuSpeedMin: {
707
            html: function () {
710
            html: function () {
708
                return formatHertz(this.CpuSpeedMin);
711
                return formatHertz(this.CpuSpeedMin);
709
            }
712
            }
710
        },
713
        },
711
        Cache: {
714
        Cache: {
712
            html: function () {
715
            html: function () {
713
                return formatBytes(this.Cache, data.Options["@attributes"].byteFormat);
716
                return formatBytes(this.Cache, data.Options["@attributes"].byteFormat);
714
            }
717
            }
715
        },
718
        },
716
        BusSpeed: {
719
        BusSpeed: {
717
            html: function () {
720
            html: function () {
718
                return formatHertz(this.BusSpeed);
721
                return formatHertz(this.BusSpeed);
719
            }
722
            }
720
        },
723
        },
721
        Cputemp: {
724
        Cputemp: {
722
            html: function () {
725
            html: function () {
723
                return formatTemp(this.Cputemp, data.Options["@attributes"].tempFormat);
726
                return formatTemp(this.Cputemp, data.Options["@attributes"].tempFormat);
724
            }
727
            }
725
        },
728
        },
726
        Voltage: {
729
        Voltage: {
727
            html: function() {
730
            html: function() {
728
                return round(this.Voltage, 2) + ' V';
731
                return round(this.Voltage, 2) + genlang(82); //V
729
            }
732
            }
730
        },
733
        },
731
        Bogomips: {
734
        Bogomips: {
732
            text: function () {
735
            text: function () {
733
                return parseInt(this.Bogomips, 10);
736
                return parseInt(this.Bogomips, 10);
734
            }
737
            }
735
        },
738
        },
736
        Load: {
739
        Load: {
737
            html: function () {
740
            html: function () {
738
                return '<div class="progress">' +
741
                return '<div class="progress">' +
739
                        '<div class="progress-bar progress-bar-info" style="width:' + round(this.Load,0) + '%;"></div>' +
742
                        '<div class="progress-bar progress-bar-info" style="width:' + round(this.Load,0) + '%;"></div>' +
740
                        '</div><div class="percent">' + round(this.Load,0) + '%</div>';
743
                        '</div><div class="percent">' + round(this.Load,0) + '%</div>';
741
            }
744
            }
742
        }
745
        }
743
    };
746
    };
744
 
747
 
745
    var hw_directives = {
748
    var hw_directives = {
746
        hwName: {
749
        hwName: {
747
            html: function() {
750
            html: function() {
748
                return this.Name;
751
                return this.Name;
749
            }
752
            }
750
        },
753
        },
751
        hwCount: {
754
        hwCount: {
752
            text: function() {
755
            text: function() {
753
                if ((this.Count !== undefined) && !isNaN(this.Count) && (parseInt(this.Count, 10)>1)) {
756
                if ((this.Count !== undefined) && !isNaN(this.Count) && (parseInt(this.Count, 10)>1)) {
754
                    return parseInt(this.Count, 10);
757
                    return parseInt(this.Count, 10);
755
                } else {
758
                } else {
756
                    return "";
759
                    return "";
757
                }
760
                }
758
            }
761
            }
759
        }
762
        }
760
    };
763
    };
761
 
764
 
762
    var mem_directives = {
765
    var mem_directives = {
763
        Speed: {
766
        Speed: {
764
            html: function() {
767
            html: function() {
765
                return formatMTps(this.Speed);
768
                return formatMTps(this.Speed);
766
            }
769
            }
767
        },
770
        },
768
        Voltage: {
771
        Voltage: {
769
            html: function() {
772
            html: function() {
770
                return round(this.Voltage, 2) + ' V';
773
                return round(this.Voltage, 2)  + genlang(82); //V
771
            }
774
            }
772
        },
775
        },
773
        Capacity: {
776
        Capacity: {
774
            html: function () {
777
            html: function () {
775
                return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat);
778
                return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat);
776
            }
779
            }
777
        }
780
        }
778
    };
781
    };
779
 
782
 
780
    var dev_directives = {
783
    var dev_directives = {
781
        Speed: {
784
        Speed: {
782
            html: function() {
785
            html: function() {
783
                return formatBPS(1000000*this.Speed);
786
                return formatBPS(1000000*this.Speed);
784
            }
787
            }
785
        },
788
        },
786
        Capacity: {
789
        Capacity: {
787
            html: function () {
790
            html: function () {
788
                return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat);
791
                return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat);
789
            }
792
            }
790
        }
793
        }
791
    };
794
    };
792
 
795
 
793
    var html="";
796
    var html="";
794
 
797
 
795
    if (data.Hardware["@attributes"] !== undefined) { 
798
    if (data.Hardware["@attributes"] !== undefined) { 
796
        if (data.Hardware["@attributes"].Name !== undefined) {
799
        if (data.Hardware["@attributes"].Name !== undefined) {
797
            html+="<tr id=\"hardware-Machine\">";
800
            html+="<tr id=\"hardware-Machine\">";
798
            html+="<th style=\"width:8%;\">"+genlang(107)+"</th>"; //Machine
801
            html+="<th style=\"width:8%;\">"+genlang(107)+"</th>"; //Machine
799
            html+="<td colspan=\"2\"><span data-bind=\"Name\"></span></td>";
802
            html+="<td colspan=\"2\"><span data-bind=\"Name\"></span></td>";
800
            html+="</tr>";
803
            html+="</tr>";
801
        }
804
        }
802
        if (data.Hardware["@attributes"].Virtualizer !== undefined) {
805
        if (data.Hardware["@attributes"].Virtualizer !== undefined) {
803
            html+="<tr id=\"hardware-Virtualizer\">";
806
            html+="<tr id=\"hardware-Virtualizer\">";
804
            html+="<th style=\"width:8%;\">"+genlang(134)+"</th>"; //Virtualizer
807
            html+="<th style=\"width:8%;\">"+genlang(134)+"</th>"; //Virtualizer
805
            html+="<td colspan=\"2\"><span data-bind=\"Virtualizer\"></span></td>";
808
            html+="<td colspan=\"2\"><span data-bind=\"Virtualizer\"></span></td>";
806
            html+="</tr>";
809
            html+="</tr>";
807
        }
810
        }
808
    }
811
    }
809
 
812
 
810
    var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Voltage:52,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9};
813
    var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Voltage:52,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9};
811
    try {
814
    try {
812
        datas = items(data.Hardware.CPU.CpuCore);
815
        datas = items(data.Hardware.CPU.CpuCore);
813
        for (i = 0; i < datas.length; i++) {
816
        for (i = 0; i < datas.length; i++) {
814
             if (i === 0) {
817
             if (i === 0) {
815
                html+="<tr id=\"hardware-CPU\" class=\"treegrid-CPU\">";
818
                html+="<tr id=\"hardware-CPU\" class=\"treegrid-CPU\">";
816
                html+="<th>CPU</th>";
819
                html+="<th>CPU</th>";
817
                html+="<td><span class=\"treegrid-span\">" + genlang(119) + ":</span></td>"; //Number of processors
820
                html+="<td><span class=\"treegrid-span\">" + genlang(119) + ":</span></td>"; //Number of processors
818
                html+="<td class=\"rightCell\"><span id=\"CPUCount\"></span></td>";
821
                html+="<td class=\"rightCell\"><span id=\"CPUCount\"></span></td>";
819
                html+="</tr>";
822
                html+="</tr>";
820
            }
823
            }
821
            html+="<tr id=\"hardware-CPU-" + i +"\" class=\"treegrid-CPU-" + i +" treegrid-parent-CPU\">";
824
            html+="<tr id=\"hardware-CPU-" + i +"\" class=\"treegrid-CPU-" + i +" treegrid-parent-CPU\">";
822
            html+="<th></th>";
825
            html+="<th></th>";
823
            if (showCPULoadCompact && (datas[i]["@attributes"].Load !== undefined)) {
826
            if (showCPULoadCompact && (datas[i]["@attributes"].Load !== undefined)) {
824
                html+="<td><span class=\"treegrid-span\" data-bind=\"Model\"></span></td>";
827
                html+="<td><span class=\"treegrid-span\" data-bind=\"Model\"></span></td>";
825
                html+="<td style=\"width:15%;\" class=\"rightCell\"><span data-bind=\"Load\"></span></td>";
828
                html+="<td style=\"width:15%;\" class=\"rightCell\"><span data-bind=\"Load\"></span></td>";
826
            } else {
829
            } else {
827
                html+="<td colspan=\"2\"><span class=\"treegrid-span\" data-bind=\"Model\"></span></td>";
830
                html+="<td colspan=\"2\"><span class=\"treegrid-span\" data-bind=\"Model\"></span></td>";
828
            }
831
            }
829
            html+="</tr>";
832
            html+="</tr>";
830
            for (proc_param in paramlist) {
833
            for (proc_param in paramlist) {
831
                if (((proc_param !== 'Load') || !showCPULoadCompact) && (datas[i]["@attributes"][proc_param] !== undefined)) {
834
                if (((proc_param !== 'Load') || !showCPULoadCompact) && (datas[i]["@attributes"][proc_param] !== undefined)) {
832
                    html+="<tr id=\"hardware-CPU-" + i + "-" + proc_param + "\" class=\"treegrid-parent-CPU-" + i +"\">";
835
                    html+="<tr id=\"hardware-CPU-" + i + "-" + proc_param + "\" class=\"treegrid-parent-CPU-" + i +"\">";
833
                    html+="<th></th>";
836
                    html+="<th></th>";
834
                    html+="<td><span class=\"treegrid-span\">" + genlang(paramlist[proc_param]) + "<span></td>";
837
                    html+="<td><span class=\"treegrid-span\">" + genlang(paramlist[proc_param]) + "<span></td>";
835
                    html+="<td class=\"rightCell\"><span data-bind=\"" + proc_param + "\"></span></td>";
838
                    html+="<td class=\"rightCell\"><span data-bind=\"" + proc_param + "\"></span></td>";
836
                    html+="</tr>";
839
                    html+="</tr>";
837
                }
840
                }
838
            }
841
            }
839
 
842
 
840
        }
843
        }
841
    }
844
    }
842
    catch (err) {
845
    catch (err) {
843
        $("#hardware-CPU").hide();
846
        $("#hardware-CPU").hide();
844
    }
847
    }
845
 
848
 
846
    var devparamlist = {Capacity:43,Manufacturer:122,Product:123,Speed:129,Voltage:52,Serial:124};
849
    var devparamlist = {Capacity:43,Manufacturer:122,Product:123,Speed:129,Voltage:52,Serial:124};
847
    for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) {
850
    for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) {
848
        try {
851
        try {
849
            if (hw_type == 'MEM') {
852
            if (hw_type == 'MEM') {
850
                datas = items(data.Hardware[hw_type].Chip);
853
                datas = items(data.Hardware[hw_type].Chip);
851
            } else {
854
            } else {
852
                datas = items(data.Hardware[hw_type].Device);
855
                datas = items(data.Hardware[hw_type].Device);
853
            }
856
            }
854
            for (i = 0; i < datas.length; i++) {
857
            for (i = 0; i < datas.length; i++) {
855
                if (i === 0) {
858
                if (i === 0) {
856
                    html+="<tr id=\"hardware-" + hw_type + "\" class=\"treegrid-" + hw_type + "\">";
859
                    html+="<tr id=\"hardware-" + hw_type + "\" class=\"treegrid-" + hw_type + "\">";
857
                    html+="<th>" + hw_type + "</th>";
860
                    html+="<th>" + hw_type + "</th>";
858
                    if (hw_type == 'MEM') {
861
                    if (hw_type == 'MEM') {
859
                        html+="<td><span class=\"treegrid-span\">" + genlang('128') + ":</span></td>"; //Number of memories
862
                        html+="<td><span class=\"treegrid-span\">" + genlang('128') + ":</span></td>"; //Number of memories
860
                    } else {
863
                    } else {
861
                        html+="<td><span class=\"treegrid-span\">" + genlang('120') + ":</span></td>"; //Number of devices
864
                        html+="<td><span class=\"treegrid-span\">" + genlang('120') + ":</span></td>"; //Number of devices
862
                    }                    
865
                    }                    
863
                    html+="<td class=\"rightCell\"><span id=\"" + hw_type + "Count\"></span></td>";
866
                    html+="<td class=\"rightCell\"><span id=\"" + hw_type + "Count\"></span></td>";
864
                    html+="</tr>";
867
                    html+="</tr>";
865
                }
868
                }
866
                html+="<tr id=\"hardware-" + hw_type + "-" + i +"\" class=\"treegrid-" + hw_type + "-" + i +" treegrid-parent-" + hw_type + "\">";
869
                html+="<tr id=\"hardware-" + hw_type + "-" + i +"\" class=\"treegrid-" + hw_type + "-" + i +" treegrid-parent-" + hw_type + "\">";
867
                html+="<th></th>";
870
                html+="<th></th>";
868
                html+="<td><span class=\"treegrid-span\" data-bind=\"hwName\"></span></td>";
871
                html+="<td><span class=\"treegrid-span\" data-bind=\"hwName\"></span></td>";
869
                html+="<td class=\"rightCell\"><span data-bind=\"hwCount\"></span></td>";
872
                html+="<td class=\"rightCell\"><span data-bind=\"hwCount\"></span></td>";
870
                html+="</tr>";
873
                html+="</tr>";
871
                for (proc_param in devparamlist) {
874
                for (proc_param in devparamlist) {
872
                    if (datas[i]["@attributes"][proc_param] !== undefined) {
875
                    if (datas[i]["@attributes"][proc_param] !== undefined) {
873
                        html+="<tr id=\"hardware-" + hw_type +"-" + i + "-" + proc_param + "\" class=\"treegrid-parent-" + hw_type +"-" + i +"\">";
876
                        html+="<tr id=\"hardware-" + hw_type +"-" + i + "-" + proc_param + "\" class=\"treegrid-parent-" + hw_type +"-" + i +"\">";
874
                        html+="<th></th>";
877
                        html+="<th></th>";
875
                        html+="<td><span class=\"treegrid-span\">" + genlang(devparamlist[proc_param]) + "<span></td>";
878
                        html+="<td><span class=\"treegrid-span\">" + genlang(devparamlist[proc_param]) + "<span></td>";
876
                        html+="<td class=\"rightCell\"><span data-bind=\"" + proc_param + "\"></span></td>";
879
                        html+="<td class=\"rightCell\"><span data-bind=\"" + proc_param + "\"></span></td>";
877
                        html+="</tr>";
880
                        html+="</tr>";
878
                    }
881
                    }
879
                }
882
                }
880
            }
883
            }
881
        }
884
        }
882
        catch (err) {
885
        catch (err) {
883
            $("#hardware-data"+hw_type).hide();
886
            $("#hardware-data"+hw_type).hide();
884
        }
887
        }
885
    }
888
    }
886
    $("#hardware-data").empty().append(html);
889
    $("#hardware-data").empty().append(html);
887
 
890
 
888
 
891
 
889
    if (data.Hardware["@attributes"] !== undefined) {
892
    if (data.Hardware["@attributes"] !== undefined) {
890
        if (data.Hardware["@attributes"].Name !== undefined) {
893
        if (data.Hardware["@attributes"].Name !== undefined) {
891
            $('#hardware-Machine').render(data.Hardware["@attributes"]);
894
            $('#hardware-Machine').render(data.Hardware["@attributes"]);
892
        }
895
        }
893
        if (data.Hardware["@attributes"].Virtualizer !== undefined) {
896
        if (data.Hardware["@attributes"].Virtualizer !== undefined) {
894
            $('#hardware-Virtualizer').render(data.Hardware["@attributes"]);
897
            $('#hardware-Virtualizer').render(data.Hardware["@attributes"]);
895
        }
898
        }
896
    }
899
    }
897
 
900
 
898
    try {
901
    try {
899
        datas = items(data.Hardware.CPU.CpuCore);
902
        datas = items(data.Hardware.CPU.CpuCore);
900
        for (i = 0; i < datas.length; i++) {
903
        for (i = 0; i < datas.length; i++) {
901
            $('#hardware-CPU-'+ i).render(datas[i]["@attributes"], directives);
904
            $('#hardware-CPU-'+ i).render(datas[i]["@attributes"], directives);
902
            for (proc_param in paramlist) {
905
            for (proc_param in paramlist) {
903
                if (((proc_param !== 'Load') || !showCPULoadCompact) && (datas[i]["@attributes"][proc_param] !== undefined)) {
906
                if (((proc_param !== 'Load') || !showCPULoadCompact) && (datas[i]["@attributes"][proc_param] !== undefined)) {
904
                    $('#hardware-CPU-'+ i +'-'+proc_param).render(datas[i]["@attributes"], directives);
907
                    $('#hardware-CPU-'+ i +'-'+proc_param).render(datas[i]["@attributes"], directives);
905
                }
908
                }
906
            }
909
            }
907
        }
910
        }
908
        if (i > 0) {
911
        if (i > 0) {
909
            $("#CPUCount").html(i);
912
            $("#CPUCount").html(i);
910
        }
913
        }
911
    }
914
    }
912
    catch (err) {
915
    catch (err) {
913
        $("#hardware-CPU").hide();
916
        $("#hardware-CPU").hide();
914
    }
917
    }
915
 
918
 
916
    var licz;
919
    var licz;
917
    for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) {
920
    for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) {
918
        try {
921
        try {
919
            licz = 0;
922
            licz = 0;
920
            if (hw_type == 'MEM') {
923
            if (hw_type == 'MEM') {
921
                datas = items(data.Hardware[hw_type].Chip);
924
                datas = items(data.Hardware[hw_type].Chip);
922
            } else {
925
            } else {
923
                datas = items(data.Hardware[hw_type].Device);
926
                datas = items(data.Hardware[hw_type].Device);
924
            }
927
            }
925
            for (i = 0; i < datas.length; i++) {
928
            for (i = 0; i < datas.length; i++) {
926
                $('#hardware-'+hw_type+'-'+ i).render(datas[i]["@attributes"], hw_directives);
929
                $('#hardware-'+hw_type+'-'+ i).render(datas[i]["@attributes"], hw_directives);
927
                if ((datas[i]["@attributes"].Count !== undefined) && !isNaN(datas[i]["@attributes"].Count) && (parseInt(datas[i]["@attributes"].Count, 10)>1)) {
930
                if ((datas[i]["@attributes"].Count !== undefined) && !isNaN(datas[i]["@attributes"].Count) && (parseInt(datas[i]["@attributes"].Count, 10)>1)) {
928
                    licz += parseInt(datas[i]["@attributes"].Count, 10);
931
                    licz += parseInt(datas[i]["@attributes"].Count, 10);
929
                } else {
932
                } else {
930
                    licz++;
933
                    licz++;
931
                }
934
                }
932
                if (hw_type == 'MEM') {
935
                if (hw_type == 'MEM') {
933
                    for (proc_param in devparamlist) {
936
                    for (proc_param in devparamlist) {
934
                        if ((datas[i]["@attributes"][proc_param] !== undefined)) {
937
                        if ((datas[i]["@attributes"][proc_param] !== undefined)) {
935
                            $('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], mem_directives);
938
                            $('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], mem_directives);
936
                        }
939
                        }
937
                    }
940
                    }
938
                } else {
941
                } else {
939
                    for (proc_param in devparamlist) {
942
                    for (proc_param in devparamlist) {
940
                        if ((datas[i]["@attributes"][proc_param] !== undefined)) {
943
                        if ((datas[i]["@attributes"][proc_param] !== undefined)) {
941
                            $('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], dev_directives);
944
                            $('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], dev_directives);
942
                        }
945
                        }
943
                    }
946
                    }
944
                }
947
                }
945
            }
948
            }
946
            if (i > 0) {
949
            if (i > 0) {
947
                $("#" + hw_type + "Count").html(licz);
950
                $("#" + hw_type + "Count").html(licz);
948
            }
951
            }
949
        }
952
        }
950
        catch (err) {
953
        catch (err) {
951
            $("#hardware-"+hw_type).hide();
954
            $("#hardware-"+hw_type).hide();
952
        }
955
        }
953
    }
956
    }
954
    $('#hardware').treegrid({
957
    $('#hardware').treegrid({
955
        initialState: 'collapsed',
958
        initialState: 'collapsed',
956
        expanderExpandedClass: 'normalicon normalicon-down',
959
        expanderExpandedClass: 'normalicon normalicon-down',
957
        expanderCollapsedClass: 'normalicon normalicon-right'
960
        expanderCollapsedClass: 'normalicon normalicon-right'
958
    });
961
    });
959
    if (showCPUListExpanded) {
962
    if (showCPUListExpanded) {
960
        try {
963
        try {
961
            $('#hardware-CPU').treegrid('expand');
964
            $('#hardware-CPU').treegrid('expand');
962
        }
965
        }
963
        catch (err) {
966
        catch (err) {
964
        }
967
        }
965
    }
968
    }
966
    if (showCPUInfoExpanded && showCPUListExpanded) {
969
    if (showCPUInfoExpanded && showCPUListExpanded) {
967
        try {
970
        try {
968
            datas = items(data.Hardware.CPU.CpuCore);
971
            datas = items(data.Hardware.CPU.CpuCore);
969
            for (i = 0; i < datas.length; i++) {
972
            for (i = 0; i < datas.length; i++) {
970
                $('#hardware-CPU-'+i).treegrid('expand');
973
                $('#hardware-CPU-'+i).treegrid('expand');
971
            }
974
            }
972
        }
975
        }
973
        catch (err) {
976
        catch (err) {
974
        }
977
        }
975
    }
978
    }
976
    $("#block_hardware").show();
979
    $("#block_hardware").show();
977
}
980
}
978
 
981
 
979
function renderMemory(data) {
982
function renderMemory(data) {
980
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('memory', blocks) < 0))) {
983
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('memory', blocks) < 0))) {
981
        $("#block_memory").remove();
984
        $("#block_memory").remove();
982
        return;
985
        return;
983
    }
986
    }
984
 
987
 
985
    var directives = {
988
    var directives = {
986
        Total: {
989
        Total: {
987
            html: function () {
990
            html: function () {
988
                return formatBytes(this["@attributes"].Total, data.Options["@attributes"].byteFormat);
991
                return formatBytes(this["@attributes"].Total, data.Options["@attributes"].byteFormat);
989
            }
992
            }
990
        },
993
        },
991
        Free: {
994
        Free: {
992
            html: function () {
995
            html: function () {
993
                return formatBytes(this["@attributes"].Free, data.Options["@attributes"].byteFormat);
996
                return formatBytes(this["@attributes"].Free, data.Options["@attributes"].byteFormat);
994
            }
997
            }
995
        },
998
        },
996
        Used: {
999
        Used: {
997
            html: function () {
1000
            html: function () {
998
                return formatBytes(this["@attributes"].Used, data.Options["@attributes"].byteFormat);
1001
                return formatBytes(this["@attributes"].Used, data.Options["@attributes"].byteFormat);
999
            }
1002
            }
1000
        },
1003
        },
1001
        Usage: {
1004
        Usage: {
1002
            html: function () {
1005
            html: function () {
1003
                if ((this.Details === undefined) || (this.Details["@attributes"] === undefined)) {
1006
                if ((this.Details === undefined) || (this.Details["@attributes"] === undefined)) {
1004
                    return '<div class="progress">' +
1007
                    return '<div class="progress">' +
1005
                        '<div class="progress-bar progress-bar-info" style="width:' + this["@attributes"].Percent + '%;"></div>' +
1008
                        '<div class="progress-bar progress-bar-info" style="width:' + this["@attributes"].Percent + '%;"></div>' +
1006
                        '</div><div class="percent">' + this["@attributes"].Percent + '%</div>';
1009
                        '</div><div class="percent">' + this["@attributes"].Percent + '%</div>';
1007
                } else {
1010
                } else {
1008
                    var rest = parseInt(this["@attributes"].Percent, 10);
1011
                    var rest = parseInt(this["@attributes"].Percent, 10);
1009
                    var html = '<div class="progress">';
1012
                    var html = '<div class="progress">';
1010
                    if ((this.Details["@attributes"].AppPercent !== undefined) && (this.Details["@attributes"].AppPercent > 0)) {
1013
                    if ((this.Details["@attributes"].AppPercent !== undefined) && (this.Details["@attributes"].AppPercent > 0)) {
1011
                        html += '<div class="progress-bar progress-bar-info" style="width:' + this.Details["@attributes"].AppPercent + '%;"></div>';
1014
                        html += '<div class="progress-bar progress-bar-info" style="width:' + this.Details["@attributes"].AppPercent + '%;"></div>';
1012
                        rest -= parseInt(this.Details["@attributes"].AppPercent, 10);
1015
                        rest -= parseInt(this.Details["@attributes"].AppPercent, 10);
1013
                    }
1016
                    }
1014
                    if ((this.Details["@attributes"].CachedPercent !== undefined) && (this.Details["@attributes"].CachedPercent > 0)) {
1017
                    if ((this.Details["@attributes"].CachedPercent !== undefined) && (this.Details["@attributes"].CachedPercent > 0)) {
1015
                        html += '<div class="progress-bar progress-bar-warning" style="width:' + this.Details["@attributes"].CachedPercent + '%;"></div>';
1018
                        html += '<div class="progress-bar progress-bar-warning" style="width:' + this.Details["@attributes"].CachedPercent + '%;"></div>';
1016
                        rest -= parseInt(this.Details["@attributes"].CachedPercent, 10);
1019
                        rest -= parseInt(this.Details["@attributes"].CachedPercent, 10);
1017
                    }
1020
                    }
1018
                    if ((this.Details["@attributes"].BuffersPercent !== undefined) && (this.Details["@attributes"].BuffersPercent > 0)) {
1021
                    if ((this.Details["@attributes"].BuffersPercent !== undefined) && (this.Details["@attributes"].BuffersPercent > 0)) {
1019
                        html += '<div class="progress-bar progress-bar-danger" style="width:' + this.Details["@attributes"].BuffersPercent + '%;"></div>';
1022
                        html += '<div class="progress-bar progress-bar-danger" style="width:' + this.Details["@attributes"].BuffersPercent + '%;"></div>';
1020
                        rest -= parseInt(this.Details["@attributes"].BuffersPercent, 10);
1023
                        rest -= parseInt(this.Details["@attributes"].BuffersPercent, 10);
1021
                    }
1024
                    }
1022
                    if (rest > 0) {
1025
                    if (rest > 0) {
1023
                        html += '<div class="progress-bar progress-bar-success" style="width:' + rest + '%;"></div>';
1026
                        html += '<div class="progress-bar progress-bar-success" style="width:' + rest + '%;"></div>';
1024
                    }
1027
                    }
1025
                    html += '</div>';
1028
                    html += '</div>';
1026
                    html += '<div class="percent">' + 'Total: ' + this["@attributes"].Percent + '% ' + '<i>(';
1029
                    html += '<div class="percent">' + 'Total: ' + this["@attributes"].Percent + '% ' + '<i>(';
1027
                    var not_first = false;
1030
                    var not_first = false;
1028
                    if (this.Details["@attributes"].AppPercent !== undefined) {
1031
                    if (this.Details["@attributes"].AppPercent !== undefined) {
1029
                        html += genlang(64) + ': '+ this.Details["@attributes"].AppPercent + '%'; //Kernel + apps
1032
                        html += '<span class="progress-bar-info">&emsp;</span>&nbsp;' + genlang(64) + ': '+ this.Details["@attributes"].AppPercent + '%'; //Kernel + apps
1030
                        not_first = true;
1033
                        not_first = true;
1031
                    }
1034
                    }
1032
                    if (this.Details["@attributes"].CachedPercent !== undefined) {
1035
                    if (this.Details["@attributes"].CachedPercent !== undefined) {
1033
                        if (not_first) html += ' - ';
1036
                        if (not_first) html += ' - ';
1034
                        html += genlang(66) + ': ' + this.Details["@attributes"].CachedPercent + '%'; //Cache
1037
                        html += '<span class="progress-bar-warning">&emsp;</span>&nbsp;' + genlang(66) + ': ' + this.Details["@attributes"].CachedPercent + '%'; //Cache
1035
                        not_first = true;
1038
                        not_first = true;
1036
                    }
1039
                    }
1037
                    if (this.Details["@attributes"].BuffersPercent !== undefined) {
1040
                    if (this.Details["@attributes"].BuffersPercent !== undefined) {
1038
                        if (not_first) html += ' - ';
1041
                        if (not_first) html += ' - ';
1039
                        html += genlang(65) + ': ' + this.Details["@attributes"].BuffersPercent + '%'; //Buffers
1042
                        html += '<span class="progress-bar-danger">&emsp;</span>&nbsp;' + genlang(65) + ': ' + this.Details["@attributes"].BuffersPercent + '%'; //Buffers
1040
                    }
1043
                    }
1041
                    html += ')</i></div>';
1044
                    html += ')</i></div>';
1042
                    return html;
1045
                    return html;
1043
                }
1046
                }
1044
            }
1047
            }
1045
        },
1048
        },
1046
        Type: {
1049
        Type: {
1047
            html: function () {
1050
            html: function () {
1048
                return genlang(28); //Physical Memory
1051
                return genlang(28); //Physical Memory
1049
            }
1052
            }
1050
        }
1053
        }
1051
    };
1054
    };
1052
 
1055
 
1053
    var directive_swap = {
1056
    var directive_swap = {
1054
        Total: {
1057
        Total: {
1055
            html: function () {
1058
            html: function () {
1056
                return formatBytes(this.Total, data.Options["@attributes"].byteFormat);
1059
                return formatBytes(this.Total, data.Options["@attributes"].byteFormat);
1057
            }
1060
            }
1058
        },
1061
        },
1059
        Free: {
1062
        Free: {
1060
            html: function () {
1063
            html: function () {
1061
                return formatBytes(this.Free, data.Options["@attributes"].byteFormat);
1064
                return formatBytes(this.Free, data.Options["@attributes"].byteFormat);
1062
            }
1065
            }
1063
        },
1066
        },
1064
        Used: {
1067
        Used: {
1065
            html: function () {
1068
            html: function () {
1066
                return formatBytes(this.Used, data.Options["@attributes"].byteFormat);
1069
                return formatBytes(this.Used, data.Options["@attributes"].byteFormat);
1067
            }
1070
            }
1068
        },
1071
        },
1069
        Usage: {
1072
        Usage: {
1070
            html: function () {
1073
            html: function () {
1071
                return '<div class="progress">' +
1074
                return '<div class="progress">' +
1072
                    '<div class="progress-bar progress-bar-info" style="width:' + this.Percent + '%;"></div>' +
1075
                    '<div class="progress-bar progress-bar-info" style="width:' + this.Percent + '%;"></div>' +
1073
                    '</div><div class="percent">' + this.Percent + '%</div>';
1076
                    '</div><div class="percent">' + this.Percent + '%</div>';
1074
            }
1077
            }
1075
        },
1078
        },
1076
        Name: {
1079
        Name: {
1077
            html: function () {
1080
            html: function () {
1078
                return this.Name + '<br>' + ((this.MountPoint !== undefined) ? this.MountPoint : this.MountPointID);
1081
                return this.Name + '<br>' + ((this.MountPoint !== undefined) ? this.MountPoint : this.MountPointID);
1079
            }
1082
            }
1080
        }
1083
        }
1081
    };
1084
    };
1082
 
1085
 
1083
    var data_memory = [];
1086
    var data_memory = [];
1084
    if (data.Memory.Swap !== undefined) {
1087
    if (data.Memory.Swap !== undefined) {
1085
        var datas = items(data.Memory.Swap.Mount);
1088
        var datas = items(data.Memory.Swap.Mount);
1086
        data_memory.push_attrs(datas);
1089
        data_memory.push_attrs(datas);
1087
        $('#swap-data').render(data_memory, directive_swap);
1090
        $('#swap-data').render(data_memory, directive_swap);
1088
        $('#swap-data').show();
1091
        $('#swap-data').show();
1089
    } else {
1092
    } else {
1090
        $('#swap-data').hide();
1093
        $('#swap-data').hide();
1091
    }
1094
    }
1092
    $('#memory-data').render(data.Memory, directives);
1095
    $('#memory-data').render(data.Memory, directives);
1093
    $("#block_memory").show();
1096
    $("#block_memory").show();
1094
}
1097
}
1095
 
1098
 
1096
function renderFilesystem(data) {
1099
function renderFilesystem(data) {
1097
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('filesystem', blocks) < 0))) {
1100
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('filesystem', blocks) < 0))) {
1098
        $("#block_filesystem").remove();
1101
        $("#block_filesystem").remove();
1099
        return;
1102
        return;
1100
    }
1103
    }
1101
 
1104
 
1102
    var directives = {
1105
    var directives = {
1103
        Total: {
1106
        Total: {
1104
            html: function () {
1107
            html: function () {
1105
                return formatBytes(this.Total, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals);
1108
                return formatBytes(this.Total, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals);
1106
            }
1109
            }
1107
        },
1110
        },
1108
        Free: {
1111
        Free: {
1109
            html: function () {
1112
            html: function () {
1110
                return formatBytes(this.Free, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals);
1113
                return formatBytes(this.Free, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals);
1111
            }
1114
            }
1112
        },
1115
        },
1113
        Used: {
1116
        Used: {
1114
            html: function () {
1117
            html: function () {
1115
                return formatBytes(this.Used, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore >= 3) && showtotals);
1118
                return formatBytes(this.Used, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore >= 3) && showtotals);
1116
            }
1119
            }
1117
        },
1120
        },
1118
        MountPoint: {
1121
        MountPoint: {
1119
            text: function () {
1122
            text: function () {
1120
                return ((this.MountPoint !== undefined) ? this.MountPoint : this.MountPointID);
1123
                return ((this.MountPoint !== undefined) ? this.MountPoint : this.MountPointID);
1121
            }
1124
            }
1122
        },
1125
        },
1123
        Name: {
1126
        Name: {
1124
            html: function () {
1127
            html: function () {
1125
                return this.Name.replace(/;/g, ";<wbr>") + ((this.MountOptions !== undefined) ? '<br><i>(' + this.MountOptions + ')</i>' : '');
1128
                return this.Name.replace(/;/g, ";<wbr>") + ((this.MountOptions !== undefined) ? '<br><i>(' + this.MountOptions + ')</i>' : '');
1126
            }
1129
            }
1127
        },
1130
        },
1128
        Percent: {
1131
        Percent: {
1129
            html: function () {
1132
            html: function () {
1130
                var used1 = (this.Total != 0) ? Math.ceil((this.Used / this.Total) * 100) : 0;
1133
                var used1 = (this.Total != 0) ? Math.ceil((this.Used / this.Total) * 100) : 0;
1131
                var used2 = Math.ceil(this.Percent);
1134
                var used2 = Math.ceil(this.Percent);
1132
                var used21= used2 - used1;
1135
                var used21= used2 - used1;
1133
                if (used21 > 0) {
1136
                if (used21 > 0) {
1134
                    return '
' + '
1137
                    return '
' + '
1135
 
1138
 
1136
 
1139
 
1137
 
1140
 
1138
 
1141
 
1139
 
1142
 
1140
 
1143
 
1141
 
1144
 
1142
 
1145
 
1143
 
1146
 
1144
 
1147
 
1145
 
1148
 
1146
 
1149
 
1147
 
1150
 
1148
 
1151
 
1149
 
1152
 
1150
 
1153
 
1151
 
1154
 
1152
 
1155
 
1153
 
1156
 
1154
 
1157
 
1155
 
1158
 
1156
 
1159
 
1157
 
1160
 
1158
 
1161
 
1159
 
1162
 
1160
 
1163
 
1161
 
1164
 
1162
 
1165
 
1163
 
1166
 
1164
 
1167
 
1165
 
1168
 
1166
 
1169
 
1167
 
1170
 
1168
 
1171
 
1169
 
1172
 
1170
 
1173
 
1171
 
1174
 
1172
 
1175
 
1173
 
1176
 
1174
 
1177
 
1175
 
1178
 
1176
 
1179
 
1177
 
1180
 
1178
 
1181
 
1179
 
1182
 
1180
 
1183
 
1181
 
1184
 
1182
 
1185
 
1183
 
1186
 
1184
 
1187
 
1185
 
1188
 
1186
 
1189
 
1187
 
1190
 
1188
 
1191
 
1189
 
1192
 
1190
 
1193
 
1191
 
1194
 
1192
 
1195
 
1193
 
1196
 
1194
 
1197
 
1195
 
1198
 
1196
 
1199
 
1197
 
1200
 
1198
 
1201
 
1199
 
1202
 
1200
 
1203
 
1201
 
1204
 
1202
 
1205
 
1203
 
1206
 
1204
 
1207
 
1205
 
-
 
1206
 
1208
 
1207
 
1209
 
1208
 
1210
 
-
 
1211
 
-
 
1212
 
-
 
1213
 
-
 
1214
 
-
 
1215
 
-
 
1216
 
-
 
1217
 
-
 
1218
 
1209
 
1219
 
-
 
1220
 
1210
 
1221
 
1211
 
1222
 
1212
 
1223
 
1213
 
1224
 
1214
 
1225
 
1215
 
1226
 
1216
 
1227
 
1217
 
1228
 
1218
 
1229
 
1219
 
1230
 
1220
 
1231
 
1221
 
-
 
1222
 
1232
 
1223
 
1233
 
1224
 
1234
 
-
 
1235
 
-
 
1236
 
-
 
1237
 
-
 
1238
 
-
 
1239
 
-
 
1240
 
-
 
1241
 
-
 
1242
 
1225
 
1243
 
-
 
1244
 
1226
 
1245
 
1227
 
1246
 
1228
 
1247
 
1229
 
1248
 
1230
 
1249
 
1231
 
1250
 
1232
 
1251
 
1233
 
1252
 
1234
 
1253
 
1235
 
1254
 
1236
 
1255
 
1237
 
1256
 
1238
 
1257
 
1239
 
1258
 
1240
 
1259
 
1241
 
1260
 
1242
 
1261
 
1243
 
1262
 
1244
 
1263
 
1245
 
1264
 
1246
 
1265
 
1247
 
1266
 
1248
 
1267
 
1249
 
1268
 
1250
 
1269
 
1251
 
1270
 
1252
 
1271
 
1253
 
1272
 
1254
 
1273
 
1255
 
1274
 
1256
 
1275
 
1257
 
1276
 
1258
 
1277
 
1259
 
1278
 
1260
 
1279
 
1261
 
1280
 
1262
 
1281
 
1263
 
1282
 
1264
 
1283
 
1265
 
1284
 
1266
 
1285
 
1267
 
1286
 
1268
 
1287
 
1269
 
1288
 
1270
 
1289
 
1271
 
1290
 
1272
 
1291
 
1273
 
1292
 
1274
 
1293
 
1275
 
1294
 
1276
 
1295
 
1277
 
1296
 
1278
 
1297
 
1279
 
1298
 
1280
 
1299
 
1281
 
1300
 
1282
 
1301
 
1283
 
1302
 
1284
 
1303
 
1285
 
1304
 
1286
 
1305
 
1287
 
1306
 
1288
 
1307
 
1289
 
1308
 
1290
 
1309
 
1291
 
1310
 
1292
 
1311
 
1293
 
1312
 
1294
 
1313
 
1295
 
1314
 
1296
 
1315
 
1297
 
1316
 
1298
 
1317
 
1299
 
1318
 
1300
 
1319
 
1301
 
1320
 
1302
 
1321
 
1303
 
1322
 
1304
 
1323
 
1305
 
1324
 
1306
 
1325
 
1307
 
1326
 
1308
 
1327
 
1309
 
1328
 
1310
 
1329
 
1311
 
1330
 
1312
 
1331
 
1313
 
1332
 
1314
 
1333
 
1315
 
1334
 
1316
 
1335
 
1317
 
1336
 
1318
 
1337
 
1319
 
1338
 
1320
 
1339
 
1321
 
1340
 
1322
 
1341
 
1323
 
1342
 
1324
 
1343
 
1325
 
1344
 
1326
 
1345
 
1327
 
1346
 
1328
 
1347
 
1329
 
1348
 
1330
 
1349
 
1331
 
1350
 
1332
 
1351
 
1333
 
1352
 
1334
 
1353
 
1335
 
1354
 
1336
 
1355
 
1337
 
1356
 
1338
 
1357
 
1339
 
1358
 
1340
 
1359
 
1341
 
1360
 
1342
 
1361
 
1343
 
1362
 
1344
 
1363
 
1345
 
1364
 
1346
 
1365
 
1347
 
1366
 
1348
 
1367
 
1349
 
1368
 
1350
 
1369
 
1351
 
1370
 
1352
 
1371
 
1353
 
1372
 
1354
 
1373
 
1355
 
1374
 
1356
 
1375
 
1357
 
1376
 
1358
 
1377
 
1359
 
1378
 
1360
 
1379
 
1361
 
1380
 
1362
 
1381
 
1363
 
1382
 
1364
 
1383
 
1365
 
1384
 
1366
 
1385
 
1367
 
1386
 
1368
 
1387
 
1369
 
1388
 
1370
 
1389
 
1371
 
1390
 
1372
 
1391
 
1373
 
1392
 
1374
 
1393
 
1375
 
1394
 
1376
 
1395
 
1377
 
1396
 
1378
 
1397
 
1379
 
1398
 
1380
 
1399
 
1381
 
1400
 
1382
 
1401
 
1383
 
1402
 
1384
 
1403
 
1385
 
1404
 
1386
 
1405
 
1387
 
1406
 
1388
 
1407
 
1389
 
1408
 
1390
 
1409
 
1391
 
1410
 
1392
 
1411
 
1393
 
1412
 
1394
 
1413
 
1395
 
1414
 
1396
 
1415
 
1397
 
1416
 
1398
 
1417
 
1399
 
1418
 
1400
 
1419
 
1401
 
1420
 
1402
 
1421
 
1403
 
1422
 
1404
 
1423
 
1405
 
1424
 
1406
 
1425
 
1407
 
1426
 
1408
 
1427
 
1409
 
1428
 
1410
 
1429
 
1411
 
1430
 
1412
 
1431
 
1413
 
1432
 
1414
 
1433
 
1415
 
1434
 
1416
 
1435
 
1417
 
1436
 
1418
 
1437
 
1419
 
1438
 
1420
 
1439
 
1421
 
1440
 
1422
 
1441
 
1423
 
1442
 
1424
 
1443
 
1425
 
1444
 
1426
 
1445
 
1427
 
1446
 
1428
 
1447
 
1429
 
1448
 
1430
 
1449
 
1431
 
1450
 
1432
 
1451
 
1433
 
1452
 
1434
 
1453
 
1435
 
1454
 
1436
 
1455
 
1437
 
1456
 
1438
 
1457
 
1439
 
1458
 
1440
 
1459
 
1441
 
1460
 
1442
 
1461
 
1443
 
1462
 
1444
 
1463
 
1445
 
1464
 
1446
 
1465
 
1447
 
1466
 
1448
 
1467
 
1449
 
1468
 
1450
 
1469
 
1451
 
1470
 
1452
 
1471
 
1453
 
1472
 
1454
 
1473
 
1455
 
1474
 
1456
 
1475
 
1457
 
1476
 
1458
 
1477
 
1459
 
1478
 
1460
 
1479
 
1461
 
1480
 
1462
 
1481
 
1463
 
1482
 
1464
 
1483
 
1465
 
1484
 
1466
 
1485
 
1467
 
1486
 
1468
 
1487
 
1469
 
1488
 
1470
 
1489
 
1471
 
1490
 
1472
 
1491
 
1473
 
1492
 
1474
 
1493
 
1475
 
1494
 
1476
 
1495
 
1477
 
1496
 
1478
 
1497
 
1479
 
1498
 
1480
 
1499
 
1481
 
1500
 
1482
 
1501
 
1483
 
1502
 
1484
 
1503
 
1485
 
1504
 
1486
 
1505
 
1487
 
1506
 
1488
 
1507
 
1489
 
1508
 
1490
 
1509
 
1491
 
1510
 
1492
 
1511
 
1493
 
1512
 
1494
 
1513
 
1495
 
1514
 
1496
 
1515
 
1497
 
1516
 
1498
 
1517
 
1499
 
1518
 
1500
 
1519
 
1501
 
1520
 
1502
 
1521
 
1503
 
1522
 
1504
 
1523
 
1505
 
1524
 
1506
 
1525
 
1507
 
1526
 
1508
 
1527
 
1509
 
1528
 
1510
 
1529
 
1511
 
1530
 
1512
 
1531
 
1513
 
1532
 
1514
 
1533
 
1515
 
1534
 
1516
 
1535
 
1517
 
1536
 
1518
 
1537
 
1519
 
1538
 
1520
 
1539
 
1521
 
1540
 
1522
 
1541
 
1523
 
1542
 
1524
 
1543
 
1525
 
1544
 
1526
 
1545
 
1527
 
1546
 
1528
 
1547
 
1529
 
1548
 
1530
 
1549
 
1531
 
1550
 
1532
 
1551
 
1533
 
1552
 
1534
 
1553
 
1535
 
1554
 
1536
 
1555
 
1537
 
1556
 
1538
 
1557
 
1539
 
1558
 
1540
 
1559
 
1541
 
1560
 
1542
 
1561
 
1543
 
1562
 
1544
 
1563
 
1545
 
1564
 
1546
 
1565
 
1547
 
1566
 
1548
 
1567
 
1549
 
1568
 
1550
 
1569
 
1551
 
1570
 
1552
 
1571
 
1553
 
1572
 
1554
 
1573
 
1555
 
1574
 
1556
 
1575
 
1557
 
1576
 
1558
 
1577
 
1559
 
1578
 
1560
 
1579
 
1561
 
1580
 
1562
 
1581
 
1563
 
1582
 
1564
 
1583
 
1565
 
1584
 
1566
 
1585
 
1567
 
1586
 
1568
 
1587
 
1569
 
1588
 
1570
 
1589
 
1571
 
1590
 
1572
 
1591
 
1573
 
1592
 
1574
 
1593
 
1575
 
1594
 
1576
 
1595
 
1577
 
1596
 
1578
 
1597
 
1579
 
1598
 
1580
 
1599
 
1581
 
1600
 
1582
 
1601
 
1583
 
1602
 
1584
 
1603
 
1585
 
1604
 
1586
 
1605
 
1587
 
1606
 
1588
 
1607
 
1589
 
1608
 
1590
 
1609
 
1591
 
1610
 
1592
 
1611
 
1593
 
1612
 
1594
 
1613
 
1595
 
1614
 
1596
 
1615
 
1597
 
1616
 
1598
 
1617
 
1599
 
1618
 
1600
 
1619
 
1601
 
1620
 
1602
 
1621
 
1603
 
1622
 
1604
 
1623
 
1605
 
1624
 
1606
 
1625
 
1607
 
1626
 
1608
 
1627
 
1609
 
1628
 
1610
 
1629
 
1611
 
1630
 
1612
 
1631
 
1613
 
1632
 
1614
 
1633
 
1615
 
1634
 
1616
 
1635
 
1617
 
1636
 
1618
 
1637
 
1619
 
1638
 
1620
 
1639
 
1621
 
1640
 
1622
 
1641
 
1623
 
1642
 
1624
 
1643
 
1625
 
1644
 
1626
 
1645
 
1627
 
1646
 
1628
 
1647
 
1629
 
1648
 
1630
 
1649
 
1631
 
1650
 
1632
 
1651
 
1633
 
1652
 
1634
 
1653
 
1635
 
1654
 
1636
 
1655
 
1637
 
1656
 
1638
 
1657
 
1639
 
1658
 
1640
 
1659
 
1641
 
1660
 
1642
 
1661
 
1643
 
1662
 
1644
 
1663
 
1645
 
1664
 
1646
 
1665
 
1647
 
1666
 
1648
 
1667
 
1649
 
1668
 
1650
 
1669
 
1651
 
1670
 
1652
 
1671
 
1653
 
1672
 
1654
 
1673
 
1655
 
1674
 
1656
 
1675
 
1657
 
1676
 
1658
 
1677
 
1659
 
1678
 
1660
 
1679
 
1661
 
1680
 
1662
 
1681
 
1663
 
1682
 
1664
 
1683
 
1665
 
1684
 
1666
 
1685
 
1667
 
1686
 
1668
 
1687
 
1669
 
1688
 
1670
 
1689
 
1671
 
1690
 
1672
 
1691
 
1673
 
1692
 
1674
 
1693
 
1675
 
1694
 
1676
 
1695
 
1677
 
1696
 
1678
 
1697
 
1679
 
1698
 
1680
 
1699
 
1681
 
1700
 
1682
 
1701
 
1683
 
1702
 
1684
 
1703
 
1685
 
1704
 
1686
 
1705
 
1687
 
1706
 
1688
 
1707
 
1689
 
1708
 
1690
 
1709
 
1691
 
1710
 
1692
 
1711
 
1693
 
1712
 
1694
 
1713
 
1695
 
1714
 
1696
 
1715
 
1697
 
1716
 
1698
 
1717
 
1699
 
1718
 
1700
 
1719
 
1701
 
1720
 
1702
 
1721
 
1703
 
1722
 
1704
 
1723
 
1705
 
1724
 
1706
 
1725
 
1707
 
1726
 
1708
 
1727
 
1709
 
1728
 
1710
 
1729
 
1711
 
1730
 
1712
 
1731
 
1713
 
1732
 
1714
 
1733
 
1715
 
1734
 
1716
 
1735
 
1717
 
1736
 
1718
 
1737
 
1719
 
1738
 
1720
 
1739
 
1721
 
1740
 
1722
 
1741
 
1723
 
1742
 
1724
 
1743
 
1725
 
1744
 
1726
 
1745
 
1727
 
1746
 
1728
 
1747
 
1729
 
1748
 
1730
 
1749
 
1731
 
1750
 
1732
 
1751
 
1733
 
1752
 
1734
 
1753
 
1735
 
1754
 
1736
 
1755
 
1737
 
1756
 
1738
 
1757
 
1739
 
1758
 
1740
 
1759
 
1741
 
1760
 
1742
 
1761
 
1743
return round((((9 * degree) / 5) + 32), 1) + String.fromCharCode(160) + genlang(61) + "<br><i>(" + round(degree, 1) + String.fromCharCode(160) + genlang(60) + ")</i>";
1762
return round((((9 * degree) / 5) + 32), 1) + String.fromCharCode(160) + genlang(61) + "<br><i>(" + round(degree, 1) + String.fromCharCode(160) + genlang(60) + ")</i>";
1744
 
1763
 
1745
 
1764
 
1746
 
1765
 
1747
 
1766
 
1748
 
1767
 
1749
 
1768
 
1750
 
1769
 
1751
 
1770
 
1752
 
1771
 
1753
 
1772
 
1754
if ((mhertz >= 0) && (mhertz < 1000)) {
1773
if ((mhertz >= 0) && (mhertz < 1000)) {
1755
 
1774
 
1756
 
1775
 
1757
< 1000)) { if (mhertz >= 1000) {
1776
< 1000)) { if (mhertz >= 1000) {
1758
 
1777
 
1759
 
1778
 
1760
 
1779
 
1761
 
1780
 
1762
 
1781
 
1763
 
1782
 
1764
 
1783
 
1765
 
1784
 
1766
 
1785
 
1767
 
1786
 
1768
 
1787
 
1769
 
1788
 
1770
 
1789
 
1771
 
1790
 
1772
 
1791
 
1773
 
1792
 
1774
 
1793
 
1775
 
1794
 
1776
 
1795
 
1777
 
1796
 
1778
 
1797
 
1779
 
1798
 
1780
 
1799
 
1781
 
1800
 
1782
 
1801
 
1783
 
1802
 
1784
 
1803
 
1785
 
1804
 
1786
 
1805
 
1787
 
1806
 
1788
 
1807
 
1789
 
1808
 
1790
 
1809
 
1791
 
1810
 
1792
 
1811
 
1793
 
1812
 
1794
 
1813
 
1795
 
1814
 
1796
 
1815
 
1797
 
1816
 
1798
 
1817
 
1799
 
1818
 
1800
 
1819
 
1801
 
1820
 
1802
 
1821
 
1803
 
1822
 
1804
 
1823
 
1805
 
1824
 
1806
 
1825
 
1807
 
1826
 
1808
 
1827
 
1809
 
1828
 
1810
 
1829
 
1811
 
1830
 
1812
 
1831
 
1813
 
1832
 
1814
 
1833
 
1815
 
1834
 
1816
 
1835
 
1817
 
1836
 
1818
 
1837
 
1819
 
1838
 
1820
 
1839
 
1821
 
1840
 
1822
 
1841
 
1823
 
1842
 
1824
 
1843
 
1825
 
1844
 
1826
 
1845
 
1827
 
1846
 
1828
 
1847
 
1829
 
1848
 
1830
 
1849
 
1831
 
1850
 
1832
 
1851
 
1833
 
1852
 
1834
 
1853
 
1835
 
1854
 
1836
 
1855
 
1837
 
1856
 
1838
 
1857
 
1839
 
1858
 
1840
 
1859
 
1841
 
1860
 
1842
 
1861
 
1843
 
1862
 
1844
< 1000)) { if (bytes > Math.pow(1000, 5)) {
1863
< 1000)) { if (bytes > Math.pow(1000, 5)) {
1845
 
1864
 
1846
 
1865
 
1847
 
1866
 
1848
 
1867
 
1849
 
1868
 
1850
 
1869
 
1851
 
1870
 
1852
< 1000)) { if (bytes > Math.pow(1000, 3)) {
1871
< 1000)) { if (bytes > Math.pow(1000, 3)) {
1853
 
1872
 
1854
 
1873
 
1855
 
1874
 
1856
 
1875
 
1857
 
1876
 
1858
 
1877
 
1859
 
1878
 
1860
< 1000)) { if (bytes > Math.pow(1000, 1)) {
1879
< 1000)) { if (bytes > Math.pow(1000, 1)) {
1861
 
1880
 
1862
 
1881
 
1863
 
1882
 
1864
 
1883
 
1865
 
1884
 
1866
 
1885
 
1867
 
1886
 
1868
 
1887
 
1869
 
1888
 
1870
 
1889
 
1871
 
1890
 
1872
 
1891
 
1873
 
1892
 
1874
 
1893
 
1875
 
1894
 
1876
 
1895
 
1877
< 1000)) { if (bytes > Math.pow(1024, 4)) {
1896
< 1000)) { if (bytes > Math.pow(1024, 4)) {
1878
 
1897
 
1879
 
1898
 
1880
 
1899
 
1881
 
1900
 
1882
 
1901
 
1883
 
1902
 
1884
 
1903
 
1885
< 1000)) { if (bytes > Math.pow(1024, 2)) {
1904
< 1000)) { if (bytes > Math.pow(1024, 2)) {
1886
 
1905
 
1887
 
1906
 
1888
 
1907
 
1889
 
1908
 
1890
 
1909
 
1891
 
1910
 
1892
 
1911
 
1893
 
1912
 
1894
 
1913
 
1895
 
1914
 
1896
 
1915
 
1897
 
1916
 
1898
 
1917
 
1899
 
1918
 
1900
 
1919
 
1901
 
1920
 
1902
 
1921
 
1903
 
1922
 
1904
< 1000)) { return "<span style='display:none'>" + round(bytes,0) + ".</span>" + show; //span for sorting
1923
< 1000)) { return "<span style='display:none'>" + round(bytes,0) + ".</span>" + show; //span for sorting
1905
 
1924
 
1906
 
1925
 
1907
 
1926
 
1908
 
1927
 
1909
 
1928
 
1910
< 1000)) { if (bps > Math.pow(1000, 5)) {
1929
< 1000)) { if (bps > Math.pow(1000, 5)) {
1911
 
1930
 
1912
 
1931
 
1913
 
1932
 
1914
 
1933
 
1915
 
1934
 
1916
 
1935
 
1917
 
1936
 
1918
 
1937
 
1919
 
1938
 
1920
 
1939
 
1921
 
1940
 
1922
< 1000)) { if (bps > Math.pow(1000, 2)) {
1941
< 1000)) { if (bps > Math.pow(1000, 2)) {
1923
 
1942
 
1924
 
1943
 
1925
 
1944
 
1926
 
1945
 
1927
 
1946
 
1928
 
1947
 
1929
 
1948
 
1930
 
1949
 
1931
 
1950
 
1932
 
1951
 
1933
 
1952
 
1934
 
1953
 
1935
 
1954
 
1936
 
1955
 
1937
 
1956
 
1938
 
1957
 
1939
 
1958
 
1940
 
1959
 
1941
 
1960
 
1942
 
1961
 
1943
 
1962
 
1944
 
1963
 
1945
 
1964
 
1946
 
1965
 
1947
 
1966
 
1948
 
1967
 
1949
 
1968
 
1950
 
1969
 
1951
 
1970
 
1952
 
1971
 
1953
 
1972
 
1954
 
1973
 
1955
 
1974
 
1956
 
1975
 
1957
 
1976
 
1958
 
1977
 
1959
 
1978
 
1960
 
1979
 
1961
 
1980
 
1962
 
1981
 
1963
 
1982
 
1964
 
1983
 
1965
 
1984
 
1966
 
1985
 
1967
 
1986
 
1968
 
1987
 
1969
 
1988
 
1970
 
1989
 
1971
 
1990
 
1972
 
1991
 
1973
 
1992
 
1974
 
1993
 
1975
 
1994
 
1976
 
1995
 
1977
 
1996
 
1978
 
1997
 
1979
 
1998
 
1980
 
1999
 
1981
 
2000
 
1982
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString(); if (n < 0 || n > 14) {
2001
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString(); if (n < 0 || n > 14) {
1983
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > return 0;
2002
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > return 0;
1984
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > }
2003
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > }
1985
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > if (n === 0) {
2004
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > if (n === 0) {
1986
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > return Math.round(x);
2005
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > return Math.round(x);
1987
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > } else {
2006
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > } else {
1988
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > e = Math.pow(10, n);
2007
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > e = Math.pow(10, n);
1989
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > k = (Math.round(x * e) / e).toString();
2008
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > k = (Math.round(x * e) / e).toString();
1990
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > if (k.indexOf('.') === -1) {
2009
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > if (k.indexOf('.') === -1) {
1991
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > k += '.';
2010
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > k += '.';
1992
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > }
2011
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > }
1993
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > k += e.toString().substring(1);
2012
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > k += e.toString().substring(1);
1994
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > return k.substring(0, k.indexOf('.') + n + 1);
2013
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > return k.substring(0, k.indexOf('.') + n + 1);
1995
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > }
2014
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n > }
1996
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n >}
2015
< 1000)) {< 10) ? "0" + day.toString() : day.toString();< 10) ? "0" + month.toString() : month.toString();< 1000) ? year.toString() : year.toString();< 10) ? "0" + minute.toString() : minute.toString();< 10) ? "0" + hour.toString() : hour.toString();< 0 || n >}
1997
 
2016