Subversion Repositories ALCASAR

Rev

Rev 2800 | Rev 3037 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
2788 rexy 1
/***************************************************************************
2
 *   Copyright (C) 2008 by phpSysInfo - A PHP System Information Script    *
3
 *   http://phpsysinfo.sourceforge.net/                                    *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation; either version 2 of the License, or     *
8
 *   (at your option) any later version.                                   *
9
 *                                                                         *
10
 *   This program is distributed in the hope that it will be useful,       *
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 *   GNU General Public License for more details.                          *
14
 *                                                                         *
15
 *   You should have received a copy of the GNU General Public License     *
16
 *   along with this program; if not, write to the                         *
17
 *   Free Software Foundation, Inc.,                                       *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 ***************************************************************************/
20
//
21
// $Id: phpsysinfo.js 699 2012-09-15 11:57:13Z namiltd $
22
//
23
 
24
/*global $, jQuery */
25
 
26
"use strict";
27
 
28
var langxml = [], filesystemTable, current_language = "", plugin_liste = [], blocks = [], langarr = [],
2976 rexy 29
     showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showMemoryInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, showTotals, increaseWidth, oldnetwork = [];
2788 rexy 30
 
31
/**
32
 * Fix PNG loading on IE6 or below
33
 */
34
function PNGload(png) {
35
    if (typeof(png.ifixpng)==='function') { //IE6 PNG fix
36
        png.ifixpng('./gfx/blank.gif');
37
    }
38
}
39
 
40
/**
41
 * generate a cookie, if not exist, and add an entry to it<br><br>
42
 * inspired by <a href="http://www.quirksmode.org/js/cookies.html">http://www.quirksmode.org/js/cookies.html</a>
43
 * @param {String} name name that holds the value
44
 * @param {String} value value that needs to be stored
45
 * @param {Number} days how many days the entry should be valid in the cookie
46
 */
47
function createCookie(name, value, days) {
48
    var date = new Date(), expires = "";
49
    if (days) {
50
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
51
        if (typeof(date.toUTCString)==="function") {
52
            expires = "; expires=" + date.toUTCString();
53
        } else {
54
            //deprecated
55
            expires = "; expires=" + date.toGMTString();
56
        }
57
    } else {
58
        expires = "";
59
    }
2976 rexy 60
    document.cookie = name + "=" + value + expires + "; path=/; samesite=strict";
2788 rexy 61
}
62
 
63
/**
64
 * read a value out of a cookie and return the value<br><br>
65
 * inspired by <a href="http://www.quirksmode.org/js/cookies.html">http://www.quirksmode.org/js/cookies.html</a>
66
 * @param {String} name name of the value that should be retrieved
67
 * @return {String}
68
 */
69
function readCookie(name) {
70
    var nameEQ = "", ca = [], c = '', i = 0;
71
    nameEQ = name + "=";
72
    ca = document.cookie.split(';');
73
    for (i = 0; i < ca.length; i++) {
74
        c = ca[i];
75
        while (c.charAt(0) === ' ') {
76
            c = c.substring(1, c.length);
77
        }
78
        if (!c.indexOf(nameEQ)) {
79
            return c.substring(nameEQ.length, c.length);
80
        }
81
    }
82
    return null;
83
}
84
 
85
/**
86
 * round a given value to the specified precision, difference to Math.round() is that there
87
 * will be appended Zeros to the end if the precision is not reached (0.1 gets rounded to 0.100 when precision is set to 3)
88
 * @param {Number} x value to round
89
 * @param {Number} n precision
90
 * @return {String}
91
 */
92
function round(x, n) {
93
    var e = 0, k = "";
94
    if (n < 0 || n > 14) {
95
        return 0;
96
    }
97
    if (n === 0) {
98
        return Math.round(x);
99
    } else {
100
        e = Math.pow(10, n);
101
        k = (Math.round(x * e) / e).toString();
102
        if (k.indexOf('.') === -1) {
103
            k += '.';
104
        }
105
        k += e.toString().substring(1);
106
        return k.substring(0, k.indexOf('.') + n + 1);
107
    }
108
}
109
 
110
/**
111
 * activates a given style and disables the old one in the document
112
 * @param {String} template template that should be activated
113
 */
114
function switchStyle(template) {
2976 rexy 115
    if (increaseWidth > 0) {
116
        $('link[rel*=style][title]').each(function getTitle(i) {
117
            if (this.getAttribute('title') === 'PSI_Template') {
118
                this.setAttribute('href', './templates/css.php?name=' + template + '&increase=' + increaseWidth);
119
            }
120
        });
121
    } else {
122
        $('link[rel*=style][title]').each(function getTitle(i) {
123
            if (this.getAttribute('title') === 'PSI_Template') {
124
                this.setAttribute('href', './templates/' + template + ".css");  
125
            }
126
        });
127
    }
2788 rexy 128
}
129
 
130
/**
131
 * load the given translation an translate the entire page<br><br>retrieving the translation is done through a
132
 * ajax call
133
 * @private
134
 * @param {String} plugin if plugin is given, the plugin translation file will be read instead of the main translation file
135
 * @param {String} langarrId internal plugin name
136
 * @return {jQuery} translation jQuery-Object
137
 */
138
function getLanguage(plugin, langarrId) {
139
    var getLangUrl = "";
140
    if (current_language) {
141
        getLangUrl = 'language/language.php?lang=' + current_language;
142
        if (plugin) {
143
            getLangUrl += "&plugin=" + plugin;
144
        }
145
    } else {
146
        getLangUrl = 'language/language.php';
147
        if (plugin) {
148
            getLangUrl += "?plugin=" + plugin;
149
        }
150
    }
151
    $.ajax({
152
        url: getLangUrl,
153
        type: 'GET',
154
        dataType: 'xml',
155
        timeout: 100000,
156
        error: function error() {
157
            $.jGrowl("Error loading language - " + getLangUrl);
158
        },
159
        success: function buildblocks(xml) {
160
            var idexp;
161
            langxml[langarrId] = xml;
162
            if (langarr[langarrId] === undefined) {
163
                langarr.push(langarrId);
164
                langarr[langarrId] = [];
165
            }
166
            $("expression", langxml[langarrId]).each(function langstore(id) {
167
                idexp = $("expression", xml).get(id);
168
                langarr[langarrId][this.getAttribute('id')] = $("exp", idexp).text().toString().replace(/\//g, "/<wbr>");
169
            });
170
            changeSpanLanguage(plugin);
171
        }
172
    });
173
}
174
 
175
/**
176
 * generate a span tag
177
 * @param {Number} id translation id in the xml file
178
 * @param {String} [plugin] name of the plugin for which the tag should be generated
179
 * @return {String} string which contains generated span tag for translation string
180
 */
181
function genlang(id, plugin) {
182
    var html = "", idString = "", plugname = "",
183
        langarrId = current_language + "_";
184
 
185
    if (plugin === undefined) {
186
        plugname = "";
187
        langarrId += "phpSysInfo";
188
    } else {
189
        plugname = plugin.toLowerCase();
190
        langarrId += plugname;
191
    }
192
    if (id < 100) {
193
        if (id < 10) {
194
            idString = "00" + id.toString();
195
        } else {
196
            idString = "0" + id.toString();
197
        }
198
    } else {
199
        idString = id.toString();
200
    }
201
    if (plugin) {
202
        idString = "plugin_" + plugname + "_" + idString;
203
    }
204
 
205
    html += "<span class=\"lang_" + idString + "\">";
206
 
207
    if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) {
208
        html += langarr[langarrId][idString];
209
    }    
210
 
211
    html += "</span>";
212
 
213
    return html;
214
}
215
 
216
/**
217
 * translates all expressions based on the translation xml file<br>
218
 * translation expressions must be in the format &lt;span class="lang_???"&gt;&lt;/span&gt;, where ??? is
219
 * the number of the translated expression in the xml file<br><br>if a translated expression is not found in the xml
220
 * file nothing would be translated, so the initial value which is inside the span tag is displayed
221
 * @param {String} [plugin] name of the plugin
222
 */
223
function changeLanguage(plugin) {
224
    var langarrId = current_language + "_";
225
 
226
    if (plugin === undefined) {
227
        langarrId += "phpSysInfo";
228
    } else {
229
        langarrId += plugin;
230
    }
231
 
232
    if (langxml[langarrId] !== undefined) {
233
        changeSpanLanguage(plugin);
234
    } else {
235
        langxml.push(langarrId);
236
        getLanguage(plugin, langarrId);
237
    }
238
}
239
 
240
function changeSpanLanguage(plugin) {
241
    var langId = "", langStr = "", langarrId = current_language + "_";
242
 
243
    if (plugin === undefined) {
244
        langarrId += "phpSysInfo";
245
        $('span[class*=lang_]').each(function translate(i) {
246
            langId = this.className.substring(5);
247
            if (langId.indexOf('plugin_') !== 0) { //does not begin with plugin_
248
                langStr = langarr[langarrId][langId];
249
                if (langStr !== undefined) {
250
                    if (langStr.length > 0) {
251
                        this.innerHTML = langStr;
252
                    }
253
                }
254
            }
255
        });
256
        $("#loader").hide();
257
        $("#output").fadeIn("slow"); //show if any language loaded
258
    } else {
259
        langarrId += plugin;
260
        $('span[class*=lang_plugin_'+plugin.toLowerCase()+'_]').each(function translate(i) {
261
            langId = this.className.substring(5);
262
            langStr = langarr[langarrId][langId];
263
            if (langStr !== undefined) {
264
                if (langStr.length > 0) {
265
                    this.innerHTML = langStr;
266
                }
267
            }
268
        });
269
        $('#panel_'+plugin).show(); //show plugin if any language loaded
270
    }
271
}
272
 
