├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── api.php ├── build ├── README.md ├── build ├── build.bat ├── build.sh └── holy_lance.php ├── common.php ├── index.php ├── init.php ├── screenshot ├── screencapture-ipv4-94cb-Holy-Lance-1474339395845.png ├── screencapture-ipv4-94cb-Holy-Lance-1474339413531.png ├── screencapture-ipv4-94cb-Holy-Lance-1474339422092.png ├── screencapture-ipv4-94cb-Holy-Lance-1474339435898.png ├── screencapture-ipv4-94cb-Holy-Lance-1474339450668.png ├── screencapture-ipv4-94cb-Holy-Lance-1474339466029.png ├── screencapture-ipv4-94cb-Holy-Lance-1477340144069.png ├── screencapture-ipv4-94cb-Holy-Lance-1477958681909.png ├── screencapture-ipv4-94cb-Holy-Lance-1479270760348.png └── screencapture-ipv4-94cb-Holy-Lance-1479270760349.png ├── static ├── css │ └── style.css └── js │ ├── common.js │ ├── easyResponsiveTabs.js │ ├── echarts.min.js │ ├── jquery.jsontotable.min.js │ └── jquery.min.js ├── test_disk.php ├── test_pi.php └── test_ping.php /.gitignore: -------------------------------------------------------------------------------- 1 | # phpstorm project files 2 | .idea -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - '5.4' 4 | - '5.5' 5 | - '5.6' 6 | - '7.0' 7 | - '7.1' 8 | - '7.2' 9 | - nightly 10 | # - hhvm 11 | 12 | # https://docs.travis-ci.com/user/reference/trusty#PHP-images 13 | matrix: 14 | include: 15 | - php: 5.2 16 | dist: precise 17 | - php: 5.3.3 18 | dist: precise 19 | # matrix: 20 | # allow_failures: 21 | # - php: hhvm 22 | 23 | before_script: 24 | - chmod 777 -R ./ 25 | - php -m 26 | - cd build 27 | 28 | script: 29 | - php build -n holy_lance 30 | - php -l holy_lance.php 31 | # - php -S 0.0.0.0:8080 & 32 | # - curl -s http://localhost:8080/holy_lance.php?file=init.php 33 | # - curl -s http://localhost:8080/holy_lance.php?file=api.php 34 | - php-cgi -f holy_lance.php file=init.php 35 | - php-cgi -f holy_lance.php file=api.php 36 | - php-cgi -f holy_lance.php file=test_disk.php 37 | - php-cgi -f holy_lance.php file=test_pi.php 38 | - php-cgi -f holy_lance.php file=test_ping.php ip=8.8.8.8 39 | - php-cgi -f holy_lance.php -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Canbin Lin (lincanbin@hotmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Holy Lance [![Build Status](https://travis-ci.org/lincanbin/Holy-Lance.svg?branch=master)](https://travis-ci.org/lincanbin/Holy-Lance) 2 | A Linux Resource / Performance Monitor based on PHP. 3 | 4 | ## Demo/Official Website 5 | 6 | * [Demo](http://ipv4.94cb.com/Holy-Lance) 7 | * [中文官方支持论坛](https://www.94cb.com) 8 | * [English official support forum](https://en.94cb.com) 9 | 10 | ## Requirements 11 | 12 | * PHP version 5.2.0 or higher. 13 | * If your PHP version is lower than 5.4, you must disable [safe_mode](http://php.net/manual/en/features.safe-mode.php). 14 | 15 | ## Install 16 | 17 | upload `build/holy_lance.php` to your server. 18 | 19 | *__OR__* 20 | 21 | ```bash 22 | wget 'https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/build/holy_lance.php' --no-check-certificate 23 | ``` 24 | 25 | ## Build 26 | 27 | If you want to modify the file name, you must rebuild it: 28 | 29 | * run `build\build.sh` under Linux. 30 | 31 | * run `build\build.bat` under Windows. 32 | 33 | ## Screenshot 34 | 35 | ![CPU](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339413531.png) 36 | 37 | ![Multi_CPU](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1477958681909.png) 38 | 39 | ![Load](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1477340144069.png) 40 | 41 | ![Memory](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339422092.png) 42 | 43 | ![Connection](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1479270760348.png) 44 | 45 | ![Disk](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339395845.png) 46 | 47 | ![Network](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339435898.png) 48 | 49 | ![Test](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1479270760349.png) 50 | 51 | ![Process](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339450668.png) 52 | 53 | ![Information](https://raw.githubusercontent.com/lincanbin/Holy-Lance/master/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339466029.png) 54 | 55 | ## Donate for Holy Lance 56 | 57 | * [Donation list](https://www.94cb.com/t/4288) 58 | 59 | * Alipay: 60 | 61 | ![Alipay](https://www.94cb.com/upload/donate_small.png) 62 | 63 | * Wechat: 64 | 65 | ![Wechat](https://www.94cb.com/upload/donate_weixin_small.png) 66 | 67 | * Paypal: 68 | 69 | https://www.paypal.me/lincanbin 70 | 71 | ## License 72 | 73 | ``` 74 | The MIT License (MIT) 75 | 76 | Copyright (c) 2016 Canbin Lin (lincanbin@hotmail.com) 77 | 78 | Permission is hereby granted, free of charge, to any person obtaining a copy 79 | of this software and associated documentation files (the "Software"), to deal 80 | in the Software without restriction, including without limitation the rights 81 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 82 | copies of the Software, and to permit persons to whom the Software is 83 | furnished to do so, subject to the following conditions: 84 | 85 | The above copyright notice and this permission notice shall be included in all 86 | copies or substantial portions of the Software. 87 | 88 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 89 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 90 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 91 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 92 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 93 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 94 | SOFTWARE. 95 | ``` 96 | -------------------------------------------------------------------------------- /api.php: -------------------------------------------------------------------------------- 1 | true, 25 | 'load' => array(0, 0, 0), 26 | 'uptime' => '0:0:0:0', 27 | 'cpu_usage' => 0, 28 | 'logic_cpu_usage' => array(), 29 | 'network_service' => array(), 30 | 'connection' => array( 31 | 'ESTABLISHED' => 0, 32 | 'SYN_SENT' => 0, 33 | 'SYN_RECV' => 0, 34 | 'FIN_WAIT1' => 0, 35 | 'FIN_WAIT2' => 0, 36 | 'TIME_WAIT' => 0, 37 | 'CLOSE' => 0, 38 | 'CLOSE_WAIT' => 0, 39 | 'LAST_ACK' => 0, 40 | 'LISTEN' => 0, 41 | 'CLOSING' => 0, 42 | 'UNKNOWN' => 0 43 | ), 44 | 'process' => array(), 45 | 'disk_free' => array() 46 | ); 47 | $system_info['load'] = sys_getloadavg(); 48 | 49 | //uptime 50 | $uptime = array(); 51 | exec("cat /proc/uptime | awk '{print $1}'", $uptime); 52 | if (!empty($uptime)){ 53 | $uptime[0] = intval($uptime[0]); 54 | $system_info['uptime'] = convert_timestamp_2_string($uptime[0]); 55 | } 56 | unset($uptime); 57 | 58 | // cpu: % and disk and network 59 | $cpu_usage1 = array(); 60 | $cpu_usage2 = array(); 61 | $disk_usage1 = array(); 62 | $disk_usage2 = array(); 63 | $network_status1 = array(); 64 | $network_status2 = array(); 65 | // Deprecated Code: Low performance 66 | // exec("top -b -n2 | grep \"Cpu(s)\"|tail -n 1 | awk '{print $2 + $4}'", $cpu_usage); 67 | exec("cat /proc/stat | grep 'cpu' | awk '{print $2+$3+$4+$5+$6+$7+$8+$9+$10\"\\n\" $5}'", $cpu_usage1); 68 | exec("cat /proc/diskstats | awk '{print $3 \"\\n\" $6 \"\\n\" $7 \"\\n\" $10 \"\\n\" $11}'", $disk_usage1); 69 | exec("cat /proc/net/dev | grep \":\" | awk '{gsub(\":\", \" \");print $1 \":\" $2 \":\" $3 \":\" $10 \":\" $11}'", $network_status1); 70 | usleep(SAMPLING_TIME); 71 | exec("cat /proc/diskstats | awk '{print $3 \"\\n\" $6 \"\\n\" $7 \"\\n\" $10 \"\\n\" $11}'", $disk_usage2); 72 | exec("cat /proc/net/dev | grep \":\" | awk '{gsub(\":\", \" \");print $1 \":\" $2 \":\" $3 \":\" $10 \":\" $11}'", $network_status2); 73 | exec("cat /proc/stat | grep 'cpu' | awk '{print $2+$3+$4+$5+$6+$7+$8+$9+$10\"\\n\" $5}'", $cpu_usage2); 74 | // CPU 75 | if (!empty($cpu_usage1)) { 76 | foreach (range(0, count($cpu_usage1) / 2 - 1) as $offset) { 77 | $cpu_usage = round((($cpu_usage2[0 + $offset * 2] - $cpu_usage1[0 + $offset * 2]) - ($cpu_usage2[1 + $offset * 2] - $cpu_usage1[1 + $offset * 2])) / ($cpu_usage2[0 + $offset * 2] - $cpu_usage1[0 + $offset * 2]) * 100, 1); 78 | if ($offset === 0) { 79 | $system_info['cpu_usage'] = $cpu_usage; 80 | } else { 81 | $system_info['logic_cpu_usage'][$offset - 1] = $cpu_usage; 82 | } 83 | } 84 | } 85 | 86 | //Disk: KiB per second 87 | if (!empty($disk_usage1)) { 88 | foreach (range(0, count($disk_usage1) / 5 - 1) as $offset) { 89 | $system_info['disk'][$disk_usage2[0 + $offset * 5]]['disk_read_speed'] = round(($disk_usage2[1 + $offset * 5] - $disk_usage1[1 + $offset * 5]) / 2 / (SAMPLING_TIME / 1000000), 1); 90 | $system_info['disk'][$disk_usage2[0 + $offset * 5]]['disk_read_active_time'] = round(($disk_usage2[2 + $offset * 5] - $disk_usage1[2 + $offset * 5]) / (SAMPLING_TIME / 1000000), 1); 91 | $system_info['disk'][$disk_usage2[0 + $offset * 5]]['disk_read_kibibytes'] = round($disk_usage2[1 + $offset * 5] / 2); 92 | $system_info['disk'][$disk_usage2[0 + $offset * 5]]['disk_write_speed'] = round(($disk_usage2[3 + $offset * 5] - $disk_usage1[3 + $offset * 5]) / 2 / (SAMPLING_TIME / 1000000), 1); 93 | $system_info['disk'][$disk_usage2[0 + $offset * 5]]['disk_write_active_time'] = round(($disk_usage2[4 + $offset * 5] - $disk_usage1[4 + $offset * 5]) / (SAMPLING_TIME / 1000000), 1); 94 | $system_info['disk'][$disk_usage2[0 + $offset * 5]]['disk_write_kibibytes'] = round($disk_usage2[3 + $offset * 5] / 2); 95 | } 96 | } 97 | unset($cpu_usage1); 98 | unset($cpu_usage2); 99 | unset($disk_usage1); 100 | unset($disk_usage2); 101 | 102 | //Network: Bytes per second 103 | $network_usage = array(); 104 | if (!empty($network_status2)) { 105 | foreach ($network_status2 as $key => $eth) { 106 | $eth_previous = explode(":", $network_status1[$key]); 107 | $eth = explode(":", $eth); 108 | $network_card_name = $eth[0]; 109 | unset($eth_previous[0]); 110 | unset($eth[0]); 111 | $network_usage[$network_card_name] = array( 112 | "receive_bytes" => $eth[1], 113 | "receive_packets" => $eth[2], 114 | "receive_speed" => ($eth[1] - $eth_previous[1]) / (SAMPLING_TIME / 1000000), 115 | "transmit_bytes" => $eth[3], 116 | "transmit_packets" => $eth[4], 117 | "transmit_speed" => ($eth[3] - $eth_previous[3]) / (SAMPLING_TIME / 1000000) 118 | ); 119 | } 120 | $system_info['network'] = $network_usage; 121 | } 122 | unset($network_status1); 123 | unset($network_status2); 124 | unset($network_usage); 125 | 126 | // memory: KiB 127 | $system_info['memory_usage_total'] = trim(shell_exec("free | grep \"Mem\" | awk '{print $2}'")); 128 | $system_info['memory_usage_used'] = trim(shell_exec("free | grep \"Mem\" | awk '{print $3}'")); 129 | $system_info['memory_usage_free'] = trim(shell_exec("free | grep \"Mem\" | awk '{print $4}'")); 130 | $system_info['memory_usage_buff'] = trim(shell_exec("cat /proc/meminfo | grep Buffers: | awk '{print $2}'")); 131 | $system_info['memory_usage_cache'] = trim(shell_exec("cat /proc/meminfo | grep Cached: | head -n1 | awk '{print $2}'")); 132 | 133 | $system_info['memory_usage_swap_total'] = trim(shell_exec("free | grep \"Swap\" | awk '{print $2}'")); 134 | $system_info['memory_usage_swap_used'] = trim(shell_exec("free | grep \"Swap\" | awk '{print $3}'")); 135 | $system_info['memory_usage_swap_free'] = trim(shell_exec("free | grep \"Swap\" | awk '{print $4}'")); 136 | 137 | // process 138 | $process_number = array(); 139 | exec("ps -ef|wc -l", $process_number); 140 | $system_info['process_number'] = $process_number[0]; 141 | unset($process_number); 142 | 143 | $process_list = array(); 144 | exec("ps auxw", $process_list); // --sort=time 145 | if (!empty($process_list)) { 146 | unset($process_list[0]); 147 | $process_map = array(); 148 | foreach ($process_list as $key => $value) { 149 | $process_map[] = explode(" ", preg_replace("/\s(?=\s)/","\\1", $value), 11); 150 | } 151 | $system_info['process'] = $process_map; 152 | } 153 | unset($process_list); 154 | 155 | // disk_free 156 | $disk_free_list = array(); 157 | exec("df -T", $disk_free_list); // --sort=time 158 | if (!empty($disk_free_list)) { 159 | unset($disk_free_list[0]); 160 | $disk_free_map = array(); 161 | foreach ($disk_free_list as $key => $value) { 162 | $disk_free_map[] = explode(" ", preg_replace("/\s(?=\s)/","\\1", $value), 7); 163 | } 164 | $system_info['disk_free'] = $disk_free_map; 165 | } 166 | unset($disk_free_list); 167 | 168 | // network service 169 | $temp_network_service_list = array(); 170 | exec("netstat -lntp | tail -n +3", $temp_network_service_list); 171 | if (!empty($temp_network_service_list)) { 172 | $network_service_list = array(); 173 | foreach ($temp_network_service_list as $key => $value) { 174 | $network_service_list[] = explode(" ", preg_replace("/\s(?=\s)/","\\1", $value), 7); 175 | } 176 | $system_info['network_service'] = $network_service_list; 177 | } 178 | unset($temp_network_service_list); 179 | 180 | // connections 181 | $temp_connection = array(); 182 | exec("netstat -nat| tail -n +3 | awk '{print $6}'|sort|uniq -c", $temp_connection); 183 | if (!empty($temp_connection)) { 184 | $connection = array(); 185 | foreach ($temp_connection as $key => $value) { 186 | $cur_connection = explode(" ", trim($value), 2); 187 | $connection[$cur_connection[1]] = intval($cur_connection[0]); 188 | } 189 | $system_info['connection'] = array_merge($system_info['connection'], $connection); 190 | } 191 | unset($temp_connection); 192 | 193 | if (version_compare(PHP_VERSION, '5.4.0') < 0) { 194 | echo json_encode($system_info); 195 | } else { 196 | echo json_encode($system_info, JSON_PRETTY_PRINT); 197 | } 198 | ?> -------------------------------------------------------------------------------- /build/README.md: -------------------------------------------------------------------------------- 1 | # Holy Lance [![Build Status](https://travis-ci.org/lincanbin/Holy-Lance.svg?branch=master)](https://travis-ci.org/lincanbin/Holy-Lance) 2 | A Linux Resource / Performance Monitor based on PHP. 3 | 4 | ## Build 5 | 6 | ```shell 7 | php build -n holy_lance 8 | ``` -------------------------------------------------------------------------------- /build/build: -------------------------------------------------------------------------------- 1 | $old_file_name_value) { 43 | $file_buffer[$old_file_name]['content'] = str_replace($old_file_name_value, $new_file_name_list[$file_name_key], $file_buffer[$old_file_name]['content']); 44 | } 45 | $file_buffer[$old_file_name]['content'] = str_replace(" ", "", $file_buffer[$old_file_name]['content']); 46 | } 47 | } 48 | 49 | function listDir($dir) 50 | { 51 | global $ignore_dir, $ignore_file, $old_file_name_list, $new_file_name_list; 52 | if (is_dir($dir)) { 53 | if ($dh = opendir($dir)) { 54 | while (($file = readdir($dh)) !== false) { 55 | if ((is_dir($dir . "/" . $file)) && $file != "." && $file != "..") { 56 | if (!in_array($file, $ignore_dir)) { 57 | // echo $file . "\n"; 58 | listDir($dir . $file . "/"); 59 | } 60 | } else { 61 | if ($file != "." && $file != "..") { 62 | $file_name = $dir . $file; 63 | if (!in_array($file_name, $ignore_file)) { 64 | $old_file_name_list[$file_name] = str_replace("../", "", $file_name); 65 | $new_file_name_list[$file_name] = BUILD_FILE_NAME . "?file=" . urlencode($old_file_name_list[$file_name]); 66 | echo $file_name . "\n"; 67 | } 68 | } 69 | } 70 | } 71 | closedir($dh); 72 | } 73 | } 74 | } 75 | 76 | 77 | listDir("../"); 78 | 79 | foreach ($old_file_name_list as $file_name => $old_file_name) { 80 | add_file_to_buffer($file_name); 81 | } 82 | 83 | $fp = fopen(BUILD_FILE_NAME, 'w'); 84 | $entry_file = !empty($file_buffer[ENTER_FILE_NAME]) ? $file_buffer[ENTER_FILE_NAME] : ''; 85 | if ($entry_file === '') { 86 | echo 'Entry file not found! '; 87 | exit(1); 88 | } 89 | unset($file_buffer[ENTER_FILE_NAME]); 90 | $common_file = !empty($file_buffer[COMMON_FILE_NAME]) ? $file_buffer[COMMON_FILE_NAME] : ''; 91 | if ($common_file === '') { 92 | echo 'Common file not found! '; 93 | exit(2); 94 | } 95 | fwrite($fp, ''); 98 | $common_file['content'] = str_replace("define('HOLY_LANCE_PASSWORD', '');", "define('HOLY_LANCE_PASSWORD', '" . $password . "');", $common_file['content']); 99 | fwrite($fp, $common_file['content']); 100 | unset($file_buffer[COMMON_FILE_NAME]); 101 | foreach ($file_buffer as $file_name => $file) { 102 | fwrite($fp, ''); 112 | fwrite($fp, $file['content']); 113 | fwrite($fp, ''); 117 | } 118 | 119 | fwrite($fp, $entry_file['content']); 120 | fclose($fp); 121 | 122 | echo "\n\n" . BUILD_FILE_NAME . " has been generated! \npssword: " . $password . "\n\n"; -------------------------------------------------------------------------------- /build/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set/p param=Enter the file name of the Lance Holy you want(Default: holy_lance): 3 | if "%param%" equ "" set "param=holy_lance" 4 | set/p pw=Enter the password of the Lance Holy you want(No password is required by default): 5 | php build -n %param% -p %pw% 6 | pause -------------------------------------------------------------------------------- /build/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Enter the file name of the Holy Lance you want (Default: holy_lance): " 3 | read file_name 4 | file_name="${file_name:=holy_lance}" 5 | echo "Enter the password of the Holy Lance you want (No password is required by default): " 6 | read pw 7 | pw="${pw:=}" 8 | php build -n $file_name -p $pw -------------------------------------------------------------------------------- /common.php: -------------------------------------------------------------------------------- 1 | = 1024 && $i < 4; $i++) 34 | $size /= 1024; 35 | return round($size, $precision) . $units[$i]; 36 | } 37 | 38 | function format_number($number) 39 | { 40 | return number_format($number, '0', '.', ' '); 41 | } 42 | 43 | 44 | function check_permission($file_name) 45 | { 46 | $fp = @fopen($file_name, 'w'); 47 | if (!$fp) { 48 | return false; 49 | } else { 50 | fclose($fp); 51 | @unlink($file_name); 52 | return true; 53 | } 54 | } 55 | 56 | function get_cpu_info_map($cpu_info_val) 57 | { 58 | $result = array(); 59 | foreach (explode("\n", $cpu_info_val) as $value) { 60 | if ($value) { 61 | $item = array_map("trim", explode(":", $value)); 62 | $result[str_replace(" ", "_", $item[0])] = $item[1]; 63 | } 64 | } 65 | return $result; 66 | } 67 | 68 | function get_mem_info_map($mem_info) 69 | { 70 | $result = array(); 71 | foreach ($mem_info as $value) { 72 | $value = str_ireplace(")", "", str_ireplace("(", "_", str_ireplace("kB", "", $value))); 73 | $item = array_map("trim", explode(":", $value)); 74 | $result[str_replace(" ", "_", $item[0])] = $item[1]; 75 | } 76 | return $result; 77 | } 78 | 79 | function convert_timestamp_2_string($timestamp) 80 | { 81 | $timestamp = intval($timestamp); 82 | return intval($timestamp / 86400) . ":" 83 | . sprintf("%02d", $timestamp % 86400 / 3600) . ":" 84 | . sprintf("%02d", $timestamp % 3600 / 60) . ":" 85 | . sprintf("%02d", $timestamp % 60); 86 | } 87 | 88 | function check_password() 89 | { 90 | if (HOLY_LANCE_PASSWORD !== '' && (!isset($_POST['password']) || $_POST['password'] !== HOLY_LANCE_PASSWORD)) { 91 | echo '{"status":false}'; 92 | exit(1); 93 | } 94 | return true; 95 | } 96 | 97 | 98 | // 创建row socket 需要root权限,所以用root账户在CLI下运行可以成功,用www用户在fpm下运行可能会失败,但是不会报错 99 | // 需要root权限运行则要php-fpm -R运行 100 | // 目前针对没有root权限做了一套临时的兼容方案 101 | function ping($host, $port = 80) 102 | { 103 | $protocolNumber = getprotobyname('icmp'); 104 | $socket = socket_create(AF_INET, SOCK_RAW, $protocolNumber); 105 | if ($socket === false) {// 没有Root权限,开启Raw socket失败,用TCP协议ping 106 | return ping_without_root($host, $port); 107 | } 108 | socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 1, 'usec' => 0)); 109 | socket_connect($socket, $host, 0); 110 | $package = "\x08\x00\x19\x2f\x00\x00\x00\x00\x70\x69\x6e\x67"; 111 | socket_send($socket, $package, strlen($package), 0); 112 | $ts1 = microtime(true); 113 | if (socket_read($socket, 255) !== false) { 114 | $ts2 = microtime(true); 115 | $result = round(($ts2 - $ts1) * 1000, 2) . ' ms'; 116 | } else { 117 | $result = socket_strerror(socket_last_error($socket)); 118 | } 119 | socket_close($socket); 120 | return $result; 121 | } 122 | 123 | function ping_without_root($host, $port) 124 | { 125 | try { 126 | $err_no = null; 127 | $err_str = null; 128 | $ts1 = microtime(true); 129 | $fp = stream_socket_client("tcp://" . $host . ":" . $port, $err_no, $err_str, 3); 130 | $ts2 = microtime(true); 131 | $result = round(($ts2 - $ts1) * 1000, 2) . ' ms'; 132 | if ($fp === false) { 133 | $result = 'Timeout'; 134 | } 135 | fclose($fp); 136 | } catch (Exception $exception) { 137 | $result = 'Timeout'; 138 | } 139 | return $result; 140 | } 141 | ?> -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Holy Lance v1.3.0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 | 48 |
49 |
50 | 51 |
52 |
    53 |
  • CPU

  • 54 |
  • 逻辑处理器

  • 55 |
  • 系统负载

  • 56 |
  • 内存

  • 57 |
  • 网络连接数

  • 58 |
