403Webshell
Server IP : 112.84.131.71  /  Your IP : 43.159.78.114
Web Server : nginx/1.28.0
System : Linux 1763701629066 6.8.0-53-generic #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025 x86_64
User : www ( 1001)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/www.lengcat.cn/wp-content/themes/onenav/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/www.lengcat.cn/wp-content/themes/onenav/assets/js/sites-chart.js
//loadFunc(function() {
//    loadChart();
//});
(function () {
    var chartTheme = IO.html.hasClass('io-black-mode') ? 'dark' : '';
    var domChart = document.getElementById("chart-container");
    var ioChart;
    var chartOption;
    function setChartTheme() {
        if (chartOption && typeof chartOption === 'object') {
            ioChart.dispose();
            ioChart = echarts.init(domChart, chartTheme);
            ioChart.setOption(chartOption);
        }
    }
    function refreshChart() {
        if (chartOption && typeof chartOption === 'object') {
            ioChart.resize();
        }
    }

    function loadChart() {
        ioChart = echarts.init(domChart, chartTheme);
        var post_data;
        ioChart.showLoading();
        jQuery.ajax({
            type: 'POST',
            url: IO.ajaxurl,
            dataType: 'json',
            data: {
                action: "get_post_ranking_data",
                data: jQuery(domChart).data(),
            },
            success: function (response) {
                ioChart.hideLoading();
                if (response.success) {
                    post_data = response.data.data.data;
                    var _series = post_data.series;
                    var Max1 = calMax(post_data.count);
                    var _yAxisData = [
                        {
                            type: 'value',
                            axisLine: {
                                show: false
                            },
                            axisLabel: {
                                formatter: '{value}'
                            },
                            max: Max1,
                            splitNumber: 4,
                            interval: Max1 / 4
                        }
                    ];
                    var _seriesData = [
                        {
                            name: _series[0],
                            type: 'bar',
                            data: post_data.desktop
                        },
                        {
                            name: _series[1],
                            type: 'bar',
                            data: post_data.mobile
                        },
                        {
                            name: _series[2],
                            type: 'line',
                            smooth: true,
                            data: post_data.count
                        }
                    ];
                    if (response.data.data.type == "down") {
                        var Max2 = calMax(post_data.download);
                        _yAxisData.push(
                            {
                                type: 'value',
                                axisLabel: {
                                    formatter: '{value}'
                                },
                                max: Max2,
                                splitNumber: 4,
                                interval: Max2 / 4
                            }
                        );
                        _seriesData.push(
                            {
                                name: _series[3],
                                type: 'line',
                                yAxisIndex: 1, itemStyle: {
                                    normal: {
                                        lineStyle: {
                                            width: 2,
                                            type: 'dotted'
                                        }
                                    }
                                },
                                data: post_data.download
                            }
                        );
                    }
                    chartOption = {
                        backgroundColor: 'rgba(0,0,0,0)',
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: {
                                type: 'none',
                                crossStyle: {
                                    color: '#999'
                                }
                            }
                        },
                        grid: {
                            top: '80',
                            bottom: '60'
                        },
                        legend: {
                            top: '24',
                            data: _series
                        },
                        xAxis: [
                            {
                                type: 'category',
                                data: post_data.x_axis,
                                axisPointer: {
                                    type: 'shadow'
                                },
                                axisLabel: {
                                    formatter: function (value) {
                                        return echarts.format.formatTime("MM.dd", new Date(value));
                                    },
                                },
                            }
                        ],
                        yAxis: _yAxisData,
                        series: _seriesData
                    };
                    if (chartOption && typeof chartOption === 'object') {
                        ioChart.setOption(chartOption);
                    };
                } else {
                    showAlert(response.data);
                }
            },
            error: function () {
                showAlert(response.data);
            }
        });
    };
    function calMax(arrs) {
        var max = arrs[0];
        for (var i = 1, ilen = arrs.length; i < ilen; i++) {
            if (arrs[i] > max) {
                max = arrs[i];
            }
        }
        if (max < 4)
            return 4;
        else
            return Math.ceil(max / 4) * 4;
    }
    loadChart();

    //增加 resize 事件
    var debouncedResize = debounce(refreshChart, 100);
    window.addEventListener('resize', debouncedResize);

    // 监听自定义事件 'themeModeChanged'
    window.addEventListener('themeModeChanged', function (e) {
        // 获取当前的主题状态 (true: 黑暗模式, false: 日间模式)
        var isDarkMode = e.detail.isDarkMode;
  
        chartTheme = isDarkMode ? 'dark' : '';
        setChartTheme();
    });

    window.addEventListener('beforeunload', function () {
        window.removeEventListener('resize', debouncedResize);
        window.removeEventListener('themeModeChanged', setChartTheme);
    });

})();

Youez - 2016 - github.com/yon3zu
LinuXploit