273
/**
274
 * generate the filesystemTable and activate the dataTables plugin on it
275
 */
276
function filesystemtable() {
277
    var html = "";
278
    html += "<h2>" + genlang(30) + "</h2>\n";
279
    html += "        <div style=\"overflow-x:auto;\">\n";
280
    html += "          <table id=\"filesystemTable\" style=\"border-collapse:collapse;\">\n";
281
    html += "            <thead>\n";
282
    html += "              <tr>\n";
283
    html += "                <th>" + genlang(31) + "</th>\n";
284
    html += "                <th>" + genlang(34) + "</th>\n";
285
    html += "                <th>" + genlang(32) + "</th>\n";
286
    html += "                <th>" + genlang(33) + "</th>\n";
287
    html += "                <th class=\"right\">" + genlang(35) + "</th>\n";
288
    html += "                <th class=\"right\">" + genlang(36) + "</th>\n";
289
    html += "                <th class=\"right\">" + genlang(37) + "</th>\n";
290
    html += "              </tr>\n";
291
    html += "            </thead>\n";
2976 rexy 292
    if (showTotals) {
293
        html += "            <tfoot>\n";
294
        html += "              <tr style=\"font-weight : bold\">\n";
295
        html += "                <td>&nbsp;</td>\n";
296
        html += "                <td>&nbsp;</td>\n";
297
        html += "                <td>" + genlang(38) + "</td>\n";
298
        html += "                <td id=\"s_fs_total\"></td>\n";
299
        html += "                <td class=\"right\"><span id=\"s_fs_tfree\"></span></td>\n";
300
        html += "                <td class=\"right\"><span id=\"s_fs_tused\"></span></td>\n";
301
        html += "                <td class=\"right\"><span id=\"s_fs_tsize\"></span></td>\n";
302
        html += "              </tr>\n";
303
        html += "            </tfoot>\n";
304
    }
2788 rexy 305
    html += "            <tbody>\n";
306
    html += "            </tbody>\n";
307
    html += "          </table>\n";
308
    html += "        </div>\n";
309
 
310
    $("#filesystem").append(html);
311
 
312
    filesystemTable = $("#filesystemTable").dataTable({
313
        "bPaginate": false,
314
        "bLengthChange": false,
315
        "bFilter": false,
316
        "bSort": true,
317
        "bInfo": false,
318
        "bProcessing": true,
319
        "bAutoWidth": false,
320
        "bStateSave": true,
321
        "aoColumns": [{
322
            "sType": 'span-string',
323
            "sWidth": "100px"
324
        }, {
325
            "sType": 'span-string',
326
            "sWidth": "50px"
327
        }, {
328
            "sType": 'span-string',
329
            "sWidth": "200px"
330
        }, {
331
            "sType": 'span-number'
332
        }, {
333
            "sType": 'span-number',
334
            "sWidth": "80px",
335
            "sClass": "right"
336
        }, {
337
            "sType": 'span-number',
338
            "sWidth": "80px",
339
            "sClass": "right"
340
        }, {
341
            "sType": 'span-number',
342
            "sWidth": "80px",
343
            "sClass": "right"
344
        }]
345
    });
346
}
347
 
348
/**
349
 * fill all errors from the xml in the error div element in the document and show the error icon
350
 * @param {jQuery} xml phpSysInfo-XML
351
 */
352
function populateErrors(xml) {
353
    var values = false;
354
    $("Errors Error", xml).each(function getError(id) {
355
//        $("#errorlist").append("<b>" + $(this).attr("Function") + "</b><br><br><pre>" + $(this).text() + "</pre><hr>");
356
        $("#errorlist").append("<b>" + $(this).attr("Function") + "</b><br><br><pre>" + $(this).attr("Message") + "</pre><hr>");
357
        values = true;
358
    });
359
    if (values) {
360
        $("#warn").css("display", "inline");
361
        $("#loadwarn").css("display", "inline");
362
    }
363
}
364
 
365
/**
366
 * show the page
367
 * @param {jQuery} xml phpSysInfo-XML
368
 */
369
function displayPage(xml) {
370
    var versioni = "";
371
//    $("#loader").hide();
372
//    $("#output").fadeIn("slow");
373
    versioni = $("Generation", xml).attr("version").toString();
374
    $("#version").html(versioni);
375
}
376
 
377
/**
378
 * format seconds to a better readable statement with days, hours and minutes
379
 * @param {Number} sec seconds that should be formatted
380
 * @return {String} html string with no breaking spaces and translation statements
381
 */
382
function formatUptime(sec) {
383
    var txt = "", intMin = 0, intHours = 0, intDays = 0;
384
    intMin = sec / 60;
385
    intHours = intMin / 60;
386
    intDays = Math.floor(intHours / 24);
387
    intHours = Math.floor(intHours - (intDays * 24));
388
    intMin = Math.floor(intMin - (intDays * 60 * 24) - (intHours * 60));
389
    if (intDays) {
390
        txt += intDays.toString() + " " + genlang(48) + " ";
391
    }
392
    if (intHours) {
393
        txt += intHours.toString() + " " + genlang(49) + " ";
394
    }
395
    return txt + intMin.toString() + " " + genlang(50);
396
}
397
 
398
/**
399
 * format a given MHz value to a better readable statement with the right suffix
400
 * @param {Number} mhertz mhertz value that should be formatted
401
 * @return {String} html string with no breaking spaces and translation statements
402
 */
403
function formatHertz(mhertz) {
404
    if ((mhertz >= 0) && (mhertz < 1000)) {
405
< 1000)) {        return mhertz.toString() + " " + genlang(92);
406
< 1000)) {    } else {
407
< 1000)) {        if (mhertz >= 1000) {
408
< 1000)) {            return round(mhertz / 1000, 2) + "&nbsp;" + genlang(93);
409
< 1000)) {        } else {
410
< 1000)) {            return "";
411
< 1000)) {        }
412
< 1000)) {    }
413
< 1000)) {}
414
 
415
< 1000)) {/**
2976 rexy 416
< 1000)) { * format a given MT/s value to a better readable statement with the right suffix
417
< 1000)) { * @param {Number} mtps mtps value that should be formatted
418
< 1000)) { * @return {String} html string with no breaking spaces and translation statements
419
< 1000)) { */
420
< 1000)) {function formatMTps(mtps) {
421
< 1000)) {    if ((mtps >= 0) && (mtps < 1000)) {
422
< 1000)) {        return mtps.toString() + "&nbsp;" + genlang(131);
423
< 1000)) {    } else {
424
< 1000)) {        if (mtps >= 1000) {
425
< 1000)) {            return round(mtps / 1000, 2) + " " + genlang(132);
426
< 1000)) {        } else {
427
< 1000)) {            return "";
428
< 1000)) {        }
429
< 1000)) {    }
430
< 1000)) {}
431
 
432
< 1000)) {/**
2788 rexy 433
< 1000)) { * format the byte values into a user friendly value with the corespondenting unit expression<br>support is included
434
< 1000)) { * for binary and decimal output<br>user can specify a constant format for all byte outputs or the output is formated
435
< 1000)) { * automatically so that every value can be read in a user friendly way
436
< 1000)) { * @param {Number} bytes value that should be converted in the corespondenting format, which is specified in the phpsysinfo.ini
437
< 1000)) { * @param {jQuery} xml phpSysInfo-XML
438
< 1000)) { * @return {String} string of the converted bytes with the translated unit expression
439
< 1000)) { */
440
< 1000)) {function formatBytes(bytes, xml) {
441
< 1000)) {    var byteFormat = "", show = "";
442
 
443
< 1000)) {    $("Options", xml).each(function getByteFormat(id) {
444
< 1000)) {        byteFormat = $(this).attr("byteFormat");
445
< 1000)) {    });
446
 