59 |
60 |
61 |
62 |

CPU

63 | Loading 64 |
65 |
66 |
67 |
68 |
69 | 利用率 70 | 0% 71 |
72 |
73 | 速度 74 | 0 GHz 75 |
76 |
77 |
78 | 进程 79 | 0 80 |
81 |
82 |
83 | 运行时间 84 | 0 85 |
86 |
87 | 88 |
89 |
90 | 最大速度: 91 | 0 GHz 92 |
93 |
94 | 插槽: 95 | 1 96 |
97 |
98 | 内核: 99 | 1 100 |
101 |
102 | 逻辑处理器: 103 | 1 104 |
105 |
106 | 缓存: 107 | 0 MiB 108 |
109 |
110 | 111 |
112 |
113 |
114 | 115 |
116 |
117 |

CPU

118 | Loading 119 |
120 |
121 |
122 | 123 |
124 |
125 |

系统负载

126 |
127 |
128 |
129 | 130 |
131 |
132 |

内存

133 | 134 |
135 |
136 |
137 |
138 |
139 | 使用中 140 | 0 MiB 141 |
142 |
143 | 可用 144 | 0 MiB 145 |
146 |
147 |
148 | Swap使用中 149 | 0 MiB 150 |
151 |
152 | Swap可用 153 | 0 MiB 154 |
155 |
156 |
157 | 已提交 158 | 0 MiB 159 |
160 |
161 | 已缓存 162 | 0 MiB 163 |
164 |
165 |
166 |
167 | 168 |
169 |
170 |

