├── MySQL主从复制监控.png ├── MySQL状态监控.png ├── README.md ├── check_mysql_repl.php ├── check_mysql_status.php ├── conn.php ├── convert_array.php ├── css ├── bootstrap.min.css ├── fontawesome-all.min.css ├── simple-line-icons.css ├── styles.css └── styles.css_bak ├── db_connect_graph_getdata.php ├── db_connect_statistic.php ├── db_qps_graph_getdata.php ├── db_using_index_graph_getdata.php ├── filter_array.php ├── image ├── chart.gif ├── mysql_monitor_chatgpt.png └── table_info.png ├── js ├── echarts.common.min.js ├── jquery-3.3.1.min.js ├── shine.js ├── show_connect.php ├── show_graph_index.php └── show_graph_qps.php ├── mail ├── mail.php └── sendEmail ├── mysql_monitor_schema.sql ├── mysql_repl_monitor.php ├── mysql_status_monitor.php ├── parallel_check_mysql_status.php ├── show_graph.php ├── table_statistic.php ├── weixin ├── wechat.py └── weixin.php ├── xadmin ├── css │ ├── font.css │ └── xadmin.css ├── fonts │ ├── iconfont.eot │ ├── iconfont.svg │ ├── iconfont.ttf │ └── iconfont.woff ├── images │ ├── aiwrap.png │ └── bg.png ├── js │ ├── cookie.js │ ├── jquery-3.3.1.min.js │ ├── xadmin.js │ └── xcity.js └── lib │ └── layui │ ├── css │ ├── layui.css │ ├── layui.mobile.css │ └── modules │ │ ├── code.css │ │ ├── laydate │ │ └── default │ │ │ └── laydate.css │ │ └── layer │ │ └── default │ │ ├── icon-ext.png │ │ ├── icon.png │ │ ├── layer.css │ │ ├── loading-0.gif │ │ ├── loading-1.gif │ │ └── loading-2.gif │ ├── font │ ├── iconfont.eot │ ├── iconfont.svg │ ├── iconfont.ttf │ └── iconfont.woff │ ├── images │ └── face │ │ ├── 0.gif │ │ ├── 1.gif │ │ ├── 10.gif │ │ ├── 11.gif │ │ ├── 12.gif │ │ ├── 13.gif │ │ ├── 14.gif │ │ ├── 15.gif │ │ ├── 16.gif │ │ ├── 17.gif │ │ ├── 18.gif │ │ ├── 19.gif │ │ ├── 2.gif │ │ ├── 20.gif │ │ ├── 21.gif │ │ ├── 22.gif │ │ ├── 23.gif │ │ ├── 24.gif │ │ ├── 25.gif │ │ ├── 26.gif │ │ ├── 27.gif │ │ ├── 28.gif │ │ ├── 29.gif │ │ ├── 3.gif │ │ ├── 30.gif │ │ ├── 31.gif │ │ ├── 32.gif │ │ ├── 33.gif │ │ ├── 34.gif │ │ ├── 35.gif │ │ ├── 36.gif │ │ ├── 37.gif │ │ ├── 38.gif │ │ ├── 39.gif │ │ ├── 4.gif │ │ ├── 40.gif │ │ ├── 41.gif │ │ ├── 42.gif │ │ ├── 43.gif │ │ ├── 44.gif │ │ ├── 45.gif │ │ ├── 46.gif │ │ ├── 47.gif │ │ ├── 48.gif │ │ ├── 49.gif │ │ ├── 5.gif │ │ ├── 50.gif │ │ ├── 51.gif │ │ ├── 52.gif │ │ ├── 53.gif │ │ ├── 54.gif │ │ ├── 55.gif │ │ ├── 56.gif │ │ ├── 57.gif │ │ ├── 58.gif │ │ ├── 59.gif │ │ ├── 6.gif │ │ ├── 60.gif │ │ ├── 61.gif │ │ ├── 62.gif │ │ ├── 63.gif │ │ ├── 64.gif │ │ ├── 65.gif │ │ ├── 66.gif │ │ ├── 67.gif │ │ ├── 68.gif │ │ ├── 69.gif │ │ ├── 7.gif │ │ ├── 70.gif │ │ ├── 71.gif │ │ ├── 8.gif │ │ └── 9.gif │ ├── lay │ └── modules │ │ ├── carousel.js │ │ ├── code.js │ │ ├── colorpicker.js │ │ ├── element.js │ │ ├── flow.js │ │ ├── form.js │ │ ├── jquery.js │ │ ├── laydate.js │ │ ├── layedit.js │ │ ├── layer.js │ │ ├── laypage.js │ │ ├── laytpl.js │ │ ├── mobile.js │ │ ├── rate.js │ │ ├── slider.js │ │ ├── table.js │ │ ├── tree.js │ │ ├── upload.js │ │ └── util.js │ ├── layui.all.js │ └── layui.js ├── 历史曲线图.png ├── 微信报警.png ├── 连接数详情.png └── 邮件告警.png /MySQL主从复制监控.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/MySQL主从复制监控.png -------------------------------------------------------------------------------- /MySQL状态监控.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/MySQL状态监控.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MySQL Monitor面向研发人员图形可视化监控工具 2 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/image/mysql_monitor_chatgpt.png) 3 | 4 | ### 2022-01-03 增加sys schema性能诊断报告 --- 重新拉取table_statistic.php文件覆盖即可 5 | 1)统计业务库里执行次数最频繁的前10条SQL语句 6 | 7 | 2)统计库里访问次数最多的前10张表 8 | 9 | ### 2022-02-05 提供podman镜像 10 | 获取镜像启动容器参见地址:https://blog.51cto.com/hcymysql/4984088 11 | 12 | # 简介: 13 | 目前常用开源监控工具有nagios,zabbix,grafana,但这些是面向专业DBA使用的,而对于业务研发人员来说,没有专业的MySQL理论知识,并且上述监控工具均为纯英文界面,交互不直观,那么多的监控指标,你知道有哪些是研发最关心的吗? 14 | 15 | 所以每次都是DBA通知研发,系统哪块出了问题,这样的效率其实是低下的,我是希望把监控这块东西定制化,做成开发一眼就能看懂的指标项,纯中文页面,清爽直观,简约而不简单,出了问题报警信息直接第一时间推送给研发,效率会大大提升,同时也减少了DBA作为中间人传话的作用(传达室大爷角色)。 16 | 17 | 参考了天兔Lepus的UI风格,目前采集了数据库连接数(具体连接了哪些应用程序IP,账号统计)、QPS/TPS、索引使用率统计,同步复制状态/延迟监控。 18 | 19 | 采用远程连接方式获取数据,所以无需要在数据库服务器端部署相关agent或计划任务,可实现微信和邮件报警。 20 | 21 | 1、MySQL状态监控 22 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/MySQL%E7%8A%B6%E6%80%81%E7%9B%91%E6%8E%A7.png) 23 | 24 | 2、点击活动连接数,可以查看具体的连接数统计信息 25 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/%E8%BF%9E%E6%8E%A5%E6%95%B0%E8%AF%A6%E6%83%85.png) 26 | 27 | 3、点击图表,可以查看历史曲线图 28 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/%E5%8E%86%E5%8F%B2%E6%9B%B2%E7%BA%BF%E5%9B%BE.png) 29 | 30 | 4、主从复制状态监控 31 | 32 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/MySQL%E4%B8%BB%E4%BB%8E%E5%A4%8D%E5%88%B6%E7%9B%91%E6%8E%A7.png) 33 | 34 | 5、微信报警 35 | 36 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/%E5%BE%AE%E4%BF%A1%E6%8A%A5%E8%AD%A6.png) 37 | 38 | 6、邮件报警 39 | 40 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/%E9%82%AE%E4%BB%B6%E5%91%8A%E8%AD%A6.png) 41 | 42 | 7、在MySQL 状态监控栏目下,点击数据库名,可以查看具体的表大小统计信息以及主键自增键值统计 43 | 44 | ![image](https://raw.githubusercontent.com/hcymysql/mysql_monitor/master/image/table_info.png) 45 | 46 | 注:sql_mode模式要去掉only_full_group_by,否则报错 47 | 48 | ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 't.ENGINE' which is not functionally dependent on columns 49 | in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 50 | 51 | ```mysql> SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));``` 52 | 53 | 一、环境搭建 54 | # yum install httpd php php-mysqlnd php-json -y 55 | # yum install python-simplejson -y 56 | # service httpd start 57 | 58 | # 注:必须依赖php-mysqlnd驱动扩展,系统自带的php-mysql要卸载掉,可参考下面的文章进行yum安装 59 | # Linux上安装php-mysqlnd扩展实例 60 | http://www.php.cn/php-weizijiaocheng-387963.html 61 | 62 | 63 | 把https://github.com/hcymysql/mysql_monitor/archive/master.zip安装包解压缩到 64 | /var/www/html/目录下 65 | 66 | # cd /var/www/html/mysql_monitor/ 67 | # chmod 755 ./mail/sendEmail 68 | # chmod 755 ./weixin/wechat.py 69 | (注:邮件和微信报警调用的第三方工具,所以这里要赋予可执行权限755) 70 | 71 | 二、MySQL Monitor监控工具搭建 72 | 73 | 1、导入MySQL Monitor监控工具表结构(sql_db库) 74 | # cd /var/www/html/mysql_monitor/ 75 | # mysql -uroot -p123456 < mysql_monitor_schema.sql 76 | 77 | ## 注:mysql_status_history表引擎可以更改为rocksdb引擎,支持数据压缩,这对于减小存储空间以及增快IO效率都有直接的帮助。 78 | https://www.percona.com/blog/2018/04/30/a-look-at-myrocks-performance/ 79 | 80 | 2、录入被监控主机的信息 81 | 82 | mysql>insert into 83 | `mysql_status_info`(`id`,`ip`,`dbname`,`user`,`pwd`,`port`,`monitor`,`send_mail`,`sen 84 | d_mail_to_list`,`send_weixin`,`send_weixin_to_list`,`alarm_threads_running`,`thresh 85 | old_alarm_threads_running`,`alarm_repl_status`,`threshold_warning_repl_delay`) 86 | values 87 | (1,'127.0.0.1','sql_db','admin','hechunyang',3306,1,1,'chunyang_he@139.com,chu 88 | nyang_he@126.com',1,'hechunyang',NULL,NULL,NULL,NULL); 89 | 90 | 注,以下字段可以按照需求变更: 91 | 92 | ip字段含义:输入被监控MySQL的IP地址 93 | 94 | dbname字段含义:输入被监控MySQL的数据库名 95 | 96 | user字段含义:输入被监控MySQL的用户名(最好给ALL管理员权限) 97 | 98 | pwd字段含义:输入被监控MySQL的密码 99 | 100 | port字段含义:输入被监控MySQL的端口号 101 | 102 | monitor字段含义:0为关闭监控(也不采集数据,直接跳过);1为开启监控(采集数据) 103 | 104 | send_mail字段含义:0为关闭邮件报警;1为开启邮件报警 105 | 106 | send_mail_to_list字段含义:邮件人列表 107 | 108 | send_weixin字段含义:0为关闭微信报警;1为开启微信报警 109 | 110 | send_weixin_to_list字段含义:微信公众号 111 | 112 | threshold_alarm_threads_running字段含义:设置连接数阀值(单位个) 113 | 114 | threshold_warning_repl_delay字段含义:设置主从复制延迟阀值(单位秒) 115 | 116 | 117 | 3、修改conn.php配置文件 118 | 119 | # vim /var/www/html/mysql_monitor/conn.php 120 | 121 | $con = mysqli_connect("127.0.0.1","admin","hechunyang","sql_db","3306") or die("数据库链接错误".mysql_error()); 122 | 123 | 改成你的MySQL Monitor监控工具表结构(sql_db库)连接信息 124 | 125 | 126 | 127 | 4、修改邮件报警信息 128 | 129 | # cd /var/www/html/mysql_monitor/mail/ 130 | # vim mail.php 131 | 132 | system("./mail/sendEmail -f chunyang_he@139.com -t '{$this->send_mail_to_list}' -s 133 | smtp.139.com:25 -u '{$this->alarm_subject}' -o message-charset=utf8 -o message-content-type=html -m '报警信息:
{$this->alarm_info}' -xu chunyang_he@139.com -xp 135 | '123456' -o tls=no"); 136 | 137 | 改成你的发件人地址,账号密码,里面的变量不用修改。 138 | 139 | 140 | 5、修改微信报警信息 141 | 142 | # cd /var/www/html/mysql_monitor/weixin/ 143 | # vim wechat.py 144 | 微信企业号设置移步 145 | https://github.com/X-Mars/Zabbix-Alert-WeChat/blob/master/README.md 看此教程配置。 146 | 147 | 6、定时任务每分钟抓取一次 148 | 149 | # crontab -l 150 | */1 * * * * cd /var/www/html/mysql_monitor/; /usr/bin/php 151 | /var/www/html/mysql_monitor/check_mysql_repl.php > /dev/null 2 >&1 152 | 153 | */1 * * * * cd /var/www/html/mysql_monitor/; /usr/bin/php 154 | /var/www/html/mysql_monitor/check_mysql_status.php > /dev/null 2 >&1 155 | 156 | # check_mysql_status.php(用来采集被监控端MySQL状态信息和触发报警——单进程) 157 | # parallel_check_mysql_status.php (2022-01-05 新增并发多进程采集被监控端MySQL状态信息和触发报警,默认并发10个进程,建议使用) 158 | # check_mysql_repl.php(用来采集被监控端MySQL主从复制信息和触发报警) 159 | 160 | 161 | 7、更改页面自动刷新频率 162 | 163 | # vim mysql_status_monitor.php 164 | # vim mysql_repl_monitor.php 165 | 166 | http-equiv="refresh" content="600" 167 | 168 | 默认页面每600秒自动刷新一次。 169 | 170 | 171 | 8、页面访问 172 | 173 | http://yourIP/mysql_monitor/mysql_status_monitor.php 174 | 175 | http://yourIP/mysql_monitor/mysql_repl_monitor.php 176 | 177 | 加一个超链接,可方便地接入你们的自动化运维平台里。 178 | 179 | -------------------------------------------------------------------------------- /check_mysql_repl.php: -------------------------------------------------------------------------------- 1 | options(MYSQLI_OPT_CONNECT_TIMEOUT, 5); 32 | if(! $link1->real_connect($ip,$user,$pwd,$dbname,$port)){ 33 | $connect_error='down'; 34 | break; 35 | } 36 | 37 | if(! $link1->query($sql, MYSQLI_ASYNC)){ 38 | break; 39 | } 40 | $all_links[]=$link1; 41 | } 42 | 43 | $processed = 0; 44 | do { 45 | $links = $errors = $reject = array(); 46 | foreach ($all_links as $link) { 47 | $links[] = $errors[] = $reject[] = $link; 48 | } 49 | if (!mysqli_poll($links, $errors, $reject, 1)) { 50 | continue; 51 | } 52 | foreach ($links as $link) { 53 | if ($result = $link->reap_async_query()) { 54 | while($row = $result->fetch_assoc()){ 55 | $r[$row['Variable_name']] = $row['Value']; 56 | unset($row['Variable_name'],$row['Value']); 57 | array_push($re,$row); 58 | } 59 | array_push($re,$r); //组成一个大的二维数组 60 | if (is_object($result)){ 61 | mysqli_free_result($result); 62 | } 63 | } else die(sprintf("MySQLi Error: %s", mysqli_error($link))); 64 | $processed++; 65 | } 66 | } while ($processed < count($all_links)); 67 | echo "---------------------------"."\n"; 68 | //print_r(array_values(array_filter(filter_array($re)))); //调试 69 | $re=array_values(array_filter(filter_array($re))); 70 | 71 | //1为Primary,0为Secondary 72 | $role=!isset($re[0]['Slave_IO_State'])?1:0; 73 | $gtid=$re[0]['Auto_Position']==1?'ON':'OFF'; 74 | echo "角色是:".$role_status=$role==1?'Primary'.PHP_EOL:'Secondary'.PHP_EOL; 75 | $is_live=isset($connect_error)?0:1; 76 | //echo $is_live."\n"; 77 | $Last_IO_Error=preg_replace('/\'/', '', $re[0]['Last_IO_Error']); 78 | $Last_SQL_Error=preg_replace('/\'/', '', $re[0]['Last_SQL_Error']); 79 | 80 | if($is_live==0){ 81 | echo "$ip"."\n"; 82 | echo $connect_error."\n"; 83 | unset($connect_error); 84 | $sql = "INSERT INTO mysql_repl_status(host,dbname,port,role,is_live) VALUES('{$ip}','{$dbname}','{$port}','{$role}','{$is_live}')"; 85 | } else { 86 | 87 | //同步状态监控 88 | if($re[0]['Slave_IO_Running']=='No' || $re[0]['Slave_SQL_Running']=='No' ){ 89 | echo "【报错】主从同步复制Slave_IO_Running状态是:{$re[0]['Slave_IO_Running']}; Slave_SQL_Running状态是:{$re[0]['Slave_SQL_Running']}\n"; 90 | //告警--------------------- 91 | if($send_mail==0 || empty($send_mail)){ 92 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 93 | } else { 94 | $alarm_subject = "【报错】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步复制异常 ".date("Y-m-d H:i:s"); 95 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步复制Slave_IO_Running状态是:{$re[0]['Slave_IO_Running']}; Slave_SQL_Running状态是:{$re[0]['Slave_SQL_Running']}"; 96 | $sendmail = new mail($send_mail_to_list,$alarm_subject,$alarm_info); 97 | $sendmail->execCommand(); 98 | } 99 | if($send_weixin==0 || empty($send_weixin)){ 100 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 101 | } else { 102 | $alarm_subject = "【报错】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步复制异常 ".date("Y-m-d H:i:s"); 103 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步复制Slave_IO_Running状态是:{$re[0]['Slave_IO_Running']}; Slave_SQL_Running状态是:{$re[0]['Slave_SQL_Running']}"; 104 | $sendweixin = new weixin($send_weixin_to_list,$alarm_subject,$alarm_info); 105 | $sendweixin->execCommand(); 106 | } 107 | if(($send_mail==1 || $send_weixin==1)){ 108 | $update_slave_status = "UPDATE mysql_status_info SET alarm_repl_status = 1 WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}'"; 109 | mysqli_query($con, $update_slave_status); 110 | } 111 | } else { 112 | //恢复--------------------- 113 | if($send_mail==0 || empty($send_mail)){ 114 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 115 | } 116 | if($send_weixin==0 || empty($send_weixin)){ 117 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 118 | } 119 | if(($send_mail==1 || $send_weixin==1)){ 120 | $recover_repl_status_sql = "SELECT alarm_repl_status FROM mysql_status_info WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}' "; 121 | $recover_repl_status = mysqli_query($con, $recover_repl_status_sql); 122 | $recover_repl_status_row = mysqli_fetch_assoc($recover_repl_status); 123 | } 124 | if(!empty($recover_repl_status_row['alarm_repl_status']) && $recover_repl_status_row['alarm_repl_status'] == 1 ){ 125 | $recover_subject = "【恢复】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步复制已恢复 ".date("Y-m-d H:i:s"); 126 | $recover_info = "主从同步复制Slave_IO_Running状态是:{$re[0]['Slave_IO_Running']}; Slave_SQL_Running状态是:{$re[0]['Slave_SQL_Running']}"; 127 | if($send_mail==1 ){ 128 | $sendmail = new mail($send_mail_to_list,$recover_subject,$recover_info); 129 | $sendmail->execCommand(); 130 | } 131 | if($send_weixin==1 ){ 132 | $sendweixin = new weixin($send_weixin_to_list,$recover_subject,$recover_info); 133 | $sendweixin->execCommand(); 134 | } 135 | 136 | $update_repl_status_sql = "UPDATE mysql_status_info SET alarm_repl_status = 0 WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}'"; 137 | mysqli_query($con, $update_repl_status_sql); 138 | } 139 | } // end else Slave_IO_Running and Slave_SQL_Running 140 | 141 | 142 | //同步延迟监控 143 | if(!empty($threshold_warning_repl_delay) && $re[0]['Seconds_Behind_Master']>=$threshold_warning_repl_delay){ 144 | echo "【告警】 【{$dbname}库】【端口{$port}】主从同步延迟{$re[0]['Seconds_Behind_Master']}秒\n"; 145 | //告警--------------------- 146 | if($send_mail==0 || empty($send_mail)){ 147 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 148 | } else { 149 | $alarm_subject = "【告警】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步延迟 ".date("Y-m-d H:i:s"); 150 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步延迟{$re[0]['Seconds_Behind_Master']}秒"; 151 | $sendmail = new mail($send_mail_to_list,$alarm_subject,$alarm_info); 152 | $sendmail->execCommand(); 153 | } 154 | if($send_weixin==0 || empty($send_weixin)){ 155 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 156 | } else { 157 | $alarm_subject = "【告警】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步延迟 ".date("Y-m-d H:i:s"); 158 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】主从同步延迟{$re[0]['Seconds_Behind_Master']}秒"; 159 | $sendweixin = new weixin($send_weixin_to_list,$alarm_subject,$alarm_info); 160 | $sendweixin->execCommand(); 161 | } 162 | if(($send_mail==1 || $send_weixin==1)){ 163 | $update_slave_status = "UPDATE mysql_status_info SET alarm_repl_status = 3 WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}'"; 164 | mysqli_query($con, $update_slave_status); 165 | } 166 | } 167 | else { 168 | //恢复--------------------- 169 | if($send_mail==0 || empty($send_mail)){ 170 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 171 | } 172 | if($send_weixin==0 || empty($send_weixin)){ 173 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 174 | } 175 | if(($send_mail==1 || $send_weixin==1)){ 176 | $recover_repl_status_sql = "SELECT alarm_repl_status FROM mysql_status_info WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}' "; 177 | $recover_repl_status = mysqli_query($con, $recover_repl_status_sql); 178 | $recover_repl_status_row = mysqli_fetch_assoc($recover_repl_status); 179 | } 180 | if(!empty($recover_repl_status_row['alarm_repl_status']) && $recover_repl_status_row['alarm_repl_status'] == 3 ){ 181 | $recover_subject = "【恢复】被监控主机:".$ip." 【{$dbname}库】主从同步延迟已恢复 ".date("Y-m-d H:i:s"); 182 | $recover_info = "主从同步延迟{$re[0]['Seconds_Behind_Master']}秒"; 183 | if($send_mail==1 ){ 184 | $sendmail = new mail($send_mail_to_list,$recover_subject,$recover_info); 185 | $sendmail->execCommand(); 186 | } 187 | if($send_weixin==1 ){ 188 | $sendweixin = new weixin($send_weixin_to_list,$recover_subject,$recover_info); 189 | $sendweixin->execCommand(); 190 | } 191 | 192 | $update_repl_status_sql = "UPDATE mysql_status_info SET alarm_repl_status = 2 WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}'"; 193 | mysqli_query($con, $update_repl_status_sql); 194 | } 195 | } // end else Seconds_Behind_Master 196 | } // end else is_live 197 | //--------------------------------------------------------------------------- 198 | $sql = "INSERT INTO mysql_repl_status(server_id,host,dbname,port,role,is_live,read_only,gtid_mode,Master_Host,Master_Port,Slave_IO_Running,Slave_SQL_Running,Seconds_Behind_Master,Master_Log_File,Relay_Master_Log_File,Read_Master_Log_Pos,Exec_Master_Log_Pos,Last_IO_Error,Last_SQL_Error,create_time) values('" .end($re)['server_id']. "','{$ip}','{$dbname}','{$port}','{$role}','{$is_live}','" .end($re)['read_only']. "','{$gtid}','{$re[0]['Master_Host']}','{$re[0]['Master_Port']}','{$re[0]['Slave_IO_Running']}','{$re[0]['Slave_SQL_Running']}','{$re[0]['Seconds_Behind_Master']}','{$re[0]['Master_Log_File']}','{$re[0]['Relay_Master_Log_File']}','{$re[0]['Read_Master_Log_Pos']}','{$re[0]['Exec_Master_Log_Pos']}','{$Last_IO_Error}','{$Last_SQL_Error}',now())"; 199 | 200 | if (mysqli_query($con, $sql)) { 201 | echo "{$ip}:'{$dbname}'新记录插入成功\n"; 202 | echo "---------------------------\n\n"; 203 | mysqli_query($con,"delete from mysql_repl_status where host='{$ip}' and dbname='{$dbname}' and port='{$port}' and create_time 216 | 217 | -------------------------------------------------------------------------------- /check_mysql_status.php: -------------------------------------------------------------------------------- 1 | options(MYSQLI_OPT_CONNECT_TIMEOUT, 5); 32 | if(! $link1->real_connect($ip,$user,$pwd,$dbname,$port)){ 33 | $connect_error='down'; 34 | break; 35 | } 36 | 37 | if(preg_match('/GLOBAL STATUS/',$sql)){ 38 | sleep(1); //等待1秒,相减得到QPS数值 39 | } 40 | 41 | if(! $link1->query($sql, MYSQLI_ASYNC)){ 42 | break; 43 | } 44 | $all_links[]=$link1; 45 | } 46 | 47 | $processed = 0; 48 | do { 49 | $links = $errors = $reject = array(); 50 | foreach ($all_links as $link) { 51 | $links[] = $errors[] = $reject[] = $link; 52 | } 53 | if (!mysqli_poll($links, $errors, $reject, 1)) { 54 | continue; 55 | } 56 | foreach ($links as $link) { 57 | if ($result = $link->reap_async_query()) { 58 | while($row = $result->fetch_row()){ 59 | $r[$row[0]] = $row[1]; 60 | } 61 | array_push($re,$r); 62 | if (is_object($result)){ 63 | mysqli_free_result($result); 64 | } 65 | } else die(sprintf("MySQLi Error: %s", mysqli_error($link))); 66 | $processed++; 67 | } 68 | } while ($processed < count($all_links)); 69 | echo "---------------------------"."\n"; 70 | print_r($re); //调试 71 | 72 | //报警和入库采集数据 73 | $role=!isset(end($re)['Waiting for master to send event'])?1:0; 74 | echo "角色是:".$role_status=$role==1?'Primary'.PHP_EOL:'Secondary'.PHP_EOL; 75 | $is_live=isset($connect_error)?0:1; 76 | 77 | $QPS_SELECT=end($re)['Com_select'] - reset($re)['Com_select']; 78 | $QPS_INSERT=end($re)['Com_insert'] - reset($re)['Com_insert']; 79 | $QPS_UPDATE=end($re)['Com_update'] - reset($re)['Com_update']; 80 | $QPS_DELETE=end($re)['Com_delete'] - reset($re)['Com_delete']; 81 | $Handler_read_key=end($re)['Handler_read_key']-reset($re)['Handler_read_key']; 82 | $Handler_read_rnd_next=end($re)['Handler_read_rnd_next']-reset($re)['Handler_read_rnd_next']; 83 | 84 | echo '每秒查询:'.$QPS_SELECT."\n"; 85 | echo '每秒插入:'.$QPS_INSERT."\n"; 86 | echo '每秒更新:'.$QPS_UPDATE."\n"; 87 | echo '每秒删除:'.$QPS_DELETE."\n"; 88 | echo '当前连接数:'.end($re)['Threads_connected']."\n"; 89 | 90 | //主机存活报警 91 | if($is_live==0){ 92 | //echo "$ip"."\n"; 93 | //echo $connect_error."\n"; 94 | unset($connect_error); 95 | 96 | //告警--------------------- 97 | if($send_mail==0 || empty($send_mail)){ 98 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 99 | } else { 100 | $alarm_subject = "【告警】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】不能连接 ".date("Y-m-d H:i:s"); 101 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】不能连接,请检查!"; 102 | $sendmail = new mail($send_mail_to_list,$alarm_subject,$alarm_info); 103 | $sendmail->execCommand(); 104 | } 105 | if($send_weixin==0 || empty($send_weixin)){ 106 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 107 | } else { 108 | $alarm_subject = "【告警】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】不能连接 ".date("Y-m-d H:i:s"); 109 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】不能连接,请检查!"; 110 | $sendweixin = new weixin($send_weixin_to_list,$alarm_subject,$alarm_info); 111 | $sendweixin->execCommand(); 112 | } 113 | //------------------------- 114 | $sql = "INSERT INTO mysql_status(host,dbname,port,is_live,create_time) VALUES('{$ip}','{$dbname}','{$port}',{$is_live},now())"; 115 | } else { 116 | //恢复--------------------- 117 | if($send_mail==0 || empty($send_mail)){ 118 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 119 | } else { 120 | $recover_sql = "SELECT is_live FROM mysql_status_history WHERE HOST='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}' ORDER BY create_time DESC LIMIT 1"; 121 | $recover_result = mysqli_query($con, $recover_sql); 122 | $recover_row = mysqli_fetch_assoc($recover_result); 123 | } 124 | if(!empty($recover_row) && $recover_row['is_live']==0){ 125 | $recover_subject = "【恢复】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】已恢复 ".date("Y-m-d H:i:s"); 126 | $recover_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】已恢复"; 127 | $sendmail = new mail($send_mail_to_list,$recover_subject,$recover_info); 128 | $sendmail->execCommand(); 129 | } 130 | 131 | if($send_weixin==0 || empty($send_weixin)){ 132 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 133 | } else { 134 | $recover_sql = "SELECT is_live FROM mysql_status_history WHERE HOST='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}' ORDER BY create_time DESC LIMIT 1 135 | "; $recover_result = mysqli_query($con, $recover_sql); 136 | $recover_row = mysqli_fetch_assoc($recover_result); 137 | } 138 | if(!empty($recover_row) && $recover_row['is_live']==0){ 139 | $recover_subject = "【恢复】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】已恢复 ".date("Y-m-d H:i:s"); 140 | $recover_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】已恢复"; 141 | $sendweixin = new weixin($send_weixin_to_list,$recover_subject,$recover_info); 142 | $sendweixin->execCommand(); 143 | } 144 | //echo $ip." ok"."\n"; 145 | //echo $is_live."\n"; 146 | $sql = "INSERT INTO mysql_status(host,dbname,port,role,is_live,max_connections,threads_connected,qps_select,qps_insert,qps_update,qps_delete,Handler_read_key,Handler_read_rnd_next,runtime,db_version,create_time) VALUES('{$ip}','{$dbname}','{$port}','{$role}',{$is_live},'".end($re)['max_connections']."',".end($re)['Threads_connected'].",$QPS_SELECT,$QPS_INSERT,$QPS_UPDATE,$QPS_DELETE,$Handler_read_key,$Handler_read_rnd_next,".round(end($re)['Uptime']/3600/24,1).",'".end($re)['version']."',now())"; 147 | } 148 | 149 | //活动连接数报警 150 | if(!empty($threshold_alarm_threads_running) && end($re)['Threads_connected'] >=$threshold_alarm_threads_running){ 151 | //告警--------------------- 152 | if($send_mail==0 || empty($send_mail)){ 153 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 154 | } else { 155 | $alarm_subject = "【告警】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】活动连接数超高,请检查。 ".date("Y-m-d H:i:s"); 156 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】活动连接数是 ".end($re)['Threads_connected'] .",高于报警阀值{$threshold_alarm_threads_running}"; 157 | $sendmail = new mail($send_mail_to_list,$alarm_subject,$alarm_info); 158 | $sendmail->execCommand(); 159 | } 160 | 161 | if($send_weixin==0 || empty($send_weixin)){ 162 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 163 | } else { 164 | $alarm_subject = "【告警】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】活动连接数超高,请检查。 ".date("Y-m-d H:i:s"); 165 | $alarm_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】活动连接数是 ".end($re)['Threads_connected'] .",高于报警阀值{$threshold_alarm_threads_running}"; 166 | $sendweixin = new weixin($send_weixin_to_list,$alarm_subject,$alarm_info); 167 | $sendweixin->execCommand(); 168 | } 169 | if(($send_mail==1 || $send_weixin==1)){ 170 | $update_connect_status = "UPDATE mysql_status_info SET alarm_threads_running = 1 WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}'"; 171 | mysqli_query($con, $update_connect_status); 172 | } 173 | } else { 174 | //恢复--------------------- 175 | if($send_mail==0 || empty($send_mail)){ 176 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭邮件监控报警。"."\n"; 177 | } 178 | if($send_weixin==0 || empty($send_weixin)){ 179 | echo "被监控主机:$ip 【{$dbname}库】【端口{$port}】关闭微信监控报警。"."\n"; 180 | } 181 | if(($send_mail==1 || $send_weixin==1)){ 182 | $recover_threads = "SELECT alarm_threads_running FROM mysql_status_info WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}' "; 183 | $recover_threads = mysqli_query($con, $recover_threads); 184 | $recover_threads_row = mysqli_fetch_assoc($recover_threads); 185 | } 186 | if(!empty($recover_threads_row['alarm_threads_running']) && $recover_threads_row['alarm_threads_running'] == 1){ 187 | $recover_subject = "【恢复】被监控主机:".$ip." 【{$dbname}库】【端口{$port}】活动连接数已恢复 ".date("Y-m-d H:i:s"); 188 | $recover_info = "被监控主机:".$ip." 【{$dbname}库】【端口{$port}】活动连接数已恢复,当前连接数是 ".end($re)['Threads_connected']; 189 | if($send_mail==1 ){ 190 | $sendmail = new mail($send_mail_to_list,$recover_subject,$recover_info); 191 | $sendmail->execCommand(); 192 | } 193 | if($send_weixin==1 ){ 194 | $sendweixin = new weixin($send_weixin_to_list,$recover_subject,$recover_info); 195 | $sendweixin->execCommand(); 196 | } 197 | 198 | $update_connect_status = "UPDATE mysql_status_info SET alarm_threads_running = 0 WHERE IP='{$ip}' AND dbname='{$dbname}' AND PORT='{$port}'"; 199 | mysqli_query($con, $update_connect_status); 200 | } 201 | } 202 | 203 | //---------------------------------------------------- 204 | 205 | if (mysqli_query($con, $sql)) { 206 | echo "\n{$ip}:'{$dbname}' 新记录插入成功\n"; 207 | echo "-------------------------------------------------------------\n\n\n"; 208 | mysqli_query($con,"INSERT INTO mysql_status_history(HOST,dbname,PORT,role,is_live,max_connections,threads_connected,qps_select,qps_insert,qps_update,qps_delete,Handler_read_key,Handler_read_rnd_next,runtime,db_version,create_time) SELECT HOST,dbname,PORT,role,is_live,max_connections,threads_connected,qps_select,qps_insert,qps_update,qps_delete,Handler_read_key,Handler_read_rnd_next,runtime,db_version,create_time FROM mysql_status;"); 209 | 210 | mysqli_query($con,"DELETE FROM mysql_status where host='{$ip}' and dbname='{$dbname}' and port='{$port}' and create_time 221 | 222 | -------------------------------------------------------------------------------- /conn.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /convert_array.php: -------------------------------------------------------------------------------- 1 | $val) { 7 | if (is_array($val)) { 8 | convertarray($val); 9 | } 10 | else{ 11 | if($key == 'Handler_read_rnd_next'){ 12 | $res_arr[$key][]= $val; 13 | } else { 14 | $res_arr[$key] = $val; 15 | } 16 | } 17 | } 18 | return $res_arr; 19 | 20 | } 21 | 22 | 23 | ?> 24 | -------------------------------------------------------------------------------- /db_connect_graph_getdata.php: -------------------------------------------------------------------------------- 1 | =${interval_time} AND create_time <=NOW() group by FLOOR(UNIX_TIMESTAMP(create_time)/60)"; 19 | 20 | $result1 = mysqli_query($con,$get_info); 21 | //echo $get_info; 22 | 23 | $array= array(); 24 | class Connections{ 25 | public $create_time; 26 | public $threads_connected; 27 | } 28 | while($row = mysqli_fetch_array($result1,MYSQLI_ASSOC)){ 29 | $cons=new Connections(); 30 | $cons->create_time = $row['create_time']; 31 | //$user->user_max = $row['user_max']; 32 | $cons->threads_connected = $row['threads_connected']; 33 | $array[]=$cons; 34 | } 35 | $top_data=json_encode($array); 36 | // echo "{".'"user"'.":".$data."}"; 37 | echo $top_data; 38 | } 39 | 40 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main'; 41 | if (function_exists($fn)) { 42 | call_user_func($fn); 43 | } 44 | */ 45 | 46 | $ip = $_GET['ip']; 47 | $dbname = $_GET['dbname']; 48 | $port = $_GET['port']; 49 | $interval_time = $_GET['interval_time']; 50 | 51 | index($ip,$dbname,$port,$interval_time); 52 | 53 | 54 | ?> 55 | 56 | -------------------------------------------------------------------------------- /db_connect_statistic.php: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | MySQL 连接数详情 27 | 28 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 53 | 54 | 64 | 65 | 66 | 67 |
68 |
69 | 74 |
75 |
76 | 77 |

连接数总和

78 | 79 |
80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | "; 95 | echo $user."
"; 96 | echo $pwd."
"; 97 | echo $dbname."
"; 98 | echo $port."
"; 99 | */ 100 | 101 | $con2 = mysqli_connect($ip,$user,$pwd,$dbname,$port) or die("数据库链接错误".mysql_error()); 102 | $get_connect_info ='SELECT USER,COUNT(*) FROM `information_schema`.`PROCESSLIST` GROUP BY USER ORDER BY COUNT(*) DESC'; 103 | $result2 = mysqli_query($con2,$get_connect_info); 104 | while($row = mysqli_fetch_array($result2)) 105 | { 106 | echo ""; 107 | echo ""; 108 | echo ""; 109 | echo ""; 110 | } 111 | //end while 112 | echo ""; 113 | echo "
连接用户数量
{$row['0']}{$row['1']}
"; 114 | echo "
"; 115 | echo "
"; 116 | echo "
"; 117 | echo "
"; 118 | ?> 119 | 120 | 121 |
122 |
123 | 128 |
129 |
130 | 131 |

应用端IP连接数总和

132 | 133 |
134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | "; 151 | echo ""; 152 | echo ""; 153 | echo ""; 154 | echo ""; 155 | echo ""; 156 | } 157 | //end while 158 | echo ""; 159 | echo "
连接用户数据库名应用端IP数量
{$row['0']}{$row['1']}{$row['2']}{$row['3']}
"; 160 | echo "
"; 161 | echo "
"; 162 | echo "
"; 163 | echo "
"; 164 | ?> 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /db_qps_graph_getdata.php: -------------------------------------------------------------------------------- 1 | =DATE_FORMAT(now(),'%Y-%m-%d')"; 19 | $get_info="select create_time,qps_select,qps_insert,qps_update,qps_delete from mysql_status_history where host='${ip}' and dbname='${dbname}' and port=${port} and 20 | create_time >=${interval_time} AND create_time <=NOW() group by FLOOR(UNIX_TIMESTAMP(create_time)/60)"; 21 | $result1 = mysqli_query($con,$get_info); 22 | //echo $get_info; 23 | 24 | $array= array(); 25 | class Connections{ 26 | public $create_time; 27 | public $qps_select; 28 | public $qps_insert; 29 | public $qps_update; 30 | public $qps_delete; 31 | } 32 | while($row = mysqli_fetch_array($result1,MYSQLI_ASSOC)){ 33 | $cons=new Connections(); 34 | $cons->create_time = $row['create_time']; 35 | $cons->qps_select = $row['qps_select']; 36 | $cons->qps_insert = $row['qps_insert']; 37 | $cons->qps_update = $row['qps_update']; 38 | $cons->qps_delete = $row['qps_delete']; 39 | $array[]=$cons; 40 | } 41 | $top_data=json_encode($array); 42 | // echo "{".'"user"'.":".$data."}"; 43 | echo $top_data; 44 | } 45 | 46 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main'; 47 | if (function_exists($fn)) { 48 | call_user_func($fn); 49 | } 50 | */ 51 | 52 | $ip = $_GET['ip']; 53 | $dbname = $_GET['dbname']; 54 | $port = $_GET['port']; 55 | $interval_time = $_GET['interval_time']; 56 | 57 | index($ip,$dbname,$port,$interval_time); 58 | 59 | 60 | ?> 61 | 62 | -------------------------------------------------------------------------------- /db_using_index_graph_getdata.php: -------------------------------------------------------------------------------- 1 | =DATE_FORMAT(now(),'%Y-%m-%d')"; 18 | $get_info="select create_time,Handler_read_key,Handler_read_rnd_next from mysql_status_history where host='${ip}' and dbname='${dbname}' and port=${port} and 19 | create_time >=${interval_time} AND create_time <=NOW() group by FLOOR(UNIX_TIMESTAMP(create_time)/60)"; 20 | $result1 = mysqli_query($con,$get_info); 21 | //echo $get_info; 22 | 23 | $array=array(); 24 | class UsingIndex{ 25 | public $create_time; 26 | public $Handler_read_key; 27 | public $Handler_read_rnd_next; 28 | } 29 | while($row = mysqli_fetch_array($result1,MYSQLI_ASSOC)){ 30 | $cons=new UsingIndex(); 31 | $cons->create_time = $row['create_time']; 32 | $cons->Handler_read_key = $row['Handler_read_key']; 33 | $cons->Handler_read_rnd_next = $row['Handler_read_rnd_next']; 34 | $array[]=$cons; 35 | } 36 | $top_data=json_encode($array); 37 | // echo "{".'"user"'.":".$data."}"; 38 | echo $top_data; 39 | } 40 | 41 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main'; 42 | if (function_exists($fn)) { 43 | call_user_func($fn); 44 | } 45 | */ 46 | 47 | $ip = $_GET['ip']; 48 | $dbname = $_GET['dbname']; 49 | $port = $_GET['port']; 50 | $interval_time = $_GET['interval_time']; 51 | 52 | index($ip,$dbname,$port,$interval_time); 53 | 54 | 55 | ?> 56 | 57 | -------------------------------------------------------------------------------- /filter_array.php: -------------------------------------------------------------------------------- 1 | $v) { 16 | if (is_array($v) && count($v)>0) { 17 | $arr[$k] = filter_array($v, $values); 18 | } 19 | foreach ($values as $value) { 20 | if ($v === $value) { 21 | unset($arr[$k]); 22 | break; 23 | } 24 | } 25 | } 26 | return $arr; 27 | } 28 | 29 | ?> 30 | -------------------------------------------------------------------------------- /image/chart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/image/chart.gif -------------------------------------------------------------------------------- /image/mysql_monitor_chatgpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/image/mysql_monitor_chatgpt.png -------------------------------------------------------------------------------- /image/table_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/image/table_info.png -------------------------------------------------------------------------------- /js/shine.js: -------------------------------------------------------------------------------- 1 | (function (root, factory) {if (typeof define === 'function' && define.amd) { 2 | // AMD. Register as an anonymous module. 3 | define(['exports', 'echarts'], factory); 4 | } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { 5 | // CommonJS 6 | factory(exports, require('echarts')); 7 | } else { 8 | // Browser globals 9 | factory({}, root.echarts); 10 | } 11 | }(this, function (exports, echarts) { 12 | var log = function (msg) { 13 | if (typeof console !== 'undefined') { 14 | console && console.error && console.error(msg); 15 | } 16 | }; 17 | if (!echarts) { 18 | log('ECharts is not Loaded'); 19 | return; 20 | } 21 | 22 | var colorPalette = [ 23 | '#c12e34','#e6b600','#0098d9','#2b821d', 24 | '#005eaa','#339ca8','#cda819','#32a487' 25 | ]; 26 | 27 | var theme = { 28 | 29 | color: colorPalette, 30 | 31 | title: { 32 | textStyle: { 33 | fontWeight: 'normal' 34 | } 35 | }, 36 | 37 | visualMap: { 38 | color:['#1790cf','#a2d4e6'] 39 | }, 40 | 41 | toolbox: { 42 | iconStyle: { 43 | normal: { 44 | borderColor: '#06467c' 45 | } 46 | } 47 | }, 48 | 49 | tooltip: { 50 | backgroundColor: 'rgba(0,0,0,0.6)' 51 | }, 52 | 53 | dataZoom: { 54 | dataBackgroundColor: '#dedede', 55 | fillerColor: 'rgba(154,217,247,0.2)', 56 | handleColor: '#005eaa' 57 | }, 58 | 59 | timeline: { 60 | lineStyle: { 61 | color: '#005eaa' 62 | }, 63 | controlStyle: { 64 | normal: { 65 | color: '#005eaa', 66 | borderColor: '#005eaa' 67 | } 68 | } 69 | }, 70 | 71 | candlestick: { 72 | itemStyle: { 73 | normal: { 74 | color: '#c12e34', 75 | color0: '#2b821d', 76 | lineStyle: { 77 | width: 1, 78 | color: '#c12e34', 79 | color0: '#2b821d' 80 | } 81 | } 82 | } 83 | }, 84 | 85 | graph: { 86 | color: colorPalette 87 | }, 88 | 89 | map: { 90 | label: { 91 | normal: { 92 | textStyle: { 93 | color: '#c12e34' 94 | } 95 | }, 96 | emphasis: { 97 | textStyle: { 98 | color: '#c12e34' 99 | } 100 | } 101 | }, 102 | itemStyle: { 103 | normal: { 104 | borderColor: '#eee', 105 | areaColor: '#ddd' 106 | }, 107 | emphasis: { 108 | areaColor: '#e6b600' 109 | } 110 | } 111 | }, 112 | 113 | gauge: { 114 | axisLine: { 115 | show: true, 116 | lineStyle: { 117 | color: [[0.2, '#2b821d'],[0.8, '#005eaa'],[1, '#c12e34']], 118 | width: 5 119 | } 120 | }, 121 | axisTick: { 122 | splitNumber: 10, 123 | length:8, 124 | lineStyle: { 125 | color: 'auto' 126 | } 127 | }, 128 | axisLabel: { 129 | textStyle: { 130 | color: 'auto' 131 | } 132 | }, 133 | splitLine: { 134 | length: 12, 135 | lineStyle: { 136 | color: 'auto' 137 | } 138 | }, 139 | pointer: { 140 | length: '90%', 141 | width: 3, 142 | color: 'auto' 143 | }, 144 | title: { 145 | textStyle: { 146 | color: '#333' 147 | } 148 | }, 149 | detail: { 150 | textStyle: { 151 | color: 'auto' 152 | } 153 | } 154 | } 155 | }; 156 | echarts.registerTheme('shine', theme); 157 | })); -------------------------------------------------------------------------------- /js/show_connect.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 103 | -------------------------------------------------------------------------------- /js/show_graph_index.php: -------------------------------------------------------------------------------- 1 | 7 | 115 | -------------------------------------------------------------------------------- /js/show_graph_qps.php: -------------------------------------------------------------------------------- 1 | 7 | 131 | -------------------------------------------------------------------------------- /mail/mail.php: -------------------------------------------------------------------------------- 1 | send_mail_to_list = $send_mail_to_list; 10 | $this->alarm_subject = $alarm_subject; 11 | $this->alarm_info = $alarm_info; 12 | } 13 | 14 | function execCommand(){ 15 | echo $this->alarm_subject."\n"; 16 | echo $this->alarm_info."\n"; 17 | system("./mail/sendEmail -f chunyang_he@139.com -t '{$this->send_mail_to_list}' -s smtp.139.com:25 -u '{$this->alarm_subject}' -o message-charset=utf8 -o message-content-type=html -m '报警信息:
{$this->alarm_info}' -xu chunyang_he@139.com -xp '123456' -o tls=no"); 18 | } 19 | } 20 | 21 | ?> 22 | -------------------------------------------------------------------------------- /mysql_monitor_schema.sql: -------------------------------------------------------------------------------- 1 | /* 2 | SQLyog Professional v10.42 3 | MySQL - 8.0.18 : Database - sql_db 4 | ********************************************************************* 5 | */ 6 | 7 | 8 | /*!40101 SET NAMES utf8 */; 9 | 10 | /*!40101 SET SQL_MODE=''*/; 11 | 12 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 13 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 14 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 15 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 16 | CREATE DATABASE /*!32312 IF NOT EXISTS*/`sql_db` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */; 17 | 18 | USE `sql_db`; 19 | 20 | /*Table structure for table `mysql_repl_status` */ 21 | 22 | DROP TABLE IF EXISTS `mysql_repl_status`; 23 | 24 | CREATE TABLE `mysql_repl_status` ( 25 | `id` int(11) NOT NULL AUTO_INCREMENT, 26 | `server_id` int(11) DEFAULT NULL, 27 | `host` varchar(30) DEFAULT NULL, 28 | `dbname` varchar(100) DEFAULT NULL, 29 | `port` int(11) DEFAULT NULL, 30 | `role` tinyint(2) DEFAULT NULL, 31 | `is_live` tinyint(4) DEFAULT NULL, 32 | `read_only` varchar(10) DEFAULT NULL, 33 | `gtid_mode` varchar(20) DEFAULT NULL, 34 | `Master_Host` varchar(30) DEFAULT NULL, 35 | `Master_Port` varchar(100) DEFAULT NULL, 36 | `Slave_IO_Running` varchar(20) DEFAULT NULL, 37 | `Slave_SQL_Running` varchar(20) DEFAULT NULL, 38 | `Seconds_Behind_Master` varchar(20) DEFAULT NULL, 39 | `Master_Log_File` varchar(30) DEFAULT NULL, 40 | `Relay_Master_Log_File` varchar(30) DEFAULT NULL, 41 | `Read_Master_Log_Pos` varchar(30) DEFAULT NULL, 42 | `Exec_Master_Log_Pos` varchar(30) DEFAULT NULL, 43 | `Last_IO_Error` varchar(500) DEFAULT NULL, 44 | `Last_SQL_Error` varchar(500) DEFAULT NULL, 45 | `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 46 | PRIMARY KEY (`id`), 47 | KEY `IX_h_d_p_c` (`host`,`dbname`,`port`,`create_time`) 48 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; 49 | 50 | /*Table structure for table `mysql_status` */ 51 | 52 | DROP TABLE IF EXISTS `mysql_status`; 53 | 54 | CREATE TABLE `mysql_status` ( 55 | `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT, 56 | `host` varchar(30) DEFAULT NULL, 57 | `dbname` varchar(100) DEFAULT NULL, 58 | `port` int(11) DEFAULT NULL, 59 | `role` tinyint(4) DEFAULT NULL, 60 | `is_live` tinyint(4) DEFAULT NULL, 61 | `max_connections` int(11) DEFAULT NULL, 62 | `threads_connected` int(11) DEFAULT NULL, 63 | `qps_select` int(11) DEFAULT NULL, 64 | `qps_insert` int(11) DEFAULT NULL, 65 | `qps_update` int(11) DEFAULT NULL, 66 | `qps_delete` int(11) DEFAULT NULL, 67 | `Handler_read_key` int(11) DEFAULT NULL, 68 | `Handler_read_rnd_next` int(11) DEFAULT NULL, 69 | `runtime` int(11) DEFAULT NULL, 70 | `db_version` varchar(100) DEFAULT NULL, 71 | `create_time` timestamp NULL DEFAULT NULL, 72 | PRIMARY KEY (`id`), 73 | KEY `IX_h_d_p_c` (`host`,`dbname`,`port`,`create_time`) 74 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; 75 | 76 | /*Table structure for table `mysql_status_history` */ 77 | 78 | DROP TABLE IF EXISTS `mysql_status_history`; 79 | 80 | CREATE TABLE `mysql_status_history` ( 81 | `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT, 82 | `host` varchar(30) DEFAULT NULL, 83 | `dbname` varchar(100) DEFAULT NULL, 84 | `port` int(11) DEFAULT NULL, 85 | `role` tinyint(4) DEFAULT NULL, 86 | `is_live` tinyint(4) DEFAULT NULL, 87 | `max_connections` int(11) DEFAULT NULL, 88 | `threads_connected` int(11) DEFAULT NULL, 89 | `qps_select` int(11) DEFAULT NULL, 90 | `qps_insert` int(11) DEFAULT NULL, 91 | `qps_update` int(11) DEFAULT NULL, 92 | `qps_delete` int(11) DEFAULT NULL, 93 | `Handler_read_key` int(11) DEFAULT NULL, 94 | `Handler_read_rnd_next` int(11) DEFAULT NULL, 95 | `runtime` int(11) DEFAULT NULL, 96 | `db_version` varchar(100) DEFAULT NULL, 97 | `create_time` timestamp NULL DEFAULT NULL, 98 | PRIMARY KEY (`id`), 99 | KEY `create_time` (`create_time`), 100 | KEY `IX_h_d_p_c` (`host`,`dbname`,`port`,`create_time`) 101 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; 102 | 103 | /*Table structure for table `mysql_status_info` */ 104 | 105 | DROP TABLE IF EXISTS `mysql_status_info`; 106 | 107 | CREATE TABLE `mysql_status_info` ( 108 | `id` int(11) NOT NULL AUTO_INCREMENT, 109 | `ip` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '输入被监控MySQL的IP地址', 110 | `dbname` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '输入被监控MySQL的数据库名', 111 | `user` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '输入被监控MySQL的用户名', 112 | `pwd` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '输入被监控MySQL的密码', 113 | `port` int(11) DEFAULT NULL COMMENT '输入被监控MySQL的端口号', 114 | `monitor` tinyint(4) DEFAULT '1' COMMENT '0为关闭监控;1为开启监控', 115 | `send_mail` tinyint(4) DEFAULT '1' COMMENT '0为关闭邮件报警;1为开启邮件报警', 116 | `send_mail_to_list` varchar(255) DEFAULT NULL COMMENT '邮件人列表', 117 | `send_weixin` tinyint(4) DEFAULT '1' COMMENT '0为关闭微信报警;1为开启微信报警', 118 | `send_weixin_to_list` varchar(100) DEFAULT NULL COMMENT '微信公众号', 119 | `alarm_threads_running` tinyint(4) DEFAULT NULL COMMENT '记录活动连接数告警信息,1为已记录', 120 | `threshold_alarm_threads_running` int(11) DEFAULT NULL COMMENT '设置连接数阀值', 121 | `alarm_repl_status` tinyint(4) DEFAULT NULL COMMENT '记录主从复制告警信息,1为记录主从状态,3为记录主从延迟状态', 122 | `threshold_warning_repl_delay` int(11) DEFAULT NULL COMMENT '设置主从复制延迟阀值', 123 | PRIMARY KEY (`id`), 124 | KEY `IX_i_d_p` (`ip`,`dbname`,`port`) 125 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='监控信息表'; 126 | 127 | 128 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 129 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 130 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 131 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 132 | -------------------------------------------------------------------------------- /mysql_repl_monitor.php: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | MySQL 主从复制监控 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 46 | 47 | 59 | 60 | 61 | 62 |
63 | 66 | 67 |
68 |
69 | 70 |
71 |
72 | 73 |

输入IP地址: 74 | 75 | 95 |   输入MySQL端口号: 96 | 97 | 98 | 99 | 100 | 101 |

102 |
103 | 104 | 105 | "; 107 | echo ""; 108 | echo "复制监控采集阀值是每1分钟/次"; 109 | echo "

最新监控时间:".date('Y-m-d H:i:s').""; 110 | echo ""; 111 | echo ""; 112 | 113 | if(isset($_POST['submit'])){ 114 | $dbname=$_POST['dbname']; 115 | $dbip=$_POST['dbip']; 116 | $dbport=$_POST['dbport']; 117 | //session_start(); 118 | //$_SESSION['transmit_dbname']=$dbname; 119 | //require 'show.html'; 120 | } else { 121 | //require 'top.html'; 122 | } 123 | 124 | ?> 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | "; 181 | 182 | $result = mysqli_query($con,$sql); 183 | 184 | //echo "复制监控采集阀值是每1分钟/次 最新监控时间:".date('Y-m-d H:i:s')."
"; 185 | 186 | while($row = mysqli_fetch_array($result)) 187 | { 188 | if($row['5']==NULL){ 189 | $role='未知'; 190 | } else { 191 | $role=$row['5']==0?'slave':'master'; 192 | } 193 | //$role=$row['5']==0?'slave':'master'; 194 | $status=$row['6']==1?'在线':'宕机'; 195 | echo ""; 196 | echo ""; 197 | echo ""; 198 | echo ""; 199 | echo ""; 200 | echo ""; 201 | echo ""; 202 | echo ""; 203 | echo ""; 204 | echo ""; 205 | echo ""; 206 | echo ""; 207 | echo ""; 208 | echo ""; 209 | echo ""; 210 | echo ""; 211 | echo ""; 212 | echo ""; 213 | echo ""; 214 | echo ""; 215 | //echo ""; 216 | echo ""; 217 | } 218 | //end while 219 | echo ""; 220 | echo "
server_id主机数据库名端口角色状态只读模式Gtid模式主库地址主库端口IOSQL同步延迟Master_Log_FileRelay_Master_Log_FileRead_Master_Log_PosExec_Master_Log_PosLast_IO_ErrorLast_SQL_Error
{$row['1']}{$row['2']}{$row['3']}{$row['4']}{$role}{$status}{$row['7']}{$row['8']}{$row['9']}{$row['10']}{$row['11']}{$row['12']}{$row['13']}{$row['14']}{$row['15']}{$row['16']}{$row['17']}{$row['18']}{$row['19']}{$row['20']}
"; 221 | echo "

"; 222 | echo "
"; 223 | echo "
"; 224 | 225 | $maxPageCount=10; 226 | $buffCount=2; 227 | $startPage=1; 228 | 229 | if ($page< $buffCount){ 230 | $startPage=1; 231 | }else if($page>=$buffCount and $page<$totalPage-$maxPageCount ){ 232 | $startPage=$page-$buffCount+1; 233 | }else{ 234 | $startPage=$totalPage-$maxPageCount+1; 235 | } 236 | 237 | $endPage=$startPage+$maxPageCount-1; 238 | 239 | 240 | $htmlstr=""; 241 | 242 | $htmlstr.=""; 243 | if ($page > 1){ 244 | $htmlstr.=""; 245 | $htmlstr.=""; 246 | } 247 | 248 | $htmlstr.=""; 249 | 250 | for ($i=$startPage;$i<=$endPage; $i++){ 251 | 252 | $htmlstr.=""; 253 | } 254 | 255 | if ($page<$totalPage){ 256 | $htmlstr.=""; 257 | $htmlstr.=""; 258 | 259 | } 260 | $htmlstr.="
第一页 上一页 总共${totalPage}页" . $i . "下一页最后页
"; 261 | echo $htmlstr; 262 | 263 | ?> 264 | -------------------------------------------------------------------------------- /mysql_status_monitor.php: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | MySQL 状态监控 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 50 | 51 | 63 | 64 | 65 | 66 |
67 |
68 |

MySQL 状态监控

69 |
70 | 71 |
72 |
73 | 74 |
75 |
76 | 77 |

输入IP地址: 78 | 79 | 80 | 101 | 102 | 125 | 126 | 127 |   输入MySQL端口号: 128 | 129 | 130 | 131 | 132 | 133 |

134 |
135 | 136 | 137 | "; 139 | echo ""; 140 | echo "监控采集阀值是每1分钟/次"; 141 | echo "

最新监控时间:".date('Y-m-d H:i:s').""; 142 | echo ""; 143 | echo ""; 144 | 145 | if(isset($_POST['submit'])){ 146 | $dbname=$_POST['dbname']; 147 | $dbip=$_POST['dbip']; 148 | $dbport=$_POST['dbport']; 149 | $dbrole=$_POST['dbrole']; 150 | //session_start(); 151 | //$_SESSION['transmit_dbname']=$dbname; 152 | //require 'show.html'; 153 | } else { 154 | //require 'top.html'; 155 | } 156 | 157 | ?> 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | "; 212 | 213 | $result = mysqli_query($con,$sql); 214 | 215 | //echo "复制监控采集阀值是每1分钟/次 最新监控时间:".date('Y-m-d H:i:s')."
"; 216 | 217 | while($row = mysqli_fetch_array($result)) 218 | { 219 | if($row['5']==0){ 220 | $role='未知'; 221 | } else { 222 | $role=$row['4']==0?'slave':'master'; 223 | } 224 | $status=$row['5']==1?'在线':'宕机'; 225 | echo ""; 226 | echo ""; 227 | //echo ""; 228 | echo ""; 229 | echo ""; 230 | echo ""; 231 | echo ""; 232 | echo ""; 233 | echo ""; 234 | //echo ""; 235 | echo ""; 236 | echo ""; 237 | echo ""; 238 | echo ""; 239 | echo ""; 240 | echo ""; 241 | echo ""; 242 | echo ""; 243 | } 244 | //end while 245 | echo ""; 246 | echo "
主机数据库名端口角色状态最大连接数活动连接数每秒查询每秒插入每秒更新每秒删除运行时间版本图表
{$row['1']}{$row['2']}{$row['2']}{$row['3']}{$role}{$status}{$row['6']}{$row['7']}{$row['7']}{$row['8']}{$row['9']}{$row['10']}{$row['11']}{$row['14']} 天{$row['15']}
"; 247 | echo "

"; 248 | echo "
"; 249 | echo "
"; 250 | 251 | $maxPageCount=10; 252 | $buffCount=2; 253 | $startPage=1; 254 | 255 | if ($page< $buffCount){ 256 | $startPage=1; 257 | }else if($page>=$buffCount and $page<$totalPage-$maxPageCount ){ 258 | $startPage=$page-$buffCount+1; 259 | }else{ 260 | $startPage=$totalPage-$maxPageCount+1; 261 | } 262 | 263 | $endPage=$startPage+$maxPageCount-1; 264 | 265 | 266 | $htmlstr=""; 267 | 268 | $htmlstr.=""; 269 | if ($page > 1){ 270 | $htmlstr.=""; 271 | $htmlstr.=""; 272 | } 273 | 274 | $htmlstr.=""; 275 | 276 | for ($i=$startPage;$i<=$endPage; $i++){ 277 | 278 | $htmlstr.=""; 279 | } 280 | 281 | if ($page<$totalPage){ 282 | $htmlstr.=""; 283 | $htmlstr.=""; 284 | 285 | } 286 | $htmlstr.="
第一页 上一页 总共${totalPage}页" . $i . "下一页最后页
"; 287 | echo $htmlstr; 288 | 289 | ?> 290 | -------------------------------------------------------------------------------- /show_graph.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 图形展示 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 33 | 34 | 40 | 41 | 47 | 48 | 54 | 55 | 61 | 62 | 68 | 69 | 70 |
28 |
29 | 30 | 31 |
32 |
35 |
36 | 37 | 38 |
39 |
42 |
43 | 44 | 45 |
46 |
49 |
50 | 51 | 52 |
53 |
56 |
57 | 58 | 59 |
60 |
63 |
64 | 65 | 66 |
67 |
71 | 72 |
73 |
74 | 75 | '; 102 | 103 | ?> 104 | 105 | 106 | 107 |
108 | 109 |
110 | 111 |

112 |
113 | 114 |

115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /table_statistic.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | MySQL 信息统计 28 | 29 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
48 |
49 |
50 |
51 | 52 | 58 | 59 |

统计库里每个表的大小

60 | 61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | "; 93 | echo ""; 94 | echo ""; 95 | echo ""; 96 | echo ""; 97 | echo ""; 98 | echo ""; 99 | echo ""; 100 | echo ""; 101 | 102 | if($row['DATA_TYPE'] == 'int'){ 103 | if ($row['IS_SIGNED'] == 0){ 104 | echo ""; 105 | } 106 | if ($row['IS_SIGNED'] == 1){ 107 | echo ""; 108 | } 109 | } 110 | 111 | if($row['DATA_TYPE'] == 'bigint'){ 112 | if ($row['IS_SIGNED'] == 0){ 113 | echo ""; 114 | } 115 | if ($row['IS_SIGNED'] == 1){ 116 | echo ""; 117 | } 118 | } 119 | 120 | echo ""; 121 | } 122 | //end while 123 | echo ""; 124 | echo "
表名存储引擎数据大小(GB)索引大小(GB)总计(GB)主键自增字段主键字段属性主键自增当前值主键自增值剩余
{$row['TABLE_NAME']}{$row['ENGINE']}".round($row['DATA_LENGTH'],3)."".round($row['INDEX_LENGTH'],3)."".round($row['TOTAL_LENGTH'],3)."{$row['COLUMN_NAME']}{$row['COLUMN_TYPE']}{$row['AUTO_INCREMENT']}". (4294967295-$row['AUTO_INCREMENT']) ."". (2147483647-$row['AUTO_INCREMENT']) ."". number_format((18446744073709551615-$row['AUTO_INCREMENT']),0, '', '') ."". (9223372036854775807-$row['AUTO_INCREMENT']) ."
"; 125 | ?> 126 | 127 | 128 |
129 |
130 |

统计库里执行次数最频繁的前10条SQL语句

131 | 132 |
133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | performance_schema参数未开启。"."
"; 148 | echo "在my.cnf配置文件里添加performance_schema=1,并重启mysqld进程生效。"."
"; 149 | die; 150 | } 151 | 152 | $version=mysqli_fetch_row(mysqli_query($con_top10,"select version()")); 153 | if(preg_match("/5.7|8.0|10.6/",$version[0])){ 154 | //echo "MySQL的版本是$version[0]"."
"; 155 | mysqli_query($con_top10,"SET @sys.statement_truncate_len = 1024"); 156 | $Top_10_info=mysqli_query($con_top10,"select query,db,last_seen,exec_count from sys.statement_analysis order by exec_count desc, last_seen desc limit 10"); 157 | while($row_Top10 = mysqli_fetch_array($Top_10_info)) 158 | { 159 | echo ""; 160 | echo ""; 161 | echo ""; 162 | echo ""; 163 | echo ""; 164 | echo ""; 165 | } 166 | //end while 167 | }else{ 168 | $Top_10_info=mysqli_query($con_top10,"SELECT DIGEST_TEXT,SCHEMA_NAME,LAST_SEEN,COUNT_STAR FROM performance_schema.events_statements_summary_by_digest ORDER BY COUNT_STAR DESC LIMIT 10"); 169 | while($row_Top10 = mysqli_fetch_array($Top_10_info)) 170 | { 171 | echo ""; 172 | echo ""; 173 | echo ""; 174 | echo ""; 175 | echo ""; 176 | echo ""; 177 | } 178 | //echo "检测到当前数据库版本 $version[0] 不支持sys库特性!"."
"; 179 | } 180 | echo ""; 181 | echo "
执行语句数据库名最近执行时间SQL执行总次数
{$row_Top10['query']}{$row_Top10['db']}{$row_Top10['last_seen']}{$row_Top10['exec_count']}
{$row_Top10['DIGEST_TEXT']}{$row_Top10['SCHEMA_NAME']}{$row_Top10['LAST_SEEN']}{$row_Top10['COUNT_STAR']}
"; 182 | ?> 183 | 184 |
185 |
186 |

统计库里访问次数最多的前10张表

187 | 188 |
189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | performance_schema参数未开启。"."
"; 205 | echo "在my.cnf配置文件里添加performance_schema=1,并重启mysqld进程生效。"."
"; 206 | die; 207 | } 208 | 209 | $version=mysqli_fetch_row(mysqli_query($con_top10,"select version()")); 210 | if(preg_match("/5.7|8.0|10.6/",$version[0])){ 211 | //echo "MySQL的版本是$version[0]"."
"; 212 | //mysqli_query($con_top10,"SET @sys.statement_truncate_len = 1024"); 213 | $Top_10_ioinfo=mysqli_query($con_top10,"select file,count_read,total_read,count_write,total_written,total from sys.io_global_by_file_by_bytes limit 10"); 214 | while($row_Top10io = mysqli_fetch_array($Top_10_ioinfo)) 215 | { 216 | echo ""; 217 | echo ""; 218 | echo ""; 219 | echo ""; 220 | echo ""; 221 | echo ""; 222 | echo ""; 223 | echo ""; 224 | } 225 | //end while 226 | }else{ 227 | $Top_10_ioinfo=mysqli_query($con_top10,"select substring_index(FILE_NAME,'/',-2) AS file,COUNT_READ AS count_read,concat(round(SUM_NUMBER_OF_BYTES_READ/1024/1024/1024,2), ' GB') AS total_read,COUNT_WRITE AS count_write,concat(round(SUM_NUMBER_OF_BYTES_WRITE/1024/1024/1024,2), ' GB') AS total_written,concat(round((SUM_NUMBER_OF_BYTES_READ+SUM_NUMBER_OF_BYTES_WRITE)/1024/1024/1024,2), ' GB') AS total from performance_schema.file_summary_by_instance ORDER BY (COUNT_READ+COUNT_WRITE) DESC limit 10"); 228 | while($row_Top10io = mysqli_fetch_array($Top_10_ioinfo)) 229 | { 230 | echo ""; 231 | echo ""; 232 | echo ""; 233 | echo ""; 234 | echo ""; 235 | echo ""; 236 | echo ""; 237 | echo ""; 238 | } 239 | //echo "检测到当前数据库版本 $version[0] 不支持sys库特性!"."
"; 240 | } 241 | echo ""; 242 | echo "
表文件名总共读取次数总共读取数据量总共写入次数总共写入数据量总共读写数据量
{$row_Top10io['file']}{$row_Top10io['count_read']}{$row_Top10io['total_read']}{$row_Top10io['count_write']}{$row_Top10io['total_written']}{$row_Top10io['total']}
{$row_Top10io['file']}{$row_Top10io['count_read']}{$row_Top10io['total_read']}{$row_Top10io['count_write']}{$row_Top10io['total_written']}{$row_Top10io['total']}
"; 243 | ?> 244 |
245 |
246 |
247 |
248 | 249 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /weixin/wechat.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | #_*_coding:utf-8 _*_ 3 | #auther:火星小刘 4 | 5 | import requests,sys,json 6 | import urllib3 7 | urllib3.disable_warnings() 8 | 9 | reload(sys) 10 | sys.setdefaultencoding('utf-8') 11 | 12 | def GetTokenFromServer(Corpid,Secret): 13 | Url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken" 14 | Data = { 15 | "corpid":Corpid, 16 | "corpsecret":Secret 17 | } 18 | r = requests.get(url=Url,params=Data,verify=False) 19 | print(r.json()) 20 | if r.json()['errcode'] != 0: 21 | return False 22 | else: 23 | Token = r.json()['access_token'] 24 | file = open('/tmp/zabbix_wechat_config.json', 'w') 25 | file.write(r.text) 26 | file.close() 27 | return Token 28 | 29 | def SendMessage(User,Agentid,Subject,Content): 30 | try: 31 | file = open('/tmp/zabbix_wechat_config.json', 'r') 32 | Token = json.load(file)['access_token'] 33 | file.close() 34 | except: 35 | Token = GetTokenFromServer(Corpid, Secret) 36 | 37 | n = 0 38 | Url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s" % Token 39 | Data = { 40 | "touser": User, # 企业号中的用户帐号,在zabbix用户Media中配置,如果配置不正常,将按部门发送。 41 | #"totag": Tagid, # 企业号中的标签id,群发使用(推荐) 42 | #"toparty": Partyid, # 企业号中的部门id,群发时使用。 43 | "msgtype": "text", # 消息类型。 44 | "agentid": Agentid, # 企业号中的应用id。 45 | "text": { 46 | "content": Subject + '\n' + Content 47 | }, 48 | "safe": "0" 49 | } 50 | r = requests.post(url=Url,data=json.dumps(Data),verify=False) 51 | while r.json()['errcode'] != 0 and n < 4: 52 | n+=1 53 | Token = GetTokenFromServer(Corpid, Secret) 54 | if Token: 55 | Url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s" % Token 56 | r = requests.post(url=Url,data=json.dumps(Data),verify=False) 57 | print(r.json()) 58 | 59 | return r.json() 60 | 61 | 62 | if __name__ == '__main__': 63 | User = sys.argv[1] # zabbix传过来的第一个参数 64 | Subject = str(sys.argv[2]) # zabbix传过来的第二个参数 65 | Content = str(sys.argv[3]) # zabbix传过来的第三个参数 66 | 67 | Corpid = "wxaf" # CorpID是企业号的标识 68 | Secret = "aKDdCRT76" # Secret是管理组凭证密钥 69 | #Tagid = "1" # 通讯录标签ID 70 | Agentid = "1000001" # 应用ID 71 | #Partyid = "1" # 部门ID 72 | 73 | Status = SendMessage(User,Agentid,Subject,Content) 74 | print Status 75 | -------------------------------------------------------------------------------- /weixin/weixin.php: -------------------------------------------------------------------------------- 1 | send_weixin_to_list = $send_weixin_to_list; 11 | $this->alarm_subject = $alarm_subject; 12 | $this->alarm_info = $alarm_info; 13 | } 14 | 15 | function execCommand(){ 16 | echo $this->alarm_subject."\n"; 17 | echo $this->alarm_info."\n"; 18 | system("/usr/bin/python ./weixin/wechat.py '{$this->send_weixin_to_list}' '{$this->alarm_subject}' '【内容】:\n{$this->alarm_info}'"); 19 | } 20 | } 21 | 22 | ?> 23 | -------------------------------------------------------------------------------- /xadmin/css/font.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'iconfont'; 3 | src: url('../fonts/iconfont.eot'); 4 | src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'), 5 | url('../fonts/iconfont.woff') format('woff'), 6 | url('../fonts/iconfont.ttf') format('truetype'), 7 | url('../fonts/iconfont.svg#iconfont') format('svg'); 8 | } 9 | .iconfont{ 10 | font-family:"iconfont" !important; 11 | font-size:16px;font-style:normal; 12 | -webkit-font-smoothing: antialiased; 13 | -webkit-text-stroke-width: 0.2px; 14 | -moz-osx-font-smoothing: grayscale; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /xadmin/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/fonts/iconfont.eot -------------------------------------------------------------------------------- /xadmin/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/fonts/iconfont.ttf -------------------------------------------------------------------------------- /xadmin/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/fonts/iconfont.woff -------------------------------------------------------------------------------- /xadmin/images/aiwrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/images/aiwrap.png -------------------------------------------------------------------------------- /xadmin/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/images/bg.png -------------------------------------------------------------------------------- /xadmin/js/cookie.js: -------------------------------------------------------------------------------- 1 | function setCookie(name, value, expires, path, domain, secure) { 2 | if(typeof is_remember!="undefined") 3 | return false; 4 | var today = new Date(); 5 | today.setTime( today.getTime() ); 6 | var expires_date = new Date( today.getTime() + (expires) ); 7 | document.cookie= name + "=" + escape(value) + 8 | ((expires) ? "; expires=" + expires_date.toGMTString() : "") + 9 | ((path) ? "; path=" + path : "") + 10 | ((domain) ? "; domain=" + domain : "") + 11 | ((secure) ? "; secure" : ""); 12 | } 13 | function getCookie(name) { 14 | var dc = document.cookie; 15 | var prefix = name + "="; 16 | var begin = dc.indexOf("; " + prefix); 17 | if (begin == -1) { 18 | begin = dc.indexOf(prefix); 19 | if (begin != 0) return null; 20 | } else { 21 | begin += 2; 22 | } 23 | var end = document.cookie.indexOf(";", begin); 24 | if (end == -1) { 25 | end = dc.length; 26 | } 27 | return unescape(dc.substring(begin + prefix.length, end)); 28 | } 29 | function deleteCookie(name, path, domain) { 30 | if (getCookie(name)) { 31 | document.cookie = name + "=" + 32 | ((path) ? "; path=" + path : "") + 33 | ((domain) ? "; domain=" + domain : "") + 34 | "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 35 | } 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /xadmin/lib/layui/css/layui.mobile.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,legend,li,ol,p,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}html{font:12px 'Helvetica Neue','PingFang SC',STHeitiSC-Light,Helvetica,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0)}a{text-decoration:none;background:0 0}a:active,a:hover{outline:0}table{border-collapse:collapse;border-spacing:0}li{list-style:none}b,strong{font-weight:700}h1,h2,h3,h4,h5,h6{font-weight:500}address,cite,dfn,em,var{font-style:normal}dfn{font-style:italic}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}img{border:0;vertical-align:bottom}.layui-inline,input,label{vertical-align:middle}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;outline:0}button,select{text-transform:none}select{-webkit-appearance:none;border:none}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=1.0.7);src:url(../font/iconfont.eot?v=1.0.7#iefix) format('embedded-opentype'),url(../font/iconfont.woff?v=1.0.7) format('woff'),url(../font/iconfont.ttf?v=1.0.7) format('truetype'),url(../font/iconfont.svg?v=1.0.7#iconfont) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-box,.layui-box *{-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important;box-sizing:content-box!important}.layui-border-box,.layui-border-box *{-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important;box-sizing:border-box!important}.layui-inline{position:relative;display:inline-block;*display:inline;*zoom:1}.layui-edge,.layui-upload-iframe{position:absolute;width:0;height:0}.layui-edge{border-style:dashed;border-color:transparent;overflow:hidden}.layui-elip{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-disabled,.layui-disabled:active{background-color:#d2d2d2!important;color:#fff!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-upload-iframe{border:0;visibility:hidden}.layui-upload-enter{border:1px solid #009E94;background-color:#009E94;color:#fff;-webkit-transform:scale(1.1);transform:scale(1.1)}@-webkit-keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.layui-m-anim-scale{animation-name:layui-m-anim-scale;-webkit-animation-name:layui-m-anim-scale}@-webkit-keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.layui-m-anim-up{-webkit-animation-name:layui-m-anim-up;animation-name:layui-m-anim-up}@-webkit-keyframes layui-m-anim-left{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes layui-m-anim-left{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}.layui-m-anim-left{-webkit-animation-name:layui-m-anim-left;animation-name:layui-m-anim-left}@-webkit-keyframes layui-m-anim-right{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes layui-m-anim-right{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}.layui-m-anim-right{-webkit-animation-name:layui-m-anim-right;animation-name:layui-m-anim-right}@-webkit-keyframes layui-m-anim-lout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes layui-m-anim-lout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}.layui-m-anim-lout{-webkit-animation-name:layui-m-anim-lout;animation-name:layui-m-anim-lout}@-webkit-keyframes layui-m-anim-rout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes layui-m-anim-rout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(100%);transform:translateX(100%)}}.layui-m-anim-rout{-webkit-animation-name:layui-m-anim-rout;animation-name:layui-m-anim-rout}.layui-m-layer{position:relative;z-index:19891014}.layui-m-layer *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.layui-m-layermain,.layui-m-layershade{position:fixed;left:0;top:0;width:100%;height:100%}.layui-m-layershade{background-color:rgba(0,0,0,.7);pointer-events:auto}.layui-m-layermain{display:table;font-family:Helvetica,arial,sans-serif;pointer-events:none}.layui-m-layermain .layui-m-layersection{display:table-cell;vertical-align:middle;text-align:center}.layui-m-layerchild{position:relative;display:inline-block;text-align:left;background-color:#fff;font-size:14px;border-radius:5px;box-shadow:0 0 8px rgba(0,0,0,.1);pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}.layui-m-layer0 .layui-m-layerchild{width:90%;max-width:640px}.layui-m-layer1 .layui-m-layerchild{border:none;border-radius:0}.layui-m-layer2 .layui-m-layerchild{width:auto;max-width:260px;min-width:40px;border:none;background:0 0;box-shadow:none;color:#fff}.layui-m-layerchild h3{padding:0 10px;height:60px;line-height:60px;font-size:16px;font-weight:400;border-radius:5px 5px 0 0;text-align:center}.layui-m-layerbtn span,.layui-m-layerchild h3{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-m-layercont{padding:50px 30px;line-height:22px;text-align:center}.layui-m-layer1 .layui-m-layercont{padding:0;text-align:left}.layui-m-layer2 .layui-m-layercont{text-align:center;padding:0;line-height:0}.layui-m-layer2 .layui-m-layercont i{width:25px;height:25px;margin-left:8px;display:inline-block;background-color:#fff;border-radius:100%;-webkit-animation:layui-m-anim-loading 1.4s infinite ease-in-out;animation:layui-m-anim-loading 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-m-layerbtn,.layui-m-layerbtn span{position:relative;text-align:center;border-radius:0 0 5px 5px}.layui-m-layer2 .layui-m-layercont p{margin-top:20px}@-webkit-keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}@keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.layui-m-layer2 .layui-m-layercont i:first-child{margin-left:0;-webkit-animation-delay:-.32s;animation-delay:-.32s}.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{-webkit-animation-delay:-.16s;animation-delay:-.16s}.layui-m-layer2 .layui-m-layercont>div{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px} -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/laydate/default/laydate.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | .laydate-set-ym,.layui-laydate,.layui-laydate *,.layui-laydate-list{box-sizing:border-box}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:laydate-upbit;animation-name:laydate-upbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@-webkit-keyframes laydate-upbit{from{-webkit-transform:translate3d(0,20px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes laydate-upbit{from{transform:translate3d(0,20px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon,.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.laydate-set-ym span,.layui-laydate-header i{padding:0 5px;cursor:pointer}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;color:#999;font-size:18px}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;height:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px 20px}.layui-laydate-footer span{margin-right:15px;display:inline-block;cursor:pointer;font-size:12px}.layui-laydate-footer span:hover{color:#5FB878}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{height:26px;line-height:26px;margin:0 0 0 -1px;padding:0 10px;border:1px solid #C9C9C9;background-color:#fff;white-space:nowrap;vertical-align:top;border-radius:2px}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;background-color:#fff}.layui-laydate-list>li{position:relative;width:33.3%;height:36px;line-height:36px;margin:3px 0;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px}.layui-laydate-range{width:546px}.layui-laydate-range .laydate-main-list-0 .laydate-next-m,.layui-laydate-range .laydate-main-list-0 .laydate-next-y,.layui-laydate-range .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5FB878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{font-weight:400;color:#333}.layui-laydate-content td{color:#666}.layui-laydate-content td.laydate-selected{background-color:#00F7DE}.laydate-selected:hover{background-color:#00F7DE!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eaeaea;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.laydate-selected.laydate-day-next,.laydate-selected.laydate-day-prev{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#FF5722}.laydate-day-mark::after{background-color:#5FB878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5FB878}.layui-laydate .layui-this{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-next,.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px} -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/font/iconfont.eot -------------------------------------------------------------------------------- /xadmin/lib/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /xadmin/lib/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/font/iconfont.woff -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/0.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/1.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/10.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/11.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/12.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/13.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/14.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/15.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/16.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/17.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/18.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/19.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/2.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/20.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/21.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/22.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/23.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/24.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/25.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/26.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/27.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/28.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/29.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/3.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/30.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/31.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/32.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/33.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/34.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/35.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/36.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/37.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/38.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/39.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/4.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/40.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/41.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/42.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/43.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/44.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/45.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/46.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/47.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/48.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/49.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/5.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/50.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/51.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/52.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/53.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/54.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/55.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/56.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/57.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/58.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/59.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/6.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/60.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/61.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/62.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/63.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/64.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/65.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/66.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/67.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/68.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/69.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/7.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/70.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/71.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/8.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/mysql_monitor/a75107ea5cad0e04fd9128c721cb7d96c0eed23a/xadmin/lib/layui/images/face/9.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
    ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/colorpicker.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.jquery,o={config:{},index:layui.colorpicker?layui.colorpicker.index+1e4:0,set:function(e){var o=this;return o.config=i.extend({},o.config,e),o},on:function(e,i){return layui.onevent.call(this,"colorpicker",e,i)}},r=function(){var e=this,i=e.config;return{config:i}},t="colorpicker",n="layui-show",l="layui-colorpicker",c=".layui-colorpicker-main",a="layui-icon-down",s="layui-icon-close",f="layui-colorpicker-trigger-span",d="layui-colorpicker-trigger-i",u="layui-colorpicker-side",p="layui-colorpicker-side-slider",g="layui-colorpicker-basis",v="layui-colorpicker-alpha-bgcolor",h="layui-colorpicker-alpha-slider",m="layui-colorpicker-basis-cursor",b="layui-colorpicker-main-input",k=function(e){var i={h:0,s:0,b:0},o=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),t=r-o;return i.b=r,i.s=0!=r?255*t/r:0,0!=i.s?e.r==r?i.h=(e.g-e.b)/t:e.g==r?i.h=2+(e.b-e.r)/t:i.h=4+(e.r-e.g)/t:i.h=-1,r==o&&(i.h=0),i.h*=60,i.h<0&&(i.h+=360),i.s*=100/255,i.b*=100/255,i},y=function(e){var e=e.indexOf("#")>-1?e.substring(1):e;if(3==e.length){var i=e.split("");e=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]}e=parseInt(e,16);var o={r:e>>16,g:(65280&e)>>8,b:255&e};return k(o)},x=function(e){var i={},o=e.h,r=255*e.s/100,t=255*e.b/100;if(0==r)i.r=i.g=i.b=t;else{var n=t,l=(255-r)*t/255,c=(n-l)*(o%60)/60;360==o&&(o=0),o<60?(i.r=n,i.b=l,i.g=l+c):o<120?(i.g=n,i.b=l,i.r=n-c):o<180?(i.g=n,i.r=l,i.b=l+c):o<240?(i.b=n,i.r=l,i.g=n-c):o<300?(i.b=n,i.g=l,i.r=l+c):o<360?(i.r=n,i.g=l,i.b=n-c):(i.r=0,i.g=0,i.b=0)}return{r:Math.round(i.r),g:Math.round(i.g),b:Math.round(i.b)}},C=function(e){var o=x(e),r=[o.r.toString(16),o.g.toString(16),o.b.toString(16)];return i.each(r,function(e,i){1==i.length&&(r[e]="0"+i)}),r.join("")},P=function(e){var i=/[0-9]{1,3}/g,o=e.match(i)||[];return{r:o[0],g:o[1],b:o[2]}},B=i(window),w=i(document),D=function(e){var r=this;r.index=++o.index,r.config=i.extend({},r.config,o.config,e),r.render()};D.prototype.config={color:"",size:null,alpha:!1,format:"hex",predefine:!1,colors:["#009688","#5FB878","#1E9FFF","#FF5722","#FFB800","#01AAED","#999","#c00","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgb(0, 186, 189)","rgb(255, 120, 0)","rgb(250, 212, 0)","#393D49","rgba(0,0,0,.5)","rgba(255, 69, 0, 0.68)","rgba(144, 240, 144, 0.5)","rgba(31, 147, 255, 0.73)"]},D.prototype.render=function(){var e=this,o=e.config,r=i(['
',"",'3&&(o.alpha&&"rgb"==o.format||(e="#"+C(k(P(o.color))))),"background: "+e):e}()+'">','',"","","
"].join("")),t=i(o.elem);o.size&&r.addClass("layui-colorpicker-"+o.size),t.addClass("layui-inline").html(e.elemColorBox=r),e.color=e.elemColorBox.find("."+f)[0].style.background,e.events()},D.prototype.renderPicker=function(){var e=this,o=e.config,r=e.elemColorBox[0],t=e.elemPicker=i(['
','
','
','
','
','
',"
",'
','
',"
","
",'
','
','
',"
","
",function(){if(o.predefine){var e=['
'];return layui.each(o.colors,function(i,o){e.push(['
','
',"
"].join(""))}),e.push("
"),e.join("")}return""}(),'
','
','',"
",'
','','',"","
"].join(""));e.elemColorBox.find("."+f)[0];i(c)[0]&&i(c).data("index")==e.index?e.removePicker(D.thisElemInd):(e.removePicker(D.thisElemInd),i("body").append(t)),D.thisElemInd=e.index,D.thisColor=r.style.background,e.position(),e.pickerEvents()},D.prototype.removePicker=function(e){var o=this;o.config;return i("#layui-colorpicker"+(e||o.index)).remove(),o},D.prototype.position=function(){var e=this,i=e.config,o=e.bindElem||e.elemColorBox[0],r=e.elemPicker[0],t=o.getBoundingClientRect(),n=r.offsetWidth,l=r.offsetHeight,c=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},a=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},s=5,f=t.left,d=t.bottom;f-=(n-o.offsetWidth)/2,d+=s,f+n+s>a("width")?f=a("width")-n-s:fa()&&(d=t.top>l?t.top-l:a()-l,d-=2*s),i.position&&(r.style.position=i.position),r.style.left=f+("fixed"===i.position?0:c(1))+"px",r.style.top=d+("fixed"===i.position?0:c())+"px"},D.prototype.val=function(){var e=this,i=(e.config,e.elemColorBox.find("."+f)),o=e.elemPicker.find("."+b),r=i[0],t=r.style.backgroundColor;if(t){var n=k(P(t)),l=i.attr("lay-type");if(e.select(n.h,n.s,n.b),"torgb"===l&&o.find("input").val(t),"rgba"===l){var c=P(t);if(3==(t.match(/[0-9]{1,3}/g)||[]).length)o.find("input").val("rgba("+c.r+", "+c.g+", "+c.b+", 1)"),e.elemPicker.find("."+h).css("left",280);else{o.find("input").val(t);var a=280*t.slice(t.lastIndexOf(",")+1,t.length-1);e.elemPicker.find("."+h).css("left",a)}e.elemPicker.find("."+v)[0].style.background="linear-gradient(to right, rgba("+c.r+", "+c.g+", "+c.b+", 0), rgb("+c.r+", "+c.g+", "+c.b+"))"}}else e.select(0,100,100),o.find("input").val(""),e.elemPicker.find("."+v)[0].style.background="",e.elemPicker.find("."+h).css("left",280)},D.prototype.side=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=r.attr("lay-type"),n=e.elemPicker.find("."+u),l=e.elemPicker.find("."+p),c=e.elemPicker.find("."+g),y=e.elemPicker.find("."+m),C=e.elemPicker.find("."+v),w=e.elemPicker.find("."+h),D=l[0].offsetTop/180*360,E=100-(y[0].offsetTop+3)/180*100,H=(y[0].offsetLeft+3)/260*100,W=Math.round(w[0].offsetLeft/280*100)/100,j=e.elemColorBox.find("."+d),F=e.elemPicker.find(".layui-colorpicker-pre").children("div"),L=function(i,n,l,c){e.select(i,n,l);var f=x({h:i,s:n,b:l});if(j.addClass(a).removeClass(s),r[0].style.background="rgb("+f.r+", "+f.g+", "+f.b+")","torgb"===t&&e.elemPicker.find("."+b).find("input").val("rgb("+f.r+", "+f.g+", "+f.b+")"),"rgba"===t){var d=0;d=280*c,w.css("left",d),e.elemPicker.find("."+b).find("input").val("rgba("+f.r+", "+f.g+", "+f.b+", "+c+")"),r[0].style.background="rgba("+f.r+", "+f.g+", "+f.b+", "+c+")",C[0].style.background="linear-gradient(to right, rgba("+f.r+", "+f.g+", "+f.b+", 0), rgb("+f.r+", "+f.g+", "+f.b+"))"}o.change&&o.change(e.elemPicker.find("."+b).find("input").val())},M=i(['
t&&(r=t);var l=r/180*360;D=l,L(l,H,E,W),e.preventDefault()};Y(r),e.preventDefault()}),n.on("click",function(e){var o=e.clientY-i(this).offset().top;o<0&&(o=0),o>this.offsetHeight&&(o=this.offsetHeight);var r=o/180*360;D=r,L(r,H,E,W),e.preventDefault()}),y.on("mousedown",function(e){var i=this.offsetTop,o=this.offsetLeft,r=e.clientY,t=e.clientX,n=function(e){var n=i+(e.clientY-r),l=o+(e.clientX-t),a=c[0].offsetHeight-3,s=c[0].offsetWidth-3;n<-3&&(n=-3),n>a&&(n=a),l<-3&&(l=-3),l>s&&(l=s);var f=(l+3)/260*100,d=100-(n+3)/180*100;E=d,H=f,L(D,f,d,W),e.preventDefault()};layui.stope(e),Y(n),e.preventDefault()}),c.on("mousedown",function(e){var o=e.clientY-i(this).offset().top-3+B.scrollTop(),r=e.clientX-i(this).offset().left-3+B.scrollLeft();o<-3&&(o=-3),o>this.offsetHeight-3&&(o=this.offsetHeight-3),r<-3&&(r=-3),r>this.offsetWidth-3&&(r=this.offsetWidth-3);var t=(r+3)/260*100,n=100-(o+3)/180*100;E=n,H=t,L(D,t,n,W),e.preventDefault(),y.trigger(e,"mousedown")}),w.on("mousedown",function(e){var i=this.offsetLeft,o=e.clientX,r=function(e){var r=i+(e.clientX-o),t=C[0].offsetWidth;r<0&&(r=0),r>t&&(r=t);var n=Math.round(r/280*100)/100;W=n,L(D,H,E,n),e.preventDefault()};Y(r),e.preventDefault()}),C.on("click",function(e){var o=e.clientX-i(this).offset().left;o<0&&(o=0),o>this.offsetWidth&&(o=this.offsetWidth);var r=Math.round(o/280*100)/100;W=r,L(D,H,E,r),e.preventDefault()}),F.each(function(){i(this).on("click",function(){i(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected");var e,o=this.style.backgroundColor,r=k(P(o)),t=o.slice(o.lastIndexOf(",")+1,o.length-1);D=r.h,H=r.s,E=r.b,3==(o.match(/[0-9]{1,3}/g)||[]).length&&(t=1),W=t,e=280*t,L(r.h,r.s,r.b,t)})})},D.prototype.select=function(e,i,o,r){var t=this,n=(t.config,C({h:e,s:100,b:100})),l=C({h:e,s:i,b:o}),c=e/360*180,a=180-o/100*180-3,s=i/100*260-3;t.elemPicker.find("."+p).css("top",c),t.elemPicker.find("."+g)[0].style.background="#"+n,t.elemPicker.find("."+m).css({top:a,left:s}),"change"!==r&&t.elemPicker.find("."+b).find("input").val("#"+l)},D.prototype.pickerEvents=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=e.elemPicker.find("."+b+" input"),n={clear:function(i){r[0].style.background="",e.elemColorBox.find("."+d).removeClass(a).addClass(s),e.color="",o.done&&o.done(""),e.removePicker()},confirm:function(i,n){var l=t.val(),c=l,f={};if(l.indexOf(",")>-1){if(f=k(P(l)),e.select(f.h,f.s,f.b),r[0].style.background=c="#"+C(f),(l.match(/[0-9]{1,3}/g)||[]).length>3&&"rgba"===r.attr("lay-type")){var u=280*l.slice(l.lastIndexOf(",")+1,l.length-1);e.elemPicker.find("."+h).css("left",u),r[0].style.background=l,c=l}}else f=y(l),r[0].style.background=c="#"+C(f),e.elemColorBox.find("."+d).removeClass(s).addClass(a);return"change"===n?(e.select(f.h,f.s,f.b,n),void(o.change&&o.change(c))):(e.color=l,o.done&&o.done(l),void e.removePicker())}};e.elemPicker.on("click","*[colorpicker-events]",function(){var e=i(this),o=e.attr("colorpicker-events");n[o]&&n[o].call(this,e)}),t.on("keyup",function(e){var o=i(this);n.confirm.call(this,o,13===e.keyCode?null:"change")})},D.prototype.events=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f);e.elemColorBox.on("click",function(){e.renderPicker(),i(c)[0]&&(e.val(),e.side())}),o.elem[0]&&!e.elemColorBox[0].eventHandler&&(w.on("click",function(o){if(!i(o.target).hasClass(l)&&!i(o.target).parents("."+l)[0]&&!i(o.target).hasClass(c.replace(/\./g,""))&&!i(o.target).parents(c)[0]&&e.elemPicker){if(e.color){var t=k(P(e.color));e.select(t.h,t.s,t.b)}else e.elemColorBox.find("."+d).removeClass(a).addClass(s);r[0].style.background=e.color||"",e.removePicker()}}),B.on("resize",function(){return!(!e.elemPicker||!i(c)[0])&&void e.position()}),e.elemColorBox[0].eventHandler=!0)},o.render=function(e){var i=new D(e);return r.call(i)},e(t,o)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/element.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var a=layui.$,i=(layui.hint(),layui.device()),e="element",l="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(t){var i=this;return a.extend(!0,i.config,t),i},s.prototype.on=function(t,a){return layui.onevent.call(this,e,t,a)},s.prototype.tabAdd=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.children(".layui-tab-bar"),o=l.children(".layui-tab-content"),r='
  • "+(i.title||"unnaming")+"
  • ";return s[0]?s.before(r):n.append(r),o.append('
    '+(i.content||"")+"
    "),f.hideTabMore(!0),f.tabAuto(),this},s.prototype.tabDelete=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabDelete(null,s),this},s.prototype.tabChange=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(t){t=t||{},b.on("click",t.headerElem,function(i){var e=a(this).index();f.tabClick.call(this,i,e,null,t)})},s.prototype.progress=function(t,i){var e="layui-progress",l=a("."+e+"[lay-filter="+t+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",i),s.text(i),this};var o=".layui-nav",r="layui-nav-item",c="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",y="layui-nav-more",h="layui-anim layui-anim-upbit",f={tabClick:function(t,i,s,o){o=o||{};var r=s||a(this),i=i||r.parent().children("li").index(r),c=o.headerElem?r.parent():r.parents(".layui-tab").eq(0),u=o.bodyElem?a(o.bodyElem):c.children(".layui-tab-content").children(".layui-tab-item"),d=r.find("a"),y=c.attr("lay-filter");"javascript:;"!==d.attr("href")&&"_blank"===d.attr("target")||(r.addClass(l).siblings().removeClass(l),u.eq(i).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+y+")",{elem:c,index:i})},tabDelete:function(t,i){var n=i||a(this).parent(),s=n.index(),o=n.parents(".layui-tab").eq(0),r=o.children(".layui-tab-content").children(".layui-tab-item"),c=o.attr("lay-filter");n.hasClass(l)&&(n.next()[0]?f.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&f.tabClick.call(n.prev()[0],null,s-1)),n.remove(),r.eq(s).remove(),setTimeout(function(){f.tabAuto()},50),layui.event.call(this,e,"tabDelete("+c+")",{elem:o,index:s})},tabAuto:function(){var t="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",n=this;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),r=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),c=a('');if(n===window&&8!=i.ie&&f.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var t=a(this);if(!t.find("."+l)[0]){var i=a('');i.on("click",f.tabDelete),t.append(i)}}),"string"!=typeof s.attr("lay-unauto"))if(o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+e)[0])return;o.append(c),s.attr("overflow",""),c.on("click",function(a){o[this.title?"removeClass":"addClass"](t),this.title=this.title?"":"收缩"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(t){var i=a(".layui-tab-title");t!==!0&&"tabmore"===a(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=a(this),i=t.parents(o),n=i.attr("lay-filter"),s=t.parent(),c=t.siblings("."+d),y="string"==typeof s.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||y||c[0]||(i.find("."+l).removeClass(l),s.addClass(l)),i.hasClass(u)&&(c.removeClass(h),c[0]&&(s["none"===c.css("display")?"addClass":"removeClass"](r+"ed"),"all"===i.attr("lay-shrink")&&s.siblings().removeClass(r+"ed"))),layui.event.call(this,e,"nav("+n+")",t)},collapse:function(){var t=a(this),i=t.find(".layui-colla-icon"),l=t.siblings(".layui-colla-content"),s=t.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),r="none"===l.css("display");if("string"==typeof s.attr("lay-accordion")){var c=s.children(".layui-colla-item").children("."+n);c.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),c.removeClass(n)}l[r?"addClass":"removeClass"](n),i.html(r?"":""),layui.event.call(this,e,"collapse("+o+")",{title:t,content:l,show:r})}};s.prototype.init=function(t,e){var l=function(){return e?'[lay-filter="'+e+'"]':""}(),s={tab:function(){f.tabAuto.call({})},nav:function(){var t=200,e={},s={},p={},b=function(l,o,r){var c=a(this),f=c.find("."+d);o.hasClass(u)?l.css({top:c.position().top,height:c.children("a").outerHeight(),opacity:1}):(f.addClass(h),l.css({left:c.position().left+parseFloat(c.css("marginLeft")),top:c.position().top+c.height()-l.height()}),e[r]=setTimeout(function(){l.css({width:c.width(),opacity:1})},i.ie&&i.ie<10?0:t),clearTimeout(p[r]),"block"===f.css("display")&&clearTimeout(s[r]),s[r]=setTimeout(function(){f.addClass(n),c.find("."+y).addClass(y+"d")},300))};a(o+l).each(function(i){var l=a(this),o=a(''),h=l.find("."+r);l.find("."+c)[0]||(l.append(o),h.on("mouseenter",function(){b.call(this,o,l,i)}).on("mouseleave",function(){l.hasClass(u)||(clearTimeout(s[i]),s[i]=setTimeout(function(){l.find("."+d).removeClass(n),l.find("."+y).removeClass(y+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[i]),p[i]=setTimeout(function(){l.hasClass(u)?o.css({height:0,top:o.position().top+o.height()/2,opacity:0}):o.css({width:0,left:o.position().left+o.width()/2,opacity:0})},t)})),h.find("a").each(function(){var t=a(this),i=(t.parent(),t.siblings("."+d));i[0]&&!t.children("."+y)[0]&&t.append(''),t.off("click",f.clickThis).on("click",f.clickThis)})})},breadcrumb:function(){var t=".layui-breadcrumb";a(t+l).each(function(){var t=a(this),i="lay-separator",e=t.attr(i)||"/",l=t.find("a");l.next("span["+i+"]")[0]||(l.each(function(t){t!==l.length-1&&a(this).after(""+e+"")}),t.css("visibility","visible"))})},progress:function(){var t="layui-progress";a("."+t+l).each(function(){var i=a(this),e=i.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),i.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var t="layui-collapse";a("."+t+l).each(function(){var t=a(this).find(".layui-colla-item");t.each(function(){var t=a(this),i=t.find(".layui-colla-title"),e=t.find(".layui-colla-content"),l="none"===e.css("display");i.find(".layui-colla-icon").remove(),i.append(''+(l?"":"")+""),i.off("click",f.collapse).on("click",f.collapse)})})}};return s[t]?s[t]():layui.each(s,function(t,a){a()})},s.prototype.render=s.prototype.init;var p=new s,b=a(document);p.render();var v=".layui-tab-title li";b.on("click",v,f.tabClick),b.on("click",f.hideTabMore),a(window).on("resize",f.tabAuto),t(e,p)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/form.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",r=".layui-form",s="layui-this",o="layui-hide",c="layui-disabled",u=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};u.prototype.set=function(e){var i=this;return t.extend(!0,i.config,e),i},u.prototype.verify=function(e){var i=this;return t.extend(!0,i.config.verify,e),i},u.prototype.on=function(e,t){return layui.onevent.call(this,l,e,t)},u.prototype.val=function(e,i){var a=t(r+'[lay-filter="'+e+'"]');a.each(function(e,a){var n=t(this);layui.each(i,function(e,t){var i,a=n.find('[name="'+e+'"]');a[0]&&(i=a[0].type,"checkbox"===i?a[0].checked=t:"radio"===i?a.each(function(){this.value===t&&(this.checked=!0)}):a.val(t))})}),f.render(null,e)},u.prototype.render=function(e,i){var n=this,u=t(r+function(){return i?'[lay-filter="'+i+'"]':""}()),d={select:function(){var e,i="请选择",a="layui-form-select",n="layui-select-title",r="layui-select-none",d="",f=u.find("select"),v=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},y=function(i,u,f){var y,p=t(this),m=i.find("."+n),k=m.find("input"),x=i.find("dl"),g=x.children("dd"),b=this.selectedIndex;if(!u){var C=function(){var e=i.offset().top+i.outerHeight()+5-h.scrollTop(),t=x.outerHeight();b=p[0].selectedIndex,i.addClass(a+"ed"),g.removeClass(o),y=null,g.eq(b).addClass(s).siblings().removeClass(s),e+t>h.height()&&e>=t&&i.addClass(a+"up"),$()},w=function(e){i.removeClass(a+"ed "+a+"up"),k.blur(),y=null,e||T(k.val(),function(e){var i=p[0].selectedIndex;e&&(d=t(p[0].options[i]).html(),0===i&&d===k.attr("placeholder")&&(d=""),k.val(d||""))})},$=function(){var e=x.children("dd."+s);if(e[0]){var t=e.position().top,i=x.height(),a=e.height();t>i&&x.scrollTop(t+x.scrollTop()-i+a-5),t<0&&x.scrollTop(t+x.scrollTop()-5)}};m.on("click",function(e){i.hasClass(a+"ed")?w():(v(e,!0),C()),x.find("."+r).remove()}),m.find(".layui-edge").on("click",function(){k.focus()}),k.on("keyup",function(e){var t=e.keyCode;9===t&&C()}).on("keydown",function(e){var t=e.keyCode;9===t&&w();var i=function(t,a){var n,l;e.preventDefault();var r=function(){var e=x.children("dd."+s);if(x.children("dd."+o)[0]&&"next"===t){var i=x.children("dd:not(."+o+",."+c+")"),n=i.eq(0).index();if(n>=0&&n无匹配项

    '):x.find("."+r).remove()},"keyup"),""===t&&x.find("."+r).remove(),void $())};f&&k.on("keyup",j).on("blur",function(i){var a=p[0].selectedIndex;e=k,d=t(p[0].options[a]).html(),0===a&&d===k.attr("placeholder")&&(d=""),setTimeout(function(){T(k.val(),function(e){d||k.val("")},"blur")},200)}),g.on("click",function(){var e=t(this),a=e.attr("lay-value"),n=p.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?k.val(""):(k.val(e.text()),e.addClass(s)),e.siblings().removeClass(s),p.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:p[0],value:a,othis:i}),w(!0),!1)}),i.find("dl>dt").on("click",function(e){return!1}),t(document).off("click",v).on("click",v)}};f.each(function(e,l){var r=t(this),o=r.next("."+a),u=this.disabled,d=l.value,f=t(l.options[l.selectedIndex]),v=l.options[0];if("string"==typeof r.attr("lay-ignore"))return r.show();var h="string"==typeof r.attr("lay-search"),p=v?v.value?i:v.innerHTML||i:i,m=t(['
    ','
    ','','
    ','
    ',function(e){var t=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?t.push("
    "+a.label+"
    "):t.push('
    '+a.innerHTML+"
    "):t.push('
    '+(a.innerHTML||i)+"
    ")}),0===t.length&&t.push('
    没有选项
    '),t.join("")}(r.find("*"))+"
    ","
    "].join(""));o[0]&&o.remove(),r.after(m),y.call(this,m,u,h)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},i=u.find("input[type=checkbox]"),a=function(e,i){var a=t(this);e.on("click",function(){var t=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(i[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(i[1]).find("em").text(n[0])),layui.event.call(a[0],l,i[2]+"("+t+")",{elem:a[0],value:a[0].value,othis:e}))})};i.each(function(i,n){var l=t(this),r=l.attr("lay-skin"),s=(l.attr("lay-text")||"").split("|"),o=this.disabled;"switch"===r&&(r="_"+r);var u=e[r]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+u[0]),f=t(['
    ",function(){var e=n.title.replace(/\s/g,""),t={checkbox:[e?""+n.title+"":"",''].join(""),_switch:""+((n.checked?s[0]:s[1])||"")+""};return t[r]||t.checkbox}(),"
    "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",i=["",""],a=u.find("input[type=radio]"),n=function(a){var n=t(this),s="layui-anim-scaleSpring";a.on("click",function(){var o=n[0].name,c=n.parents(r),u=n.attr("lay-filter"),d=c.find("input[name="+o.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=t(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(i[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(i[0]),layui.event.call(n[0],l,"radio("+u+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var r=t(this),s=r.next("."+e),o=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();s[0]&&s.remove();var u=t(['
    ',''+i[l.checked?0:1]+"","
    "+function(){var e=l.title||"";return"string"==typeof r.next().attr("lay-radio")&&(e=r.next().html(),r.next().remove()),e}()+"
    ","
    "].join(""));r.after(u),n.call(this,u)})}};return e?d[e]?d[e]():a.error("不支持的"+e+"表单渲染"):layui.each(d,function(e,t){t()}),n};var d=function(){var e=t(this),a=f.config.verify,s=null,o="layui-form-danger",c={},u=e.parents(r),d=u.find("*[lay-verify]"),v=e.parents("form")[0],h=u.find("input,select,textarea"),y=e.attr("lay-filter");if(layui.each(d,function(e,l){var r=t(this),c=r.attr("lay-verify").split("|"),u=r.attr("lay-verType"),d=r.val();if(r.removeClass(o),layui.each(c,function(e,t){var c,f="",v="function"==typeof a[t];if(a[t]){var c=v?f=a[t](d,l):!a[t][0].test(d);if(f=f||a[t][1],c)return"tips"===u?i.tips(f,function(){return"string"==typeof r.attr("lay-ignore")||"select"!==l.tagName.toLowerCase()&&!/^checkbox|radio$/.test(l.type)?r:r.next()}(),{tips:1}):"alert"===u?i.alert(f,{title:"提示",shadeClose:!0}):i.msg(f,{icon:5,shift:6}),n.android||n.ios||l.focus(),r.addClass(o),s=!0}}),s)return s}),s)return!1;var p={};return layui.each(h,function(e,t){if(t.name=(t.name||"").replace(/^\s*|\s*&/,""),t.name){if(/^.*\[\]$/.test(t.name)){var i=t.name.match(/^(.*)\[\]$/g)[0];p[i]=0|p[i],t.name=t.name.replace(/^(.*)\[\]$/,"$1["+p[i]++ +"]")}/^checkbox|radio$/.test(t.type)&&!t.checked||(c[t.name]=t.value)}}),layui.event.call(this,l,"submit("+y+")",{elem:this,form:v,field:c})},f=new u,v=t(document),h=t(window);f.render(),v.on("reset",r,function(){var e=t(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),v.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/layedit.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define(["layer","form"],function(t){"use strict";var e=layui.$,i=layui.layer,a=layui.form,l=(layui.hint(),layui.device()),n="layedit",o="layui-show",r="layui-disabled",c=function(){var t=this;t.index=0,t.config={tool:["strong","italic","underline","del","|","left","center","right","|","link","unlink","face","image"],hideTool:[],height:280}};c.prototype.set=function(t){var i=this;return e.extend(!0,i.config,t),i},c.prototype.on=function(t,e){return layui.onevent(n,t,e)},c.prototype.build=function(t,i){i=i||{};var a=this,n=a.config,r="layui-layedit",c=e("string"==typeof t?"#"+t:t),u="LAY_layedit_"+ ++a.index,d=c.next("."+r),y=e.extend({},n,i),f=function(){var t=[],e={};return layui.each(y.hideTool,function(t,i){e[i]=!0}),layui.each(y.tool,function(i,a){C[a]&&!e[a]&&t.push(C[a])}),t.join("")}(),m=e(['
    ','
    '+f+"
    ",'
    ','',"
    ","
    "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

    ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

    "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

    "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

      ','
    • ','','
      ','',"
      ","
    • ",'
    • ','','
      ','",'","
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
  • '+e+'
  • ')}),'
      '+t.join("")+"
    "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
      ','
    • ','','
      ','","
      ","
    • ",'
    • ','','
      ','',"
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
      ",u=1;u<=i.length;u++){var r='
    • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
    • ":n+=r}n+="
    "+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/slider.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(i,t){return e.slide("set",i,t||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",m="layui-slider-input-btn",p="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),m=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=t.disabled?"#c2c2c2":t.theme,f='
    '+(t.tips?'
    ':"")+'
    '+(t.range?'
    ':"")+"
    ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x
    ')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
    ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),u=l.setTips?l.setTips(u):u,s.find("."+d).html(u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
    f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
      '),s=o(["
    • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
    • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
      '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/upload.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,r,e,i)}},l=function(){var e=this;return{upload:function(i){e.upload.call(e,i)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var t=this;t.config=i.extend({},t.config,o.config,e),t.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var t=this,e=t.config;e.elem=i(e.elem),e.bindAction=i(e.bindAction),t.file(),t.events()},p.prototype.file=function(){var e=this,t=e.config,n=e.elemFile=i(['"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
      '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
      ',"
      "].join(""));i("#"+f)[0]||i("body").append(n),t.elem.next().hasClass(c)||(e.elemFile.wrap(a),t.elem.next("."+c).append(function(){var e=[];return layui.each(t.data,function(i,t){t="function"==typeof t?t():t,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var t=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&t+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:t,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,i){i="function"==typeof i?i():i,r.append(e,i)}),i.ajax({url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(i){t++,d(e,i),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=i("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files},resetFile:function(e,i,t){var n=new File([i],t);o.files=o.files||{},o.files[e]=n}},y=function(){if("choose"!==t&&!l.auto||(l.choose&&l.choose(g),"choose"!==t))return l.before&&l.before(g),a.ie?a.ie>9?u():c():void u()};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,i){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var i=0,t=e||o.files||o.chooseFiles||r.files;return layui.each(t,function(){i++}),i}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?t.toFixed(2)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,a,n="layui-fixbar",r="layui-fixbar-top",o=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['
        ',t.bar1?'
      • '+c[0]+"
      • ":"",t.bar2?'
      • '+c[1]+"
      • ":"",'
      • '+c[2]+"
      • ","
      "].join("")),s=g.find("."+r),u=function(){var e=o.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+n)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),a=i.attr("lay-type");"top"===a&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,a)}),o.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var a=this,n="function"==typeof e,r=new Date(t).getTime(),o=new Date(!e||n?(new Date).getTime():e).getTime(),l=r-o,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];n&&(i=e);var g=setTimeout(function(){a.countdown(t,o+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,a=[[],[]],n=(new Date).getTime()-new Date(t).getTime();return n>6912e5?(n=new Date(t),a[0][0]=i.digit(n.getFullYear(),4),a[0][1]=i.digit(n.getMonth()+1),a[0][2]=i.digit(n.getDate()),e||(a[1][0]=i.digit(n.getHours()),a[1][1]=i.digit(n.getMinutes()),a[1][2]=i.digit(n.getSeconds())),a[0].join("-")+" "+a[1].join(":")):n>=864e5?(n/1e3/60/60/24|0)+"天前":n>=36e5?(n/1e3/60/60|0)+"小时前":n>=12e4?(n/1e3/60|0)+"分钟前":n<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var a=t.length;a/g,">").replace(/'/g,"'").replace(/"/g,""")}};!function(t,e,i){"$:nomunge";function a(){n=e[l](function(){r.each(function(){var e=t(this),i=e.width(),a=e.height(),n=t.data(this,g);(i!==n.w||a!==n.h)&&e.trigger(c,[n.w=i,n.h=a])}),a()},o[s])}var n,r=t([]),o=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";o[s]=250,o[u]=!0,t.event.special[c]={setup:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===r.length&&a()},teardown:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.not(e),e.removeData(g),r.length||clearTimeout(n)},add:function(e){function a(e,a,r){var o=t(this),l=t.data(this,g)||{};l.w=a!==i?a:o.width(),l.h=r!==i?r:o.height(),n.apply(this,arguments)}if(!o[u]&&this[l])return!1;var n;return t.isFunction(e)?(n=e,a):(n=e.handler,void(e.handler=a))}}}(e,window),t("util",i)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/layui.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.4.5"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,o=t.scripts,n=o.length-1,r=n;r>0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){var e=function(e,t){layui[e]=t,o.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),o.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":o.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function p(){return++y>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),a)},o.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof o.callback[e]?o.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},void(n.onerror=function(e){n.onerror=null,"function"==typeof o&&o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),o.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===o)return delete n[t];o="object"==typeof o?o:{key:o};try{var r=JSON.parse(n[t])}catch(i){var r={}}return"value"in o&&(r[o.key]=o.value),o.remove&&delete r[o.key],n[t]=JSON.stringify(r),o.key?r[o.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oi?1:r