447
< 1000)) {    switch (byteFormat.toLowerCase()) {
448
< 1000)) {    case "pib":
449
< 1000)) {        show += round(bytes / Math.pow(1024, 5), 2);
450
< 1000)) {        show += "&nbsp;" + genlang(90);
451
< 1000)) {        break;
452
< 1000)) {    case "tib":
453
< 1000)) {        show += round(bytes / Math.pow(1024, 4), 2);
454
< 1000)) {        show += " " + genlang(86);
455
< 1000)) {        break;
456
< 1000)) {    case "gib":
457
< 1000)) {        show += round(bytes / Math.pow(1024, 3), 2);
458
< 1000)) {        show += "&nbsp;" + genlang(87);
459
< 1000)) {        break;
460
< 1000)) {    case "mib":
461
< 1000)) {        show += round(bytes / Math.pow(1024, 2), 2);
462
< 1000)) {        show += " " + genlang(88);
463
< 1000)) {        break;
464
< 1000)) {    case "kib":
465
< 1000)) {        show += round(bytes / Math.pow(1024, 1), 2);
466
< 1000)) {        show += "&nbsp;" + genlang(89);
467
< 1000)) {        break;
468
< 1000)) {    case "pb":
469
< 1000)) {        show += round(bytes / Math.pow(1000, 5), 2);
470
< 1000)) {        show += " " + genlang(91);
471
< 1000)) {        break;
472
< 1000)) {    case "tb":
473
< 1000)) {        show += round(bytes / Math.pow(1000, 4), 2);
474
< 1000)) {        show += "&nbsp;" + genlang(85);
475
< 1000)) {        break;
476
< 1000)) {    case "gb":
477
< 1000)) {        show += round(bytes / Math.pow(1000, 3), 2);
478
< 1000)) {        show += " " + genlang(41);
479
< 1000)) {        break;
480
< 1000)) {    case "mb":
481
< 1000)) {        show += round(bytes / Math.pow(1000, 2), 2);
482
< 1000)) {        show += "&nbsp;" + genlang(40);
483
< 1000)) {        break;
484
< 1000)) {    case "kb":
485
< 1000)) {        show += round(bytes / Math.pow(1000, 1), 2);
486
< 1000)) {        show += " " + genlang(39);
487
< 1000)) {        break;
488
< 1000)) {    case "b":
489
< 1000)) {        show += bytes;
490
< 1000)) {        show += " " + genlang(96);
491
< 1000)) {        break;
492
< 1000)) {    case "auto_decimal":
493
< 1000)) {        if (bytes > Math.pow(1000, 5)) {
494
< 1000)) {            show += round(bytes / Math.pow(1000, 5), 2);
495
< 1000)) {            show += "&nbsp;" + genlang(91);
496
< 1000)) {        } else {
497
< 1000)) {            if (bytes > Math.pow(1000, 4)) {
498
< 1000)) {                show += round(bytes / Math.pow(1000, 4), 2);
499
< 1000)) {                show += " " + genlang(85);
500
< 1000)) {            } else {
501
< 1000)) {                if (bytes > Math.pow(1000, 3)) {
502
< 1000)) {                    show += round(bytes / Math.pow(1000, 3), 2);
503
< 1000)) {                    show += "&nbsp;" + genlang(41);
504
< 1000)) {                } else {
505
< 1000)) {                    if (bytes > Math.pow(1000, 2)) {
506
< 1000)) {                        show += round(bytes / Math.pow(1000, 2), 2);
507
< 1000)) {                        show += " " + genlang(40);
508
< 1000)) {                    } else {
509
< 1000)) {                        if (bytes > Math.pow(1000, 1)) {
510
< 1000)) {                            show += round(bytes / Math.pow(1000, 1), 2);
511
< 1000)) {                            show += "&nbsp;" + genlang(39);
512
< 1000)) {                        } else {
513
< 1000)) {                                show += bytes;
514
< 1000)) {                                show += "&nbsp;" + genlang(96);
515
< 1000)) {                        }
516
< 1000)) {                    }
517
< 1000)) {                }
518
< 1000)) {            }
519
< 1000)) {        }
520
< 1000)) {        break;
521
< 1000)) {    default:
522
< 1000)) {        if (bytes > Math.pow(1024, 5)) {
523
< 1000)) {            show += round(bytes / Math.pow(1024, 5), 2);
524
< 1000)) {            show += " " + genlang(90);
525
< 1000)) {        } else {
526
< 1000)) {            if (bytes > Math.pow(1024, 4)) {
527
< 1000)) {                show += round(bytes / Math.pow(1024, 4), 2);
528
< 1000)) {                show += "&nbsp;" + genlang(86);
529
< 1000)) {            } else {
530
< 1000)) {                if (bytes > Math.pow(1024, 3)) {
531
< 1000)) {                    show += round(bytes / Math.pow(1024, 3), 2);
532
< 1000)) {                    show += " " + genlang(87);
533
< 1000)) {                } else {
534
< 1000)) {                    if (bytes > Math.pow(1024, 2)) {
535
< 1000)) {                        show += round(bytes / Math.pow(1024, 2), 2);
536
< 1000)) {                        show += "&nbsp;" + genlang(88);
537
< 1000)) {                    } else {
538
< 1000)) {                        if (bytes > Math.pow(1024, 1)) {
539
< 1000)) {                            show += round(bytes / Math.pow(1024, 1), 2);
540
< 1000)) {                            show += " " + genlang(89);
541
< 1000)) {                        } else {
542
< 1000)) {                            show += bytes;
543
< 1000)) {                            show += " " + genlang(96);
544
< 1000)) {                        }
545
< 1000)) {                    }
546
< 1000)) {                }
547
< 1000)) {            }
548
< 1000)) {        }
549
< 1000)) {    }
550
< 1000)) {    return show;
551
< 1000)) {}
552
 
553
< 1000)) {function formatBPS(bps) {
554
< 1000)) {    var show = "";
555
 
556
< 1000)) {    if (bps > Math.pow(1000, 5)) {
557
< 1000)) {        show += round(bps / Math.pow(1000, 5), 2);
558
< 1000)) {        show += String.fromCharCode(160) + 'Pb/s';
559
< 1000)) {    } else {
560
< 1000)) {        if (bps > Math.pow(1000, 4)) {
561
< 1000)) {            show += round(bps / Math.pow(1000, 4), 2);
562
< 1000)) {            show += String.fromCharCode(160) + 'Tb/s';
563
< 1000)) {        } else {
564
< 1000)) {            if (bps > Math.pow(1000, 3)) {
565
< 1000)) {                show += round(bps / Math.pow(1000, 3), 2);
566
< 1000)) {                show += String.fromCharCode(160) + 'Gb/s';
567
< 1000)) {            } else {
568
< 1000)) {                if (bps > Math.pow(1000, 2)) {
569
< 1000)) {                    show += round(bps / Math.pow(1000, 2), 2);
570
< 1000)) {                    show += String.fromCharCode(160) + 'Mb/s';
571
< 1000)) {                } else {
572
< 1000)) {                    if (bps > Math.pow(1000, 1)) {
573
< 1000)) {                        show += round(bps / Math.pow(1000, 1), 2);
574
< 1000)) {                        show += String.fromCharCode(160) + 'Kb/s';
575
< 1000)) {                    } else {
576
< 1000)) {                            show += bps;
577
< 1000)) {                            show += String.fromCharCode(160) + 'b/s';
578
< 1000)) {                    }
579
< 1000)) {                }
580
< 1000)) {            }
581
< 1000)) {        }
582
< 1000)) {    }
583
< 1000)) {    return show;
584
< 1000)) {}
585
 
586
< 1000)) {/**
587
< 1000)) { * format a celcius temperature to fahrenheit and also append the right suffix
588
< 1000)) { * @param {String} degreeC temperature in celvius
589
< 1000)) { * @param {jQuery} xml phpSysInfo-XML
590
< 1000)) { * @return {String} html string with no breaking spaces and translation statements
591
< 1000)) { */
592
< 1000)) {function formatTemp(degreeC, xml) {
593
< 1000)) {    var tempFormat = "", degree = 0;
594
 
595
< 1000)) {    $("Options", xml).each(function getOptions(id) {
596
< 1000)) {        tempFormat = $(this).attr("tempFormat").toString().toLowerCase();
597
< 1000)) {    });
598
 
599
< 1000)) {    degree = parseFloat(degreeC);
600
< 1000)) {    if (isNaN(degreeC)) {
601
< 1000)) {        return "---";
602
< 1000)) {    } else {
603
< 1000)) {        switch (tempFormat) {
604
< 1000)) {        case "f":
605
< 1000)) {            return round((((9 * degree) / 5) + 32), 1) + "&nbsp;" + genlang(61);
606
< 1000)) {        case "c":
607
< 1000)) {            return round(degree, 1) + "&nbsp;" + genlang(60);
608
< 1000)) {        case "c-f":
609
< 1000)) {            return round(degree, 1) + "&nbsp;" + genlang(60) + "<br><i>(" + round((((9 * degree) / 5) + 32), 1) + " " + genlang(61) + ")i>";
610
< 1000)) {        case "f-c":
611
< 1000)) {            return round((((9 * degree) / 5) + 32), 1) + "&nbsp;" + genlang(61) + "<br><i>(" + round(degree, 1) + "&nbsp;" + genlang(60) + ")</i>";
612
< 1000)) {        }
613
< 1000)) {    }
614
< 1000)) {}
615
 
616
< 1000)) {/**
617
< 1000)) { * create a visual HTML bar from a given size, the layout of that bar can be costumized through the bar css-class
618
< 1000)) { * @param {Number} size barclass
619
< 1000)) { * @return {String} HTML string which contains the full layout of the bar
620
< 1000)) { */
621
< 1000)) {function createBar(size, barclass) {
622
< 1000)) {    if (barclass === undefined) {
623
< 1000)) {        barclass = "bar";
624
< 1000)) {    }
625
< 1000)) {    return "
 div>&nbsp;" + size + "%";
626
< 1000)) {
}
627
 
628
< 1000)) {
/**
629
< 1000)) {
* (re)fill the vitals block with the values from the given xml
630
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
631
< 1000)) {
*/
632
< 1000)) {
function refreshVitals(xml) {
633
< 1000)) {
var hostname = "", ip = "";
634
< 1000)) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('vitals', blocks) < 0))) {
635
< 1000)) {
$("#vitals").remove();
636
< 1000)) {
$("Vitals", xml).each(function getVitals(id) {
637
< 1000)) {
hostname = $(this).attr("Hostname");
638
< 1000)) {
ip = $(this).attr("IPAddr");
639
< 1000)) {
document.title = "System information: " + hostname + " (" + ip + ")";
640
< 1000)) {
$("#s_hostname_title").html(hostname);
641
< 1000)) {
$("#s_ip_title").html(ip);
642
< 1000)) {
});
643
< 1000)) {
return;
644
< 1000)) {
}
645
 