网络连接数

171 |
172 |
173 |
174 |
175 |
176 | ESTABLISHED 177 | 0 178 |
179 |
180 | SYN_SENT 181 | 0 182 |
183 |
184 | SYN_RECV 185 | 0 186 |
187 |
188 | FIN_WAIT1 189 | 0 190 |
191 |
192 |
193 | FIN_WAIT2 194 | 0 195 |
196 |
197 | TIME_WAIT 198 | 0 199 |
200 |
201 | CLOSE 202 | 0 203 |
204 |
205 | CLOSE_WAIT 206 | 0 207 |
208 |
209 |
210 | LAST_ACK 211 | 0 212 |
213 |
214 | LISTEN 215 | 0 216 |
217 |
218 | CLOSING 219 | 0 220 |
221 |
222 | UNKNOWN 223 | 0 224 |
225 |
226 |
227 |
228 | 229 |
230 |
231 | 232 |
233 |
234 |
235 | 236 |
237 |
238 | 239 |
240 |
241 |
242 |
243 | 系统类型 244 | 245 |
246 |
247 | 发行版信息 248 | 249 |
250 |
251 | 系统版本 252 | 253 |
254 |
255 | 系统语言 256 | 257 |
258 |
259 | 260 |
261 | 服务器解析引擎 262 | 263 |
264 |
265 | PHP版本 266 | 267 |
268 |
269 | Zend引擎版本 270 | 271 |
272 |
273 | 274 | 283 |
284 | OPCache状态 285 | 286 |
287 | 290 |
291 | OPCache运行时间 292 | 293 |
294 | 297 | 0): 299 | ?> 300 |
301 | OPCache命中率 302 | 303 | % 307 | 308 |
309 |
310 | OPCache命中次数 311 | 312 | 313 | 314 |
315 |
316 | OPCache缓存脚本数 317 | 318 | 319 |  /  320 | 321 | 322 |
323 | 326 | 329 |
330 | OPCache内存占用 331 | 332 | 335 |  /  336 | 337 | 338 |
339 | 342 |
343 | 346 | 347 |
348 | 脚本最大占用内存 349 | 350 |
351 |
352 | 脚本超时时间 353 | 354 |
355 |
356 | socket超时时间 357 | 358 |
359 |
360 | 361 |
362 |
363 | 允许的最大POST数据 364 | 365 |
366 |
367 | 上传文件大小限制 368 | 369 |
370 |
371 | 372 |
373 | 服务器接口类型 374 | 375 |
376 |
377 | 服务器IP 378 | 379 |
380 |
381 | 服务器端口 382 | 383 |
384 |
385 | 386 | 387 |
388 | 已编译扩展: 389 | 390 |
391 | 392 |
393 | 394 | 398 |
399 | 已禁用函数: 400 | 401 |
402 | 406 |
407 | 408 |
409 |
410 | 411 |
412 |
413 | 414 |
415 |
416 |
417 |
418 | 419 |
420 | 磁盘连续读取速度 421 | Run 422 |
423 |
424 | 磁盘连续写入速度 425 | Run 426 |
427 |
428 | 磁盘4k读取速度 429 | Run 430 |
431 |
432 | 磁盘4k写入速度 433 | Run 434 |
435 |
436 | 437 |
438 | 计算PI(5M) 439 | Run 440 |
441 |
442 | 计算PI(10M) 443 | Run 444 |
445 |
446 | 计算PI(50M) 447 | Run 448 |
449 |
450 | 计算PI(100M) 451 | Run 452 |
453 |
454 | 455 | 464 |
465 | Ping 客户端主机 466 | Run 467 |
468 | 471 |
472 | Ping Baidu 473 | Run 474 |
475 |
476 | Ping GitHub 477 | Run 478 |
479 |
480 | Ping 114 481 | Run 482 |
483 |
484 | 485 |
486 | Ping Google 487 | Run 488 |
489 |
490 | Ping Youtube 491 | Run 492 |
493 |
494 | Ping Twitter 495 | Run 496 |
497 |
498 | Ping FaceBook 499 | Run 500 |
501 |
502 | Ping WikiPedia 503 | Run 504 |
505 |
506 | 507 |
508 | Ping 阿里云华北1青岛 509 | Run 510 |
511 |
512 | Ping 阿里云华北2北京 513 | Run 514 |
515 |
516 | Ping 阿里云华北3张家口 517 | Run 518 |
519 |
520 | Ping 阿里云华北5呼和浩特 521 | Run 522 |
523 |
524 | 525 |
526 | Ping 阿里云华南1深圳 527 | Run 528 |
529 |
530 | Ping 阿里云华东1杭州 531 | Run 532 |
533 |
534 | Ping 阿里云华东2上海 535 | Run 536 |
537 |
538 | Ping 阿里云香港 539 | Run 540 |
541 |
542 | 543 |
544 | Ping 阿里云亚太东南1新加坡 545 | Run 546 |
547 |
548 | Ping 阿里云亚太东南2悉尼 549 | Run 550 |
551 |
552 | Ping 阿里云亚太东南3吉隆坡 553 | Run 554 |
555 |
556 | Ping 阿里云亚太东北1日本 557 | Run 558 |
559 |
560 | 561 |
562 | Ping 阿里云美西1硅谷 563 | Run 564 |
565 |
566 | Ping 阿里云美东1弗吉尼亚 567 | Run 568 |
569 |
570 | Ping 阿里云中欧1法兰克福 571 | Run 572 |
573 |
574 | Ping 阿里云中东1迪拜 575 | Run 576 |
577 |
578 |
579 |
580 | 581 |
582 |
583 | 584 |
585 |
586 |
587 |

588 |

589 | 					MIT License
590 | 
591 | Copyright (c) 2016 Canbin Lin (lincanbin@hotmail.com)
592 | 
593 | Permission is hereby granted, free of charge, to any person obtaining a copy
594 | of this software and associated documentation files (the "Software"), to deal
595 | in the Software without restriction, including without limitation the rights
596 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
597 | copies of the Software, and to permit persons to whom the Software is
598 | furnished to do so, subject to the following conditions:
599 | 
600 | The above copyright notice and this permission notice shall be included in all
601 | copies or substantial portions of the Software.
602 | 
603 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
604 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
605 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
606 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
607 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
608 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
609 | SOFTWARE.
610 | 
611 | 				    
612 |

613 |

614 | GitHub地址:https://github.com/lincanbin/Holy-Lance 615 |

616 |

617 | 618 |

