!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/netdata/web/gui/src/dashboard.js/   drwxr-xr-x
Free 13.26 GB of 57.97 GB (22.88%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     chart-registry.js (2.57 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
// *** src/dashboard.js/chart-registry.js

// Chart Registry

// When multiple charts need the same chart, we avoid downloading it
// multiple times (and having it in browser memory multiple time)
// by using this registry.

// Every time we download a chart definition, we save it here with .add()
// Then we try to get it back with .get(). If that fails, we download it.

NETDATA.fixHost = function (host) {
    while (host.slice(-1) === '/') {
        host = host.substring(0, host.length - 1);
    }

    return host;
};

NETDATA.chartRegistry = {
    charts: {},

    globalReset: function () {
        this.charts = {};
    },

    add: function (host, id, data) {
        if (typeof this.charts[host] === 'undefined') {
            this.charts[host] = {};
        }

        //console.log('added ' + host + '/' + id);
        this.charts[host][id] = data;
    },

    get: function (host, id) {
        if (typeof this.charts[host] === 'undefined') {
            return null;
        }

        if (typeof this.charts[host][id] === 'undefined') {
            return null;
        }

        //console.log('cached ' + host + '/' + id);
        return this.charts[host][id];
    },

    downloadAll: function (host, callback) {
        host = NETDATA.fixHost(host);

        let self = this;

        function got_data(h, data, callback) {
            if (data !== null) {
                self.charts[h] = data.charts;

                // update the server timezone in our options
                if (typeof data.timezone === 'string') {
                    NETDATA.options.server_timezone = data.timezone;
                }
            } else {
                NETDATA.error(406, h + '/api/v1/charts');
            }

            if (typeof callback === 'function') {
                callback(data);
            }
        }

        if (netdataSnapshotData !== null) {
            got_data(host, netdataSnapshotData.charts, callback);
        } else {
            $.ajax({
                url: host + '/api/v1/charts',
                async: true,
                cache: false,
                xhrFields: {withCredentials: true} // required for the cookie
            })
                .done(function (data) {
                    data = NETDATA.xss.checkOptional('/api/v1/charts', data);
                    got_data(host, data, callback);
                })
                .fail(function () {
                    NETDATA.error(405, host + '/api/v1/charts');

                    if (typeof callback === 'function') {
                        callback(null);
                    }
                });
        }
    }
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0217 ]--