646
< 1000)) {
var kernel = "", distro = "", icon = "", uptime = "", users = 0, loadavg = "", os = "";
647
< 1000)) {
var processes = 0, prunning = 0, psleeping = 0, pstopped = 0, pzombie = 0, pwaiting = 0, pother = 0;
648
< 1000)) {
var syslang = "", codepage = "";
649
< 1000)) {
var lastboot = 0;
650
< 1000)) {
var timestamp = parseInt($("Generation", xml).attr("timestamp"), 10)*1000; //server time
651
< 1000)) {
var not_first = false;
652
< 1000)) {
var datetimeFormat = "";
653
< 1000)) {
if (isNaN(timestamp)) timestamp = Number(new Date()); //client time
654
 
655
< 1000)) {
$("Options", xml).each(function getDatetimeFormat(id) {
656
< 1000)) {
datetimeFormat = $(this).attr("datetimeFormat");
657
< 1000)) {
});
658
 
659
< 1000)) {
$("Vitals", xml).each(function getVitals(id) {
660
< 1000)) {
hostname = $(this).attr("Hostname");
661
< 1000)) {
ip = $(this).attr("IPAddr");
662
< 1000)) {
kernel = $(this).attr("Kernel");
663
< 1000)) {
distro = $(this).attr("Distro");
664
< 1000)) {
icon = $(this).attr("Distroicon");
665
< 1000)) {
os = $(this).attr("OS");
666
< 1000)) {
uptime = formatUptime(parseInt($(this).attr("Uptime"), 10));
667
< 1000)) {
lastboot = new Date(timestamp - (parseInt($(this).attr("Uptime"), 10)*1000));
668
< 1000)) {
users = parseInt($(this).attr("Users"), 10);
669
< 1000)) {
loadavg = $(this).attr("LoadAvg");
670
< 1000)) {
if ($(this).attr("CPULoad") !== undefined) {
671
< 1000)) {
loadavg = loadavg + "<br>" + createBar(parseInt($(this).attr("CPULoad"), 10));
672
< 1000)) {
}
673
< 1000)) {
if ($(this).attr("SysLang") !== undefined) {
674
< 1000)) {
syslang = $(this).attr("SysLang");
675
< 1000)) {
document.getElementById("s_syslang_tr").style.display='';
676
< 1000)) {
}
677
 
678
< 1000)) {
if ($(this).attr("CodePage") !== undefined) {
679
< 1000)) {
codepage = $(this).attr("CodePage");
680
< 1000)) {
if ($(this).attr("SysLang") !== undefined) {
681
< 1000)) {
document.getElementById("s_codepage_tr1").style.display='';
682
< 1000)) {
} else {
683
< 1000)) {
document.getElementById("s_codepage_tr2").style.display='';
684
< 1000)) {
}
685
< 1000)) {
}
686
 
687
< 1000)) {
//processes
688
< 1000)) {
if ($(this).attr("Processes") !== undefined) {
689
< 1000)) {
processes = parseInt($(this).attr("Processes"), 10);
690
< 1000)) {
if ((($(this).attr("CodePage") !== undefined) && ($(this).attr("SysLang") === undefined)) ||
691
< 1000)) {
(($(this).attr("CodePage") === undefined) && ($(this).attr("SysLang") !== undefined))) {
692
< 1000)) {
document.getElementById("s_processes_tr1").style.display='';
693
< 1000)) {
} else {
694
< 1000)) {
document.getElementById("s_processes_tr2").style.display='';
695
< 1000)) {
}
696
< 1000)) {
}
697
< 1000)) {
if ($(this).attr("ProcessesRunning") !== undefined) {
698
< 1000)) {
prunning = parseInt($(this).attr("ProcessesRunning"), 10);
699
< 1000)) {
}
700
< 1000)) {
if ($(this).attr("ProcessesSleeping") !== undefined) {
701
< 1000)) {
psleeping = parseInt($(this).attr("ProcessesSleeping"), 10);
702
< 1000)) {
}
703
< 1000)) {
if ($(this).attr("ProcessesStopped") !== undefined) {
704
< 1000)) {
pstopped = parseInt($(this).attr("ProcessesStopped"), 10);
705
< 1000)) {
}
706
< 1000)) {
if ($(this).attr("ProcessesZombie") !== undefined) {
707
< 1000)) {
pzombie = parseInt($(this).attr("ProcessesZombie"), 10);
708
< 1000)) {
}
709
< 1000)) {
if ($(this).attr("ProcessesWaiting") !== undefined) {
710
< 1000)) {
pwaiting = parseInt($(this).attr("ProcessesWaiting"), 10);
711
< 1000)) {
}
712
< 1000)) {
if ($(this).attr("ProcessesOther") !== undefined) {
713
< 1000)) {
pother = parseInt($(this).attr("ProcessesOther"), 10);
714
< 1000)) {
}
715
 
2976 rexy 716
< 1000)) {
document.title = "System information: " + hostname + " (" + ip + ")";
2788 rexy 717
< 1000)) {
$("#s_hostname_title").html(hostname);
718
< 1000)) {
$("#s_ip_title").html(ip);
719
< 1000)) {
$("#s_hostname").html(hostname);
720
< 1000)) {
$("#s_ip").html(ip);
721
< 1000)) {
$("#s_kernel").html(kernel);
722
< 1000)) {
$("#s_distro").html("<img src='./gfx/images/" + icon + "' alt='Icon' title='' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' /> " + distro); //onload IE6 PNG fix
723
< 1000)) {
$("#s_os").html("</FONT></B>OSIcon<B><FONT COLOR="#BC8F8F">
724
< 1000)) {
if ((datetimeFormat !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
726
< 1000)) {
} else {
728
< 1000)) {
$("#s_lastboot").html(lastboot.toUTCString());
730
< 1000)) {
//deprecated
732
< 1000)) {
}
734
< 1000)) {
$("#s_users").html(users);
736
< 1000)) {
$("#s_syslang").html(syslang);
738
< 1000)) {
$("#s_codepage_2").html(codepage);
740
< 1000)) {
$("#s_processes_2").html(processes);
742
< 1000)) {
$("#s_processes_1").append(" (");
744
< 1000)) {
var typelist = {running:111,sleeping:112,stopped:113,zombie:114,waiting:115,other:116};
746
< 1000)) {
if (eval("p" + proc_type)) {
748
< 1000)) {
$("#s_processes_1").append(", ");
750
< 1000)) {
}
752
< 1000)) {
$("#s_processes_2").append(eval("p" + proc_type) + "&nbsp;" + genlang(typelist[proc_type]));
754
< 1000)) {
}
756
< 1000)) {
$("#s_processes_1").append(") ");
758
< 1000)) {
}
760
< 1000)) {
}
762
 
763
 
764
< 1000)) {
* build the cpu information as table rows
766
< 1000)) {
* @param {Array} tree array that holds the positions for treetable plugin
768
< 1000)) {
* @param {Array} collapsed array that holds all collapsed elements hwne opening page
770
< 1000)) {
function fillCpu(xml, tree, rootposition, collapsed) {
772
< 1000)) {
$("Hardware CPU CpuCore", xml).each(function getCpuCore(cpuCoreId) {
774
< 1000)) {
cpucount++;
776
< 1000)) {
speed = parseInt($(this).attr("CpuSpeed"), 10);
778
< 1000)) {
speedmin = parseInt($(this).attr("CpuSpeedMin"), 10);
780
< 1000)) {
virt = $(this).attr("Virt");
782
< 1000)) {
temp = parseInt($(this).attr("Cputemp"), 10);
784
< 1000)) {
manufacturer = $(this).attr("Manufacturer");
786
< 1000)) {
if (!showCPUListExpanded) {
789
< 1000)) {
}
791
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + model + "</span></div></td><td>" + createBar(load) + "</td></tr>\n";
793
< 1000)) {
html += "<tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespan\">" + model + "</span></div></td></tr>\n";
795
< 1000)) {
cpucoreposition = tree.push(rootposition);
797
< 1000)) {
collapsed.push(cpucoreposition);
799
< 1000)) {
if (!isNaN(speed)) {
801
< 1000)) {
tree.push(cpucoreposition);
803
< 1000)) {
if (!isNaN(speedmax)) {
805
< 1000)) {
tree.push(cpucoreposition);
807
< 1000)) {
if (!isNaN(speedmin)) {
809
< 1000)) {
tree.push(cpucoreposition);
811
< 1000)) {
if (!isNaN(cache)) {
813
< 1000)) {
tree.push(cpucoreposition);
815
< 1000)) {
if (virt !== undefined) {
817
< 1000)) {
tree.push(cpucoreposition);
819
< 1000)) {
if (!isNaN(bus)) {
821
< 1000)) {
tree.push(cpucoreposition);
823
< 1000)) {
if (!isNaN(bogo)) {
825
< 1000)) {
tree.push(cpucoreposition);
827
< 1000)) {
/*
829
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(51) + ":</span></div></td><td>" + formatTemp(temp, xml) + "</td></tr>\n";
831
< 1000)) {
}
833
< 1000)) {
if (manufacturer !== undefined) {
835
< 1000)) {
tree.push(cpucoreposition);
837
< 1000)) {
if (!isNaN(load) && !showCPULoadCompact) {
839
< 1000)) {
tree.push(cpucoreposition);
841
< 1000)) {
});
843
< 1000)) {
html += "<tr><td colspan=\"2\">" + genlang(42) + "</td></tr>\n";
845
< 1000)) {
}
847
< 1000)) {
}
849
 
850
< 1000)) {
var cpucount = 0;
852
< 1000)) {
cpucount++;
854
< 1000)) {
return cpucount;
856
< 1000)) {
/**
859
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
861
< 1000)) {
* @param {Array} tree array that holds the positions for treetable plugin
863
< 1000)) {
*/
865
< 1000)) {
var devicecount = 0, html = "";
2976 rexy 867
< 1000)) {
var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", speed = 0, voltage = 0, devcoreposition = 0;
2788 rexy 869
 
870
< 1000)) {
name = $(this).attr("Name");
872
< 1000)) {
manufacturer = $(this).attr("Manufacturer");
874
< 1000)) {
speed = parseInt($(this).attr("Speed"), 10);
876
< 1000)) {
serial = $(this).attr("Serial");
878
< 1000)) {
if (!isNaN(count) && count > 1) {
880
< 1000)) {
}
882
< 1000)) {
devcoreposition = tree.push(rootposition);
884
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(43) + ":</span></div></td><td>" + formatBytes(capacity, xml) + "</td></tr>\n";
886
< 1000)) {
}
888
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(122) + ":</span></div></td><td>" + manufacturer + "</td></tr>\n";
890
< 1000)) {
}
892
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(123) + ":</span></div></td><td>" + product + "</td></tr>\n";
894
< 1000)) {
}
2976 rexy 896
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(129) + ":</span></div></td><td>" + ((type=="MEM")?formatMTps(speed):formatBPS(1000000*speed)) + "</td></tr>\n";
898
< 1000)) {
}
900
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(52) + ":</span></div></td><td>" + round(voltage, 2) + " V</td></tr>\n";
902
< 1000)) {
}
2788 rexy 904
< 1000)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(124) + ":</span></div></td><td>" + serial + "</td></tr>\n";
906
< 1000)) {
}
908
< 1000)) {
if (devicecount === 0) {
910
< 1000)) {
tree.push(rootposition);
912
< 1000)) {
return html;
914
< 1000)) {
function countHWDevice(xml, type) {
917
< 1000)) {
$("Hardware " + type + ((type=="MEM")?" Chip":" Device"), xml).each(function getHWDevice(deviceId) {
2788 rexy 919
< 1000)) {
});
921
< 1000)) {
}
923
 