619 |
620 |
621 |
622 |
623 | 626 | 627 | 628 | -------------------------------------------------------------------------------- /init.php: -------------------------------------------------------------------------------- 1 | 0) print $1}'", $network_cards); 22 | exec("cat /proc/diskstats | awk '{if ($4 > 0) print $3}'", $disk); 23 | $cpu_info = array( 24 | 'cpu_name' => trim(shell_exec('cat /proc/cpuinfo | grep name | cut -f2 -d: | head -1')), // CPU名称 25 | 'cpu_num' => trim(shell_exec('cat /proc/cpuinfo | grep "physical id"| sort | uniq | wc -l')), // CPU个数(X路CPU) 26 | 'cpu_core_num' => trim(shell_exec('cat /proc/cpuinfo | grep "cores" | uniq | awk -F ":" \'{print $2}\'')), // CPU核心数 27 | 'cpu_processor_num' => trim(shell_exec('cat /proc/cpuinfo | grep "processor" | wc -l')), // CPU逻辑处理器个数 28 | 'cpu_frequency' => trim(shell_exec('cat /proc/cpuinfo | grep MHz | uniq | awk -F ":" \'{print $2}\'')), // CPU 频率 29 | ); 30 | $all_cpu_info = array_map("get_cpu_info_map", explode("\n\n", trim(shell_exec('cat /proc/cpuinfo')))); 31 | $memory_info = get_mem_info_map(explode("\n", trim(shell_exec('cat /proc/meminfo')))); 32 | $network_info = array(); 33 | foreach ($network_cards as $eth) { 34 | $network_info[$eth]['ip'] = explode("\n", trim(shell_exec("ip addr show " . $eth . " | grep 'inet' | awk '{print $2}' 2> /dev/null; if [[ $? -ne 0 ]]; then ifconfig " . $eth . " | grep 'inet' | sed 's/addr://g' | awk '{print $2}'; fi"))); 35 | } 36 | $system_env = array( 37 | 'status' => true, 38 | 'version' => 1, 39 | 'system_name' => trim(shell_exec('cat /etc/*-release | head -n1')), 40 | 'psssword_require' => false, 41 | 'cpu_info' => $cpu_info, 42 | 'cpu' => $all_cpu_info, 43 | 'disk' => $disk, 44 | 'memory' => $memory_info, 45 | 'network' => $network_cards, 46 | 'network_info' => $network_info 47 | ); 48 | 49 | if (version_compare(PHP_VERSION, '5.4.0') < 0) { 50 | echo json_encode($system_env); 51 | } else { 52 | echo json_encode($system_env, JSON_PRETTY_PRINT); 53 | } 54 | ?> 55 | -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339395845.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339395845.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339413531.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339413531.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339422092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339422092.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339435898.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339435898.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339450668.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339450668.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339466029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1474339466029.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1477340144069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1477340144069.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1477958681909.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1477958681909.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1479270760348.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1479270760348.png -------------------------------------------------------------------------------- /screenshot/screencapture-ipv4-94cb-Holy-Lance-1479270760349.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincanbin/Holy-Lance/2d44b87b9c061a1aa1bd386cbc70d543c1269686/screenshot/screencapture-ipv4-94cb-Holy-Lance-1479270760349.png -------------------------------------------------------------------------------- /static/css/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Holy Lance 3 | * https://github.com/lincanbin/Holy-Lance 4 | * 5 | * Copyright 2016 Canbin Lin (lincanbin@hotmail.com) 6 | * http://www.94cb.com/ 7 | * 8 | * Licensed under the MIT License: 9 | * https://opensource.org/licenses/MIT 10 | * 11 | * A Linux Resource / Performance Monitor based on PHP. 12 | */ 13 | html, #MainTab { 14 | height:100%; 15 | } 16 | body { 17 | height:100%; 18 | margin: 0; 19 | padding: 0; 20 | background: #FFF; 21 | font-family: 'Segoe UI'; 22 | } 23 | table { 24 | width: 100%; 25 | border-collapse: collapse; 26 | margin: 0 auto; 27 | } 28 | a { 29 | text-decoration: none; 30 | color: #3498db; 31 | } 32 | tr:nth-of-type(odd) { 33 | background: #eee; 34 | } 35 | th { 36 | background: #3498db; 37 | color: white; 38 | font-weight: bold; 39 | cursor: pointer; 40 | max-width: 400px; 41 | } 42 | .selected-col-desc:after { 43 | content: "▼"; 44 | float: right; 45 | } 46 | .selected-col-asc:after { 47 | content: "▲"; 48 | float: right; 49 | } 50 | td, th { 51 | padding: 10px; 52 | border: 1px solid #ccc; 53 | text-align: left; 54 | font-size: 18px; 55 | max-width: 400px; 56 | } 57 | ul.resp-tabs-list, p { 58 | margin: 0; 59 | padding: 0; 60 | } 61 | .resp-tabs-list li { 62 | font-weight: 600; 63 | font-size: 13px; 64 | display: inline-block; 65 | padding: 20px 65px; 66 | margin: 0 4px 0 0; 67 | list-style: none; 68 | cursor: pointer; 69 | float: left; 70 | } 71 | .resp-tabs-list .tab-label { 72 | font-size: 11px; 73 | } 74 | .resp-tabs-container { 75 | padding: 0; 76 | background-color: #fff; 77 | clear: left; 78 | } 79 | h2.resp-accordion { 80 | cursor: pointer; 81 | padding: 5px; 82 | display: none; 83 | } 84 | .resp-tab-content { 85 | display: none; 86 | padding: 15px 0; 87 | } 88 | .resp-tab-item .main { 89 | border-top: 4px solid #C1C1C1 !important; 90 | } 91 | .resp-tab-active { 92 | border: 1px solid #5AB1D0 !important; 93 | border-bottom: none; 94 | margin-bottom: -1px !important; 95 | padding: 16px 64px 20px 64px !important; 96 | border-top: 4px solid #5AB1D0 !important; 97 | border-bottom: 0 #fff solid !important; 98 | } 99 | .resp-tab-active { 100 | border-bottom: none; 101 | background-color: #fff; 102 | } 103 | .resp-content-active, .resp-accordion-active { 104 | display: block; 105 | } 106 | .resp-tab-content { 107 | /*border: 1px solid #c1c1c1;*/ 108 | border-top-color: #5AB1D0; 109 | } 110 | h2.resp-accordion { 111 | font-size: 13px; 112 | border: 1px solid #c1c1c1; 113 | border-top: 0 solid #c1c1c1; 114 | margin: 0; 115 | padding: 10px 15px; 116 | } 117 | h2.resp-tab-active { 118 | border-bottom: 0 solid #c1c1c1 !important; 119 | margin-bottom: 0 !important; 120 | padding: 10px 15px !important; 121 | } 122 | h2.resp-tab-title:last-child { 123 | border-bottom: 12px solid #c1c1c1 !important; 124 | background: blue; 125 | } 126 | /*-----------Vertical tabs-----------*/ 127 | .resp-vtabs ul.resp-tabs-list { 128 | float: left; 129 | width: 15%; 130 | min-width: 150px; 131 | } 132 | .resp-vtabs .resp-tabs-list li { 133 | display: block; 134 | padding: 15px 15px !important; 135 | margin: 0 0 4px; 136 | cursor: pointer; 137 | float: none; 138 | } 139 | .resp-vtabs .resp-tabs-container { 140 | padding: 0; 141 | background-color: #fff; 142 | /*border: 1px solid #c1c1c1;*/ 143 | float: left; 144 | width: 83%; 145 | min-height: 460px; 146 | border-radius: 4px; 147 | clear: none; 148 | } 149 | .resp-vtabs .resp-tab-content { 150 | border: none; 151 | word-wrap: break-word; 152 | } 153 | .resp-vtabs li.resp-tab-active { 154 | position: relative; 155 | z-index: 1; 156 | margin-right: -1px !important; 157 | padding: 14px 15px 15px 14px !important; 158 | border-top: 1px solid; 159 | border: 1px solid #5AB1D0 !important; 160 | border-left: 4px solid #5AB1D0 !important; 161 | margin-bottom: 4px !important; 162 | border-right: 1px #FFF solid !important; 163 | } 164 | .resp-arrow { 165 | width: 0; 166 | height: 0; 167 | float: right; 168 | margin-top: 3px; 169 | border-left: 6px solid transparent; 170 | border-right: 6px solid transparent; 171 | border-top: 12px solid #c1c1c1; 172 | } 173 | h2.resp-tab-active span.resp-arrow { 174 | border: none; 175 | border-left: 6px solid transparent; 176 | border-right: 6px solid transparent; 177 | border-bottom: 12px solid #9B9797; 178 | } 179 | /*-----------Accordion styles-----------*/ 180 | h2.resp-tab-active { 181 | background: #DBDBDB; 182 | /* !important;*/ 183 | } 184 | .resp-easy-accordion h2.resp-accordion { 185 | display: block; 186 | } 187 | .resp-easy-accordion .resp-tab-content { 188 | border: 1px solid #c1c1c1; 189 | } 190 | .resp-easy-accordion .resp-tab-content:last-child { 191 | border-bottom: 1px solid #c1c1c1; 192 | /* !important;*/ 193 | } 194 | .resp-jfit { 195 | width: 100%; 196 | margin: 0; 197 | } 198 | .resp-tab-content-active { 199 | display: block; 200 | } 201 | h2.resp-accordion:first-child { 202 | border-top: 1px solid #c1c1c1; 203 | /* !important;*/ 204 | } 205 | /*Here your can change the breakpoint to set the accordion, when screen resolution changed*/ 206 | @media only screen and (max-width: 960px) { 207 | ul.resp-tabs-list { 208 | display: none; 209 | } 210 | h2.resp-accordion { 211 | display: block; 212 | } 213 | .resp-vtabs .resp-tab-content { 214 | border: 1px solid #C1C1C1; 215 | } 216 | .resp-vtabs .resp-tabs-container { 217 | border: none; 218 | float: none; 219 | width: 100%; 220 | min-height: 100px; 221 | clear: none; 222 | } 223 | .resp-accordion-closed { 224 | display: none !important; 225 | } 226 | .resp-vtabs .resp-tab-content:last-child { 227 | border-bottom: 1px solid #c1c1c1 !important; 228 | } 229 | } 230 | 231 | .chart-title-set{ 232 | width: 85%; 233 | margin: 0 auto; 234 | margin-top: 10px; 235 | position:relative; 236 | } 237 | 238 | .chart-title { 239 | display: inline; 240 | font-size: 35px; 241 | font-weight: 400; 242 | } 243 | 244 | .chart-sub-title { 245 | font-size: 25px; 246 | float: right; 247 | position: absolute; 248 | bottom: 0; 249 | right: 20px; 250 | } 251 | 252 | .info_block_container { 253 | width: 85%; 254 | margin: 0 auto; 255 | margin-top: 10px; 256 | margin-bottom: 200px; 257 | } 258 | 259 | .info_block_container:after { 260 | content: "."; 261 | display: block; 262 | height: 0; 263 | clear: both; 264 | visibility: hidden; 265 | } 266 | 267 | .info_block { 268 | display: inline; 269 | float: left; 270 | } 271 | 272 | .info { 273 | min-width: 65px; 274 | display: block; 275 | float: left; 276 | margin: 5px 30px; 277 | } 278 | 279 | .info-clear{ 280 | clear: both; 281 | } 282 | 283 | .info-label { 284 | color: #707070; 285 | font-size: 12px; 286 | display: block; 287 | } 288 | 289 | .info-content { 290 | font-size: 22px; 291 | font-weight: 500; 292 | display: block; 293 | } 294 | 295 | 296 | .info-inline { 297 | font-size: 12px; 298 | display: block; 299 | margin: 7px 10px; 300 | } 301 | 302 | .info-inline-label { 303 | width: 120px; 304 | color: #707070; 305 | display: inline-block; 306 | } 307 | 308 | .info-inline-content { 309 | display: inline; 310 | } 311 | -------------------------------------------------------------------------------- /static/js/common.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Holy Lance 3 | * https://github.com/lincanbin/Holy-Lance 4 | * 5 | * Copyright 2016 Canbin Lin (lincanbin@hotmail.com) 6 | * http://www.94cb.com/ 7 | * 8 | * Licensed under the MIT License: 9 | * https://opensource.org/licenses/MIT 10 | * 11 | * A Linux Resource / Performance Monitor based on PHP. 12 | */ 13 | var numberOfRecords = 360; // points 14 | var intervalTime = 3000; // ms 15 | var password = ''; 16 | 17 | function getCpuColumn(cpuNumber) { 18 | var start = Math.ceil(Math.sqrt(cpuNumber)); 19 | for (var i = start; i <= cpuNumber; i++) { 20 | if ((cpuNumber % i) === 0) { 21 | // console.log(Math.abs((cpuNumber / i) - i)); 22 | return i; 23 | } 24 | } 25 | } 26 | 27 | function cloneObject(obj) { 28 | var copy; 29 | // Handle the 3 simple types, and null or undefined 30 | if (null === obj || "object" != typeof obj) return obj; 31 | // Handle Date 32 | if (obj instanceof Date) { 33 | copy = new Date(); 34 | copy.setTime(obj.getTime()); 35 | return copy; 36 | } 37 | // Handle Array 38 | if (obj instanceof Array) { 39 | copy = []; 40 | for (var i = 0, len = obj.length; i < len; i++) { 41 | copy[i] = cloneObject(obj[i]); 42 | } 43 | return copy; 44 | } 45 | // Handle Object 46 | if (obj instanceof Object) { 47 | copy = {}; 48 | for (var attr in obj) { 49 | if (obj.hasOwnProperty(attr)) copy[attr] = cloneObject(obj[attr]); 50 | } 51 | return copy; 52 | } 53 | throw new Error("Unable to copy obj! Its type isn't supported."); 54 | } 55 | 56 | function listSort(arr, field, order){ 57 | var refer = [], result = [], index; 58 | order = order == 'asc' ? 'asc' : 'desc'; 59 | for(i = 0; i < arr.length; i++){ 60 | refer[i] = arr[i][field] + '|' + i; 61 | } 62 | refer = refer.sort(function(a, b) { 63 | return +/\d+/.exec(a)[0] - +/\d+/.exec(b)[0]; 64 | }); 65 | if(order=='desc') refer.reverse(); 66 | for(i = 0;i < refer.length;i++){ 67 | index = refer[i].split('|')[1]; 68 | result[i] = arr[index]; 69 | } 70 | return result; 71 | } 72 | 73 | function numberFormatter(number) { 74 | return number.toString().replace(/\d+?(?=(?:\d{3})+$)/img, "$& "); 75 | } 76 | 77 | function kibiBytesToSize(bytes) { 78 | if (bytes == 0) return '0 B'; 79 | var kibi = 1024, // or 1000 80 | sizes = ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'], 81 | i = Math.floor(Math.log(bytes) / Math.log(kibi)); 82 | sizes[-1] = 'B'; 83 | return (bytes / Math.pow(kibi, i)).toFixed(2) + ' ' + sizes[i]; 84 | } 85 | 86 | function resizeChart() { 87 | if ($("#cpu_usage").is(":visible")) { 88 | cpuUsageChart.setOption(cpuUsageChartoption); 89 | window.cpuUsageChart.resize(); 90 | } 91 | if ($("#logic_cpu_usage_container").is(":visible")) { 92 | for (var i = 0; i < window.env.cpu.length; i++) { 93 | window.logicCpuUsageChart[i].setOption(logicCpuUsageChartoption[i]); 94 | window.logicCpuUsageChart[i].resize(); 95 | } 96 | } 97 | if ($("#load_usage").is(":visible")) { 98 | loadUsageChart.setOption(loadUsageChartoption, true); 99 | window.loadUsageChart.resize(); 100 | } 101 | if ($("#memory_usage").is(":visible")) { 102 | memoryUsageChart.setOption(memoryUsageChartoption); 103 | window.memoryUsageChart.resize(); 104 | } 105 | if ($("#connection_usage").is(":visible")) { 106 | connectionUsageChart.setOption(connectionUsageChartoption); 107 | window.connectionUsageChart.resize(); 108 | } 109 | for (var offset in window.env.disk) { 110 | if ($("#disk_" + window.env.disk[offset] + "_speed").is(":visible")) { 111 | window.diskUsageChart[window.env.disk[offset]].setOption(diskUsageChartoption[window.env.disk[offset]]); 112 | window.diskUsageChart[window.env.disk[offset]].resize(); 113 | window.diskSpeedChart[window.env.disk[offset]].setOption(diskSpeedChartoption[window.env.disk[offset]]); 114 | window.diskSpeedChart[window.env.disk[offset]].resize(); 115 | } 116 | } 117 | for (var offset in window.env.network) { 118 | if ($("#network_" + window.env.network[offset] + "_usage").is(":visible")) { 119 | window.networkUsageChart[window.env.network[offset]].setOption(networkUsageChartoption[window.env.network[offset]]); 120 | window.networkUsageChart[window.env.network[offset]].resize(); 121 | } 122 | 123 | } 124 | 125 | 126 | } 127 | 128 | function init(data) { 129 | var cpuNumber = data.cpu.length; 130 | window.env = data; 131 | window.processSortedBy = 2; 132 | window.processOrder = 'desc'; 133 | // console.log(data); 134 | for (var offset in data.disk) { 135 | $("#PerformanceList").append('
  • 磁盘 ' + 136 | data.disk[offset] + 137 | '

  • '); 138 | $("#PerformanceContainer").append('

    磁盘 ' + 139 | data.disk[offset] + 140 | '

    ' + 141 | '
    ' + 142 | '
    ' + 143 | '
    ' + 144 | '
    ' + 145 | '
    ' + 146 | ' 活动时间' + 147 | ' 0 %' + 148 | '
    ' + 149 | '
    ' + 150 | ' 平均读取响应时间' + 151 | ' 0 毫秒' + 152 | '
    ' + 153 | '
    ' + 154 | ' 平均写入响应时间' + 155 | ' 0 毫秒' + 156 | '
    ' + 157 | '
    ' + 158 | '
    ' + 159 | ' 总读取字节' + 160 | ' 0 KiB' + 161 | '
    ' + 162 | '
    ' + 163 | ' 总写入字节' + 164 | ' 0 KiB' + 165 | '
    ' + 166 | '
    ' + 167 | '
    ' + 168 | ' 读取速度' + 169 | ' 0 KiB / 秒' + 170 | '
    ' + 171 | '
    ' + 172 | ' 写入速度' + 173 | ' 0 KiB / 秒' + 174 | '
    ' + 175 | '
    ' + 176 | '
    ' + 177 | '
    '); 178 | } 179 | 180 | for (var offset in data.network) { 181 | $("#PerformanceList").append('
  • 网卡 ' + 182 | data.network[offset] + 183 | '

  • '); 184 | var temp = '

    网卡 ' + 185 | data.network[offset] + 186 | '

    ' + 187 | '
    ' + 188 | '
    ' + 189 | '
    ' + 190 | '
    ' + 191 | ' 发送速率' + 192 | ' 0 KiB / 秒' + 193 | '
    ' + 194 | '
    ' + 195 | ' 接收速率' + 196 | ' 0 KiB / 秒' + 197 | '
    ' + 198 | '
    ' + 199 | '
    ' + 200 | ' 已发送字节' + 201 | ' 0 KiB' + 202 | '
    ' + 203 | '
    ' + 204 | ' 已接收字节' + 205 | ' 0 KiB' + 206 | '
    ' + 207 | '
    ' + 208 | '
    ' + 209 | ' 已发送包' + 210 | ' 0' + 211 | '
    ' + 212 | '
    ' + 213 | ' 已接收包' + 214 | ' 0' + 215 | '
    ' + 216 | '
    ' + 217 | '
    '; 218 | for (var offset2 in data.network_info[data.network[offset]].ip) { 219 | var ip = data.network_info[data.network[offset]].ip[offset2]; 220 | var ip_version = ip.indexOf(":") !== -1 ? "6" : "4"; 221 | temp += '' + 222 | '
    ' + 223 | ' IPV' + ip_version + ' 地址:' + 224 | ' ' + ip + '' + 225 | '
    '; 226 | } 227 | temp += '' + 228 | '
    ' + 229 | '
    ' + 230 | '
    '; 231 | $("#PerformanceContainer").append(temp); 232 | 233 | // 逻辑处理器 234 | var cpu_column = getCpuColumn(cpuNumber); 235 | var logic_cpu_width = Math.floor(100 / cpu_column); 236 | var logic_cpu_height = Math.floor(640 / (cpuNumber / cpu_column)); 237 | temp = ''; 238 | for (var i = 0; i < cpuNumber; i++) { 239 | temp += '
    '; 240 | } 241 | $("#logic_cpu_usage_container").html(temp); 242 | } 243 | 244 | $('#MainTab').easyResponsiveTabs({ 245 | type: 'default', //Types: default, vertical, accordion 246 | width: 'auto', //auto or any width like 600px 247 | fit: true, // 100% fit in a container 248 | closed: 'accordion', // Start closed if in accordion view 249 | tabidentify: 'main', // The tab groups identifier 250 | inactive_bg: '#F5F5F5', // background color for inactive 251 | activate: function() { 252 | resizeChart(); 253 | } 254 | }); 255 | 256 | $('#PerformanceTab').easyResponsiveTabs({ 257 | type: 'vertical', 258 | width: 'auto', 259 | fit: true, 260 | tabidentify: 'performance', // The tab groups identifier 261 | // activetab_bg: '#FFFFFF', // background color for active tabs in this group 262 | // inactive_bg: '#F5F5F5', // background color for inactive tabs in this group 263 | // active_border_color: '#C1C1C1', // border color for active tabs heads in this group 264 | // active_content_border_color: '#5AB1D0', // border color for active tabs contect in this group so that it matches the tab head border 265 | activate: function() { 266 | resizeChart(); 267 | } // Callback function, gets called if tab is switched 268 | }); 269 | $('#system_name').text(data.system_name); 270 | $('#cpu_model_name').text(data.cpu_info.cpu_name); 271 | $('#logic_cpu_model_name').text(data.cpu_info.cpu_name); 272 | $('#total_memory').text(kibiBytesToSize(data.memory.MemTotal)); 273 | $('#cpu_max_frequency').text((data.cpu_info.cpu_frequency / 1000).toFixed(2) + " GHz"); 274 | $('#cpu_frequency').text((data.cpu_info.cpu_frequency / 1000).toFixed(2) + " GHz"); 275 | $('#cpu_num').text(data.cpu_info.cpu_num); 276 | $('#cpu_processor_num').text(numberFormatter(data.cpu_info.cpu_processor_num)); 277 | $('#cpu_core_num').text(data.cpu_info.cpu_core_num); 278 | $('#cpu_cache_size').text(kibiBytesToSize(parseInt(data.cpu[0].cache_size.replace("KB", "").replace(" ", "")))); 279 | 280 | window.cpuUsageChart = echarts.init(document.getElementById('cpu_usage')); 281 | window.cpuUsageChartoption = { 282 | title: {}, 283 | tooltip: { 284 | trigger: 'axis' 285 | }, 286 | xAxis: { 287 | data: (function (){ 288 | var res = []; 289 | var len = 1; 290 | while (len <= numberOfRecords) { 291 | res.push((new Date()).toLocaleTimeString().replace(/^\D*/,'')); 292 | len++; 293 | } 294 | return res; 295 | })() 296 | }, 297 | yAxis: { 298 | type: 'value', 299 | name: 'CPU利用率 %', 300 | splitLine: { 301 | show: true 302 | }, 303 | max: 100, 304 | min: 0 305 | }, 306 | color: ['#117DBB'], 307 | series: [ 308 | { 309 | name:'CPU Usage', 310 | type:'line', 311 | areaStyle: {normal: {}}, 312 | data:(function (){ 313 | var res = []; 314 | var len = 1; 315 | while (len <= numberOfRecords) { 316 | res.push(0); 317 | len++; 318 | } 319 | return res; 320 | })() 321 | } 322 | ] 323 | }; 324 | 325 | window.loadUsageChart = echarts.init(document.getElementById('load_usage')); 326 | window.loadUsageChartoption = { 327 | series : [ 328 | { 329 | name: '1分钟平均负载', 330 | type: 'gauge', 331 | z: 3, 332 | min: 0, 333 | max: cpuNumber, 334 | splitNumber: 10, 335 | radius: '70%', 336 | axisLine: { // 坐标轴线 337 | lineStyle: { // 属性lineStyle控制线条样式 338 | width: 10 339 | } 340 | }, 341 | axisTick: { // 坐标轴小标记 342 | length: 15, // 属性length控制线长 343 | lineStyle: { // 属性lineStyle控制线条样式 344 | color: 'auto' 345 | } 346 | }, 347 | splitLine: { // 分隔线 348 | length: 20, // 属性length控制线长 349 | lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 350 | color: 'auto' 351 | } 352 | }, 353 | title : { 354 | textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE 355 | fontWeight: 'bolder', 356 | fontSize: 20, 357 | fontStyle: 'italic' 358 | } 359 | }, 360 | detail : { 361 | textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE 362 | fontWeight: 'bolder' 363 | } 364 | }, 365 | data:[{value: 0, name: '1分钟平均负载'}] 366 | }, 367 | { 368 | name: '5分钟平均负载', 369 | type: 'gauge', 370 | center: ['20%', '55%'], // 默认全局居中 371 | radius: '55%', 372 | min:0, 373 | max:cpuNumber, 374 | endAngle:45, 375 | splitNumber:10, 376 | axisLine: { // 坐标轴线 377 | lineStyle: { // 属性lineStyle控制线条样式 378 | width: 8 379 | } 380 | }, 381 | axisTick: { // 坐标轴小标记 382 | length:12, // 属性length控制线长 383 | lineStyle: { // 属性lineStyle控制线条样式 384 | color: 'auto' 385 | } 386 | }, 387 | splitLine: { // 分隔线 388 | length:20, // 属性length控制线长 389 | lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 390 | color: 'auto' 391 | } 392 | }, 393 | pointer: { 394 | width:5 395 | }, 396 | title: { 397 | offsetCenter: [0, '-30%'], // x, y,单位px 398 | }, 399 | detail: { 400 | textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE 401 | fontWeight: 'bolder' 402 | } 403 | }, 404 | data:[{value: 0, name: '5分钟平均负载'}] 405 | }, 406 | { 407 | name: '15分钟平均负载', 408 | type: 'gauge', 409 | center: ['80%', '55%'], // 默认全局居中 410 | radius: '55%', 411 | min: 0, 412 | max: cpuNumber, 413 | startAngle: 135, 414 | endAngle: -45, 415 | splitNumber: 10, 416 | axisLine: { // 坐标轴线 417 | lineStyle: { // 属性lineStyle控制线条样式 418 | width: 8 419 | } 420 | }, 421 | axisTick: { // 坐标轴小标记 422 | length:12, // 属性length控制线长 423 | lineStyle: { // 属性lineStyle控制线条样式 424 | color: 'auto' 425 | } 426 | }, 427 | splitLine: { // 分隔线 428 | length:20, // 属性length控制线长 429 | lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 430 | color: 'auto' 431 | } 432 | }, 433 | pointer: { 434 | width:5 435 | }, 436 | title: { 437 | offsetCenter: [0, '-30%'], // x, y,单位px 438 | }, 439 | detail: { 440 | textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE 441 | fontWeight: 'bolder' 442 | } 443 | }, 444 | data:[{value: 0, name: '15分钟平均负载'}] 445 | } 446 | ] 447 | }; 448 | 449 | window.logicCpuUsageChart = []; 450 | window.logicCpuUsageChartoption = []; 451 | for (var i = 0; i < cpuNumber; i++) { 452 | window.logicCpuUsageChart[i] = echarts.init(document.getElementById('logic_cpu_' + i + '_usage')); 453 | window.logicCpuUsageChartoption[i] = cloneObject(window.cpuUsageChartoption); 454 | logicCpuUsageChartoption[i].grid = { 455 | show: true, 456 | borderColor: '#117DBB', 457 | borderWidth: 1, 458 | left: 3, 459 | top: 3, 460 | right: 3, 461 | bottom: 3 462 | }; 463 | logicCpuUsageChartoption[i].xAxis.show = false; 464 | logicCpuUsageChartoption[i].yAxis.axisLabel = { 465 | show: false 466 | }; 467 | logicCpuUsageChartoption[i].yAxis.name = 'CPU' + i + ' 利用率 %'; 468 | logicCpuUsageChartoption[i].series[0].name = 'CPU' + i + ' Usage'; 469 | } 470 | window.memoryUsageChart = echarts.init(document.getElementById('memory_usage')); 471 | window.memoryUsageChartoption = cloneObject(window.cpuUsageChartoption); 472 | memoryUsageChartoption.yAxis.name = '内存使用量 MiB'; 473 | memoryUsageChartoption.color = ['#8B12AE']; 474 | memoryUsageChartoption.series[0].name = 'Memory Usage'; 475 | 476 | window.connectionUsageChart = echarts.init(document.getElementById('connection_usage')); 477 | window.connectionUsageChartoption = cloneObject(window.cpuUsageChartoption); 478 | connectionUsageChartoption.yAxis.name = '连接数'; 479 | connectionUsageChartoption.color = [ 480 | '#F44336', 481 | '#9C27B0', 482 | '#673AB7', 483 | '#2196F3', 484 | '#03A9F4', 485 | '#009688', 486 | '#4CAF50', 487 | '#CDDC39', 488 | '#FFEB3B', 489 | '#FF9800', 490 | '#FF5722', 491 | '#9E9E9E' 492 | ]; 493 | connectionUsageChartoption.yAxis.max = null; 494 | connectionUsageChartoption.legend = { 495 | data: [ 496 | 'ESTABLISHED', 497 | 'SYN_SENT', 498 | 'SYN_RECV', 499 | 'FIN_WAIT1', 500 | 'FIN_WAIT2', 501 | 'TIME_WAIT', 502 | 'CLOSE', 503 | 'CLOSE_WAIT', 504 | 'LAST_ACK', 505 | 'LISTEN', 506 | 'CLOSING', 507 | 'UNKNOWN' 508 | ] 509 | }; 510 | connectionUsageChartoption.series[0].name = 'ESTABLISHED'; 511 | connectionUsageChartoption.series[0].stack = 'AllConnection'; 512 | connectionUsageChartoption.series[1] = cloneObject(connectionUsageChartoption.series[0]); 513 | connectionUsageChartoption.series[1].name = 'SYN_SENT'; 514 | connectionUsageChartoption.series[2] = cloneObject(connectionUsageChartoption.series[0]); 515 | connectionUsageChartoption.series[2].name = 'SYN_RECV'; 516 | connectionUsageChartoption.series[3] = cloneObject(connectionUsageChartoption.series[0]); 517 | connectionUsageChartoption.series[3].name = 'FIN_WAIT1'; 518 | connectionUsageChartoption.series[4] = cloneObject(connectionUsageChartoption.series[0]); 519 | connectionUsageChartoption.series[4].name = 'FIN_WAIT2'; 520 | connectionUsageChartoption.series[5] = cloneObject(connectionUsageChartoption.series[0]); 521 | connectionUsageChartoption.series[5].name = 'TIME_WAIT'; 522 | connectionUsageChartoption.series[6] = cloneObject(connectionUsageChartoption.series[0]); 523 | connectionUsageChartoption.series[6].name = 'CLOSE'; 524 | connectionUsageChartoption.series[7] = cloneObject(connectionUsageChartoption.series[0]); 525 | connectionUsageChartoption.series[7].name = 'CLOSE_WAIT'; 526 | connectionUsageChartoption.series[8] = cloneObject(connectionUsageChartoption.series[0]); 527 | connectionUsageChartoption.series[8].name = 'LAST_ACK'; 528 | connectionUsageChartoption.series[9] = cloneObject(connectionUsageChartoption.series[0]); 529 | connectionUsageChartoption.series[9].name = 'LISTEN'; 530 | connectionUsageChartoption.series[10] = cloneObject(connectionUsageChartoption.series[0]); 531 | connectionUsageChartoption.series[10].name = 'CLOSING'; 532 | connectionUsageChartoption.series[11] = cloneObject(connectionUsageChartoption.series[0]); 533 | connectionUsageChartoption.series[11].name = 'UNKNOWN'; 534 | 535 | window.diskUsageChart = []; 536 | window.diskUsageChartoption = []; 537 | window.diskSpeedChart = []; 538 | window.diskSpeedChartoption = []; 539 | for (var offset in data.disk) { 540 | window.diskUsageChart[data.disk[offset]] = echarts.init(document.getElementById('disk_' + data.disk[offset] + '_usage')); 541 | window.diskUsageChartoption[data.disk[offset]] = cloneObject(window.cpuUsageChartoption); 542 | diskUsageChartoption[data.disk[offset]].yAxis.name = '活动时间 %'; 543 | diskUsageChartoption[data.disk[offset]].color = ['#4DA60C']; 544 | diskUsageChartoption[data.disk[offset]].series[0].name = 'Disk Usage'; 545 | 546 | window.diskSpeedChart[data.disk[offset]] = echarts.init(document.getElementById('disk_' + data.disk[offset] + '_speed')); 547 | window.diskSpeedChartoption[data.disk[offset]] = cloneObject(window.cpuUsageChartoption); 548 | diskSpeedChartoption[data.disk[offset]].yAxis.name = '磁盘传输速率 read(+) / write(-) KiB/s'; 549 | diskSpeedChartoption[data.disk[offset]].yAxis.max = null; 550 | diskSpeedChartoption[data.disk[offset]].yAxis.min = null; 551 | diskSpeedChartoption[data.disk[offset]].color = ['#4DA60C']; 552 | diskSpeedChartoption[data.disk[offset]].series[0].name = '磁盘读取速率'; 553 | diskSpeedChartoption[data.disk[offset]].series[1] = cloneObject(diskSpeedChartoption[data.disk[offset]].series[0]); 554 | diskSpeedChartoption[data.disk[offset]].series[1].name = '磁盘写入速率'; 555 | } 556 | window.networkUsageChart = []; 557 | window.networkUsageChartoption = []; 558 | for (var offset in data.network) { 559 | window.networkUsageChart[data.network[offset]] = echarts.init(document.getElementById('network_' + data.network[offset] + '_usage')); 560 | window.networkUsageChartoption[data.network[offset]] = cloneObject(window.cpuUsageChartoption); 561 | networkUsageChartoption[data.network[offset]].yAxis.name = '吞吐量 out(+) / in(-) KiB/s'; 562 | networkUsageChartoption[data.network[offset]].yAxis.max = null; 563 | networkUsageChartoption[data.network[offset]].yAxis.min = null; 564 | networkUsageChartoption[data.network[offset]].color = ['#A74F01']; 565 | networkUsageChartoption[data.network[offset]].series[0].name = '上行速率'; 566 | networkUsageChartoption[data.network[offset]].series[1] = cloneObject(networkUsageChartoption[data.network[offset]].series[0]); 567 | networkUsageChartoption[data.network[offset]].series[0].name = '下行速率'; 568 | } 569 | 570 | refreshChart(); 571 | } 572 | 573 | function drawProcessTable(processData, formatData) { 574 | // Process if ($("#cpu_usage").is(":visible")) { 575 | $("#Process").empty(); 576 | processData = listSort(processData, window.processSortedBy, window.processOrder); 577 | if (formatData) { 578 | for (var key in processData) { 579 | processData[key][2] = processData[key][2] + "%"; 580 | processData[key][3] = processData[key][3] + "%"; 581 | processData[key][4] = kibiBytesToSize(processData[key][4]); 582 | processData[key][5] = kibiBytesToSize(processData[key][5]); 583 | processData[key][6] = processData[key][6].replace("?", "").replace("tty", "终端"); 584 | processData[key][7] = processData[key][7].split(""); 585 | var tempState = processData[key][7]; 586 | var tempStateList = []; 587 | var stateDict = { 588 | "D": "正在等待磁盘", 589 | "R": "正在运行", 590 | "S": "处于休眠状态", 591 | "T": "正在被跟踪或被停止", 592 | "W": "进入内存交换", 593 | "X": "进程已退出", 594 | "Z": "僵进程", // 进程已终止, 但进程描述符存在 595 | "<": "高优先级", 596 | "N": "低优先级", 597 | "L": "有些页面被锁在内存中", 598 | "s": "主进程", 599 | "l": "多线程进程", 600 | "+": "前台进程" 601 | }; 602 | for (var i = 0; i < tempState.length; i++) { 603 | tempStateList.push(stateDict[tempState[i]]); 604 | } 605 | processData[key][7] = tempStateList.join("
    "); 606 | } 607 | } 608 | processData.unshift([ 609 | "用户", 610 | "进程ID", 611 | "CPU", 612 | "内存", 613 | "虚拟内存", 614 | "常驻内存", 615 | "终端位置", 616 | "状态", 617 | "启动时间", 618 | "使用的CPU时间", 619 | "命令" 620 | ]); 621 | $.jsontotable(processData, { id: '#Process', header: true }); 622 | $("th").each(function(key){ 623 | $(this).attr("data-code", key); 624 | }); 625 | $("th").bind("click", function() { 626 | var tempProcessSortedBy = $(this).attr("data-code"); 627 | if (tempProcessSortedBy == window.processSortedBy) { 628 | window.processOrder = window.processOrder == "desc" ? "asc" : "desc"; 629 | } else { 630 | window.processSortedBy = tempProcessSortedBy; 631 | window.processOrder = "desc"; 632 | } 633 | processData.shift(); 634 | $("th").unbind("click"); 635 | drawProcessTable(processData ,false); 636 | }); 637 | $("th:eq(" + window.processSortedBy + ")").attr("class", "selected-col-" + window.processOrder); 638 | } 639 | 640 | 641 | function drawDiskFreeTable(diskFreeData) { 642 | // Process if ($("#cpu_usage").is(":visible")) { 643 | $("#DiskFree").empty(); 644 | for (var key in diskFreeData) { 645 | diskFreeData[key][2] = kibiBytesToSize(diskFreeData[key][2]); 646 | diskFreeData[key][3] = kibiBytesToSize(diskFreeData[key][3]); 647 | diskFreeData[key][4] = kibiBytesToSize(diskFreeData[key][4]); 648 | } 649 | diskFreeData.unshift([ 650 | "文件系统", 651 | "类型", 652 | "容量", 653 | "已用", 654 | "可用", 655 | "使用率", 656 | "挂载点" 657 | ]); 658 | $.jsontotable(diskFreeData, { id: '#DiskFree', header: true }); 659 | } 660 | 661 | function drawChart(data) { 662 | $("#cpu_usage_info").text(data.cpu_usage + "%"); 663 | $("#process_number").text(data.process_number); 664 | $("#uptime").text(data.uptime); 665 | 666 | $('#logic_cpu_usage_label').text(data.logic_cpu_usage.slice(0, Math.min(data.logic_cpu_usage.length, 4)).join('% ') + '%' + (data.logic_cpu_usage.length > 4 ? ' ……' : '')); 667 | 668 | $("#memory_usage_used").text(kibiBytesToSize(data.memory_usage_used)); 669 | $("#memory_usage_available").text(kibiBytesToSize(parseInt(data.memory_usage_total) - parseInt(data.memory_usage_used))); 670 | 671 | $("#memory_usage_swap_used").text(kibiBytesToSize(data.memory_usage_swap_used)); 672 | $("#memory_usage_swap_free").text(kibiBytesToSize(data.memory_usage_swap_free)); 673 | 674 | $("#memory_submit").text(kibiBytesToSize(parseInt(data.memory_usage_used) + parseInt(data.memory_usage_swap_used)) + " / " + kibiBytesToSize(parseInt(data.memory_usage_total) + parseInt(data.memory_usage_swap_total))); 675 | $("#memory_usage_cache").text(kibiBytesToSize(data.memory_usage_cache)); 676 | 677 | axisData = (new Date()).toLocaleTimeString().replace(/^\D*/,''); 678 | // CPU 679 | $("#cpu_usage_label").text(data.cpu_usage + "%"); 680 | cpuUsageChartoption.series[0].data.shift(); 681 | cpuUsageChartoption.series[0].data.push(data.cpu_usage); 682 | cpuUsageChartoption.xAxis.data.shift(); 683 | cpuUsageChartoption.xAxis.data.push(axisData); 684 | if ($("#cpu_usage").is(":visible")) { 685 | cpuUsageChart.setOption(cpuUsageChartoption); 686 | } 687 | // Logic CPU 688 | for (var i = 0; i < window.env.cpu.length; i++) { 689 | logicCpuUsageChartoption[i].series[0].data.shift(); 690 | logicCpuUsageChartoption[i].series[0].data.push(data.logic_cpu_usage[i]); 691 | logicCpuUsageChartoption[i].xAxis.data.shift(); 692 | logicCpuUsageChartoption[i].xAxis.data.push(axisData); 693 | if ($("#logic_cpu_usage_container").is(":visible")) { 694 | window.logicCpuUsageChart[i].setOption(logicCpuUsageChartoption[i]); 695 | } 696 | } 697 | // Load 698 | $("#load_usage_label").text(data.load[0]); 699 | loadUsageChartoption.series[0].data[0].value = data.load[0]; 700 | loadUsageChartoption.series[1].data[0].value = data.load[1]; 701 | loadUsageChartoption.series[2].data[0].value = data.load[2]; 702 | if ($("#load_usage").is(":visible")) { 703 | loadUsageChart.setOption(loadUsageChartoption, true); 704 | } 705 | // Memory 706 | $("#memory_usage_label").text(kibiBytesToSize(data.memory_usage_used) + " / " + kibiBytesToSize(data.memory_usage_total) + " (" + Math.round(data.memory_usage_used * 100 / data.memory_usage_total) + "%)"); 707 | memoryUsageChartoption.yAxis.max = Math.round(data.memory_usage_total / 1024); 708 | memoryUsageChartoption.series[0].data.shift(); 709 | memoryUsageChartoption.series[0].data.push(Math.round(data.memory_usage_used / 1024)); 710 | memoryUsageChartoption.xAxis.data.shift(); 711 | memoryUsageChartoption.xAxis.data.push(axisData); 712 | if ($("#memory_usage").is(":visible")) { 713 | memoryUsageChart.setOption(memoryUsageChartoption); 714 | } 715 | // Connection 716 | connectionUsageChartoption.series[0].data.shift(); 717 | connectionUsageChartoption.series[0].data.push(data.connection.ESTABLISHED); 718 | $('#connection_ESTABLISHED_usage_info').text(data.connection.ESTABLISHED); 719 | connectionUsageChartoption.series[1].data.shift(); 720 | connectionUsageChartoption.series[1].data.push(data.connection.SYN_SENT); 721 | $('#connection_SYN_SENT_usage_info').text(data.connection.SYN_SENT); 722 | connectionUsageChartoption.series[2].data.shift(); 723 | connectionUsageChartoption.series[2].data.push(data.connection.SYN_RECV); 724 | $('#connection_SYN_RECV_usage_info').text(data.connection.SYN_RECV); 725 | connectionUsageChartoption.series[3].data.shift(); 726 | connectionUsageChartoption.series[3].data.push(data.connection.FIN_WAIT1); 727 | $('#connection_FIN_WAIT1_usage_info').text(data.connection.FIN_WAIT1); 728 | connectionUsageChartoption.series[4].data.shift(); 729 | connectionUsageChartoption.series[4].data.push(data.connection.FIN_WAIT2); 730 | $('#connection_FIN_WAIT2_usage_info').text(data.connection.FIN_WAIT2); 731 | connectionUsageChartoption.series[5].data.shift(); 732 | connectionUsageChartoption.series[5].data.push(data.connection.TIME_WAIT); 733 | $('#connection_TIME_WAIT_usage_info').text(data.connection.TIME_WAIT); 734 | connectionUsageChartoption.series[6].data.shift(); 735 | connectionUsageChartoption.series[6].data.push(data.connection.CLOSE); 736 | $('#connection_CLOSE_usage_info').text(data.connection.CLOSE); 737 | connectionUsageChartoption.series[7].data.shift(); 738 | connectionUsageChartoption.series[7].data.push(data.connection.CLOSE_WAIT); 739 | $('#connection_CLOSE_WAIT_usage_info').text(data.connection.CLOSE_WAIT); 740 | connectionUsageChartoption.series[8].data.shift(); 741 | connectionUsageChartoption.series[8].data.push(data.connection.LAST_ACK); 742 | $('#connection_LAST_ACK_usage_info').text(data.connection.LAST_ACK); 743 | connectionUsageChartoption.series[9].data.shift(); 744 | connectionUsageChartoption.series[9].data.push(data.connection.LISTEN); 745 | $('#connection_LISTEN_usage_info').text(data.connection.LISTEN); 746 | connectionUsageChartoption.series[10].data.shift(); 747 | connectionUsageChartoption.series[10].data.push(data.connection.CLOSING); 748 | $('#connection_CLOSING_usage_info').text(data.connection.CLOSING); 749 | connectionUsageChartoption.series[11].data.shift(); 750 | connectionUsageChartoption.series[11].data.push(data.connection.UNKNOWN); 751 | $('#connection_UNKNOWN_usage_info').text(data.connection.UNKNOWN); 752 | connectionUsageChartoption.xAxis.data.shift(); 753 | connectionUsageChartoption.xAxis.data.push(axisData); 754 | if ($("#connection_usage").is(":visible")) { 755 | connectionUsageChart.setOption(connectionUsageChartoption); 756 | } 757 | $('#connection_usage_label').text( 758 | data.connection.ESTABLISHED + 759 | data.connection.SYN_SENT + 760 | data.connection.SYN_RECV + 761 | data.connection.FIN_WAIT1 + 762 | data.connection.FIN_WAIT2 + 763 | data.connection.TIME_WAIT + 764 | data.connection.CLOSE + 765 | data.connection.CLOSE_WAIT + 766 | data.connection.LAST_ACK + 767 | data.connection.LISTEN + 768 | data.connection.CLOSING + 769 | data.connection.UNKNOWN 770 | ); 771 | // Disk 772 | for (var offset in window.env.disk) { 773 | // console.log(window.env.disk[offset]); 774 | // console.log(data.disk[window.env.disk[offset]]); 775 | // Disk Usage 776 | var disk_usage_percent = Math.min((data.disk[window.env.disk[offset]].disk_read_active_time + data.disk[window.env.disk[offset]].disk_write_active_time) / 10, 100); 777 | $("#disk_" + window.env.disk[offset] + "_usage_label").text(disk_usage_percent + "%"); 778 | $("#disk_" + window.env.disk[offset] + "_usage_info").text(disk_usage_percent + "%"); 779 | $("#disk_" + window.env.disk[offset] + "_read_active_time").text(data.disk[window.env.disk[offset]].disk_read_active_time + " 毫秒"); 780 | $("#disk_" + window.env.disk[offset] + "_write_active_time").text(data.disk[window.env.disk[offset]].disk_write_active_time + " 毫秒"); 781 | $("#disk_" + window.env.disk[offset] + "_read_speed").text(kibiBytesToSize(data.disk[window.env.disk[offset]].disk_read_speed) + " / 秒"); 782 | $("#disk_" + window.env.disk[offset] + "_write_speed").text(kibiBytesToSize(data.disk[window.env.disk[offset]].disk_write_speed) + " / 秒"); 783 | $("#disk_" + window.env.disk[offset] + "_read_kibibytes").text(kibiBytesToSize(data.disk[window.env.disk[offset]].disk_read_kibibytes)); 784 | $("#disk_" + window.env.disk[offset] + "_write_kibibytes").text(kibiBytesToSize(data.disk[window.env.disk[offset]].disk_write_kibibytes)); 785 | diskUsageChartoption[window.env.disk[offset]].series[0].data.shift(); 786 | diskUsageChartoption[window.env.disk[offset]].series[0].data.push(disk_usage_percent); 787 | diskUsageChartoption[window.env.disk[offset]].xAxis.data.shift(); 788 | diskUsageChartoption[window.env.disk[offset]].xAxis.data.push(axisData); 789 | if ($("#disk_" + window.env.disk[offset] + "_usage").is(":visible")) { 790 | window.diskUsageChart[window.env.disk[offset]].setOption(diskUsageChartoption[window.env.disk[offset]]); 791 | } 792 | // console.log(window.diskUsageChart[window.env.disk[offset]].isDisposed); 793 | // Disk Speed 794 | diskSpeedChartoption[window.env.disk[offset]].series[0].data.shift(); 795 | diskSpeedChartoption[window.env.disk[offset]].series[0].data.push(data.disk[window.env.disk[offset]].disk_read_speed); 796 | diskSpeedChartoption[window.env.disk[offset]].series[1].data.shift(); 797 | diskSpeedChartoption[window.env.disk[offset]].series[1].data.push(-data.disk[window.env.disk[offset]].disk_write_speed); 798 | diskSpeedChartoption[window.env.disk[offset]].xAxis.data.shift(); 799 | diskSpeedChartoption[window.env.disk[offset]].xAxis.data.push(axisData); 800 | if ($("#disk_" + window.env.disk[offset] + "_speed").is(":visible")) { 801 | window.diskSpeedChart[window.env.disk[offset]].setOption(diskSpeedChartoption[window.env.disk[offset]]); 802 | } 803 | } 804 | // Network 805 | for (var eth in window.env.network) { 806 | $("#network_" + window.env.network[eth] + "_usage_label").text("发送:" + kibiBytesToSize(data.network[window.env.network[eth]].transmit_speed / 1024) + "/s 接收:" + kibiBytesToSize(data.network[window.env.network[eth]].receive_speed / 1024) + "/s"); 807 | // networkUsageChartoption[window.env.network[eth]].yAxis.max = Math.max(data.network[window.env.network[eth]].transmit_speed, data.network[window.env.network[eth]].receive_speed / 1024); 808 | $("#eth_" + window.env.network[eth] + "_receive_bytes").text(kibiBytesToSize(data.network[window.env.network[eth]].receive_bytes / 1024)); 809 | $("#eth_" + window.env.network[eth] + "_receive_packets").text(numberFormatter(data.network[window.env.network[eth]].receive_packets)); 810 | $("#eth_" + window.env.network[eth] + "_receive_speed").text(kibiBytesToSize(data.network[window.env.network[eth]].receive_speed / 1024) + " / 秒"); 811 | $("#eth_" + window.env.network[eth] + "_transmit_bytes").text(kibiBytesToSize(data.network[window.env.network[eth]].transmit_bytes / 1024)); 812 | $("#eth_" + window.env.network[eth] + "_transmit_packets").text(numberFormatter(data.network[window.env.network[eth]].transmit_packets)); 813 | $("#eth_" + window.env.network[eth] + "_transmit_speed").text(kibiBytesToSize(data.network[window.env.network[eth]].transmit_speed / 1024) + " / 秒"); 814 | 815 | networkUsageChartoption[window.env.network[eth]].series[0].data.shift(); 816 | networkUsageChartoption[window.env.network[eth]].series[0].data.push(-Math.round(data.network[window.env.network[eth]].receive_speed / 1024)); 817 | networkUsageChartoption[window.env.network[eth]].series[1].data.shift(); 818 | networkUsageChartoption[window.env.network[eth]].series[1].data.push(Math.round(data.network[window.env.network[eth]].transmit_speed / 1024)); 819 | networkUsageChartoption[window.env.network[eth]].xAxis.data.shift(); 820 | networkUsageChartoption[window.env.network[eth]].xAxis.data.push(axisData); 821 | if ($("#network_" + window.env.network[eth] + "_usage").is(":visible")) { 822 | window.networkUsageChart[window.env.network[eth]].setOption(networkUsageChartoption[window.env.network[eth]]); 823 | } 824 | } 825 | // Process 826 | if ($("#Process").is(":visible") || $("#Process").children().length === 0) { 827 | drawProcessTable(data.process, true); 828 | } 829 | // DiskFree 830 | if ($("#DiskFree").is(":visible") || $("#DiskFree").children().length === 0) { 831 | drawDiskFreeTable(data.disk_free); 832 | } 833 | } 834 | function refreshChart() { 835 | $.ajax({ 836 | type: "POST", 837 | url: "api.php", 838 | data: { 839 | password: password 840 | }, 841 | dataType: "json", 842 | success: function(data){ 843 | drawChart(data); 844 | // Callback 845 | setTimeout(function(){refreshChart();}, intervalTime); 846 | }, 847 | error: function (data, e) { 848 | // Callback 849 | setTimeout(function(){refreshChart();}, intervalTime); 850 | } 851 | }); 852 | } 853 | 854 | function diskTest() { 855 | $("#disk_read_512k").text('…'); 856 | $("#disk_write_512k").text('…'); 857 | $("#disk_read_4k").text('…'); 858 | $("#disk_write_4k").text('…'); 859 | $.ajax({ 860 | type: "POST", 861 | url: "test_disk.php", 862 | data: {password: password}, 863 | dataType: "json", 864 | success: function(data){ 865 | $("#disk_read_512k").text(data.result.disk_read_512k); 866 | $("#disk_write_512k").text(data.result.disk_write_512k); 867 | $("#disk_read_4k").text(data.result.disk_read_4k); 868 | $("#disk_write_4k").text(data.result.disk_write_4k); 869 | } 870 | }); 871 | } 872 | 873 | function pingTest(_this, ip, port) { 874 | port = (typeof port === 'undefined') ? 80 : port; 875 | _this.textContent="…"; 876 | $.ajax({ 877 | type: "POST", 878 | url: "test_ping.php", 879 | data: {password: password, ip: ip, port: port}, 880 | dataType: "json", 881 | success: function(data){ 882 | _this.textContent=data.result; 883 | } 884 | }); 885 | } 886 | 887 | function pingPi(_this, accuracy) { 888 | _this.textContent="…"; 889 | $.ajax({ 890 | type: "POST", 891 | url: "test_pi.php", 892 | data: {password: password, accuracy:accuracy}, 893 | dataType: "json", 894 | success: function(data){ 895 | _this.textContent=data.time; 896 | } 897 | }); 898 | } 899 | 900 | $(document).ready(function () { 901 | if (passwordRequired) { 902 | password = prompt("请输入Holy Lance的密码",""); 903 | if (password !== null){ 904 | //TODO 校验密码操作 905 | }else{ 906 | alert("未输入密码"); 907 | } 908 | } 909 | if (passwordRequired === false || password !== ''){ 910 | var postData = password === '' ? {} : {password: password}; 911 | $.ajax({ 912 | type: "POST", 913 | url: "init.php", 914 | data: postData, 915 | dataType: "json", 916 | success: function(data){ 917 | if (data.status) { 918 | $('body').show(); 919 | init(data); 920 | } else { 921 | alert('密码错误'); 922 | } 923 | } 924 | }); 925 | } 926 | }); -------------------------------------------------------------------------------- /static/js/easyResponsiveTabs.js: -------------------------------------------------------------------------------- 1 | // Easy Responsive Tabs Plugin 2 | // Author: Samson.Onna 3 | 4 | (function ($) { 5 | $.fn.extend({ 6 | easyResponsiveTabs: function (options) { 7 | //Set the default values, use comma to separate the settings, example: 8 | var defaults = { 9 | type: 'default', //default, vertical, accordion; 10 | width: 'auto', 11 | fit: true, 12 | closed: false, 13 | tabidentify: '', 14 | activetab_bg: 'white', 15 | inactive_bg: '#F5F5F5', 16 | active_border_color: '#c1c1c1', 17 | active_content_border_color: '#c1c1c1', 18 | activate: function () { 19 | } 20 | } 21 | //Variables 22 | var options = $.extend(defaults, options); 23 | var opt = options, jtype = opt.type, jfit = opt.fit, jwidth = opt.width, vtabs = 'vertical', accord = 'accordion'; 24 | var hash = window.location.hash; 25 | var historyApi = !!(window.history && history.replaceState); 26 | 27 | //Events 28 | $(this).bind('tabactivate', function (e, currentTab) { 29 | if (typeof options.activate === 'function') { 30 | options.activate.call(currentTab, e) 31 | } 32 | }); 33 | 34 | //Main function 35 | this.each(function () { 36 | var $respTabs = $(this); 37 | var $respTabsList = $respTabs.find('ul.resp-tabs-list.' + options.tabidentify); 38 | var respTabsId = $respTabs.attr('id'); 39 | $respTabs.find('ul.resp-tabs-list.' + options.tabidentify + ' li').addClass('resp-tab-item').addClass(options.tabidentify); 40 | $respTabs.css({ 41 | 'display': 'block', 42 | 'width': jwidth 43 | }); 44 | 45 | if (options.type == 'vertical') 46 | $respTabsList.css('margin-top', '3px'); 47 | 48 | $respTabs.find('.resp-tabs-container.' + options.tabidentify).css('border-color', options.active_content_border_color); 49 | $respTabs.find('.resp-tabs-container.' + options.tabidentify + ' > div').addClass('resp-tab-content').addClass(options.tabidentify); 50 | jtab_options(); 51 | //Properties Function 52 | function jtab_options() { 53 | if (jtype == vtabs) { 54 | $respTabs.addClass('resp-vtabs').addClass(options.tabidentify); 55 | } 56 | if (jfit == true) { 57 | $respTabs.css({ width: '100%', margin: '0px' }); 58 | } 59 | if (jtype == accord) { 60 | $respTabs.addClass('resp-easy-accordion').addClass(options.tabidentify); 61 | $respTabs.find('.resp-tabs-list').css('display', 'none'); 62 | } 63 | } 64 | 65 | 66 | //Assigning the h2 markup to accordion title 67 | var $tabItemh2; 68 | $respTabs.find('.resp-tab-content.' + options.tabidentify).before(""); 69 | 70 | $respTabs.find('.resp-tab-content.' + options.tabidentify).prev("h2").css({ 71 | 'background-color': options.inactive_bg, 72 | 'border-color': options.active_border_color 73 | }); 74 | 75 | var itemCount = 0; 76 | $respTabs.find('.resp-accordion').each(function () { 77 | $tabItemh2 = $(this); 78 | var $tabItem = $respTabs.find('.resp-tab-item:eq(' + itemCount + ')'); 79 | var $accItem = $respTabs.find('.resp-accordion:eq(' + itemCount + ')'); 80 | $accItem.append($tabItem.html()); 81 | $accItem.data($tabItem.data()); 82 | $tabItemh2.attr('aria-controls', options.tabidentify + '_tab_item-' + (itemCount)); 83 | itemCount++; 84 | }); 85 | 86 | //Assigning the 'aria-controls' to Tab items 87 | var count = 0, 88 | $tabContent; 89 | $respTabs.find('.resp-tab-item').each(function () { 90 | $tabItem = $(this); 91 | $tabItem.attr('aria-controls', options.tabidentify + '_tab_item-' + (count)); 92 | $tabItem.attr('role', 'tab'); 93 | $tabItem.css({ 94 | 'background-color': options.inactive_bg, 95 | 'border-color': 'none' 96 | }); 97 | 98 | //Assigning the 'aria-labelledby' attr to tab-content 99 | var tabcount = 0; 100 | $respTabs.find('.resp-tab-content.' + options.tabidentify).each(function () { 101 | $tabContent = $(this); 102 | $tabContent.attr('aria-labelledby', options.tabidentify + '_tab_item-' + (tabcount)).css({ 103 | 'border-color': options.active_border_color 104 | }); 105 | tabcount++; 106 | }); 107 | count++; 108 | }); 109 | 110 | // Show correct content area 111 | var tabNum = 0; 112 | if (hash != '') { 113 | var matches = hash.match(new RegExp(respTabsId + "([0-9]+)")); 114 | if (matches !== null && matches.length === 2) { 115 | tabNum = parseInt(matches[1], 10) - 1; 116 | if (tabNum > count) { 117 | tabNum = 0; 118 | } 119 | } 120 | } 121 | 122 | //Active correct tab 123 | $($respTabs.find('.resp-tab-item.' + options.tabidentify)[tabNum]).addClass('resp-tab-active').css({ 124 | 'background-color': options.activetab_bg, 125 | 'border-color': options.active_border_color 126 | }); 127 | 128 | //keep closed if option = 'closed' or option is 'accordion' and the element is in accordion mode 129 | if (options.closed !== true && !(options.closed === 'accordion' && !$respTabsList.is(':visible')) && !(options.closed === 'tabs' && $respTabsList.is(':visible'))) { 130 | $($respTabs.find('.resp-accordion.' + options.tabidentify)[tabNum]).addClass('resp-tab-active').css({ 131 | 'background-color': options.activetab_bg + ' !important', 132 | 'border-color': options.active_border_color, 133 | 'background': 'none' 134 | }); 135 | 136 | 137 | $($respTabs.find('.resp-tab-content.' + options.tabidentify)[tabNum]).addClass('resp-tab-content-active').addClass(options.tabidentify).attr('style', 'display:block'); 138 | } 139 | //assign proper classes for when tabs mode is activated before making a selection in accordion mode 140 | else { 141 | // $($respTabs.find('.resp-tab-content.' + options.tabidentify)[tabNum]).addClass('resp-accordion-closed'); //removed resp-tab-content-active 142 | } 143 | 144 | //Tab Click action function 145 | $respTabs.find("[role=tab]").each(function () { 146 | 147 | var $currentTab = $(this); 148 | $currentTab.click(function () { 149 | 150 | var $currentTab = $(this); 151 | var $tabAria = $currentTab.attr('aria-controls'); 152 | 153 | if ($currentTab.hasClass('resp-accordion') && $currentTab.hasClass('resp-tab-active')) { 154 | $respTabs.find('.resp-tab-content-active.' + options.tabidentify).slideUp('', function () { 155 | $(this).addClass('resp-accordion-closed'); 156 | }); 157 | $currentTab.removeClass('resp-tab-active').css({ 158 | 'background-color': options.inactive_bg, 159 | 'border-color': 'none' 160 | }); 161 | return false; 162 | } 163 | if (!$currentTab.hasClass('resp-tab-active') && $currentTab.hasClass('resp-accordion')) { 164 | $respTabs.find('.resp-tab-active.' + options.tabidentify).removeClass('resp-tab-active').css({ 165 | 'background-color': options.inactive_bg, 166 | 'border-color': 'none' 167 | }); 168 | $respTabs.find('.resp-tab-content-active.' + options.tabidentify).slideUp().removeClass('resp-tab-content-active resp-accordion-closed'); 169 | $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active').css({ 170 | 'background-color': options.activetab_bg, 171 | 'border-color': options.active_border_color 172 | }); 173 | 174 | $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + '].' + options.tabidentify).slideDown().addClass('resp-tab-content-active'); 175 | } else { 176 | // console.log('here'); 177 | $respTabs.find('.resp-tab-active.' + options.tabidentify).removeClass('resp-tab-active').css({ 178 | 'background-color': options.inactive_bg, 179 | 'border-color': 'none' 180 | }); 181 | 182 | 183 | $respTabs.find('.resp-tab-content-active.' + options.tabidentify).removeAttr('style').removeClass('resp-tab-content-active').removeClass('resp-accordion-closed'); 184 | 185 | 186 | $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active').css({ 187 | 'background-color': options.activetab_bg, 188 | 'border-color': options.active_border_color 189 | }); 190 | 191 | 192 | $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + '].' + options.tabidentify).addClass('resp-tab-content-active').attr('style', 'display:block'); 193 | } 194 | //Trigger tab activation event 195 | $currentTab.trigger('tabactivate', $currentTab); 196 | 197 | //Update Browser History 198 | if (historyApi) { 199 | var currentHash = window.location.hash; 200 | var tabAriaParts = $tabAria.split('tab_item-'); 201 | // var newHash = respTabsId + (parseInt($tabAria.substring(9), 10) + 1).toString(); 202 | var newHash = respTabsId + (parseInt(tabAriaParts[1], 10) + 1).toString(); 203 | if (currentHash != "") { 204 | var re = new RegExp(respTabsId + "[0-9]+"); 205 | if (currentHash.match(re) != null) { 206 | newHash = currentHash.replace(re, newHash); 207 | } 208 | else { 209 | newHash = currentHash + "|" + newHash; 210 | } 211 | } 212 | else { 213 | newHash = '#' + newHash; 214 | } 215 | 216 | history.replaceState(null, null, newHash); 217 | } 218 | }); 219 | 220 | }); 221 | 222 | //Window resize function 223 | $(window).resize(function () { 224 | $respTabs.find('.resp-accordion-closed').removeAttr('style'); 225 | }); 226 | }); 227 | } 228 | }); 229 | })(jQuery); 230 | -------------------------------------------------------------------------------- /static/js/jquery.jsontotable.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery JSON to Table - v1.1.3 - 2014-10-11 2 | * https://github.com/jongha/jquery-jsontotable 3 | * Copyright (c) 2014 Jong-Ha Ahn; Licensed MIT */ 4 | !function(a){a.jsontotable=function(b,c){var d=a.extend({id:null,header:!0,className:null},c);c=a.extend(d,c);var e=b;if("string"==typeof e&&(e=a.parseJSON(e)),c.id&&e.length){var f,g,h=a("
    ");c.className&&h.addClass(c.className),a.fn.appendTr=function(b,c){var d,e,f,h,i,j=c?"thead":"tbody",k=c?"th":"td";if(a.isPlainObject(b)&&b._data){g=""+f+""}else h="<"+k+">"+f+"";g.append(h)}if(c)a(this).append(a("<"+j+">").append(g));else{var l=a(this).find("tbody");0===l.length&&(l=a(this).append("")),l.append(g)}return this};var i=function(a){if(null==a||"object"!=typeof a)return a;var b=a.constructor();for(var c in a)a.hasOwnProperty(c)&&(b[c]=i(a[c]));return b},j=!1,k={},l=null;if(c.header){if(k=i(e[0]._data?e[0]._data:e[0]),"[object Object]"===k.toString()){j=!0;for(l in k)k[l]=l}h.appendTr(k,!0)}for(f=c.header?1:0;f)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="
    t
    ",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
    ",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; 4 | return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="
    ",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) 5 | }b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("