924
< 1000)) {
* (re)fill the hardware block with the values from the given xml
926
< 1000)) {
*/
928
< 1000)) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('hardware', blocks) < 0))) {
930
< 1000)) {
return;
932
< 1000)) {
var html = "", tree = [], closed = [], index = 0, machine = "";
935
< 1000)) {
html += "<h2>" + genlang(10) + "</h2>\n";
937
< 1000)) {
html += " <table id=\"HardwareTree\" class=\"tablemain\">\n";
939
< 1000)) {
$("Hardware", xml).each(function getMachine(id) {
942
< 1000)) {
});
944
< 1000)) {
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(107) + "</span></div></td></tr>\n";
946
< 1000)) {
tree.push(tree.push(0));
948
< 1000)) {
if (countCpu(xml)) {
951
< 1000)) {
html += fillCpu(xml, tree, tree.push(0), closed);
953
< 1000)) {
var typelist = {MEM:130,PCI:17,IDE:18,SCSI:19,NVMe:126,USB:20,TB:117,I2C:118};
2788 rexy 956
< 1000)) {
if (countHWDevice(xml, dev_type)) {
958
< 1000)) {
index = tree.push(0);
960
< 1000)) {
html += fillHWDevice(xml, dev_type, tree, index);
962
< 1000)) {
}
964
 
965
< 1000)) {
html += " </table>\n";
967
< 1000)) {
$("#hardware").append(html);
969
 
970
< 1000)) {
openImg: "./gfx/treeTable/tv-collapsable.gif",
972
< 1000)) {
leafImg: "./gfx/treeTable/tv-item.gif",
974
< 1000)) {
lastShutImg: "./gfx/treeTable/tv-expandable-last.gif",
976
< 1000)) {
vertLineImg: "./gfx/treeTable/vertline.gif",
978
< 1000)) {
collapse: closed,
980
< 1000)) {
striped: true,
982
< 1000)) {
state: false
984
< 1000)) {
}
986
 
987
< 1000)) {
*(re)fill the network block with the values from the given xml
989
< 1000)) {
*/
991
< 1000)) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('network', blocks) < 0))) {
993
< 1000)) {
return;
995
< 1000)) {
var tree = [], closed = [], html0= "", html1= "" ,html = "", isinfo = false, preoldnetwork = [], timestamp;
998
 
999
< 1000)) {
html0 += "<h2>" + genlang(21) + "</h2>\n";
1002
 
1003
< 1000)) {
html1 += " <tr>\n";
1005
< 1000)) {
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(23) + "</th>\n";
1007
< 1000)) {
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(25) + "</th>\n";
2788 rexy 1009
< 1000)) {
html1 += " </thead>\n";
1011
 
1012
< 1000)) {
$("Generation", xml).each(function getTimestamp(id) {
1014
< 1000)) {
});
1016
< 1000)) {
$("Network NetDevice", xml).each(function getDevice(id) {
1019
< 1000)) {
', htmltx = '';
1020
< 1000)) {
rx = parseInt($(this).attr("RxBytes"), 10);
1022
< 1000)) {
er = parseInt($(this).attr("Err"), 10);
1024
< 1000)) {
if (showNetworkActiveSpeed && ($.inArray(name, oldnetwork) >= 0)) {
1027
< 1000)) {
if (((diff = rx - oldnetwork[name].rx) > 0) && ((difftime = timestamp - oldnetwork[name].timestamp) > 0)) {
1029
< 1000)) {
htmlrx ="<br><i>("+formatBPS(round(8*diff/difftime, 2))+")</i>";
1031
< 1000)) {
htmlrx ="<br><i>("+formatBytes(round(diff/difftime, 2), xml)+"/s)</i>";
1033
< 1000)) {
}
1035
< 1000)) {
if (showNetworkActiveSpeed == 2) {
1037
< 1000)) {
} else {
1039
< 1000)) {
}
1041
< 1000)) {
}
1043
 
1044
< 1000)) {
networkindex = tree.push(0);
1047
 
1048
< 1000)) {
preoldnetwork.pushIfNotExist(name);
1050
< 1000)) {
}
1052
 
1053
< 1000)) {
if ( (info !== undefined) && (info !== "") ) {
1055
< 1000)) {
isinfo = true;
1057
< 1000)) {
html +="<tr><td colspan=\"4\"><div class=\"treediv\"><span class=\"treespan\">" + infos[i] + "</span></div></td></tr>";
1059
< 1000)) {
}
1061
< 1000)) {
closed.push(networkindex);
1063
< 1000)) {
}
1065
< 1000)) {
html += " </tbody>\n";
1067
< 1000)) {
html += "</div>\n";
1069
< 1000)) {
if (isinfo) {
1071
< 1000)) {
html1 += " <tbody class=\"tree\">\n";
1073
< 1000)) {
html0 += " <table id=\"NetworkTree\" class=\"stripeMe\" style=\"border-collapse:collapse;\">\n";
1075
< 1000)) {
}
1077
< 1000)) {
if (isinfo) $("#NetworkTree").jqTreeTable(tree, {
1080
< 1000)) {
shutImg: "./gfx/treeTable/tv-expandable.gif",
1082
< 1000)) {
lastOpenImg: "./gfx/treeTable/tv-collapsable-last.gif",
1084
< 1000)) {
lastLeafImg: "./gfx/treeTable/tv-item-last.gif",
1086
< 1000)) {
blankImg: "./gfx/treeTable/blank.gif",
1088
< 1000)) {
column: 0,
1090
< 1000)) {
highlight: false,
1092
< 1000)) {
});
1094
 
1095
< 1000)) {
while (oldnetwork.length > 0) {
1097
< 1000)) {
oldnetwork.pop(); //remove last object reference from array
1099
< 1000)) {
oldnetwork = preoldnetwork;
1101
< 1000)) {
}
1103
 
1104
< 1000)) {
* (re)fill the memory block with the values from the given xml
1106
< 1000)) {
*/
1108
< 1000)) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('memory', blocks) < 0))) {
1110
< 1000)) {
return;
1112
< 1000)) {
var html = "", tree = [], closed = [];
1115
 
1116
< 1000)) {
html += "<h2>" + genlang(27) + "</h2>\n";
1118
< 1000)) {
html += " <table id=\"MemoryTree\" class=\"tablemain\">\n";
1120
< 1000)) {
html += " <tr>\n";
2976 rexy 1122
< 1000)) {
html += " <th style=\"width:33.3%;\">" + genlang(33) + "</th>\n";
1124
< 1000)) {
html += " <th class=\"right\" style=\"width:14.2%;\">" + genlang(36) + "</th>\n";
1126
< 1000)) {
html += " </tr>\n";
1128
< 1000)) {
html += " <tbody class=\"tree\">\n";
1130
 
1131
< 1000)) {
var free = 0, total = 0, used = 0, percent = 0, memoryindex = 0;
1133
< 1000)) {
used = parseInt($(this).attr("Used"), 10);
1135
< 1000)) {
percent = parseInt($(this).attr("Percent"), 10);
2976 rexy 1137
< 1000)) {
memoryindex = tree.push(0);
1139
 
1140
< 1000)) {
var app = 0, appp = 0, buff = 0, buffp = 0, cached = 0, cachedp = 0;
1142
< 1000)) {
appp = parseInt($(this).attr("AppPercent"), 10);
1144
< 1000)) {
buffp = parseInt($(this).attr("BuffersPercent"), 10);
1146
< 1000)) {
cachedp = parseInt($(this).attr("CachedPercent"), 10);
1148
< 1000)) {
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(64) + "</span></div></td><td>" + createBar(appp) + "</td><td class=\"right\">&nbsp;</td><td class=\"right\">" + formatBytes(app, xml) + "</td><td class=\"right\">&nbsp;</td></tr>";
2788 rexy 1150
< 1000)) {
}
1152
< 1000)) {
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(66) + "</span></div></td><td>" + createBar(cachedp) + "</td><td class=\"right\">&nbsp;</td><td class=\"right\">" + formatBytes(cached, xml) + "</td><td class=\"right\">&nbsp;</td></tr>";
2788 rexy 1154
< 1000)) {
}
1156
< 1000)) {
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(65) + "</span></div></td><td>" + createBar(buffp) + "</td><td class=\"rigth\">&nbsp;</td><td class=\"right\">" + formatBytes(buff, xml) + "</td><td class=\"right\">&nbsp;</td></tr>";
2788 rexy 1158
< 1000)) {
}
1160
< 1000)) {
if (!showMemoryInfosExpanded) {
1162
< 1000)) {
}
1164
< 1000)) {
});
1166
< 1000)) {
$("Memory Swap", xml).each(function getSwap(id) {
1168
< 1000)) {
free = parseInt($(this).attr("Free"), 10);
1170
< 1000)) {
total = parseInt($(this).attr("Total"), 10);
1172
< 1000)) {
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(29) + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>";
2788 rexy 1174
< 1000)) {
$("Memory Swap Mount", xml).each(function getDevices(id) {
1177
< 1000)) {
if (!showMemoryInfosExpanded) {
1179
< 1000)) {
}
1181
< 1000)) {
used = parseInt($(this).attr("Used"), 10);
1183
< 1000)) {
percent = parseInt($(this).attr("Percent"), 10);
1185
< 1000)) {
mpoint = $(this).attr("MountPoint");
1187
 
1188
< 1000)) {
mpoint = mpid;
1190
< 1000)) {
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + mpoint + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>";
2788 rexy 1193
< 1000)) {
});
1195
< 1000)) {
html += " </tbody>\n";
1198
< 1000)) {
html += "</div>\n";
1200
< 1000)) {
$("#MemoryTree").jqTreeTable(tree, {
1203
< 1000)) {
shutImg: "./gfx/treeTable/tv-expandable.gif",
1205
< 1000)) {
lastOpenImg: "./gfx/treeTable/tv-collapsable-last.gif",
1207
< 1000)) {
lastLeafImg: "./gfx/treeTable/tv-item-last.gif",
1209
< 1000)) {
blankImg: "./gfx/treeTable/blank.gif",
1211
< 1000)) {
column: 0,
1213
< 1000)) {
highlight: false,
1215
< 1000)) {
});
1217
 
1218
< 1000)) {
/**
1221
< 1000)) {
* appends the filesystems (each in a row) to the filesystem table in the tbody<br>before the rows are inserted the entire
1223
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
1225
< 1000)) {
function refreshFilesystems(xml) {
1227
< 1000)) {
filesystem', blocks) < 0))) {
1228
< 1000)) {
return;
1230
< 1000)) {
var total_usage = 0, total_used = 0, total_free = 0, total_size = 0, threshold = 0;
1233
 
1234
< 1000)) {
$("Options", xml).each(function getThreshold(id) {
1237
< 1000)) {
});
1239
 
1240
< 1000)) {
var mpoint = "", mpid = 0, type = "", name = "", free = 0, used = 0, size = 0, percent = 0, options = "", inodes = 0, inodes_text = "", options_text = "", ignore = 0;
1242
< 1000)) {
type = $(this).attr("FSType");
1244
< 1000)) {
free = parseInt($(this).attr("Free"), 10);
1246
< 1000)) {
size = parseInt($(this).attr("Total"), 10);
1248
< 1000)) {
options = $(this).attr("MountOptions");
1250
< 1000)) {
mpoint = $(this).attr("MountPoint");
1252
< 1000)) {
if (mpoint === undefined) {
1255
< 1000)) {
}
1257
< 1000)) {
options_text = "<br><i>(" + options + ")</i>";
1259
< 1000)) {
if (!isNaN(inodes)) {
1261
< 1000)) {
}
1263
 
2976 rexy 1264
< 1000)) {
if (ignore >= 3) {
1266
< 1000)) {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn") + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
1268
< 1000)) {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
1270
< 1000)) {
} else {
1272
< 1000)) {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn") + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
1274
< 1000)) {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
1276
< 1000)) {
}
1278
< 1000)) {
if (!isNaN(threshold) && (percent >= threshold) && (showTotals || isNaN(ignore) || (ignore < 4))) {
2788 rexy 1280
< 1000)) {
} else {
1282
< 1000)) {
}
1284
< 1000)) {
if (showTotals) {
1286
< 1000)) {
if (ignore == 2) {
1288
< 1000)) {
} else if (ignore == 1) {
1290
< 1000)) {
total_size += used;
1292
< 1000)) {
} else {
2788 rexy 1294
< 1000)) {
total_free += free;
1296
< 1000)) {
}
2976 rexy 1298
< 1000)) {
}
1300
< 1000)) {
if (showTotals) {
1303
< 1000)) {
$("#s_fs_total").html(createBar(total_usage, "barwarn"));
2788 rexy 1305
< 1000)) {
$("#s_fs_total").html(createBar(total_usage));
2788 rexy 1307
< 1000)) {
$("#s_fs_tfree").html(formatBytes(total_free, xml));
1309
< 1000)) {
$("#s_fs_tsize").html(formatBytes(total_size, xml));
2788 rexy 1311
< 1000)) {
}
1313
 
1314
< 1000)) {
* (re)fill the temperature block with the values from the given xml<br><br>
1316
< 1000)) {
* and also the HDDTemp information, if there are no information the entire table will be removed
1318
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
1320
< 1000)) {
function refreshTemp(xml) {
1322
< 1000)) {
temperature', blocks) < 0))) {
1323
< 1000)) {
return;
1325
< 1000)) {
var values = false;
1328
< 1000)) {
$("MBInfo Temperature Item", xml).each(function getTemperatures(id) {
2976 rexy 1330
< 1000)) {
label = $(this).attr("Label");
1332
< 1000)) {
event = $(this).attr("Event");
1334
< 1000)) {
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
2788 rexy 1336
< 1000)) {
if (isFinite(limit))
1338
< 1000)) {
$("#temperatureTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + formatTemp(value, xml) + "</td><td class=\"right\">" + _limit + "</td></tr>");
1340
< 1000)) {
});
1342
< 1000)) {
$("#temperature").show();
1344
< 1000)) {
$("#temperature").hide();
1346
< 1000)) {
}
1348
 
1349
< 1000)) {
* (re)fill the voltage block with the values from the given xml<br><br>
1351
< 1000)) {
* entire table will be removed to avoid HTML warnings
1353
< 1000)) {
*/
1355
< 1000)) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('voltage', blocks) < 0))) {
1357
< 1000)) {
return;
1359
< 1000)) {
var values = false;
1362
< 1000)) {
$("MBInfo Voltage Item", xml).each(function getVoltages(id) {
2976 rexy 1364
< 1000)) {
label = $(this).attr("Label");
1366
< 1000)) {
event = $(this).attr("Event");
1368
< 1000)) {
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
2788 rexy 1370
< 1000)) {
if (isFinite(max))
1372
< 1000)) {
min = parseFloat($(this).attr("Min"));
1374
< 1000)) {
_min = round(min, 2) + "&nbsp;" + genlang(62);
1376
< 1000)) {
values = true;
1378
< 1000)) {
if (values) {
1380
< 1000)) {
} else {
1382
< 1000)) {
}
1384
< 1000)) {
/**
1387
< 1000)) {
* build the fan information into a separate block, if there is no fan information available the
1389
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
1391
< 1000)) {
function refreshFans(xml) {
1393
< 1000)) {
fans', blocks) < 0))) {
1394
< 1000)) {
return;
1396
< 1000)) {
var values = false;
1399
< 1000)) {
$("MBInfo Fans Item", xml).each(function getFans(id) {
2976 rexy 1401
< 1000)) {
label = $(this).attr("Label");
1403
< 1000)) {
event = $(this).attr("Event");
1405
< 1000)) {
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
2976 rexy 1407
< 1000)) {
unit = $(this).attr("Unit");
1409
< 1000)) {
if (isFinite(min))
1411
< 1000)) {
$("#fansTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td><td class=\"right\">" + _min + "</td></tr>");
1413
< 1000)) {
if (isFinite(min))
1415
< 1000)) {
$("#fansTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value,0) + "&nbsp;" + genlang(63) + "</td><td class=\"right\">" + _min + "</td></tr>");
1417
< 1000)) {
values = true;
1419
< 1000)) {
if (values) {
1421
< 1000)) {
} else {
1423
< 1000)) {
}
1425
< 1000)) {
/**
1428
< 1000)) {
* build the power information into a separate block, if there is no power information available the
1430
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
1432
< 1000)) {
function refreshPower(xml) {
1434
< 1000)) {
power', blocks) < 0))) {
1435
< 1000)) {
return;
1437
< 1000)) {
var values = false;
1440
< 1000)) {
$("MBInfo Power Item", xml).each(function getPowers(id) {
2976 rexy 1442
< 1000)) {
label = $(this).attr("Label");
1444
< 1000)) {
event = $(this).attr("Event");
1446
< 1000)) {
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
2788 rexy 1448
< 1000)) {
if (isFinite(limit))
1450
< 1000)) {
$("#powerTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value, 2) + "&nbsp;" + genlang(103) + "</td><td class=\"right\">" + _limit + "</td></tr>");
1452
< 1000)) {
});
1454
< 1000)) {
$("#power").show();
1456
< 1000)) {
$("#power").hide();
1458
< 1000)) {
}
1460
 
1461
< 1000)) {
* (re)fill the current block with the values from the given xml<br><br>
1463
< 1000)) {
* entire table will be removed to avoid HTML warnings
1465
< 1000)) {
*/
1467
< 1000)) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('current', blocks) < 0))) {
1469
< 1000)) {
return;
1471
< 1000)) {
var values = false;
1474
< 1000)) {
$("MBInfo Current Item", xml).each(function getCurrents(id) {
2976 rexy 1476
< 1000)) {
label = $(this).attr("Label");
1478
< 1000)) {
event = $(this).attr("Event");
1480
< 1000)) {
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
2788 rexy 1482
< 1000)) {
if (isFinite(max))
1484
< 1000)) {
min = parseFloat($(this).attr("Min"));
1486
< 1000)) {
_min = round(min, 2) + "&nbsp;" + genlang(106);
1488
< 1000)) {
values = true;
1490
< 1000)) {
if (values) {
1492
< 1000)) {
} else {
1494
< 1000)) {
}
1496
< 1000)) {
/**
1499
< 1000)) {
* build the other information into a separate block, if there is no other information available the
1501
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
1503
< 1000)) {
function refreshOther(xml) {
1505
< 1000)) {
other', blocks) < 0))) {
1506
< 1000)) {
return;
1508
< 1000)) {
var values = false;
1511
< 1000)) {
$("MBInfo Other Item", xml).each(function getOthers(id) {
2976 rexy 1513
< 1000)) {
label = $(this).attr("Label");
1515
< 1000)) {
event = $(this).attr("Event");
1517
< 1000)) {
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
2976 rexy 1519
< 1000)) {
if (unit === "%") {
1521
< 1000)) {
} else {
1523
< 1000)) {
}
2788 rexy 1525
< 1000)) {
});
1527
< 1000)) {
$("#other").show();
1529
< 1000)) {
$("#other").hide();
1531
< 1000)) {
}
1533
 
1534
< 1000)) {
* (re)fill the ups block with the values from the given xml<br><br>
1536
< 1000)) {
* entire table will be removed to avoid HTML warnings
1538
< 1000)) {
*/
1540
< 1000)) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('ups', blocks) < 0))) {
1542
< 1000)) {
return;
1544
< 1000)) {
var add_apcupsd_cgi_links = ($("[ApcupsdCgiLinks='1']", xml).length > 0);
1547
< 1000)) {
html += "<h2>" + genlang(68) + "</h2>\n";
1549
< 1000)) {
html += " <table class=\"tablemain\" id=\"UPSTree\">\n";
1551
< 1000)) {
$("#ups").empty();
1554
< 1000)) {
var name = "", model = "", mode = "", start_time = "", upsstatus = "", temperature = "", outages_count = "", last_outage = "", last_outage_finish = "", line_voltage = "", line_frequency = "", load_percent = "", battery_date = "", battery_voltage = "", battery_charge_percent = "", time_left_minutes = "";
1556
< 1000)) {
model = $(this).attr("Model");
1558
< 1000)) {
start_time = $(this).attr("StartTime");
1560
< 1000)) {
temperature = $(this).attr("Temperature");
1563
< 1000)) {
last_outage = $(this).attr("LastOutage");
1565
< 1000)) {
line_voltage = $(this).attr("LineVoltage");
1567
< 1000)) {
load_percent = parseInt($(this).attr("LoadPercent"), 10);
1569
< 1000)) {
battery_voltage = $(this).attr("BatteryVoltage");
1571
< 1000)) {
time_left_minutes = $(this).attr("TimeLeftMinutes");
1573
 
1574
< 1000)) {
html += "<tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + name + " (" + mode + ")</span></div></td></tr>\n";
1576
< 1000)) {
html += "<tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + name + "</span></div></td></tr>\n";
1578
< 1000)) {
index = tree.push(0);
1580
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(70) + "</span></div></td><td>" + model + "</td></tr>\n";
2788 rexy 1582
< 1000)) {
}
1584
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(72) + "</span></div></td><td>" + start_time + "</td></tr>\n";
2788 rexy 1586
< 1000)) {
}
1588
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(73) + "</span></div></td><td>" + upsstatus + "</td></tr>\n";
2788 rexy 1590
< 1000)) {
}
1592
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(84) + "</span></div></td><td>" + temperature + "</td></tr>\n";
2788 rexy 1594
< 1000)) {
}
1596
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(74) + "</span></div></td><td>" + outages_count + "</td></tr>\n";
2788 rexy 1598
< 1000)) {
}
1600
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(75) + "</span></div></td><td>" + last_outage + "</td></tr>\n";
2788 rexy 1602
< 1000)) {
}
1604
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(76) + "</span></div></td><td>" + last_outage_finish + "</td></tr>\n";
2788 rexy 1606
< 1000)) {
}
1608
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(77) + "</span></div></td><td>" + line_voltage + "&nbsp;" + genlang(82) + "</td></tr>\n";
2788 rexy 1610
< 1000)) {
}
1612
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(108) + "</span></div></td><td>" + line_frequency + "&nbsp;" + genlang(109) + "</td></tr>\n";
2788 rexy 1614
< 1000)) {
}
1616
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(78) + "</span></div></td><td>" + createBar(load_percent) + "</td></tr>\n";
2788 rexy 1618
< 1000)) {
}
1620
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(104) + "</span></div></td><td>" + battery_date + "</td></tr>\n";
2788 rexy 1622
< 1000)) {
}
1624
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(79) + "</span></div></td><td>" + battery_voltage + "&nbsp;" + genlang(82) + "</td></tr>\n";
2788 rexy 1626
< 1000)) {
}
1628
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(80) + "</span></div></td><td>" + createBar(battery_charge_percent) + "</td></tr>\n";
2788 rexy 1630
< 1000)) {
}
1632
< 1000)) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(81) + "</span></div></td><td>" + time_left_minutes + "&nbsp;" + genlang(83) + "</td></tr>\n";
2788 rexy 1634
< 1000)) {
}
1636
< 1000)) {
});
1638
< 1000)) {
html += " </table>\n";
1640
< 1000)) {
if (add_apcupsd_cgi_links){
1642
< 1000)) {
details' href='/cgi-bin/apcupsd/multimon.cgi' target='apcupsdcgi'>" + genlang(99) + "a>)\n";
1643
< 1000)) {
$("#ups").append(html);
1646
 
1647
< 1000)) {
$("#UPSTree").jqTreeTable(tree, {
1649
< 1000)) {
shutImg: "./gfx/treeTable/tv-expandable.gif",
1651
< 1000)) {
lastOpenImg: "./gfx/treeTable/tv-collapsable-last.gif",
1653
< 1000)) {
lastLeafImg: "./gfx/treeTable/tv-item-last.gif",
1655
< 1000)) {
blankImg: "./gfx/treeTable/blank.gif",
1657
< 1000)) {
column: 0,
1659
< 1000)) {
highlight: false,
1661
< 1000)) {
});
1663
< 1000)) {
} else {
1665
< 1000)) {
}
1667
< 1000)) {
/**
1670
< 1000)) {
*/
1672
< 1000)) {
$.ajax({
1674
< 1000)) {
1675
< 1000)) {
1676
< 1000)) {
if ((typeof(initiate) === 'boolean') && (initiate === true)) {
1678
< 1000)) {
sticky: true
1680
< 1000)) {
} else {
1682
< 1000)) {
}
1684
< 1000)) {
success: function buildblocks(xml) {
1686
< 1000)) {
1687
< 1000)) {
}
1689
 
1690
< 1000)) {
refreshHardware(xml);
1692
< 1000)) {
refreshFilesystems(xml);
1694
< 1000)) {
refreshVoltage(xml);
1696
< 1000)) {
refreshTemp(xml);
1698
< 1000)) {
refreshPower(xml);
1700
< 1000)) {
refreshUps(xml);
1702
< 1000)) {
if ((typeof(initiate) === 'boolean') && (initiate === true)) {
1705
< 1000)) {
settimer(xml);
1707
< 1000)) {
for (var i = 0; i < plugin_liste.length; i++) {
1709
< 1000)) {
//dynamic call
1711
< 1000)) {
1712
< 1000)) {
catch (err) {
1714
< 1000)) {
}
1716
< 1000)) {
$('.stripeMe tr:nth-child(even)').addClass('even');
1719
< 1000)) {
});
1721
< 1000)) {
/**
1724
< 1000)) {
* @param {jQuery} xml phpSysInfo-XML
1726
< 1000)) {
function settimer(xml) {
1728
< 1000)) {
var options, refresh = "";
1730
< 1000)) {
refresh = $(this).attr("refresh");
1732
< 1000)) {
1733
< 1000)) {
}
1735
< 1000)) {
}
1737
 
1738
< 1000)) {
var i = 0, old_template = null, cookie_template = null, cookie_language = null, blocktmp = "";
1740
 
1741
< 1000)) {
showCPUInfoExpanded = $("#showCPUInfoExpanded").val().toString()==="true";
1743
< 1000)) {
showMemoryInfosExpanded = $("#showMemoryInfosExpanded").val().toString()==="true";
1745
< 1000)) {
showTotals = $("#hideTotals").val().toString()!=="true";
1747
< 1000)) {
if (isNaN(increaseWidth) || (increaseWidth<=0)) increaseWidth = 0;
2788 rexy 1749
< 1000)) {
case "bps": showNetworkActiveSpeed = 2;
1751
< 1000)) {
case "true": showNetworkActiveSpeed = 1;
1753
< 1000)) {
default: showNetworkActiveSpeed = 0;
1755
< 1000)) {
blocktmp = $("#blocks").val().toString();
1758
< 1000)) {
if (blocktmp === "true") {
1760
< 1000)) {
} else {
1762
< 1000)) {
1763
< 1000)) {
for (i = 0; i < blocks.length; i++) {
1765
< 1000)) {
$("#output").children().eq(j).before($("#"+blocks[i]));
1767
< 1000)) {
}
1769
< 1000)) {
}
1772
< 1000)) {
if ($("#language option").length < 2) {
1775
< 1000)) {
/*
1777
< 1000)) {
for (i = 0; i < plugin_liste.length; i++) {
1779
< 1000)) {
}
1781
< 1000)) {
} else {
1783
< 1000)) {
if (cookie_language !== null) {
1785
< 1000)) {
$("#language").val(current_language);
1787
< 1000)) {
current_language = $("#language").val().toString();
1789
< 1000)) {
/*
1791
< 1000)) {
for (i = 0; i < plugin_liste.length; i++) {
1793
< 1000)) {
}
1795
< 1000)) {
$('#language').show();
1797
< 1000)) {
1798
< 1000)) {
var i = 0;
1800
< 1000)) {
createCookie('psi_language', current_language, 365);
1802
< 1000)) {
for (i = 0; i < plugin_liste.length; i++) {
1804
< 1000)) {
}
1806
< 1000)) {
});
1808
< 1000)) {
if ($("#template option").length < 2) {
1810
< 1000)) {
} else {
1812
< 1000)) {
if (cookie_template !== null) {
1814
< 1000)) {
$("#template").val(cookie_template);
1816
< 1000)) {
$("#template").val(old_template);
1818
< 1000)) {
}
1820
< 1000)) {
$('#template').show();
1822
< 1000)) {
1823
< 1000)) {
switchStyle($("#template").val().toString());
1825
< 1000)) {
#template").val().toString(), 365);
1826
< 1000)) {
});
1828
< 1000)) {
filesystemtable();
1831
 
1832
< 1000)) {
$("#errors").nyroModal();
1835
< 1000)) {
jQuery.fn.dataTableExt.oSort['span-string-asc'] = function sortStringAsc(a, b) {
1838
< 1000)) {
x = a.substring(a.indexOf(">") + 1, a.indexOf("</"));
1840
< 1000)) {
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
1842
< 1000)) {
jQuery.fn.dataTableExt.oSort['span-string-desc'] = function sortStringDesc(a, b) {
1845
< 1000)) {
x = a.substring(a.indexOf(">") + 1, a.indexOf("</"));
1847
< 1000)) {
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
1849
< 1000)) {
jQuery.fn.dataTableExt.oSort['span-number-asc'] = function sortNumberAsc(a, b) {
1852
< 1000)) {
x = parseInt(a.substring(a.indexOf(">") + 1, a.indexOf("</")), 10);
1854
< 1000)) {
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
1856
< 1000)) {
jQuery.fn.dataTableExt.oSort['span-number-desc'] = function sortNumberDesc(a, b) {
1859
< 1000)) {
x = parseInt(a.substring(a.indexOf(">") + 1, a.indexOf("</")), 10);
1861
< 1000)) {
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
1863
< 1000)) {
jQuery.fn.dataTableExt.oSort['span-ip-asc'] = function sortIpAsc(a, b) {
1866
< 1000)) {
aa = a.substring(a.indexOf(">") + 1, a.indexOf("</"));
1868
< 1000)) {
x = full_addr(aa);
1870
< 1000)) {
if ((x === '') || (y === '')) {
1872
< 1000)) {
y = bb;
1874
< 1000)) {
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
1876
< 1000)) {
jQuery.fn.dataTableExt.oSort['span-ip-desc'] = function sortIpDesc(a, b) {
1879
< 1000)) {
aa = a.substring(a.indexOf(">") + 1, a.indexOf("</"));
1881
< 1000)) {
x = full_addr(aa);
1883
< 1000)) {
if ((x === '') || (y === '')) {
1885
< 1000)) {
y = bb;
1887
< 1000)) {
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
1889
< 1000)) {
function full_addr(ip_string) {
1892
< 1000)) {
ip_string = $.trim(ip_string).toLowerCase();
1894
< 1000)) {
if (ip_string.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/)) {
1896
< 1000)) {
1897
< 1000)) {
// replace ipv4 address if any
1899
< 1000)) {
if (ipv4) {
1901
< 1000)) {
ipv4 = ipv4[2].match(/[0-9]+/g);
1903
< 1000)) {
var byte = parseInt(ipv4[i],10);
1905
< 1000)) {
ipv4[i] = ("0" + byte.toString(16)).substr(-2);
1907
< 1000)) {
wrongvalue = true;
1909
< 1000)) {
}
1911
< 1000)) {
if (wrongvalue) {
1913
< 1000)) {
1914
< 1000)) {
ip_string += ipv4[0] + ipv4[1] + ':' + ipv4[2] + ipv4[3];
1916
< 1000)) {
}
1918
 
1919
< 1000)) {
1920
< 1000)) {
1921
< 1000)) {
// take care of leading and trailing ::
1923
< 1000)) {
1924
 
1925
< 1000)) {
1926
 
1927
< 1000)) {
var hex = ipv6[li];
1929
< 1000)) {
if (!hex.match(/^[0-9a-f]{1,4}$/)) {
1931
< 1000)) {
break;
1933
< 1000)) {
// normalize leading zeros
1935
< 1000)) {
}
1937
< 1000)) {
// normalize grouped zeros ::
1939
< 1000)) {
for (var j = ipv6.length; j <= 8; j ++) {
1941
< 1000)) {
1942
< 1000)) {
ipv6[li] = hex.join(':');
1944
< 1000)) {
}
1946
< 1000)) {
var out = ipv6.join(':');
1948
< 1000)) {
return out;
1950
< 1000)) {
return '';
1952
< 1000)) {
} else {
1954
< 1000)) {
1955
< 1000)) {
}
1957
 
1958
< 1000)) {
* generate the block element for a specific plugin that is available
1960
< 1000)) {
* @param {Number} translationid id of the translated headline in the plugin translation file
1962
< 1000)) {
* @return {String} HTML string which contains the full layout of the block
1964
< 1000)) {
function buildBlock(plugin, translationid, reload) {
1966
< 1000)) {
if (reload) {
1968
< 1000)) {
}
1970
< 1000)) {
block += "<div id=\"Plugin_" + plugin + "\" class=\"plugin\" style=\"display:none;\">\n";
2976 rexy 1972
< 1000)) {
block += "<span class=\"Hostname_" + plugin + "\"></span></h2>\n";
2788 rexy 1974
< 1000)) {
block += "</div>\n";
1976
< 1000)) {
}
1978
 
1979
< 1000)) {
* translate a plugin and add this plugin to the internal plugin-list, this is only needed once and shouldn't be called more than once
1981
< 1000)) {
*/
1983
< 1000)) {
plugin_liste.pushIfNotExist(plugin);
1985
< 1000)) {
}
1987
 
1988
< 1000)) {
* generate a formatted datetime string of the current datetime
1990
< 1000)) {
*/
1992
< 1000)) {
var date, day = 0, month = 0, year = 0, hour = 0, minute = 0, days = "", months = "", years = "", hours = "", minutes = "";
1994
< 1000)) {
day = date.getDate();
1996
< 1000)) {
year = date.getFullYear();
1998
< 1000)) {
minute = date.getMinutes();
2000
 
2001
< 1000)) {
days = (day < 10) ? "0" + day.toString() : day.toString();
2003
< 1000)) {
years = (year < 1000) ? year.toString() : year.toString();
2005
< 1000)) {
hours = (hour < 10) ? "0" + hour.toString() : hour.toString();
2007
 
2008
< 1000)) {
}
2010
 
2011
< 1000)) {
if (typeof(val) == 'undefined' || val === '') {
2013
< 1000)) {
}
2015
< 1000)) {
if ($.inArray(val, this) == -1) {
2017
< 1000)) {
}
2019
< 1000)) {
/**
2022
< 1000)) {
* @param {String} name name of the script that should be included
2024
< 1000)) {
/*
2026
< 1000)) {
var scrptE, hdEl;
2028
< 1000)) {
hdEl = document.getElementsByTagName("head")[0];
2030
< 1000)) {
scrptE.setAttribute("type", "text/javascript");
2032
< 1000)) {
}
2034
< 1000)) {
/**
2036
< 1000)) {
* @param {String} name name of the css file that should be included
2038
< 1000)) {
/*
2040
< 1000)) {
var scrptE, hdEl;
2042
< 1000)) {
hdEl = document.getElementsByTagName("head")[0];
2044
< 1000)) {
scrptE.setAttribute("rel", "stylesheet");
2046
< 1000)) {
hdEl.appendChild(scrptE);
2048
< 1000)) {
*/