diff --git a/.docker/db/Dockerfile b/.docker/db/Dockerfile deleted file mode 100644 index c22404d1..00000000 --- a/.docker/db/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM mysql:5.7 - -#设置免密登录 -ENV MYSQL_ALLOW_EMPTY_PASSWORD yes - -VOLUME ["/var/lib/mysql"] - -RUN sed -i "s/^user.*/user = root/g" /etc/mysql/my.cnf - -RUN chown -R mysql /var/lib/mysql -RUN chgrp -R mysql /var/lib/mysql - -#将所需文件放到容器中 -COPY .docker/db/setup.sh /var/lib/mysql/setup.sh -COPY .docker/db/ppgo_job2.sql /var/lib/mysql/ppgo_job2.sql -COPY .docker/db/privileges.sql /var/lib/mysql/privileges.sql - -#设置容器启动时执行的命令 -CMD ["sh", "/var/lib/mysql/setup.sh"] \ No newline at end of file diff --git a/.docker/db/ppgo_job2.sql b/.docker/db/ppgo_job2.sql deleted file mode 100644 index 04cc3224..00000000 --- a/.docker/db/ppgo_job2.sql +++ /dev/null @@ -1,324 +0,0 @@ -/* - Navicat MySQL Data Transfer - - Source Server : localhost - Source Server Version : 50639 - Source Host : localhost - Source Database : ppgo_job2 - - Target Server Version : 50639 - File Encoding : utf-8 - - Date: 08/09/2018 12:22:47 PM -*/ - -SET NAMES utf8; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for `default` --- ---------------------------- -DROP TABLE IF EXISTS `default`; -CREATE TABLE `default` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `user_name` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名', - `email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱', - `password` char(32) NOT NULL DEFAULT '' COMMENT '密码', - `salt` char(10) NOT NULL DEFAULT '' COMMENT '密码盐', - `last_login` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间', - `last_ip` char(15) NOT NULL DEFAULT '' COMMENT '最后登录IP', - `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0正常 -1禁用', - PRIMARY KEY (`id`), - UNIQUE KEY `idx_user_name` (`user_name`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of `default` --- ---------------------------- -BEGIN; -INSERT INTO `default` VALUES ('1', 'admin', 'admin@example.com', '7fef6171469e80d32c0559f88b377245', '', '0', '', '0'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_task` --- ---------------------------- -DROP TABLE IF EXISTS `pp_task`; -CREATE TABLE `pp_task` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `group_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分组ID', - `server_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器id', - `task_name` varchar(50) NOT NULL DEFAULT '' COMMENT '任务名称', - `description` varchar(200) NOT NULL DEFAULT '' COMMENT '任务描述', - `cron_spec` varchar(100) NOT NULL DEFAULT '' COMMENT '时间表达式', - `concurrent` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '是否只允许一个实例', - `command` text NOT NULL COMMENT '命令详情', - `timeout` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '超时设置 s', - `execute_times` int(11) NOT NULL DEFAULT '0' COMMENT '累计执行次数', - `prev_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上次执行时间', - `is_notify` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0-不通知,1-通知', - `notify_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0-邮件通知,1-信息通知,', - `notify_user_ids` varchar(200) NOT NULL DEFAULT '0' COMMENT '通知用户ID字符串,1,2,3', - `status` tinyint(4) NOT NULL DEFAULT '2' COMMENT '-1删除,0停用 1启用 2审核中,3不通过', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `create_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID', - `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后一次编辑时间', - `update_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后一次编辑者ID', - PRIMARY KEY (`id`), - KEY `idx_group_id` (`group_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of `pp_task` --- ---------------------------- -BEGIN; -INSERT INTO `pp_task` VALUES ('1', '3', '2', '打印服务器内存', '2秒钟一次', '*/2 * * * *', '0', 'free -G', '0', '334', '1531645982', '0', '0', '0', '0', '1497855526', '0', '1531644960', '1'), ('2', '2', '1', '外部测试服务器', '8秒钟一次', '*/8 * * * * *', '0', 'echo \"hello world \\n\" >> /tmp/ppgo.log&& echo \"Hello world\"', '0', '151', '1531462016', '0', '0', '0', '2', '1502876155', '0', '1531645495', '1'), ('3', '1', '1', '审核不通过的任务测试', '2s执行一次', '*/2 * * * *', '0', '/webroot/server/php/bin/php /webroot/www/default/test2.php', '0', '26', '1531275962', '0', '0', '0', '2', '1502936077', '0', '1531644281', '1'), ('4', '2', '0', '输出错误', '5秒执行一次', '*/5 * * * *', '0', 'tthh', '0', '72', '1531722855', '0', '0', '0', '0', '1502945973', '0', '1531645619', '1'), ('5', '1', '0', '密码验证任务112', '5秒执行一次', '*/5 * * * *', '0', '/webroot/server/php/bin/php /webroot/www/default/test2.php', '0', '29', '1531468808', '0', '0', '0', '3', '1503991581', '0', '1531723027', '1'), ('6', '1', '0', '打印并输出', '10秒一次,打印 hello ppgo_job', '*/10 * * * *', '0', 'echo \"hello ppgo_job\\n\" >> /tmp/test_ppgo.log', '0', '162', '1531722930', '0', '0', '0', '0', '1530599445', '1', '1531644960', '1'), ('7', '3', '1', '打印ppgo', '5秒一次', '*/5 * * * * *', '0', 'echo \"hello ppgo\\n\" >> /tmp/ppgo.log&&echo \"yes\\n\"', '0', '108', '1531645980', '0', '0', '0', '0', '1530761019', '1', '1531645347', '1'), ('8', '3', '3', '查看网络情况', '5秒一次', '*/5 * * * * *', '0', 'ifconfig', '0', '59', '1531645980', '0', '0', '0', '0', '1531468119', '1', '1531645083', '1'), ('9', '1', '0', '查看磁盘情况-短信', '5秒一次', '*/5 * * * * *', '0', 'df -h', '0', '46', '1531722935', '1', '1', '5,3,2', '0', '1531468712', '1', '1533702062', '1'), ('10', '1', '0', '测试通知通知的任务', '用于测试通知邮件的任务', '0 */5 * * *', '0', 'sleep 1s & lsss', '1', '22', '1533783831', '1', '0', '2', '0', '1533697794', '1', '1533781696', '1'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_task_ban` --- ---------------------------- -DROP TABLE IF EXISTS `pp_task_ban`; -CREATE TABLE `pp_task_ban` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(64) NOT NULL DEFAULT '0' COMMENT '命令', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', - `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='权限和角色关系表'; - --- ---------------------------- --- Records of `pp_task_ban` --- ---------------------------- -BEGIN; -INSERT INTO `pp_task_ban` VALUES ('1', 'rm -rf', '1528639322', '1528639692', '0'), ('2', 'dd if=/dev/random of=/dev/sda', '1528639322', '1528639588', '0'), ('3', 'mkfs.ext3 /dev/sda', '1528639445', '0', '0'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_task_group` --- ---------------------------- -DROP TABLE IF EXISTS `pp_task_group`; -CREATE TABLE `pp_task_group` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `group_name` varchar(50) NOT NULL DEFAULT '' COMMENT '组名', - `description` varchar(255) NOT NULL DEFAULT '' COMMENT '说明', - `create_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', - `update_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改者Id', - `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', - `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态:1-正常,0-删除', - PRIMARY KEY (`id`), - KEY `idx_user_id` (`create_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of `pp_task_group` --- ---------------------------- -BEGIN; -INSERT INTO `pp_task_group` VALUES ('1', '任务分组甲', '任务分组甲', '1', '1531643000', '1', '1531643000', '1'), ('2', '任务分组乙', '任务分组乙', '1', '1531643030', '1', '1531643030', '1'), ('3', '任务分组丙', '任务分组丙', '1', '1531643070', '1', '1531643070', '1'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_task_log` --- ---------------------------- -DROP TABLE IF EXISTS `pp_task_log`; -CREATE TABLE `pp_task_log` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `task_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '任务ID', - `output` mediumtext NOT NULL COMMENT '任务输出', - `error` text NOT NULL COMMENT '错误信息', - `status` tinyint(4) NOT NULL COMMENT '状态', - `process_time` int(11) NOT NULL DEFAULT '0' COMMENT '消耗时间/毫秒', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - PRIMARY KEY (`id`), - KEY `idx_task_id` (`task_id`,`create_time`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of `pp_task_log` --- ---------------------------- -BEGIN; -INSERT INTO `pp_task_log` VALUES ('1', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:19815 errors:0 dropped:0 overruns:0 frame:0\n TX packets:9732 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28901272 (27.5 MiB) TX bytes:606185 (591.9 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '365', '1531645278'), ('2', '7', 'yes\\n\n', '', '0', '436', '1531645325'), ('3', '7', 'yes\\n\n', '', '0', '319', '1531645375'), ('4', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '21', '1531645573'), ('5', '1', '', 'Process exited with status 1:', '-1', '293', '1531645698'), ('6', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645700'), ('7', '6', '', '', '0', '14', '1531645700'), ('8', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663541 41176073 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '18', '1531645700'), ('9', '7', 'yes\\n\n', '', '0', '448', '1531645700'), ('10', '1', '', 'Process exited with status 1:', '-1', '596', '1531645700'), ('11', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:19911 errors:0 dropped:0 overruns:0 frame:0\n TX packets:9799 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28912798 (27.5 MiB) TX bytes:619389 (604.8 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '632', '1531645700'), ('12', '1', '', 'Process exited with status 1:', '-1', '252', '1531645702'), ('13', '1', '', 'Process exited with status 1:', '-1', '312', '1531645704'), ('14', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '13', '1531645705'), ('15', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663541 41176073 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '15', '1531645705'), ('16', '7', 'yes\\n\n', '', '0', '423', '1531645705'), ('17', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:19999 errors:0 dropped:0 overruns:0 frame:0\n TX packets:9861 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28923348 (27.5 MiB) TX bytes:631959 (617.1 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '454', '1531645705'), ('18', '1', '', 'Process exited with status 1:', '-1', '318', '1531645706'), ('19', '1', '', 'Process exited with status 1:', '-1', '310', '1531645708'), ('20', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663541 41176073 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '11', '1531645710'), ('21', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '12', '1531645710'), ('22', '6', '', '', '0', '12', '1531645710'), ('23', '7', 'yes\\n\n', '', '0', '356', '1531645710'), ('24', '1', '', 'Process exited with status 1:', '-1', '394', '1531645710'), ('25', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20115 errors:0 dropped:0 overruns:0 frame:0\n TX packets:9946 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28937354 (27.5 MiB) TX bytes:648771 (633.5 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '432', '1531645710'), ('26', '1', '', 'Process exited with status 1:', '-1', '452', '1531645712'), ('27', '1', '', 'Process exited with status 1:', '-1', '339', '1531645714'), ('28', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531645715'), ('29', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663549 41176065 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '12', '1531645715'), ('30', '7', 'yes\\n\n', '', '0', '327', '1531645715'), ('31', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20203 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10010 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28947904 (27.6 MiB) TX bytes:661461 (645.9 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '360', '1531645715'), ('32', '1', '', 'Process exited with status 1:', '-1', '236', '1531645716'), ('33', '1', '', 'Process exited with status 1:', '-1', '233', '1531645718'), ('34', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663554 41176060 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531645720'), ('35', '6', '', '', '0', '15', '1531645720'), ('36', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '18', '1531645720'), ('37', '7', 'yes\\n\n', '', '0', '333', '1531645720'), ('38', '1', '', 'Process exited with status 1:', '-1', '434', '1531645720'), ('39', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20318 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10094 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28961908 (27.6 MiB) TX bytes:678299 (662.4 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '443', '1531645720'), ('40', '1', '', 'Process exited with status 1:', '-1', '234', '1531645722'), ('41', '1', '', 'Process exited with status 1:', '-1', '237', '1531645724'), ('42', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '9', '1531645725'), ('43', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663546 41176068 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '14', '1531645725'), ('44', '7', 'yes\\n\n', '', '0', '372', '1531645725'), ('45', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20405 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10155 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28972456 (27.6 MiB) TX bytes:690883 (674.6 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '454', '1531645725'), ('46', '1', '', 'Process exited with status 1:', '-1', '227', '1531645726'), ('47', '1', '', 'Process exited with status 1:', '-1', '304', '1531645728'), ('48', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663546 41176068 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '11', '1531645730'), ('49', '6', '', '', '0', '11', '1531645730'), ('50', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '15', '1531645730'), ('51', '7', 'yes\\n\n', '', '0', '358', '1531645730'), ('52', '1', '', 'Process exited with status 1:', '-1', '398', '1531645730'), ('53', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20522 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10239 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28986522 (27.6 MiB) TX bytes:707657 (691.0 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '424', '1531645730'), ('54', '1', '', 'Process exited with status 1:', '-1', '258', '1531645732'), ('55', '1', '', 'Process exited with status 1:', '-1', '345', '1531645734'), ('56', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663546 41176068 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '10', '1531645735'), ('57', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645735'), ('58', '7', 'yes\\n\n', '', '0', '359', '1531645735'), ('59', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20610 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10302 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:28997130 (27.6 MiB) TX bytes:720355 (703.4 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '379', '1531645735'), ('60', '1', '', 'Process exited with status 1:', '-1', '248', '1531645736'), ('61', '1', '', 'Process exited with status 1:', '-1', '247', '1531645738'), ('62', '6', '', '', '0', '9', '1531645740'), ('63', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663546 41176068 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '15', '1531645740'), ('64', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645740'), ('65', '7', 'yes\\n\n', '', '0', '421', '1531645740'), ('66', '1', '', 'Process exited with status 1:', '-1', '502', '1531645740'), ('67', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20726 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10384 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29011194 (27.6 MiB) TX bytes:737067 (719.7 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '525', '1531645740'), ('68', '1', '', 'Process exited with status 1:', '-1', '218', '1531645742'), ('69', '1', '', 'Process exited with status 1:', '-1', '255', '1531645744'), ('70', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531645745'), ('71', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663546 41176068 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '12', '1531645745'), ('72', '7', 'yes\\n\n', '', '0', '331', '1531645745'), ('73', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20813 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10442 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29021684 (27.6 MiB) TX bytes:749413 (731.8 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '396', '1531645745'), ('74', '1', '', 'Process exited with status 1:', '-1', '313', '1531645746'), ('75', '1', '', 'Process exited with status 1:', '-1', '297', '1531645748'), ('76', '6', '', '', '0', '13', '1531645750'), ('77', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '12', '1531645750'), ('78', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663549 41176065 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '10', '1531645750'), ('79', '7', 'yes\\n\n', '', '0', '323', '1531645750'), ('80', '1', '', 'Process exited with status 1:', '-1', '368', '1531645750'), ('81', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:20929 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10526 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29035690 (27.6 MiB) TX bytes:766245 (748.2 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '398', '1531645750'), ('82', '1', '', 'Process exited with status 1:', '-1', '247', '1531645752'), ('83', '1', '', 'Process exited with status 1:', '-1', '231', '1531645754'), ('84', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531645755'), ('85', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663554 41176060 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531645755'), ('86', '7', 'yes\\n\n', '', '0', '343', '1531645755'), ('87', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21018 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10588 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29046358 (27.7 MiB) TX bytes:778889 (760.6 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '365', '1531645755'), ('88', '1', '', 'Process exited with status 1:', '-1', '245', '1531645756'), ('89', '1', '', 'Process exited with status 1:', '-1', '239', '1531645758'), ('90', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '10', '1531645760'), ('91', '6', '', '', '0', '13', '1531645760'), ('92', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663567 41176047 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '19', '1531645760'), ('93', '1', '', 'Process exited with status 1:', '-1', '428', '1531645760'), ('94', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21135 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10671 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29060424 (27.7 MiB) TX bytes:795603 (776.9 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '466', '1531645760'), ('95', '7', 'yes\\n\n', '', '0', '522', '1531645760'), ('96', '1', '', 'Process exited with status 1:', '-1', '348', '1531645762'), ('97', '1', '', 'Process exited with status 1:', '-1', '238', '1531645764'), ('98', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '10', '1531645765'), ('99', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663567 41176047 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531645765'), ('100', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21224 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10735 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29070976 (27.7 MiB) TX bytes:808361 (789.4 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '323', '1531645765'), ('101', '7', 'yes\\n\n', '', '0', '367', '1531645765'), ('102', '1', '', 'Process exited with status 1:', '-1', '244', '1531645766'), ('103', '1', '', 'Process exited with status 1:', '-1', '265', '1531645768'), ('104', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '10', '1531645770'), ('105', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663575 41176039 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '11', '1531645770'), ('106', '6', '', '', '0', '18', '1531645770'), ('107', '7', 'yes\\n\n', '', '0', '397', '1531645770'), ('108', '1', '', 'Process exited with status 1:', '-1', '439', '1531645770'), ('109', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21339 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10818 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29084922 (27.7 MiB) TX bytes:825069 (805.7 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '452', '1531645770'), ('110', '1', '', 'Process exited with status 1:', '-1', '236', '1531645772'), ('111', '1', '', 'Process exited with status 1:', '-1', '253', '1531645774'), ('112', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '10', '1531645775'), ('113', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663575 41176039 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '14', '1531645775'), ('114', '7', 'yes\\n\n', '', '0', '337', '1531645775'), ('115', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21426 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10879 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29095470 (27.7 MiB) TX bytes:837653 (818.0 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '392', '1531645775'), ('116', '1', '', 'Process exited with status 1:', '-1', '278', '1531645776'), ('117', '1', '', 'Process exited with status 1:', '-1', '259', '1531645778'), ('118', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663575 41176039 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '12', '1531645780'), ('119', '6', '', '', '0', '15', '1531645780'), ('120', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '20', '1531645780'), ('121', '7', 'yes\\n\n', '', '0', '486', '1531645780'), ('122', '1', '', 'Process exited with status 1:', '-1', '511', '1531645780'), ('123', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21542 errors:0 dropped:0 overruns:0 frame:0\n TX packets:10966 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29109534 (27.7 MiB) TX bytes:854659 (834.6 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '531', '1531645780'), ('124', '1', '', 'Process exited with status 1:', '-1', '441', '1531645782'), ('125', '1', '', 'Process exited with status 1:', '-1', '268', '1531645784'), ('126', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531645785'), ('127', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663575 41176039 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531645785'), ('128', '7', 'yes\\n\n', '', '0', '403', '1531645785'), ('129', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21629 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11030 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29120024 (27.7 MiB) TX bytes:867359 (847.0 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '483', '1531645785'), ('130', '1', '', 'Process exited with status 1:', '-1', '233', '1531645786'), ('131', '1', '', 'Process exited with status 1:', '-1', '283', '1531645788'), ('132', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645790'), ('133', '6', '', '', '0', '12', '1531645790'), ('134', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663577 41176037 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '15', '1531645790'), ('135', '7', 'yes\\n\n', '', '0', '488', '1531645790'), ('136', '1', '', 'Process exited with status 1:', '-1', '498', '1531645790'), ('137', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21747 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11116 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29134208 (27.7 MiB) TX bytes:884299 (863.5 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '520', '1531645790'), ('138', '1', '', 'Process exited with status 1:', '-1', '266', '1531645792'), ('139', '1', '', 'Process exited with status 1:', '-1', '252', '1531645794'), ('140', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663580 41176034 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '10', '1531645795'), ('141', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645795'), ('142', '7', 'yes\\n\n', '', '0', '334', '1531645795'), ('143', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21836 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11179 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29144876 (27.7 MiB) TX bytes:896997 (875.9 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '355', '1531645795'), ('144', '1', '', 'Process exited with status 1:', '-1', '231', '1531645796'), ('145', '1', '', 'Process exited with status 1:', '-1', '271', '1531645798'), ('146', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663580 41176034 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '16', '1531645800'), ('147', '6', '', '', '0', '23', '1531645800'), ('148', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '25', '1531645800'), ('149', '7', 'yes\\n\n', '', '0', '348', '1531645800'), ('150', '1', '', 'Process exited with status 1:', '-1', '404', '1531645800'), ('151', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:21949 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11258 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29158528 (27.8 MiB) TX bytes:913355 (891.9 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '430', '1531645800'), ('152', '1', '', 'Process exited with status 1:', '-1', '290', '1531645802'), ('153', '1', '', 'Process exited with status 1:', '-1', '232', '1531645804'), ('154', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '10', '1531645805'), ('155', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663580 41176034 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '12', '1531645805'), ('156', '7', 'yes\\n\n', '', '0', '346', '1531645805'), ('157', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22039 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11321 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29169256 (27.8 MiB) TX bytes:926059 (904.3 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '393', '1531645805'), ('158', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663583 41176031 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '11', '1531645810'), ('159', '6', '', '', '0', '15', '1531645810'), ('160', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '19', '1531645810'), ('161', '7', 'yes\\n\n', '', '0', '395', '1531645810'), ('162', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22080 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11352 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29174734 (27.8 MiB) TX bytes:932881 (911.0 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '405', '1531645810'), ('163', '1', '', 'Process exited with status 1:', '-1', '5284', '1531645806'), ('164', '1', '', 'Process exited with status 1:', '-1', '254', '1531645812'), ('165', '1', '', 'Process exited with status 1:', '-1', '254', '1531645814'), ('166', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '14', '1531645815'), ('167', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663587 41176027 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '14', '1531645815'), ('168', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22185 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11427 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29186838 (27.8 MiB) TX bytes:947354 (925.1 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '321', '1531645815'), ('169', '7', 'yes\\n\n', '', '0', '341', '1531645815'), ('170', '1', '', 'Process exited with status 1:', '-1', '235', '1531645816'), ('171', '1', '', 'Process exited with status 1:', '-1', '237', '1531645818'), ('172', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663587 41176027 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531645820'), ('173', '6', '', '', '0', '16', '1531645820'), ('174', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '16', '1531645820'), ('175', '7', 'yes\\n\n', '', '0', '405', '1531645820'), ('176', '1', '', 'Process exited with status 1:', '-1', '470', '1531645820'), ('177', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22301 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11511 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29200844 (27.8 MiB) TX bytes:964180 (941.5 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '511', '1531645820'), ('178', '1', '', 'Process exited with status 1:', '-1', '336', '1531645822'), ('179', '1', '', 'Process exited with status 1:', '-1', '275', '1531645824'), ('180', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645825'), ('181', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663589 41176025 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '14', '1531645825'), ('182', '7', 'yes\\n\n', '', '0', '362', '1531645825'), ('183', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22390 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11574 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29211592 (27.8 MiB) TX bytes:976986 (954.0 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '412', '1531645825'), ('184', '1', '', 'Process exited with status 1:', '-1', '325', '1531645826'), ('185', '1', '', 'Process exited with status 1:', '-1', '380', '1531645828'), ('186', '6', '', '', '0', '12', '1531645830'), ('187', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '10', '1531645830'), ('188', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663589 41176025 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '20', '1531645830'), ('189', '7', 'yes\\n\n', '', '0', '363', '1531645830'), ('190', '1', '', 'Process exited with status 1:', '-1', '404', '1531645830'), ('191', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22506 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11657 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29225482 (27.8 MiB) TX bytes:993642 (970.3 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '430', '1531645830'), ('192', '1', '', 'Process exited with status 1:', '-1', '263', '1531645832'), ('193', '1', '', 'Process exited with status 1:', '-1', '239', '1531645834'), ('194', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '9', '1531645835'), ('195', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663589 41176025 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '12', '1531645835'), ('196', '7', 'yes\\n\n', '', '0', '335', '1531645835'), ('197', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22594 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11720 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29236090 (27.8 MiB) TX bytes:1006340 (982.7 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '360', '1531645835'), ('198', '1', '', 'Process exited with status 1:', '-1', '320', '1531645836'), ('199', '1', '', 'Process exited with status 1:', '-1', '271', '1531645838'), ('200', '6', '', '', '0', '22', '1531645840'), ('201', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663601 41176013 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '24', '1531645840'), ('202', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '28', '1531645840'), ('203', '7', 'yes\\n\n', '', '0', '487', '1531645840'), ('204', '1', '', 'Process exited with status 1:', '-1', '565', '1531645840'), ('205', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22711 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11805 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29250156 (27.8 MiB) TX bytes:1023168 (999.1 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '598', '1531645840'), ('206', '1', '', 'Process exited with status 1:', '-1', '229', '1531645842'), ('207', '1', '', 'Process exited with status 1:', '-1', '239', '1531645844'), ('208', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '17', '1531645845'), ('209', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663603 41176011 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '26', '1531645845'), ('210', '7', 'yes\\n\n', '', '0', '528', '1531645845'), ('211', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22796 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11865 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29260526 (27.9 MiB) TX bytes:1035640 (1011.3 KiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '604', '1531645845'), ('212', '1', '', 'Process exited with status 1:', '-1', '287', '1531645846'), ('213', '1', '', 'Process exited with status 1:', '-1', '416', '1531645848'), ('214', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '14', '1531645850'), ('215', '6', '', '', '0', '17', '1531645850'), ('216', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663603 41176011 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '19', '1531645850'), ('217', '7', 'yes\\n\n', '', '0', '352', '1531645850'), ('218', '1', '', 'Process exited with status 1:', '-1', '464', '1531645850'), ('219', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:22904 errors:0 dropped:0 overruns:0 frame:0\n TX packets:11945 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29273836 (27.9 MiB) TX bytes:1051376 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '477', '1531645850'), ('220', '1', '', 'Process exited with status 1:', '-1', '363', '1531645852'), ('221', '1', '', 'Process exited with status 1:', '-1', '305', '1531645854'), ('222', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645855'), ('223', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663596 41176018 66% /\ndevfs 185Ki 185Ki 0Bi 100% 642 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531645855'), ('224', '7', 'yes\\n\n', '', '0', '357', '1531645855'), ('225', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23001 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12013 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29285142 (27.9 MiB) TX bytes:1065162 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '415', '1531645855'), ('226', '1', '', 'Process exited with status 1:', '-1', '237', '1531645856'), ('227', '1', '', 'Process exited with status 1:', '-1', '350', '1531645858'), ('228', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '21', '1531645860'), ('229', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663600 41176014 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '24', '1531645860'), ('230', '6', '', '', '0', '31', '1531645860'), ('231', '7', 'yes\\n\n', '', '0', '462', '1531645860'), ('232', '1', '', 'Process exited with status 1:', '-1', '552', '1531645860'), ('233', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23116 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12095 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29299088 (27.9 MiB) TX bytes:1081858 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '569', '1531645860'), ('234', '1', '', 'Process exited with status 1:', '-1', '367', '1531645862'), ('235', '1', '', 'Process exited with status 1:', '-1', '356', '1531645864'), ('236', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '9', '1531645865'), ('237', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663607 41176007 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '12', '1531645865'), ('238', '7', 'yes\\n\n', '', '0', '443', '1531645865'), ('239', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23203 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12159 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29309520 (27.9 MiB) TX bytes:1094490 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '475', '1531645865'), ('240', '1', '', 'Process exited with status 1:', '-1', '280', '1531645866'), ('241', '1', '', 'Process exited with status 1:', '-1', '261', '1531645868'), ('242', '6', '', '', '0', '10', '1531645870'), ('243', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663611 41176003 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '14', '1531645870'), ('244', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '16', '1531645870'), ('245', '7', 'yes\\n\n', '', '0', '319', '1531645870'), ('246', '1', '', 'Process exited with status 1:', '-1', '425', '1531645870'), ('247', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23320 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12243 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29323644 (27.9 MiB) TX bytes:1111300 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '449', '1531645870'), ('248', '1', '', 'Process exited with status 1:', '-1', '242', '1531645872'), ('249', '1', '', 'Process exited with status 1:', '-1', '239', '1531645874'), ('250', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663604 41176010 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '11', '1531645875'), ('251', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '12', '1531645875'), ('252', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23406 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12305 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29334016 (27.9 MiB) TX bytes:1123870 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '359', '1531645875'), ('253', '7', 'yes\\n\n', '', '0', '365', '1531645875'), ('254', '1', '', 'Process exited with status 1:', '-1', '240', '1531645876'), ('255', '1', '', 'Process exited with status 1:', '-1', '248', '1531645878'), ('256', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645880'), ('257', '6', '', '', '0', '15', '1531645880'), ('258', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663610 41176004 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '15', '1531645880'), ('259', '7', 'yes\\n\n', '', '0', '385', '1531645880'), ('260', '1', '', 'Process exited with status 1:', '-1', '440', '1531645880'), ('261', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23521 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12387 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29347904 (27.9 MiB) TX bytes:1140560 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '461', '1531645880'); -INSERT INTO `pp_task_log` VALUES ('262', '1', '', 'Process exited with status 1:', '-1', '350', '1531645882'), ('263', '1', '', 'Process exited with status 1:', '-1', '345', '1531645884'), ('264', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '12', '1531645885'), ('265', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663613 41176001 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '15', '1531645885'), ('266', '7', 'yes\\n\n', '', '0', '534', '1531645885'), ('267', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23609 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12451 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29358454 (27.9 MiB) TX bytes:1153302 (1.0 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '624', '1531645885'), ('268', '1', '', 'Process exited with status 1:', '-1', '418', '1531645886'), ('269', '1', '', 'Process exited with status 1:', '-1', '292', '1531645888'), ('270', '6', '', '', '0', '20', '1531645890'), ('271', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '25', '1531645890'), ('272', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663496 41176118 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '29', '1531645890'), ('273', '7', 'yes\\n\n', '', '0', '475', '1531645890'), ('274', '1', '', 'Process exited with status 1:', '-1', '596', '1531645890'), ('275', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23727 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12538 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29372522 (28.0 MiB) TX bytes:1170234 (1.1 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '642', '1531645890'), ('276', '1', '', 'Process exited with status 1:', '-1', '302', '1531645892'), ('277', '1', '', 'Process exited with status 1:', '-1', '302', '1531645894'), ('278', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663569 41176045 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '10', '1531645895'), ('279', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645895'), ('280', '7', 'yes\\n\n', '', '0', '408', '1531645895'), ('281', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23814 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12599 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29383070 (28.0 MiB) TX bytes:1182802 (1.1 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '429', '1531645895'), ('282', '1', '', 'Process exited with status 1:', '-1', '263', '1531645896'), ('283', '1', '', 'Process exited with status 1:', '-1', '333', '1531645898'), ('284', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663573 41176041 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '10', '1531645898'), ('285', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663573 41176041 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531645900'), ('286', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '16', '1531645900'), ('287', '6', '', '', '0', '19', '1531645900'), ('288', '7', 'yes\\n\n', '', '0', '371', '1531645900'), ('289', '1', '', 'Process exited with status 1:', '-1', '454', '1531645900'), ('290', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:23933 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12686 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29397256 (28.0 MiB) TX bytes:1199746 (1.1 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '472', '1531645900'), ('291', '1', '', 'Process exited with status 1:', '-1', '425', '1531645902'), ('292', '1', '', 'Process exited with status 1:', '-1', '355', '1531645904'), ('293', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663578 41176036 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '22', '1531645905'), ('294', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '21', '1531645905'), ('295', '7', 'yes\\n\n', '', '0', '415', '1531645905'), ('296', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24021 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12750 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29407864 (28.0 MiB) TX bytes:1212494 (1.1 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '466', '1531645905'), ('297', '1', '', 'Process exited with status 1:', '-1', '229', '1531645906'), ('298', '1', '', 'Process exited with status 1:', '-1', '281', '1531645908'), ('299', '6', '', '', '0', '12', '1531645910'), ('300', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1 465Gi 307Gi 157Gi 67% 80663581 41176033 66% /\ndevfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '15', '1531645910'), ('301', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '14', '1531645910'), ('302', '7', 'yes\\n\n', '', '0', '410', '1531645910'), ('303', '1', '', 'Process exited with status 1:', '-1', '475', '1531645910'), ('304', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24134 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12830 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29421632 (28.0 MiB) TX bytes:1229012 (1.1 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '491', '1531645910'), ('305', '1', '', 'Process exited with status 1:', '-1', '354', '1531645912'), ('306', '1', '', 'Process exited with status 1:', '-1', '306', '1531645914'), ('307', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645915'), ('308', '7', 'yes\\n\n', '', '0', '336', '1531645915'), ('309', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24217 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12890 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29431708 (28.0 MiB) TX bytes:1241404 (1.1 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '433', '1531645915'), ('310', '1', '', 'Process exited with status 1:', '-1', '242', '1531645916'), ('311', '1', '', 'Process exited with status 1:', '-1', '338', '1531645918'), ('312', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '13', '1531645920'), ('313', '7', 'yes\\n\n', '', '0', '506', '1531645920'), ('314', '1', '', 'Process exited with status 1:', '-1', '564', '1531645920'), ('315', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24335 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12975 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29445892 (28.0 MiB) TX bytes:1258268 (1.1 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '596', '1531645920'), ('316', '1', '', 'Process exited with status 1:', '-1', '307', '1531645922'), ('317', '1', '', 'Process exited with status 1:', '-1', '353', '1531645924'), ('318', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645925'), ('319', '7', 'yes\\n\n', '', '0', '443', '1531645925'), ('320', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24425 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13039 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29456620 (28.0 MiB) TX bytes:1271016 (1.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '502', '1531645925'), ('321', '1', '', 'Process exited with status 1:', '-1', '247', '1531645926'), ('322', '1', '', 'Process exited with status 1:', '-1', '282', '1531645928'), ('323', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645930'), ('324', '7', 'yes\\n\n', '', '0', '325', '1531645930'), ('325', '1', '', 'Process exited with status 1:', '-1', '414', '1531645930'), ('326', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24542 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13124 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29470744 (28.1 MiB) TX bytes:1287886 (1.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '437', '1531645930'), ('327', '1', '', 'Process exited with status 1:', '-1', '282', '1531645932'), ('328', '1', '', 'Process exited with status 1:', '-1', '346', '1531645934'), ('329', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645935'), ('330', '7', 'yes\\n\n', '', '0', '406', '1531645935'), ('331', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24631 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13188 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29481412 (28.1 MiB) TX bytes:1300622 (1.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '431', '1531645935'), ('332', '1', '', 'Process exited with status 1:', '-1', '254', '1531645936'), ('333', '1', '', 'Process exited with status 1:', '-1', '242', '1531645938'), ('334', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645940'), ('335', '7', 'yes\\n\n', '', '0', '343', '1531645940'), ('336', '1', '', 'Process exited with status 1:', '-1', '432', '1531645940'), ('337', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24743 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13268 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29495120 (28.1 MiB) TX bytes:1317088 (1.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '449', '1531645940'), ('338', '1', '', 'Process exited with status 1:', '-1', '242', '1531645942'), ('339', '1', '', 'Process exited with status 1:', '-1', '282', '1531645944'), ('340', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645945'), ('341', '7', 'yes\\n\n', '', '0', '445', '1531645945'), ('342', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24829 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13328 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29505550 (28.1 MiB) TX bytes:1329538 (1.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '509', '1531645945'), ('343', '1', '', 'Process exited with status 1:', '-1', '325', '1531645946'), ('344', '1', '', 'Process exited with status 1:', '-1', '267', '1531645948'), ('345', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '11', '1531645950'), ('346', '7', 'yes\\n\n', '', '0', '498', '1531645950'), ('347', '1', '', 'Process exited with status 1:', '-1', '542', '1531645950'), ('348', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:24948 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13413 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29519794 (28.1 MiB) TX bytes:1346402 (1.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '564', '1531645950'), ('349', '1', '', 'Process exited with status 1:', '-1', '295', '1531645952'), ('350', '1', '', 'Process exited with status 1:', '-1', '282', '1531645954'), ('351', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531645955'), ('352', '7', 'yes\\n\n', '', '0', '396', '1531645955'), ('353', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:25037 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13476 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29530462 (28.1 MiB) TX bytes:1359078 (1.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '451', '1531645955'), ('354', '1', '', 'Process exited with status 1:', '-1', '285', '1531645956'), ('355', '1', '', 'Process exited with status 1:', '-1', '362', '1531645958'), ('356', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645960'), ('357', '7', 'yes\\n\n', '', '0', '318', '1531645960'), ('358', '1', '', 'Process exited with status 1:', '-1', '396', '1531645960'), ('359', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:25153 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13559 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29544526 (28.1 MiB) TX bytes:1375828 (1.3 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '410', '1531645960'), ('360', '1', '', 'Process exited with status 1:', '-1', '337', '1531645962'), ('361', '1', '', 'Process exited with status 1:', '-1', '465', '1531645964'), ('362', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531645965'), ('363', '7', 'yes\\n\n', '', '0', '368', '1531645965'), ('364', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:25242 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13622 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29555194 (28.1 MiB) TX bytes:1388510 (1.3 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '461', '1531645965'), ('365', '1', '', 'Process exited with status 1:', '-1', '291', '1531645966'), ('366', '1', '', 'Process exited with status 1:', '-1', '340', '1531645968'), ('367', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '7', '1531645970'), ('368', '7', 'yes\\n\n', '', '0', '438', '1531645970'), ('369', '1', '', 'Process exited with status 1:', '-1', '493', '1531645970'), ('370', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:25359 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13709 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29569202 (28.1 MiB) TX bytes:1405494 (1.3 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '507', '1531645970'), ('371', '1', '', 'Process exited with status 1:', '-1', '316', '1531645972'), ('372', '1', '', 'Process exited with status 1:', '-1', '273', '1531645974'), ('373', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531645975'), ('374', '7', 'yes\\n\n', '', '0', '558', '1531645975'), ('375', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:25441 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13767 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29579276 (28.2 MiB) TX bytes:1417766 (1.3 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '618', '1531645975'), ('376', '1', '', 'Process exited with status 1:', '-1', '342', '1531645976'), ('377', '1', '', 'Process exited with status 1:', '-1', '422', '1531645978'), ('378', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '15', '1531645980'), ('379', '7', 'yes\\n\n', '', '0', '489', '1531645980'), ('380', '1', '', 'Process exited with status 1:', '-1', '544', '1531645980'), ('381', '8', 'eth1 Link encap:Ethernet HWaddr 00:0C:29:CB:2C:63 \n inet addr:172.16.210.153 Bcast:172.16.210.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fecb:2c63/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:25559 errors:0 dropped:0 overruns:0 frame:0\n TX packets:13853 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:29593402 (28.2 MiB) TX bytes:1434638 (1.3 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n TX packets:12 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)\n\n', '', '0', '586', '1531645980'), ('382', '1', '', 'Process exited with status 1:', '-1', '343', '1531645982'), ('383', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '72', '1531722850'), ('384', '4', '', 'exit status 127:sh: tthh: command not found\n', '-1', '8', '1531722855'), ('385', '6', '', '', '0', '21', '1531722930'), ('386', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1s1 233Gi 44Gi 183Gi 20% 827232 9223372036853948575 0% /\ndevfs 185Ki 185Ki 0Bi 100% 640 0 100% /dev\n/dev/disk1s4 233Gi 5.0Gi 183Gi 3% 4 9223372036854775803 0% /private/var/vm\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '31', '1531722930'), ('387', '9', 'Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n/dev/disk1s1 233Gi 44Gi 183Gi 20% 827232 9223372036853948575 0% /\ndevfs 185Ki 185Ki 0Bi 100% 640 0 100% /dev\n/dev/disk1s4 233Gi 5.0Gi 183Gi 3% 4 9223372036854775803 0% /private/var/vm\nmap -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\nmap auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n', '', '0', '13', '1531722935'), ('388', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '39', '1533777088'), ('389', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '25', '1533777370'), ('390', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '36', '1533777450'), ('391', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '22', '1533777561'), ('392', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '23', '1533777649'), ('393', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '21', '1533777745'), ('394', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '21', '1533777807'), ('395', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '19', '1533777859'), ('396', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '28', '1533778322'), ('397', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '38', '1533779412'), ('398', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '21', '1533779580'), ('399', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '51', '1533780177'), ('400', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '25', '1533780374'), ('401', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '27', '1533780731'), ('402', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '31', '1533781149'), ('403', '10', '', 'exit status 127:sh: ls-s: command not found\n', '-1', '33', '1533781493'), ('404', '10', '', '任务执行超过 1 秒\n----------------------\nsh: lsss: command not found\n\n', '-2', '1017', '1533781700'), ('405', '10', '', '任务执行超过 1 秒\n----------------------\nsh: lsss: command not found\n\n', '-2', '1010', '1533782997'), ('406', '10', '', '任务执行超过 1 秒\n----------------------\nsh: lsss: command not found\n\n', '-2', '1009', '1533783102'), ('407', '10', '', '任务执行超过 1 秒\n----------------------\nsh: lsss: command not found\n\n', '-2', '1010', '1533783421'), ('408', '10', '', '任务执行超过 1 秒\n----------------------\nsh: lsss: command not found\n\n', '-2', '1008', '1533783662'), ('409', '10', '', '任务执行超过 1 秒\n----------------------\nsh: lsss: command not found\n\n', '-2', '1012', '1533783831'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_task_server` --- ---------------------------- -DROP TABLE IF EXISTS `pp_task_server`; -CREATE TABLE `pp_task_server` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', - `group_id` int(64) NOT NULL, - `server_name` varchar(64) NOT NULL DEFAULT '0' COMMENT '服务器名称', - `server_account` varchar(32) NOT NULL DEFAULT 'root' COMMENT '账户名称', - `server_outer_ip` varchar(20) NOT NULL DEFAULT '0' COMMENT '外网IP', - `server_ip` varchar(20) NOT NULL DEFAULT '0' COMMENT '服务器内网IP', - `port` int(4) unsigned NOT NULL DEFAULT '22' COMMENT '服务器端口', - `password` varchar(64) NOT NULL DEFAULT '0' COMMENT '服务器密码', - `private_key_src` varchar(128) NOT NULL DEFAULT '0' COMMENT '私钥文件地址', - `public_key_src` varchar(128) NOT NULL DEFAULT '0' COMMENT '公钥地址', - `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '登录类型:0-密码登录,1-私钥登录', - `detail` varchar(255) NOT NULL DEFAULT '0' COMMENT '备注', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', - `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态:0-正常,1-删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='服务器列表'; - --- ---------------------------- --- Records of `pp_task_server` --- ---------------------------- -BEGIN; -INSERT INTO `pp_task_server` VALUES ('1', '2', '密钥验证服务器', 'root', '0', '172.16.210.168', '22', '', '/Users/haodaquan/.ssh/my_service', '/Users/haodaquan/.ssh/my_service.pub', '1', '远程服务器示例', '1531642563', '1531642563', '0'), ('2', '1', '密码验证服务器', 'root', '0', '172.16.210.153', '22', 'haodaquan2008', '', '', '0', '这是密码验证服务器', '1502945869', '1531618335', '0'), ('3', '3', '测试服务器', 'root', '0', '172.16.210.153', '22', 'haodaquan2008', '', '', '0', '测试服务器', '1531641591', '1531641591', '0'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_task_server_group` --- ---------------------------- -DROP TABLE IF EXISTS `pp_task_server_group`; -CREATE TABLE `pp_task_server_group` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `group_name` varchar(50) NOT NULL DEFAULT '0' COMMENT '组名', - `description` varchar(255) NOT NULL DEFAULT '' COMMENT '说明', - `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1-正常,0-删除', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', - `create_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `update_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新id', - PRIMARY KEY (`id`), - KEY `idx_user_id` (`create_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of `pp_task_server_group` --- ---------------------------- -BEGIN; -INSERT INTO `pp_task_server_group` VALUES ('1', '资源A组', '服务器A组', '1', '1531617485', '1531617485', '1', '1'), ('2', '资源B组', '服务器B组', '1', '1531617507', '1531617507', '1', '1'), ('3', '资源C组', '资源C组', '1', '1531617530', '1531617530', '1', '1'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_uc_admin` --- ---------------------------- -DROP TABLE IF EXISTS `pp_uc_admin`; -CREATE TABLE `pp_uc_admin` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `login_name` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名', - `real_name` varchar(32) NOT NULL DEFAULT '0' COMMENT '真实姓名', - `password` char(32) NOT NULL DEFAULT '' COMMENT '密码', - `role_ids` varchar(255) NOT NULL DEFAULT '0' COMMENT '角色id字符串,如:2,3,4', - `phone` varchar(20) NOT NULL DEFAULT '0' COMMENT '手机号码', - `email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱', - `salt` char(10) NOT NULL DEFAULT '' COMMENT '密码盐', - `last_login` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间', - `last_ip` char(15) NOT NULL DEFAULT '' COMMENT '最后登录IP', - `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,1-正常 0禁用', - `create_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID', - `update_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改者ID', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `idx_user_name` (`login_name`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; - --- ---------------------------- --- Records of `pp_uc_admin` --- ---------------------------- -BEGIN; -INSERT INTO `pp_uc_admin` VALUES ('1', 'admin', '超级管理员', 'abfcf6dcedfb4b5b1505d41a8b4c77e8', '0', '13811551087', 'haodaquan2008@163.com', 'aYk4Q1P83v', '1533546302', '[', '1', '0', '1', '0', '1528462051'), ('2', 'test_1', 'pipi', 'b937149452da9f7a36f304dc00149edc', '1', '13811551087', 'haodaquan2008@163.com', '1Uep', '1531645875', '[', '1', '1', '1', '1528459479', '1533703722'), ('3', 'test_ppgo2', 'ppgo2', '5fc38807c6740436407bf80015a7cf06', '2', '13811889999', '333@123.com', 'Qph1', '0', '', '1', '1', '1', '1531645748', '1531645748'), ('4', 'test_ppgo3', 'ppgo3', '548a12147d443ea5a99a65ad4dd1ed30', '3', '13999990000', '222@123.com', '9Xta', '1531645939', '[', '1', '1', '1', '1531645785', '1531645785'), ('5', 'test_ppgo4', 'ppgo4', '3225f516ea8a1c27d695084e0b67b651', '2,1', '13777777999', '44@qq.com', '7QmD', '1531705759', '[', '1', '1', '1', '1531645832', '1531645832'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_uc_auth` --- ---------------------------- -DROP TABLE IF EXISTS `pp_uc_auth`; -CREATE TABLE `pp_uc_auth` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', - `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '上级ID,0为顶级', - `auth_name` varchar(64) NOT NULL DEFAULT '0' COMMENT '权限名称', - `auth_url` varchar(255) NOT NULL DEFAULT '0' COMMENT 'URL地址', - `sort` int(1) unsigned NOT NULL DEFAULT '999' COMMENT '排序,越小越前', - `icon` varchar(255) NOT NULL, - `is_show` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否显示,0-隐藏,1-显示', - `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作者ID', - `create_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID', - `update_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改者ID', - `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,1-正常,0-删除', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='权限因子'; - --- ---------------------------- --- Records of `pp_uc_auth` --- ---------------------------- -BEGIN; -INSERT INTO `pp_uc_auth` VALUES ('1', '0', '所有权限', '/', '1', '', '0', '1', '1', '1', '1', '1505620970', '1505620970'), ('2', '1', '权限管理', '/', '999', 'fa-id-card', '1', '1', '0', '1', '1', '0', '1505622360'), ('3', '2', '用户管理', '/admin/list', '1', 'fa-user-o', '1', '0', '0', '0', '1', '0', '1528385411'), ('4', '2', '角色管理', '/role/list', '2', 'fa-user-circle-o', '1', '1', '0', '1', '1', '0', '1505621852'), ('5', '3', '新增', '/admin/add', '1', '', '0', '1', '0', '1', '1', '0', '1505621685'), ('6', '3', '修改', '/admin/edit', '2', '', '0', '1', '0', '1', '1', '0', '1505621697'), ('7', '3', '删除', '/admin/ajaxdel', '3', '', '0', '1', '1', '1', '1', '1505621756', '1505621756'), ('8', '4', '新增', '/role/add', '1', '', '1', '1', '0', '1', '1', '0', '1505698716'), ('9', '4', '修改', '/role/edit', '2', '', '0', '1', '1', '1', '1', '1505621912', '1505621912'), ('10', '4', '删除', '/role/ajaxdel', '3', '', '0', '1', '1', '1', '1', '1505621951', '1505621951'), ('11', '2', '权限因子', '/auth/list', '3', 'fa-list', '1', '1', '1', '1', '1', '1505621986', '1505621986'), ('12', '11', '新增', '/auth/add', '1', '', '0', '1', '1', '1', '1', '1505622009', '1505622009'), ('13', '11', '修改', '/auth/edit', '2', '', '0', '1', '1', '1', '1', '1505622047', '1505622047'), ('14', '11', '删除', '/auth/ajaxdel', '3', '', '0', '1', '1', '1', '1', '1505622111', '1505622111'), ('15', '1', '个人中心', 'profile/edit', '1001', 'fa-user-circle-o', '1', '1', '0', '1', '1', '0', '1506001114'), ('16', '15', '资料修改', '/user/edit', '1', 'fa-edit', '1', '0', '0', '0', '1', '1528385551', '1528385551'), ('17', '1', '基本设置', '/', '2', 'fa-cogs', '1', '1', '0', '1', '1', '0', '1528464467'), ('18', '17', '资源分组', '/servergroup/list', '2', 'fa-cubes', '1', '1', '0', '1', '1', '0', '1528466663'), ('19', '17', '资源管理', '/server/list', '1', 'fa-cube', '1', '1', '0', '1', '1', '0', '1528464498'), ('20', '17', '禁用命令', '/ban/list', '3', 'fa-exclamation-triangle', '1', '1', '0', '1', '1', '0', '1528464656'), ('21', '18', '新增', '/servergroup/add', '1', '', '0', '1', '0', '1', '1', '0', '1528466669'), ('22', '18', '修改', '/servergroup/edit', '2', '', '0', '1', '0', '1', '1', '0', '1528466675'), ('23', '18', '删除', '/servergroup/ajaxdel', '3', '', '0', '1', '0', '1', '1', '0', '1528466684'), ('24', '19', '新增', '/server/add', '1', '', '0', '1', '1', '1', '1', '1528464882', '1528464882'), ('25', '19', '修改', '/server/edit', '2', '', '0', '1', '1', '1', '1', '1528464904', '1528464904'), ('26', '19', '删除', '/server/ajaxdel', '3', '', '0', '1', '1', '1', '1', '1528464937', '1528464937'), ('27', '20', '新增', '/ban/add', '1', '', '0', '1', '1', '1', '1', '1528464977', '1528464977'), ('28', '20', '修改', '/ban/edit', '2', '', '0', '1', '1', '1', '1', '1528465005', '1528465005'), ('29', '20', '删除', '/ban/ajaxdel', '3', '', '0', '1', '1', '1', '1', '1528465036', '1528465036'), ('30', '1', '任务管理', '/job/list', '1', 'fa-tasks', '1', '1', '1', '1', '1', '1528639988', '1528639988'), ('31', '30', '任务列表', '/task/list', '1', 'fa-object-ungroup', '1', '1', '0', '1', '1', '0', '1531212830'), ('32', '30', '任务分组', '/group/list', '3', 'fa-object-group', '1', '1', '0', '1', '1', '0', '1531212219'), ('33', '32', '新增', '/group/add', '1', '', '0', '1', '1', '1', '1', '1528640546', '1528640546'), ('34', '32', '编辑', '/group/edit', '2', '', '0', '1', '1', '1', '1', '1528640572', '1528640572'), ('35', '32', '删除', '/group/ajaxdel', '3', '', '0', '1', '1', '1', '1', '1528640604', '1528640604'), ('36', '31', '新增', '/task/add', '1', '', '0', '1', '1', '1', '1', '1528728220', '1528728220'), ('37', '31', '编辑', '/task/edit', '2', '', '0', '1', '1', '1', '1', '1528728251', '1528728251'), ('38', '42', '删除', '/task/ajaxdel', '3', '', '0', '1', '0', '1', '1', '0', '1531279999'), ('39', '31', '查看', '/task/detail', '3', '', '0', '1', '0', '1', '1', '0', '1531279407'), ('40', '42', '审核通过', '/task/ajaxaudit', '5', '', '0', '1', '0', '1', '1', '0', '1531466535'), ('41', '31', '复制', '/task/copy', '5', '', '0', '1', '0', '1', '1', '0', '1531286150'), ('42', '30', '任务审核', '/task/auditlist', '2', 'fa-gavel', '1', '1', '0', '1', '1', '0', '1531212806'), ('43', '42', '批量审核通过', '/task/ajaxbatchaudit', '1', '', '0', '1', '0', '1', '1', '0', '1531466506'), ('44', '42', '批量审核不通过', '/task/ajaxbatchnopass', '2', '', '0', '1', '0', '1', '1', '0', '1531466513'), ('45', '31', '测试执行', '/task/ajaxrun', '4', '', '0', '1', '0', '1', '1', '0', '1531446085'), ('46', '31', '批量暂停', '/task/ajaxbatchpause', '9', '', '0', '1', '0', '1', '1', '0', '1531466394'), ('47', '31', '批量开启', '/task/ajaxbatchstart', '6', '', '0', '1', '0', '1', '1', '0', '1531466385'), ('48', '31', '开启', '/task/ajaxstart', '7', '', '0', '1', '0', '1', '1', '0', '1531466404'), ('49', '31', '暂停', '/task/ajaxpause', '8', '', '0', '1', '0', '1', '1', '0', '1531466411'), ('50', '42', '审核不通过', '/task/ajaxnopass', '6', '', '0', '1', '0', '1', '1', '0', '1531466546'), ('51', '42', '批量删除', '/task/ajaxbatchdel', '4', '', '0', '1', '0', '1', '1', '0', '1531466528'), ('52', '19', '复制', '/server/copy', '3', '', '0', '1', '1', '1', '1', '1531383393', '1531383393'), ('53', '19', '测试', '/server/ajaxtestserver', '5', '', '0', '1', '0', '1', '1', '0', '1531466851'), ('54', '1', '日志管理', '/tasklog/list', '10', 'fa-file-text-o', '0', '1', '1', '1', '1', '1531389296', '1531389296'), ('55', '54', '详情', '/tasklog/detail', '1', '', '0', '1', '1', '1', '1', '1531389347', '1531389347'), ('56', '54', '删除', '/tasklog/ajaxdel', '2', '', '0', '1', '0', '1', '1', '0', '1531466707'), ('57', '17', '提醒设置', '/remind/list', '4', 'fa-bell-o', '1', '1', '1', '1', '0', '1533607960', '1533607960'), ('58', '57', '新增', '/remind/add', '1', '', '0', '1', '1', '1', '1', '1533608257', '1533608257'), ('59', '57', '编辑', '/remind/edit', '2', '', '0', '1', '1', '1', '1', '1533608298', '1533608298'), ('60', '57', '删除', '/remind/ajaxdel', '3', '', '0', '1', '1', '1', '1', '1533608395', '1533608395'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_uc_role` --- ---------------------------- -DROP TABLE IF EXISTS `pp_uc_role`; -CREATE TABLE `pp_uc_role` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `role_name` varchar(32) NOT NULL DEFAULT '0' COMMENT '角色名称', - `detail` varchar(255) NOT NULL DEFAULT '0' COMMENT '备注', - `server_group_ids` varchar(255) NOT NULL DEFAULT '0' COMMENT '服务器分组权限ids,1,2,3', - `task_group_ids` varchar(255) NOT NULL DEFAULT '0' COMMENT '任务分组权限ids ,1,2,32', - `create_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID', - `update_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改这ID', - `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态1-正常,0-删除', - `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', - `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; - --- ---------------------------- --- Records of `pp_uc_role` --- ---------------------------- -BEGIN; -INSERT INTO `pp_uc_role` VALUES ('1', '普通管理员', '可以运行和关闭任务', '10,1', '4,1', '0', '1', '1', '1531705962', '1531705962'), ('2', '高级管理员', '可以批量操作任务,创建任务,创建任务分组,审核任务等', ',10,1,2', '4,6,1,2', '0', '1', '1', '1533607237', '1533607237'), ('3', '资深管理员', '系统配置,任务管理等', '1,2,3', '2,1,3', '0', '1', '1', '1531644877', '1531644877'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_uc_role_auth` --- ---------------------------- -DROP TABLE IF EXISTS `pp_uc_role_auth`; -CREATE TABLE `pp_uc_role_auth` ( - `role_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '角色ID', - `auth_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '权限ID', - PRIMARY KEY (`role_id`,`auth_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限和角色关系表'; - --- ---------------------------- --- Records of `pp_uc_role_auth` --- ---------------------------- -BEGIN; -INSERT INTO `pp_uc_role_auth` VALUES ('1', '1'), ('1', '15'), ('1', '16'), ('1', '30'), ('1', '31'), ('1', '36'), ('1', '37'), ('1', '39'), ('1', '41'), ('1', '46'), ('1', '47'), ('1', '48'), ('1', '49'), ('1', '54'), ('1', '55'), ('1', '56'), ('2', '0'), ('2', '17'), ('2', '18'), ('2', '19'), ('2', '20'), ('2', '21'), ('2', '22'), ('2', '23'), ('2', '24'), ('2', '25'), ('2', '26'), ('2', '27'), ('2', '28'), ('2', '29'), ('2', '32'), ('2', '33'), ('2', '34'), ('2', '35'), ('2', '38'), ('2', '40'), ('2', '42'), ('2', '43'), ('2', '44'), ('2', '45'), ('2', '50'), ('2', '51'), ('2', '52'), ('2', '53'); -COMMIT; - --- ---------------------------- --- Table structure for `pp_user` --- ---------------------------- -DROP TABLE IF EXISTS `pp_user`; -CREATE TABLE `pp_user` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `user_name` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名', - `email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱', - `password` char(32) NOT NULL DEFAULT '' COMMENT '密码', - `salt` char(10) NOT NULL DEFAULT '' COMMENT '密码盐', - `last_login` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间', - `last_ip` char(15) NOT NULL DEFAULT '' COMMENT '最后登录IP', - `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0正常 -1禁用', - PRIMARY KEY (`id`), - UNIQUE KEY `idx_user_name` (`user_name`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of `pp_user` --- ---------------------------- -BEGIN; -INSERT INTO `pp_user` VALUES ('1', 'admin', 'haodaquan@shoplinq.cn', 'abfcf6dcedfb4b5b1505d41a8b4c77e8', 'aYk4Q1P83v', '1528124357', '[', '0'); -COMMIT; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/.docker/web/.env b/.docker/web/.env deleted file mode 100644 index a813a276..00000000 --- a/.docker/web/.env +++ /dev/null @@ -1,3 +0,0 @@ -CGO_ENABLED=0 -GOOS=darwin -GOARCH=amd64 \ No newline at end of file diff --git a/.docker/web/Dockerfile b/.docker/web/Dockerfile deleted file mode 100644 index 437bbb41..00000000 --- a/.docker/web/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM alpine:3.8 - -# Expose the application on port 8080* -EXPOSE 8080 443 -RUN apk add tzdata bash --update-cache --repository http://mirrors.ustc.edu.cn/alpine/v3.8/main/ --allow-untrusted -RUN apk add --no-cache --virtual .build-deps curl tzdata --update-cache --repository http://mirrors.ustc.edu.cn/alpine/v3.8/main/ --allow-untrusted && \ - curl -o wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && chmod +x wait-for-it.sh && \ - apk del .build-deps -COPY conf/app.conf ./conf/ -COPY static ./static -COPY views ./views -ADD PPGo_Job . -CMD ["./PPGo_Job"] diff --git a/.gitignore b/.gitignore index 50c373b0..5be8dcd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ - .DS_Store .idea -PPGo_Job* +*.exe +_old/ +data/ info.log +resource/log/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 11d2de74..00000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go -go: - - 1.9.x -script: go get github.com/george518/PPGo_Job - -notifications: - on_success: never - on_failure: always diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..3b3a22d8 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,100 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project + +PPGo_Job — 定时任务管理系统,GoFrame v2 重构版。 + +**框架:** GoFrame v2(原版基于 Beego v1) +**数据库:** SQLite(纯 Go 驱动 `modernc.org/sqlite`,无需 CGO) +**定时任务:** GoFrame `gcron`(原版自定义 crons/ 包) + +## Build & Run + +```bash +# 编译(纯 Go,不需要 gcc/MinGW) +CGO_ENABLED=0 go build -o ppgo_job.exe . + +# 运行 +./ppgo_job.exe + +# 访问 http://localhost:8082 +# 默认账号 admin / 123456 +``` + +## Architecture + +``` +main.go # GoFrame 启动入口 +config.yml # YAML 配置 +boot/ # 启动初始化 + db.go # 数据库初始化 + router.go # 路由注册 + tplfunc.go # 自定义模板函数(urlfor/date/substr 等) + init.go # 启动后初始化(加载任务到调度器) +controller/ # HTTP 层 + base.go # display/ajaxMsg/ajaxList/parseFilters 辅助函数 + login.go # 登录/登出 + home.go # 首页/仪表盘/帮助 + task.go # 任务 CRUD + 服务器/分组/日志/权限管理 +service/ # 业务逻辑 + scheduler/ # gcron 调度 + 任务执行引擎 +dao/ # 数据访问层 +model/entity/ # 数据库实体(含 Cols 字段常量) +middleware/ # 认证中间件(Cookie + RBAC 权限) +consts/ # 常量、表名定义 +resource/ + template/ # LayUI 模板(从原 views/ 迁移) + static/ # 静态资源(layui/css/js) +sql/schema.sql # 建表 DDL + 初始数据 +_old/ # 原 Beego 旧代码(参考用) + agent/ # 远程执行器(独立二进制,后续迁移) +``` + +## Layer Rules + +- **controller**:参数解析 → 调用 Service/DAO → 渲染模板或返回 JSON。不含业务逻辑。 +- **service**:业务逻辑。不含 HTTP 概念。 +- **dao**:数据访问。纯 CRUD。 +- **middleware**:认证、权限检查。 + +## Key Packages + +| Package | Purpose | +|---|---| +| `controller` | All HTTP handlers (flat package, organized by file) | +| `dao` | Database CRUD operations, singleton pattern (`var Xxx = new(xxxDao)`) | +| `model/entity` | DB structs with `orm` tags and Cols constants | +| `service/scheduler` | Cron job scheduling + task execution engine | +| `middleware` | Cookie auth + RBAC permission checking | +| `consts` | Table names, status constants, message codes | + +## Template Convention + +LayUI 模板使用 `{{include "MainContent" .}}` 布局模式(layout.html 中定义)。 + +- `display(r, "page.html", data)` — 渲染带布局的页面 +- `displayTpl(r, "page.html", data)` — 直接渲染模板 +- `ajaxMsg(r, msg, code)` — JSON 消息响应 +- `ajaxList(r, msg, code, count, data)` — LayUI table JSON 格式 + +## Database + +SQLite 建表脚本:`sql/schema.sql` +首次启动自动创建 `./data/ppgo_job.db` + +## Migration Status + +| Phase | Status | +|-------|--------| +| 1 项目骨架 | ✅ | +| 2 数据访问层 | ✅ | +| 3 路由+控制器框架 | ✅ | +| 4 认证系统 | ✅ | +| 5 模板渲染 | ✅ | +| 6 任务调度器 | ✅ | +| 7 服务层 | ✅ | +| 8 清理 | ✅ | + +待办:SSH/Telnet/Agent 远程执行器(参考 `_old/jobs/job.go`)、通知渠道(参考 `_old/notify/`) diff --git a/README.md b/README.md index 0160449c..6ef05bc9 100644 --- a/README.md +++ b/README.md @@ -1,301 +1,361 @@ -PPGo_Job定时任务管理系统 +PPGo_Job 定时任务管理系统 ==== -![](http://www.haodaquan.com/Uploads/article/2018-07-26/153262059813931.png) +一款轻量级定时任务管理系统,基于 **GoFrame v2** 重构。部署简单,资源消耗少,运行稳定。 -一、说明 ----- -PPGo_Job是一款轻量级定时任务管理系统,go语言开发,部署超级简单,资源消耗少,运行稳定。 -支持定时任务可视化管理、多人多权限的管理,支持大并发,可同时管理多台服务器上的定时任务。 +## 技术栈 -PPGo_Job从v1.0开源以来,得到众多技术朋友的支持和欢迎,已应用在多个公司的生产环境,同时也 -吸收使用者的建议和意见,不断改进和优化,目前已经上线了20余个版本,9个稳定版本(生产环境部署完成后才发布新版本)。 +- **框架:** GoFrame v2(原 Beego v1) +- **数据库:** SQLite(纯 Go 驱动 `modernc.org/sqlite`,无需 CGO) +- **定时任务:** GoFrame `gcron` +- **前端:** LayUI(服务端模板渲染) +## 快速开始 -码云地址:https://gitee.com/georgehao/PPGo_Job -Github地址:https://github.com/george518/PPGo_Job - -文档地址:http://www.haodaquan.com/topics/1### -Wiki:https://github.com/george518/PPGo_Job/wiki - - -二、架构 ----- -![](http://www.haodaquan.com/Uploads/editormd/2019-07-06/156240332990478.png) - - -![](http://www.haodaquan.com/Uploads/editormd/2019-07-21/156368574611565.png) -三、特性 ----- - - -V2.x新增以下功能和特性: - -- 1、全新UI,基于LayUI构建全新页面,后端模板手工搭建,让操作更加人性化。后台模板地址:https://github.com/george518/PP_admin-template -- 2、新增权限管理功能,根据菜单权限、操作权限和数据权限进行划分,方便多用户多权限管理定时任务。 -- 3、新增服务器复制功能,让服务器资源添加更加方便。 -- 4、新增定时任务详情页面,将任务相关操作更加集中起来操作。 -- 5、新增任务审核功能,提高任务的管控能力。 -- 6、新增禁止命令管理功能,配合任务审核功能,提高任务运行安全性,总有人会犯错。 -- 7、优化日志详情页面,查看日志更方便,你想看到的现场内容都在,亲。 -- 8、支持docker化部署,这年头,系统不支持docker化部署好像不能出门似的。 -- 9、支持windows系统运行定时系统,不歧视windows,也要支持。 -- 10、提醒信息新增钉钉和微信通知功能,并支持编辑通知模版功能。让提醒内容个性化,不再死板。 -- 11、新增创建、启动、关闭任务的API,通过接口的方式控制定时任务,猜你喜欢。 -- 12、**新增任务执行器agent,可以通过ssh,telnet或者agent的方式接受并执行任务** - -总之,管理定时任务,使用PPGo_Job吧,节省出来的时间,或皮或浪,随你。 - - - -三、支持 ----- -1、给项目一个star - -2、请我喝瓶水 - -![github](https://github.com/george518/PP_blog/blob/master/static/public/images/weixin.png?raw=true "github") - -四、先睹为快 ----- -![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/1-index.png?raw=true "github") -![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/2-task.png?raw=true "github") -![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/3-task_detail.png?raw=true "github") -![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/10-auth.png?raw=true "github") -![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/11-role.png?raw=true "github") -![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/12-role_add.png?raw=true "github") -![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/15.log.png?raw=true "github") - - -五、安装方法 ----- - -方法一、 编译安装 - -- go get github.com/george518/PPGo_Job -- 创建mysql数据库,并将ppgo_job2.sql导入 -- 修改config 配置数据库 -- 运行 go build -- 运行 ./run.sh start|stop - -mac -- 运行 ./package.sh -a amd64 -p darwin -v v2.x.0 - -linux -- 运行 ./package.sh -a 386 -p linux -v v2.x.0 -- 运行 ./package.sh -a amd64 -p linux -v v2.x.0 - -windows -- 运行 ./package.sh -a amd64 -p windows -v v2.x.0 - - -方法二、直接使用 - -linux - -- 进入 https://github.com/george518/PPGo_Job/releases -- 下载 ppgo_job-linux-2.x.0.zip 并解压 -- 进入文件夹,设置好数据库(创建数据库,导入ppgo_job2.sql)和配置文件(conf/app.conf) -- 运行 ./run.sh start|stop - -mac - -- 进入https://github.com/george518/PPGo_Job/releases -- 下载 ppgo_job-mac-2.x.0.zip 并解压 -- 进入文件夹,设置好数据库(创建数据库,导入ppgo_job2.sql)和配置文件(conf/app.conf) -- 运行 ./run.sh start|stop - -windows - -- 进入 https://github.com/george518/PPGo_Job/releases -- 下载 ppgo_job-windows-2.x.0.zip 并解压 -- 进入文件夹,设置好数据库(创建数据库,导入ppgo_job2.sql)和配置文件(conf/app.conf) -- 运行 run.bat - ----- -前台访问:http://your_host:8080 -用户名:admin 密码:123456 - -配置文件 ----- -根据自己的情况修改数据库和启动端口 -``` -appname = PPGo_Job2 -httpport = 8080 -runmode = dev - -version= V2.2 - -# 允许同时运行的任务数 -jobs.pool = 1000 - -# 站点名称 -site.name = 定时任务管理器 - -#通知方式 0=邮件,1=信息,2=钉钉,3=微信 -notify.type = 0 - -# 数据库配置 -db.host = 127.0.0.1 -db.user = root -db.password = "123456" -db.port = 3306 -db.name = ppgo_job2 -db.prefix = pp_ -db.timezone = Asia/Shanghai - -# 邮件通知配置 -email.host = smtp.mxhichina.com -email.port = 25 -email.from = ci@xxx.cn -email.user = ci@xxx.cn -email.password = "xxxxxx" -email.pool = 10 - -# 短信通知方式配置 -msg.url = http://chanxiyou.com/api/tools/send_sms -msg.pool = 10 - -# 钉钉通知配置 -dingtalk.url = "https://oapi.dingtalk.com/robot/send?access_token=%s" -dingtalk.pool = 10 - -# 微信通知方式配置 -wechat.url = http://xx.com/api/tools/send_wechat -wechat.pool = 10 -``` - -六、编译安装-可能会遇到的问题 ----- -go build 时遇到以下错误: -jobs/job.go:19:2: cannot find package "golang.org/x/crypto/ssh" in any of: - -需要 git clone https://github.com/golang/crypto.git -并拷贝到 $GOPATH/src/golang.org/x/ 下就OK - -或 - -git clone https://github.com/golang/crypto.git $GOPATH/src/golang.org/x/crypto - -# Docker -本地编译好的2进制文件放在根目录下执行下面的命令即可拥有 ```bash -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build +# 编译(纯 Go,不需要 gcc/MinGW) +CGO_ENABLED=0 go build -o ppgo_job.exe . + +# 运行 +./ppgo_job.exe ``` -``` -docker-compose up -d +> 首次启动自动在 `./data/ppgo_job.db` 创建 SQLite 数据库、表和默认管理员。 -#日志查看 -docker-compose logs -f web +**访问地址:** http://localhost:8082 +**默认账号:** admin / **密码:** 123456 -``` -# Windows远程执行 +## 运行测试 -1.开启telnet功能 +```bash +# 运行所有测试 +CGO_ENABLED=0 go test -count=1 ./... -控制面板->程序和功能->打开或关闭Windows功能,选择Telnet服务端和Telnet客户端 +# 运行单元测试(libs、consts、dao,无需启动服务器) +CGO_ENABLED=0 go test -count=1 ./libs/ ./consts/ ./dao/ -2.启动telnet服务 +# 运行集成测试(自动启动测试服务器,端口 18082) +CGO_ENABLED=0 go test -count=1 -timeout=120s -run "TestLogin|TestAuth|TestHome|TestTask|TestServer|TestGroup|TestBan|TestTemplate|TestStatic|TestDatabase|TestCORS" . -控制面板->管理工具->服务->Telnet->启动类型改为自动并启动 - -3.登陆授权 - -控制面板->管理工具->本地安全策略,在本地安全策略中,安全设置->本地策略->安全选项->网络访问:本地帐户的共享和安全模型->经典 - -控制面板->管理工具->本地安全策略->安全设置->本地策略->安全选项->帐户:使用空密码的本地帐户只允许进行控制台登录->已禁用 - -控制面板->管理工具->计算机管理->系统工具->本地用户和组->组->TelnetClients->添加用户 - -七、任务接口说明 ----- -三个简陋的接口,满足日常所需。 - -1、新增和修改任务接口 - -- url:/task/apitask -- method:post -- params: -``` -id:0 -create_id:4 -group_id:3 -task_name:测试API创建任务 -description:测试 -concurrent:0 -server_id:2 -cron_spec:*/2 * * * * -command:free -G -timeout:0 -is_notify:0 -notify_type:0 -notify_tpl_id:0 -notify_user_ids:0 +# 运行特定包测试 +CGO_ENABLED=0 go test -v -count=1 ./libs/ ``` -参数含义详见数据库字段。 -需要注意的是id为0为新增,大于0为修改。 +> 集成测试覆盖登录、认证拦截、CRUD 操作、模板渲染、静态文件、CORS 头、数据库种子数据等功能。 +> 测试使用独立的端口 `:18082`,不会干扰正在运行的开发实例。 -2、任务启动接口 - -- url:/task/apistart -- method:post -- params: +--- + +## 📖 使用指南 + +### 1. 登录 + +打开浏览器访问 `http://localhost:8082`,输入默认账号 `admin` / `123456` 登录。 + +> 💡 如果访问时遇到"重定向次数过多",清除浏览器 Cookie 后刷新即可。 + +--- + +### 2. 首页仪表盘 + +登录后进入系统首页,展示: +- **任务概览** — 总任务数、运行中、待审核 +- **近期执行统计** — 过去 7 天的成功/失败/超时柱状图 +- **即将执行的任务** — 最近将要触发的定时任务 +- **系统信息** — 运行时间、内存使用、goroutine 数量 + +--- + +### 3. 任务管理 + +#### 3.1 新增任务 + +左侧菜单「任务管理 → 任务列表」→ 点击「新增」按钮。 + +必填字段: +| 字段 | 说明 | 示例 | +|------|------|------| +| 任务名称 | 有意义的名称 | `数据库备份` | +| Cron 表达式 | **6 段格式(含秒)** | `0 0 3 * * *`(每天凌晨 3 点) | +| 执行命令 | 要执行的 shell 命令 | `mysqldump -u root db1 > /backup.sql` | +| 超时时间 | 超时后自动终止(秒) | `300`(5 分钟) | + +> ⚠️ **Cron 表达式注意事项:** +> 本项目使用 GoFrame `gcron`,Cron 表达式为 **6 段格式**(比标准多一位秒): +> +> ``` +> 秒 分 时 日 月 周 +> ``` +> +> 常用示例: +> - `0 */5 * * * *` — 每 5 分钟 +> - `0 0 3 * * *` — 每天凌晨 3 点 +> - `0 30 9 * * 1-5` — 工作日 9:30 +> - `0 0 0 1 * *` — 每月 1 号零点 +> +> 如果误填了标准 5 段表达式,系统会提示 `invalid pattern` 错误。 + +可选字段: +- **任务分组** — 归类管理 +- **执行服务器** — 选择远程服务器(留空 = 本机执行) +- **执行方式** — 同时执行(所有服务器一起跑) / 轮询执行(逐台跑) +- **允许并发** — 默认不允许(上一个未执行完,下一个不会触发) +- **失败通知** — 勾选后可选择通知模板和接收人 + +#### 3.2 任务列表 + +列表展示了所有任务,支持: +- **按分组筛选** — 右上角下拉框 +- **按名称搜索** — 输入关键字后点查询 +- **表格操作按钮:** + +| 按钮 | 功能 | +|------|------| +| 🔍 详细 | 查看任务完整信息 | +| ✏️ 编辑 | 修改任务参数 | +| ▶️ 启动 | 将暂停的任务加入调度 | +| ⏸️ 暂停 | 从调度中移除(暂不执行) | +| ▶️ 测试 | **立即执行一次**(不依赖 Cron 触发) | +| 📋 日志 | 查看该任务的执行记录 | +| 📝 复制 | 基于现有任务创建新任务 | +| 🗑️ 删除 | 软删除(可在数据库恢复) | + +#### 3.3 任务审核 + +超级管理员 `admin` 创建的任务自动进入暂停状态;普通账号创建的任务进入「待审核」状态,需要管理员在「任务管理 → 任务审核」中通过后才能启动。 + +--- + +### 4. 服务器管理 + +#### 4.1 新增服务器 + +「服务器管理 → 服务器列表」→ 点击「新增」。 + +| 字段 | 说明 | 示例 | +|------|------|------| +| 服务器名称 | 标识名称 | `Web 服务器 01` | +| 连接方式 | SSH / Telnet / Agent | SSH | +| IP 地址 | 连接 IP | `192.168.1.100` | +| 端口 | SSH 默认 22 | `22` | +| 账号 | 登录用户名 | `root` | +| 密码/密钥 | 密码或私钥内容 | — | + +> ⚠️ **注意:** 远程执行功能目前为**占位状态**,实际 SSH/Telnet/Agent 连接尚未实现。当前只支持**本机执行**(服务器 ID = 0)。 + +#### 4.2 资源分组 + +将服务器归类管理。多个服务器可以属于同一个资源组,方便在创建任务时批量选择。 + +--- + +### 5. 系统设置 + +#### 5.1 任务分组 + +对任务进行分类,例如:`数据备份`、`日志清理`、`监控脚本`。 + +#### 5.2 禁用命令 + +设置禁止执行的关键词。创建/编辑任务时,如果命令包含禁用词(如 `rm -rf`),系统会拒绝保存。 + +#### 5.3 通知模板 + +配置任务执行失败时的通知内容。支持变量占位符:`{{task_name}}`、`{{status}}`。 + +> ⚠️ **注意:** 通知**发送功能**目前为占位状态,实际邮件/钉钉/微信推送尚未实现。模板可以先配置好。 + +--- + +### 6. 执行日志 + +「日志管理 → 执行日志」查看所有任务的执行记录。 + +| 字段 | 说明 | +|------|------| +| 状态 | ✅ 成功 / ❌ 失败 / ⏰ 超时 | +| 耗时 | 执行耗时(毫秒) | +| 执行时间 | 触发时间 | +| 输出 | 命令的标准输出 | +| 错误 | 错误信息(如果有) | + +支持按任务 ID 筛选、分页浏览、查看详情和删除。 + +--- + +### 7. 权限管理 + +#### 7.1 权限因子 + +系统内置的菜单和功能权限,支持新增/编辑/删除。每个权限对应一个侧边栏菜单项。 + +权限结构为两级: +- **一级菜单** — 如「任务管理」「服务器管理」 +- **二级菜单** — 如「任务列表」「任务审核」 + +#### 7.2 角色管理 + +创建角色并绑定权限,支持数据权限控制(限制可查看的服务器组和任务组)。 + +例如创建一个「运维人员」角色,只赋予任务管理和日志查看权限。 + +#### 7.3 管理员管理 + +创建系统用户,可关联角色。新增的管理员默认密码 `123456`。 + +> `admin` 是超级管理员,**不能被禁用**,拥有全部权限。 + +--- + +### 8. 个人资料 + +右上角用户头像 → 可修改个人资料(姓名、电话、邮箱、钉钉/微信等)及修改密码。 + +--- + +## 注意事项 + +### ⚡ Cron 表达式格式 + +本项目使用 **6 段格式**(含秒),不要使用标准 5 段格式: ``` -id:11 +✅ 正确: 0 0 3 * * * (每天凌晨 3 点) +❌ 错误: 0 3 * * * (缺少秒字段 → 报错) +✅ 正确: 0 */5 * * * * (每 5 分钟) ``` -3、任务暂停接口 +### 🔒 端口冲突 -- url:/task/apipause -- method:post -- params: - - ``` - id:11 - ``` +如果启动提示 `bind: Only one usage of each socket address`,说明端口 8082 已被占用: +```bash +# 查看谁占了端口 +netstat -ano | findstr 8082 -注意使用 form-data的方式传参 +# 杀掉进程(PID 替换为实际值) +taskkill //PID 进程号 //F -4、返回json,status=0表示成功,其他为失败,msg是错误理由或id - -``` -{ - "message": 11, - "status": 0 -} +# 或者修改 config.yml 换个端口 ``` -具体可以使用postman测试 +### 💾 数据库 +SQLite 数据库文件在 `./data/ppgo_job.db`,直接复制即可备份。如需重置,删除该文件后重启服务即可自动重建。 -八、常见操作问题 ----- -1、如何删除任务? +--- -目前操作的步骤是,在非admin用户登陆情况下,编辑一下任务,此任务会到待审核任务列表中,就可以删除了。 -因为删除已经审核通过的任务是敏感操作,并且认为删除任务操作执行不多,再加上列表中操作太多,所以就放到待审核任务里执行操作了。如果大家觉得需要在任务列表中添加的话,后期再做修改。 +## 项目结构 -2、删除资源分组问题。 +``` +├── main.go # 入口 +├── config.yml # 配置文件 +├── boot/ # 启动初始化 +│ ├── db.go # 数据库目录初始化 +│ ├── router.go # 路由注册 + 路由表 +│ ├── tplfunc.go # 模板函数(urlfor/date/substr) +│ └── init.go # 自动建表 + 种子数据 + 加载调度任务 +├── controller/ # HTTP 控制器 +│ ├── base.go # display/ajaxMsg/ajaxList 辅助函数 +│ ├── login.go # 登录/登出 +│ ├── home.go # 首页仪表盘 +│ ├── task.go # 任务/服务器/分组/日志/CRUD +│ ├── admin.go # 服务器/分组/禁用命令/通知模板 CRUD +│ └── system.go # 权限因子/角色/管理员/个人资料 CRUD +├── service/ +│ └── scheduler/ # 任务调度 + 执行引擎 +│ ├── scheduler.go # gcron 调度管理 +│ └── task_runner.go # 命令执行器(本地/远程) +├── dao/ # 数据访问层 +├── model/entity/ # 数据库实体(含字段常量) +├── middleware/ # 认证中间件(Cookie + 权限加载) +├── libs/ # 工具函数(密码哈希/SHA256) +├── consts/ # 常量定义 +└── resource/ + ├── template/ # LayUI 模板 + └── static/ # JS/CSS/字体 +``` -所谓的资源,其实就是执行任务的服务器或者容器。资源的分组就是给这些服务器或者容器分个类。因此,删除资源分组的时候,基于谨慎型原则,必须保证要删除的资源分组下没有服务器资源。要么删除,要么转移到其他分组下。 +## 配置文件(`config.yml`) +```yaml +server: + address: ":8082" # 监听端口 + name: "ppgo_job" + logStdout: true # 日志输出到控制台 +database: + default: + type: sqlite # 数据库类型(仅支持 sqlite) + name: "./data/ppgo_job.db" -九、联系我 ----- -qq群号:547564773 -欢迎交流,欢迎提交代码。 +jobs: + pool: 1000 # 任务并发池大小 -十、感谢 ----- -@bannerchi -@linxiaozhi -@gongwalker +site: + name: "定时任务管理器" # 站点标题 +``` +## API 接口 +| 接口 | 方法 | 说明 | +|------|------|------| +| `/` | GET | 登录页面 | +| `/login_in` | POST | 登录(参数:username, password) | +| `/login_out` | GET | 登出 | +| `/home` | GET | 首页(需认证) | +| `/home/start` | GET | 仪表盘数据(需认证) | +| `/task/table` | GET | 任务列表 JSON(LayUI 表格格式) | +| `/task/ajax_save` | POST | 新增/编辑任务 | +| `/task/ajax_start` | POST | 启动任务 | +| `/task/ajax_pause` | POST | 暂停任务 | +| `/task/ajax_del` | POST | 删除任务 | +| `/task/ajax_run` | POST | 立即执行 | +| `/task/ajax_audit` | POST | 审核通过 | +| `/task/ajax_nopass` | POST | 审核不通过 | +| `/task/ajax_batch_start` | POST | 批量启动 | +| `/task/ajax_batch_pause` | POST | 批量暂停 | +| `/task/ajax_batch_del` | POST | 批量删除 | +| `/task/ajax_batch_audit` | POST | 批量审核通过 | +| `/server/table` | GET | 服务器列表 JSON | +| `/server/ajax_save` | POST | 新增/编辑服务器 | +| `/server/ajax_del` | POST | 删除服务器 | +| `/group/table` | GET | 任务分组列表 JSON | +| `/group/ajax_save` | POST | 新增/编辑任务分组 | +| `/server_group/ajax_save` | POST | 新增/编辑资源分组 | +| `/ban/ajax_save` | POST | 新增/编辑禁用命令 | +| `/notify_tpl/ajax_save` | POST | 新增/编辑通知模板 | +| `/auth/get_nodes` | GET | 权限树 JSON(zTree 格式) | +| `/role/ajax_save` | POST | 新增/编辑角色 | +| `/admin/table` | GET | 管理员列表 JSON | +| `/admin/ajax_save` | POST | 新增/编辑管理员 | +| `/user/ajax_save` | POST | 修改个人资料 | +| `/task_log/table` | GET | 执行日志列表 JSON | +完整路由见 `boot/router.go`。 +## 编译部署 + +```bash +# 本地运行 +CGO_ENABLED=0 go build -o ppgo_job.exe . && ./ppgo_job.exe + +# Linux +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ppgo_job . + +# Windows +CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ppgo_job.exe . + +# Mac +CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ppgo_job . +``` + +## 已知限制 + +- **远程执行尚未实现** — SSH/Telnet/Agent 连接方式为占位状态,任务只支持本机执行 +- **通知功能尚未实现** — 邮件/钉钉/微信推送为占位状态 +- **Agent API** — 远程 Agent 注册和管理暂未实现 + +## License + +MIT diff --git a/agent/common/protocol.go b/agent/common/protocol.go deleted file mode 100644 index 00689581..00000000 --- a/agent/common/protocol.go +++ /dev/null @@ -1,25 +0,0 @@ -/************************************************************ -** @Description: common -** @Author: george hao -** @Date: 2018-11-29 11:14 -** @Last Modified by: george hao -** @Last Modified time: 2018-11-29 11:14 -*************************************************************/ -package common - -//配置开始 注释查看配置文件 -type Conf struct { - Version string - AppMode string - LogLevel string - ServerName string - ServerId int - TcpPort int - TcpIp string - GroupId string - RegisterUrl string - UpdateStatusUrl string - IpType int -} - -var ExitChan = make(chan int, 1) diff --git a/agent/config/conf.ini b/agent/config/conf.ini deleted file mode 100644 index 806ae2af..00000000 --- a/agent/config/conf.ini +++ /dev/null @@ -1,23 +0,0 @@ -# GOLBAL -# dev prod -AppMode = dev -Version = 1.0.0 -# ALL,DEBUG,INFO,NOTICE,WARN,ERROR,FATAL -LogLevel = ALL -# 执行器配置 -# auto-自动起名,或者自己起名 -ServerName = auto -# 启动后回写 -ServerId = 4 -# 端口,必须配置!! -TcpPort = 1564 -# auto-自动获取 -TcpIp = auto -# Ip地址是外网还是内网,1-外网,0-内网,若填写TcpIp则本项配置无意义 -IpType = 0 -# 添加的执行器属于分组Id,默认为1 -GroupId = 1 -# 以下配置必填,地址格式:http://yourdomain/server/apisave -RegisterUrl = http://localhost:8080/server/apisave -UpdateStatusUrl = http://localhost:8080/server/apistatus - diff --git a/agent/main.go b/agent/main.go deleted file mode 100644 index 330b0bce..00000000 --- a/agent/main.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "flag" - "github.com/george518/PPGo_Job/agent/server" - "log" - "runtime" -) - -//文件配置路径 -var configFilePath string - -func initArgs() { - //server -c ./configpath - //defaultPath := "/Users/haodaquan/golang/src/github.com/george518/PPGo_Job/agent/config/conf.ini" - defaultPath := "./config/conf.ini" - flag.StringVar(&configFilePath, "c", defaultPath, "config file path request") - flag.Parse() -} - -func initEnv() { - runtime.GOMAXPROCS(runtime.NumCPU()) -} - -func main() { - var err error - - //初始化线程 - initEnv() - - //配置文件路径 - initArgs() - - //加载配置 - if err = server.InitConfig(configFilePath); err != nil { - goto ERR - } - - server.NLog("INFO", "配置文件读取完毕...") - - //应用关闭监控 - server.ListenSignal() - - //自动注册 - if err = server.Register(); err != nil { - goto ERR - } - - server.NLog("INFO", "自动注册完成...") - - server.NLog("INFO", "agent is running...") - //监听 - if err = server.RpcRun(); err != nil { - goto ERR - } - -ERR: - log.Fatal(err.Error()) -} diff --git a/agent/run.sh b/agent/run.sh deleted file mode 100644 index ec878060..00000000 --- a/agent/run.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# @Author: haodaquan -# @Date: 2017-06-29 17:44:45 -# @Last Modified by: haodaquan -# @Last Modified time: 2019-07-03 17:44:45 - - -case $1 in - start) - nohup ./ppgo_agent 2>&1 >> info_agent.log 2>&1 /dev/null & - echo "服务已启动..." - sleep 1 - ;; - stop) - killall ppgo_agent - echo "服务已停止..." - sleep 1 - ;; - restart) - killall ppgo_agent - sleep 1 - nohup ./ppgo_agent 2>&1 >> info_agent.log 2>&1 /dev/null & - echo "服务已重启..." - sleep 1 - ;; - *) - echo "$0 {start|stop|restart}" - exit 4 - ;; -esac \ No newline at end of file diff --git a/agent/server/config.go b/agent/server/config.go deleted file mode 100644 index 8d6b7c85..00000000 --- a/agent/server/config.go +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************ -** @Description: server -** @Author: george hao -** @Date: 2018-11-29 11:13 -** @Last Modified by: george hao -** @Last Modified time: 2018-11-29 11:13 -*************************************************************/ -package server - -import ( - "github.com/george518/PPGo_Job/agent/common" - "github.com/go-ini/ini" -) - -var C = new(common.Conf) -var ConfPath string - -func InitConfig(path string) error { - - Cfg, err := ini.Load(path) - if err != nil { - return err - } - - ConfPath = path - err = Cfg.MapTo(C) - return err -} - -func SaveConfig(key string, value string) error { - Cfg, err := ini.Load(ConfPath) - if err != nil { - return err - } - Cfg.Section("").Key(key).SetValue(value) - Cfg.SaveTo(ConfPath) - InitConfig(ConfPath) - return nil -} diff --git a/agent/server/job.go b/agent/server/job.go deleted file mode 100644 index 67c7b50f..00000000 --- a/agent/server/job.go +++ /dev/null @@ -1,139 +0,0 @@ -/************************************************************ -** @Description: job -** @Author: george hao -** @Date: 2019-06-24 15:14 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-24 15:14 -*************************************************************/ -package server - -import ( - "bytes" - "fmt" - "github.com/astaxie/beego/logs" - . "github.com/george518/PPGo_Job/jobs" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" - "os/exec" - "runtime" - "runtime/debug" - "sync" - "time" -) - -//执行句柄map -var CmdMap sync.Map - -func SetCmdMap(key string, cmd *exec.Cmd) { - if _, ok := CmdMap.Load(key); ok { - Counter.Store(key, cmd) - } -} - -func GetCmdMap(key string) *exec.Cmd { - if v, ok := CmdMap.Load(key); ok { - return v.(*exec.Cmd) - } - - return nil -} - -func RestJobFromTask(task *models.Task, serverId int) (*Job, error) { - - if task.Id < 1 { - return nil, fmt.Errorf("ToJob: 缺少id") - } - - if task.ServerIds == "" { - return nil, fmt.Errorf("任务执行失败,找不到执行的服务器") - } - - job := ResetCommandJob(task.Id, serverId, task.TaskName, task.Command) - job.Task = task - job.Concurrent = task.Concurrent == 1 - job.ServerId = serverId - job.ServerName = "执行器" - - return job, nil -} - -func ResetCommandJob(id int, serverId int, name string, command string) *Job { - job := &Job{ - Id: id, - Name: name, - } - - job.JobKey = libs.JobKey(id, serverId) - job.RunFunc = func(timeout time.Duration) (jobResult *JobResult) { - bufOut := new(bytes.Buffer) - bufErr := new(bytes.Buffer) - //cmd := exec.Command("/bin/bash", "-c", command) - var cmd *exec.Cmd - if runtime.GOOS == "windows" { - cmd = exec.Command("CMD", "/C", command) - } else { - cmd = exec.Command("sh", "-c", command) - } - cmd.Stdout = bufOut - cmd.Stderr = bufErr - cmd.Start() - err, isTimeout := runCmdWithTimeout(cmd, timeout) - - jobResult = new(JobResult) - jobResult.ErrMsg = bufErr.String() - jobResult.OutMsg = bufOut.String() - jobResult.IsOk = true - if err != nil { - jobResult.IsOk = false - } - - jobResult.IsTimeout = isTimeout - - return - } - return job -} -func runCmdWithTimeout(cmd *exec.Cmd, timeout time.Duration) (error, bool) { - done := make(chan error) - go func() { - done <- cmd.Wait() - }() - - var err error - select { - case <-time.After(timeout): - logs.Warn(fmt.Sprintf("任务执行时间超过%d秒,进程将被强制杀掉: %d", int(timeout/time.Second), cmd.Process.Pid)) - go func() { - <-done // 读出上面的goroutine数据,避免阻塞导致无法退出 - }() - if err = cmd.Process.Kill(); err != nil { - logs.Error(fmt.Sprintf("进程无法杀掉: %d, 错误信息: %s", cmd.Process.Pid, err)) - } - return err, true - case err = <-done: - return err, false - } -} - -func Run(j *Job) *JobResult { - - defer func() { - if err := recover(); err != nil { - logs.Error(err, "\n", string(debug.Stack())) - } - }() - - logs.Debug(fmt.Sprintf("开始执行任务: %d", j.JobKey)) - - j.Status++ - defer func() { - j.Status-- - }() - - timeout := time.Duration(time.Hour * 24) - if j.Task.Timeout > 0 { - timeout = time.Second * time.Duration(j.Task.Timeout) - } - - return j.RunFunc(timeout) -} diff --git a/agent/server/logs.go b/agent/server/logs.go deleted file mode 100644 index 5ed31421..00000000 --- a/agent/server/logs.go +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************ -** @Description: log -** @Author: haodaquan -** @Date: 2018-08-22 23:00 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-08-22 23:00 -*************************************************************/ -package server - -import ( - "fmt" - "log" - "net/http" - "strings" - "time" -) - -var Env string - -func init() { - log.SetFlags(log.LstdFlags | log.Lshortfile) -} - -//http相关 -func WriteLog(r *http.Request, t time.Time, match string, pattern string) { - - if C.AppMode != "prod" { - d := time.Now().Sub(t) - l := fmt.Sprintf("[ACCESS] | % -10s | % -40s | % -16s | % -10s | % -40s |", - r.Method, r.URL.Path, d.String(), match, pattern) - log.Println(l) - } -} - -//系统运行相关 -func NLog(level string, value ...interface{}) { - if strings.Contains(C.LogLevel, level) || C.LogLevel == "ALL" { - log.Println("["+level+"]", value) - return - } -} diff --git a/agent/server/notify.go b/agent/server/notify.go deleted file mode 100644 index dfa0c70c..00000000 --- a/agent/server/notify.go +++ /dev/null @@ -1,104 +0,0 @@ -/************************************************************ -** @Description: notify -** @Author: george hao -** @Date: 2019-06-26 15:17 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-26 15:17 -*************************************************************/ -package server - -import ( - "encoding/json" - "fmt" - "github.com/george518/PPGo_Job/libs" - "strconv" -) - -//启动时注册 -func Register() error { - //获取本机ip以及端口 todo ip合法性判断 - if C.TcpIp == "auto" { - tcpIp := libs.GetHostIp(C.IpType) - if tcpIp == "" { - return fmt.Errorf("无法获取本机IP,请手工在配置文件里设置") - } - SaveConfig("TcpIp", tcpIp) - } - param := make(map[string]string, 0) - if C.ServerName == "auto" { - serverName := "agent-" + C.TcpIp + "-" + strconv.Itoa(C.TcpPort) - SaveConfig("ServerName", serverName) - } - - param["server_ip"] = C.TcpIp - param["port"] = strconv.Itoa(C.TcpPort) - param["server_name"] = C.ServerName - param["detail"] = "自动注册执行器" - param["connection_type"] = "2" - param["group_id"] = C.GroupId - - if C.RegisterUrl == "" { - return fmt.Errorf("自动注册地址配置错误") - } - body, err := libs.HttpGet(C.RegisterUrl, param) - if err != nil { - return err - } - - m := make(map[string]interface{}) - err = json.Unmarshal([]byte(body), &m) - if err != nil { - return err - } - - if _, ok := m["status"]; ok { - if m["status"] == float64(0) { - //回写serverId - serverId := int(m["message"].(float64)) - SaveConfig("ServerId", strconv.Itoa(serverId)) - return nil - } else { - return fmt.Errorf("自动注册失败:%v", m["message"]) - } - } - - return fmt.Errorf("自动注册失败") -} - -//程序异常退出的通知 -func Close() error { - - param := make(map[string]string, 0) - param["server_ip"] = C.TcpIp - param["port"] = strconv.Itoa(C.TcpPort) - param["status"] = "1" - - if C.UpdateStatusUrl == "" { - return fmt.Errorf("执行器退出通知异常,请到系统中修改状态") - } - body, err := libs.HttpGet(C.UpdateStatusUrl, param) - if err != nil { - return err - } - - m := make(map[string]interface{}) - err = json.Unmarshal([]byte(body), &m) - if err != nil { - return err - } - - if _, ok := m["status"]; ok { - if m["status"] == float64(0) { - return nil - } else { - return fmt.Errorf("执行器退出通知异常:%v", m["message"]) - } - } - - return fmt.Errorf("执行器退出通知异常:未知原因") -} - -//心跳机制 -func Heartbeat() error { - return nil -} diff --git a/agent/server/service.go b/agent/server/service.go deleted file mode 100644 index 62299ba9..00000000 --- a/agent/server/service.go +++ /dev/null @@ -1,38 +0,0 @@ -/************************************************************ -** @Description: service -** @Author: george hao -** @Date: 2019-06-26 15:27 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-26 15:27 -*************************************************************/ -package server - -import ( - "net" - "net/rpc" - "net/rpc/jsonrpc" - "strconv" -) - -//初始化路由 -func init() { - rpc.RegisterName("RpcTask", new(RpcTask)) - rpc.RegisterName("HeartBeat", new(RpcTask)) -} - -func RpcRun() error { - - listener, err := net.Listen("tcp", ":"+strconv.Itoa(C.TcpPort)) - if err != nil { - return err - } - for { - conn, err := listener.Accept() - if err != nil { - return err - } - //注意ServerCodec是个方法,不是接口 - go rpc.ServeCodec(jsonrpc.NewServerCodec(conn)) - //go rpc.ServeConn(conn) - } -} diff --git a/agent/server/signal.go b/agent/server/signal.go deleted file mode 100644 index 9b2574ae..00000000 --- a/agent/server/signal.go +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************ -** @Description: server -** @Author: george hao -** @Date: 2018-11-29 11:24 -** @Last Modified by: george hao -** @Last Modified time: 2018-11-29 11:24 -*************************************************************/ -package server - -import ( - "os" - "os/signal" - "syscall" -) - -//监听关闭状态 -func ListenSignal() { - //创建监听退出chan - c := make(chan os.Signal) - //监听指定信号 ctrl+c kill - signal.Notify(c, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGUSR1, syscall.SIGUSR2) - - go func() { - for s := range c { - switch s { - case syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGUSR1, syscall.SIGUSR2: - NLog("NOTICE", " Ready to quit close type ", s) - //TODO 异常警报,汇报状态 - if err := Close(); err != nil { - NLog("ERROR", err.Error()) - } else { - NLog("NOTICE", " 执行器安全关闭...") - } - os.Exit(0) - default: - NLog("NOTICE", " close type ", s) - os.Exit(1) - } - } - }() -} diff --git a/agent/server/task.go b/agent/server/task.go deleted file mode 100644 index a1030aa1..00000000 --- a/agent/server/task.go +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************ -** @Description: task -** @Author: george hao -** @Date: 2019-06-24 13:22 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-24 13:22 -*************************************************************/ -package server - -import ( - "github.com/astaxie/beego/logs" - "github.com/george518/PPGo_Job/jobs" - "github.com/george518/PPGo_Job/models" -) - -type RpcTask struct { -} - -type RpcResult struct { - Status int - Message string -} - -//Execute once -func (r *RpcTask) RunTask(task *models.Task, Result *jobs.JobResult) error { - server_id := C.ServerId - job, err := RestJobFromTask(task, server_id) - if err != nil { - return nil - } - *Result = *(Run(job)) - return nil -} - -//Kill execution -func (r *RpcTask) KillCommand(task models.Task, reply *RpcResult) error { - reply.Status = 200 - reply.Message = "Ok kill " + task.TaskName - return nil -} - -func (r *RpcTask) HeartBeat(ping string, reply *RpcResult) error { - reply.Status = 200 - reply.Message = ping + " pong" - logs.Info(ping) - return nil -} diff --git a/agent/test/conf/conf.go b/agent/test/conf/conf.go deleted file mode 100644 index cb689a13..00000000 --- a/agent/test/conf/conf.go +++ /dev/null @@ -1,28 +0,0 @@ -/************************************************************ -** @Description: conf -** @Author: george hao -** @Date: 2019-06-27 09:49 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-27 09:49 -*************************************************************/ -package main - -import ( - "github.com/astaxie/beego/logs" - "github.com/george518/PPGo_Job/agent/server" -) - -func main() { - //获取配置,修改配置 - loadconfig() -} - -func loadconfig() { - - path := "/Users/haodaquan/golang/src/github.com/george518/PPGo_Job/actuator/config/conf.ini" - server.InitConfig(path) - logs.Info(server.C.TcpIp, server.ConfPath) - server.SaveConfig("TcpIp", "10.32.33.22") - logs.Info(server.C.TcpIp, server.ConfPath) - -} diff --git a/agent/test/ip/ip.go b/agent/test/ip/ip.go deleted file mode 100644 index b846eb1e..00000000 --- a/agent/test/ip/ip.go +++ /dev/null @@ -1,18 +0,0 @@ -/************************************************************ -** @Description: ip -** @Author: george hao -** @Date: 2019-06-27 09:22 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-27 09:22 -*************************************************************/ -package main - -import ( - "github.com/astaxie/beego/logs" - "github.com/george518/PPGo_Job/libs" -) - -func main() { - logs.Info(libs.PublicIp()) - -} diff --git a/agent/test/sqls/ts.go b/agent/test/sqls/ts.go deleted file mode 100644 index fd43ef10..00000000 --- a/agent/test/sqls/ts.go +++ /dev/null @@ -1,15 +0,0 @@ -/************************************************************ -** @Description: ts -** @Author: george hao -** @Date: 2019-07-04 17:23 -** @Last Modified by: george hao -** @Last Modified time: 2019-07-04 17:23 -*************************************************************/ -package main - -import "github.com/george518/PPGo_Job/models" - -func main() { - - models.TaskTotalRunNum() -} diff --git a/assets/screenshot/1-index.png b/assets/screenshot/1-index.png deleted file mode 100644 index 892f8fae..00000000 Binary files a/assets/screenshot/1-index.png and /dev/null differ diff --git a/assets/screenshot/10-auth.png b/assets/screenshot/10-auth.png deleted file mode 100644 index df1b02af..00000000 Binary files a/assets/screenshot/10-auth.png and /dev/null differ diff --git a/assets/screenshot/11-role.png b/assets/screenshot/11-role.png deleted file mode 100644 index 665acd09..00000000 Binary files a/assets/screenshot/11-role.png and /dev/null differ diff --git a/assets/screenshot/12-role_add.png b/assets/screenshot/12-role_add.png deleted file mode 100644 index f64f3f61..00000000 Binary files a/assets/screenshot/12-role_add.png and /dev/null differ diff --git a/assets/screenshot/13-admin.png b/assets/screenshot/13-admin.png deleted file mode 100644 index 744b1270..00000000 Binary files a/assets/screenshot/13-admin.png and /dev/null differ diff --git a/assets/screenshot/14-user.png b/assets/screenshot/14-user.png deleted file mode 100644 index 2da326cd..00000000 Binary files a/assets/screenshot/14-user.png and /dev/null differ diff --git a/assets/screenshot/15.log.png b/assets/screenshot/15.log.png deleted file mode 100644 index 5d81a62a..00000000 Binary files a/assets/screenshot/15.log.png and /dev/null differ diff --git a/assets/screenshot/2-task.png b/assets/screenshot/2-task.png deleted file mode 100644 index 4ad6f042..00000000 Binary files a/assets/screenshot/2-task.png and /dev/null differ diff --git a/assets/screenshot/3-task_detail.png b/assets/screenshot/3-task_detail.png deleted file mode 100644 index 6e7aebb9..00000000 Binary files a/assets/screenshot/3-task_detail.png and /dev/null differ diff --git a/assets/screenshot/4-task_audit.png b/assets/screenshot/4-task_audit.png deleted file mode 100644 index 2f271f5a..00000000 Binary files a/assets/screenshot/4-task_audit.png and /dev/null differ diff --git a/assets/screenshot/5-task_group.png b/assets/screenshot/5-task_group.png deleted file mode 100644 index f13b150e..00000000 Binary files a/assets/screenshot/5-task_group.png and /dev/null differ diff --git a/assets/screenshot/6-server_group.png b/assets/screenshot/6-server_group.png deleted file mode 100644 index f41784ee..00000000 Binary files a/assets/screenshot/6-server_group.png and /dev/null differ diff --git a/assets/screenshot/7-server.png b/assets/screenshot/7-server.png deleted file mode 100644 index 82b6e8f1..00000000 Binary files a/assets/screenshot/7-server.png and /dev/null differ diff --git a/assets/screenshot/7-server_add.png b/assets/screenshot/7-server_add.png deleted file mode 100644 index 09a2d19f..00000000 Binary files a/assets/screenshot/7-server_add.png and /dev/null differ diff --git a/assets/screenshot/8-ban.png b/assets/screenshot/8-ban.png deleted file mode 100644 index ff93b494..00000000 Binary files a/assets/screenshot/8-ban.png and /dev/null differ diff --git a/assets/screenshot/9-ban_edit.png b/assets/screenshot/9-ban_edit.png deleted file mode 100644 index 1b0e6cef..00000000 Binary files a/assets/screenshot/9-ban_edit.png and /dev/null differ diff --git a/assets/screenshot/ppgo.png b/assets/screenshot/ppgo.png deleted file mode 100644 index 25ce598d..00000000 Binary files a/assets/screenshot/ppgo.png and /dev/null differ diff --git a/boot/db.go b/boot/db.go new file mode 100644 index 00000000..a9ad0f17 --- /dev/null +++ b/boot/db.go @@ -0,0 +1,32 @@ +package boot + +import ( + "context" + "fmt" + "os" + "path/filepath" + + "github.com/gogf/gf/v2/frame/g" + _ "github.com/gogf/gf/contrib/drivers/sqlite/v2" +) + +func init() { + ctx := context.Background() + + dbPath := g.Cfg().MustGet(ctx, "database.default.name", "./data/ppgo_job.db").String() + + // 相对路径 → 转为工作目录下的绝对路径 + if !filepath.IsAbs(dbPath) { + wd, err := os.Getwd() + if err == nil { + dbPath = filepath.Join(wd, dbPath) + } + } + + dir := filepath.Dir(dbPath) + if err := os.MkdirAll(dir, os.ModePerm); err != nil { + g.Log().Fatalf(ctx, "创建数据目录失败: %v", err) + } + + g.Log().Info(ctx, fmt.Sprintf("数据库路径: %s", dbPath)) +} diff --git a/boot/init.go b/boot/init.go new file mode 100644 index 00000000..03063940 --- /dev/null +++ b/boot/init.go @@ -0,0 +1,168 @@ +package boot + +import ( + "context" + "time" + + "ppgo_job/service/scheduler" + + "github.com/gogf/gf/v2/frame/g" +) + +func init() { + ctx := context.Background() + g.Log().Info(ctx, "PPGo_Job 正在初始化...") + + autoInitDB(ctx) + scheduler.Scheduler.Init(ctx) + + g.Log().Info(ctx, "PPGo_Job 初始化完成") +} + +func autoInitDB(ctx context.Context) { + tables := []string{ + `CREATE TABLE IF NOT EXISTS pp_uc_admin ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + login_name TEXT NOT NULL UNIQUE, real_name TEXT NOT NULL DEFAULT '', + password TEXT NOT NULL DEFAULT '', role_ids TEXT NOT NULL DEFAULT '', + phone TEXT NOT NULL DEFAULT '', email TEXT NOT NULL DEFAULT '', + dingtalk TEXT NOT NULL DEFAULT '', wechat TEXT NOT NULL DEFAULT '', + salt TEXT NOT NULL DEFAULT '', last_login INTEGER NOT NULL DEFAULT 0, + last_ip TEXT NOT NULL DEFAULT '', status INTEGER NOT NULL DEFAULT 1, + create_id INTEGER NOT NULL DEFAULT 0, update_id INTEGER NOT NULL DEFAULT 0, + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0 + )`, + `CREATE TABLE IF NOT EXISTS pp_uc_auth ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + auth_name TEXT NOT NULL DEFAULT '', auth_url TEXT NOT NULL DEFAULT '', + user_id INTEGER NOT NULL DEFAULT 0, pid INTEGER NOT NULL DEFAULT 0, + sort INTEGER NOT NULL DEFAULT 0, icon TEXT NOT NULL DEFAULT '', + is_show INTEGER NOT NULL DEFAULT 1, status INTEGER NOT NULL DEFAULT 1, + create_id INTEGER NOT NULL DEFAULT 0, update_id INTEGER NOT NULL DEFAULT 0, + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0 + )`, + `CREATE TABLE IF NOT EXISTS pp_uc_role ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + role_name TEXT NOT NULL DEFAULT '', detail TEXT NOT NULL DEFAULT '', + server_group_ids TEXT NOT NULL DEFAULT '', task_group_ids TEXT NOT NULL DEFAULT '', + status INTEGER NOT NULL DEFAULT 1, + create_id INTEGER NOT NULL DEFAULT 0, update_id INTEGER NOT NULL DEFAULT 0, + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0 + )`, + `CREATE TABLE IF NOT EXISTS pp_uc_role_auth ( + auth_id INTEGER NOT NULL, role_id INTEGER NOT NULL, + PRIMARY KEY (auth_id, role_id) + )`, + `CREATE TABLE IF NOT EXISTS pp_task_server_group ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + group_name TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', + create_id INTEGER NOT NULL DEFAULT 0, update_id INTEGER NOT NULL DEFAULT 0, + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0, + status INTEGER NOT NULL DEFAULT 1 + )`, + `CREATE TABLE IF NOT EXISTS pp_task_server ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + group_id INTEGER NOT NULL DEFAULT 0, connection_type INTEGER NOT NULL DEFAULT 0, + server_name TEXT NOT NULL DEFAULT '', server_account TEXT NOT NULL DEFAULT '', + server_outer_ip TEXT NOT NULL DEFAULT '', server_ip TEXT NOT NULL DEFAULT '', + port INTEGER NOT NULL DEFAULT 22, password TEXT NOT NULL DEFAULT '', + private_key_src TEXT NOT NULL DEFAULT '', public_key_src TEXT NOT NULL DEFAULT '', + type INTEGER NOT NULL DEFAULT 0, detail TEXT NOT NULL DEFAULT '', + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0, + status INTEGER NOT NULL DEFAULT 1 + )`, + `CREATE TABLE IF NOT EXISTS pp_task_group ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + group_name TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', + create_id INTEGER NOT NULL DEFAULT 0, update_id INTEGER NOT NULL DEFAULT 0, + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0, + status INTEGER NOT NULL DEFAULT 1 + )`, + `CREATE TABLE IF NOT EXISTS pp_task ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + group_id INTEGER NOT NULL DEFAULT 0, server_ids TEXT NOT NULL DEFAULT '', + server_type INTEGER NOT NULL DEFAULT 0, task_name TEXT NOT NULL DEFAULT '', + description TEXT NOT NULL DEFAULT '', cron_spec TEXT NOT NULL DEFAULT '', + concurrent INTEGER NOT NULL DEFAULT 0, command TEXT NOT NULL DEFAULT '', + timeout INTEGER NOT NULL DEFAULT 0, execute_times INTEGER NOT NULL DEFAULT 0, + prev_time INTEGER NOT NULL DEFAULT 0, status INTEGER NOT NULL DEFAULT 2, + is_notify INTEGER NOT NULL DEFAULT 0, notify_type INTEGER NOT NULL DEFAULT 0, + notify_tpl_id INTEGER NOT NULL DEFAULT 0, notify_user_ids TEXT NOT NULL DEFAULT '', + create_id INTEGER NOT NULL DEFAULT 0, update_id INTEGER NOT NULL DEFAULT 0, + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0 + )`, + `CREATE TABLE IF NOT EXISTS pp_task_log ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + task_id INTEGER NOT NULL DEFAULT 0, server_id INTEGER NOT NULL DEFAULT 0, + server_name TEXT NOT NULL DEFAULT '', output TEXT NOT NULL DEFAULT '', + error TEXT NOT NULL DEFAULT '', status INTEGER NOT NULL DEFAULT 0, + process_time INTEGER NOT NULL DEFAULT 0, create_time INTEGER NOT NULL DEFAULT 0 + )`, + `CREATE TABLE IF NOT EXISTS pp_task_ban ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + code TEXT NOT NULL DEFAULT '', create_time INTEGER NOT NULL DEFAULT 0, + update_time INTEGER NOT NULL DEFAULT 0, status INTEGER NOT NULL DEFAULT 1 + )`, + `CREATE TABLE IF NOT EXISTS pp_notify_tpl ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + type TEXT NOT NULL DEFAULT 'system', tpl_name TEXT NOT NULL DEFAULT '', + tpl_type INTEGER NOT NULL DEFAULT 0, title TEXT NOT NULL DEFAULT '', + content TEXT NOT NULL DEFAULT '', status INTEGER NOT NULL DEFAULT 1, + create_id INTEGER NOT NULL DEFAULT 0, update_id INTEGER NOT NULL DEFAULT 0, + create_time INTEGER NOT NULL DEFAULT 0, update_time INTEGER NOT NULL DEFAULT 0 + )`, + } + + for _, sql := range tables { + if _, err := g.DB().Exec(ctx, sql); err != nil { + g.Log().Warningf(ctx, "建表失败: %v", err) + } + } + + var adminCount int + _ = g.DB().GetScan(ctx, &adminCount, "SELECT COUNT(*) FROM pp_uc_admin WHERE id=?", 1) + if adminCount == 0 { + _, _ = g.DB().Exec(ctx, + "INSERT INTO pp_uc_admin(id, login_name, real_name, password, role_ids, salt, status, create_time, update_time) VALUES(?,?,?,?,?,?,?,?,?)", + 1, "admin", "管理员", "bc9b5718afdffe85fb13555347969ff5", "0", "abcd", 1, time.Now().Unix(), time.Now().Unix(), + ) + g.Log().Info(ctx, "已创建默认管理员 admin / 123456") + } + + var authCount int + _ = g.DB().GetScan(ctx, &authCount, "SELECT COUNT(*) FROM pp_uc_auth") + if authCount == 0 { + seedAuth(ctx) + } +} + +func seedAuth(ctx context.Context) { + now := time.Now().Unix() + type row struct{ id, pid, sort, isShow int; name, url, icon string } + rows := []row{ + // pid=0 = 一级菜单 + {1, 0, 1, 1, "任务管理", " ", "fa-tasks"}, + {2, 0, 2, 1, "服务器管理", " ", "fa-server"}, + {3, 0, 3, 1, "系统设置", " ", "fa-cog"}, + {4, 0, 4, 1, "日志管理", " ", "fa-file-text"}, + {5, 0, 5, 1, "权限管理", " ", "fa-lock"}, + // 二级菜单(pid=父菜单的id) + {14, 1, 1, 1, "任务列表", "/task/list", "fa-tasks"}, + {15, 1, 2, 1, "任务审核", "/task/audit_list", "fa-check"}, + {16, 2, 1, 1, "服务器列表", "/server/list", "fa-server"}, + {6, 3, 1, 1, "任务分组", "/group/list", "fa-folder"}, + {7, 3, 2, 1, "资源分组", "/server_group/list","fa-sitemap"}, + {8, 3, 3, 1, "禁用命令", "/ban/list", "fa-ban"}, + {9, 3, 4, 1, "通知模板", "/notify_tpl/list", "fa-bullhorn"}, + {10, 4, 1, 1, "执行日志", "/task_log/list", "fa-file"}, + {11, 5, 1, 1, "权限因子", "/auth/index", "fa-key"}, + {12, 5, 2, 1, "角色管理", "/role/list", "fa-group"}, + {13, 5, 3, 1, "管理员管理","/admin/list", "fa-user"}, + } + for _, r := range rows { + g.DB().Exec(ctx, + "INSERT INTO pp_uc_auth(id, auth_name, auth_url, pid, sort, icon, is_show, status, create_time, update_time) VALUES(?,?,?,?,?,?,?,1,?,?)", + r.id, r.name, r.url, r.pid, r.sort, r.icon, r.isShow, now, now, + ) + } +} diff --git a/boot/router.go b/boot/router.go new file mode 100644 index 00000000..0101d07e --- /dev/null +++ b/boot/router.go @@ -0,0 +1,170 @@ +package boot + +import ( + "context" + "ppgo_job/controller" + "ppgo_job/middleware" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" +) + +var RouteMap = map[string]string{ + "LoginController.LoginIn": "/login_in", + "LoginController.LoginOut": "/login_out", + "TaskController.AjaxSave": "/task/ajax_save", + "TaskController.AjaxNotifyType": "/task/ajax_notify_type", + "TaskController.Logs": "/task_log/list", + "ServerController.AjaxSave": "/server/ajax_save", + "ServerController.AjaxDel": "/server/ajax_del", + "ServerController.AjaxTestServer": "/server/ajax_test_server", + "GroupController.AjaxSave": "/group/ajax_save", + "GroupController.AjaxDel": "/group/ajax_del", + "ServerGroupController.AjaxSave": "/server_group/ajax_save", + "ServerGroupController.AjaxDel": "/server_group/ajax_del", + "BanController.AjaxSave": "/ban/ajax_save", + "BanController.AjaxDel": "/ban/ajax_del", + "NotifyTplController.AjaxSave": "/notify_tpl/ajax_save", + "NotifyTplController.AjaxDel": "/notify_tpl/ajax_del", + "AdminController.AjaxSave": "/admin/ajax_save", + "AdminController.AjaxDel": "/admin/ajax_del", + "RoleController.AjaxSave": "/role/ajax_save", + "RoleController.AjaxDel": "/role/ajax_del", + "AuthController.AjaxSave": "/auth/ajax_save", + "AuthController.AjaxDel": "/auth/ajax_del", + "UserController.AjaxSave": "/user/ajax_save", +} + +func init() { + s := g.Server() + s.AddStaticPath("/static", g.Cfg().MustGet(context.Background(), "server.staticPath", "resource/static").String()) + s.BindMiddlewareDefault(ghttp.MiddlewareCORS) + + // 公开路由 + s.Group("/", func(g *ghttp.RouterGroup) { + g.GET("/", controller.Login) + g.GET("/login_in", controller.LoginIn) + g.POST("/login_in", controller.LoginIn) + g.GET("/login_out", controller.LoginOut) + }) + + // 认证路由 + s.Group("/", func(g *ghttp.RouterGroup) { + g.Middleware(middleware.Auth) + + g.GET("/home", controller.HomeIndex) + g.GET("/home/start", controller.HomeStart) + g.GET("/help", controller.Help) + + // ===== 任务管理 ===== + g.GET("/task/list", controller.TaskList) + g.GET("/task/table", controller.TaskTable) + g.GET("/task/add", controller.TaskAdd) + g.GET("/task/edit", controller.TaskEdit) + g.GET("/task/copy", controller.TaskCopy) + g.GET("/task/detail", controller.TaskDetail) + g.GET("/task/audit_list", controller.TaskAuditList) + g.POST("/task/ajax_save", controller.TaskAjaxSave) + g.POST("/task/ajax_del", controller.TaskAjaxDel) + g.POST("/task/ajax_start", controller.TaskAjaxStart) + g.POST("/task/ajax_pause", controller.TaskAjaxPause) + g.POST("/task/ajax_run", controller.TaskAjaxRun) + g.POST("/task/ajax_audit", controller.TaskAjaxAudit) + g.POST("/task/ajax_nopass", controller.TaskAjaxNopass) + g.POST("/task/ajax_batch_start", controller.TaskAjaxBatchStart) + g.POST("/task/ajax_batch_pause", controller.TaskAjaxBatchPause) + g.POST("/task/ajax_batch_del", controller.TaskAjaxBatchDel) + g.POST("/task/ajax_batch_audit", controller.TaskAjaxBatchAudit) + g.POST("/task/ajax_batch_no_pass", controller.TaskAjaxBatchNoPass) + g.POST("/task/ajax_notify_type", controller.NotifyTplAjaxByType) + + // ===== 服务器管理 ===== + g.GET("/server/list", controller.ServerList) + g.GET("/server/table", controller.ServerTable) + g.GET("/server/add", controller.ServerAdd) + g.GET("/server/edit", controller.ServerEdit) + g.GET("/server/copy", controller.ServerCopy) + g.GET("/server/get_server_by_group_id", controller.ServerGetByGroupId) + g.POST("/server/ajax_save", controller.ServerAjaxSave) + g.POST("/server/ajax_del", controller.ServerAjaxDel) + g.POST("/server/ajax_test_server", controller.ServerAjaxTest) + + // ===== 任务分组 ===== + g.GET("/group/list", controller.GroupList) + g.GET("/group/table", controller.GroupTable) + g.GET("/group/add", controller.GroupAdd) + g.GET("/group/edit", controller.GroupEdit) + g.POST("/group/ajax_save", controller.GroupAjaxSave) + g.POST("/group/ajax_del", controller.GroupAjaxDel) + + // ===== 资源分组 ===== + g.GET("/server_group/list", controller.ServerGroupList) + g.GET("/server_group/table", controller.ServerGroupTable) + g.GET("/server_group/add", controller.ServerGroupAdd) + g.GET("/server_group/edit", controller.ServerGroupEdit) + g.POST("/server_group/ajax_save", controller.ServerGroupAjaxSave) + g.POST("/server_group/ajax_del", controller.ServerGroupAjaxDel) + + // ===== 执行日志 ===== + g.GET("/task_log/list", controller.TaskLogList) + g.GET("/task_log/table", controller.TaskLogTable) + g.GET("/task_log/detail", controller.TaskLogDetail) + g.POST("/task_log/ajax_del", controller.TaskLogAjaxDel) + + // ===== 禁用命令 ===== + g.GET("/ban/list", controller.BanList) + g.GET("/ban/table", controller.BanTable) + g.GET("/ban/add", controller.BanAdd) + g.GET("/ban/edit", controller.BanEdit) + g.POST("/ban/ajax_save", controller.BanAjaxSave) + g.POST("/ban/ajax_del", controller.BanAjaxDel) + + // ===== 通知模板 ===== + g.GET("/notify_tpl/list", controller.NotifyTplList) + g.GET("/notify_tpl/table", controller.NotifyTplTable) + g.GET("/notify_tpl/add", controller.NotifyTplAdd) + g.GET("/notify_tpl/edit", controller.NotifyTplEdit) + g.POST("/notify_tpl/ajax_save", controller.NotifyTplAjaxSave) + g.POST("/notify_tpl/ajax_del", controller.NotifyTplAjaxDel) + + // ===== 权限管理 ===== + g.GET("/auth/index", controller.AuthIndex) + g.GET("/auth/list", controller.AuthIndex) + g.GET("/auth/get_nodes", controller.AuthGetNodes) + g.GET("/auth/get_node", controller.AuthGetNode) + g.POST("/auth/ajax_save", controller.AuthAjaxSave) + g.POST("/auth/ajax_del", controller.AuthAjaxDel) + + // ===== 角色管理 ===== + g.GET("/role/list", controller.RoleList) + g.GET("/role/table", controller.RoleTable) + g.GET("/role/add", controller.RoleAdd) + g.GET("/role/edit", controller.RoleEdit) + g.POST("/role/ajax_save", controller.RoleAjaxSave) + g.POST("/role/ajax_del", controller.RoleAjaxDel) + + // ===== 管理员管理 ===== + g.GET("/admin/list", controller.AdminList) + g.GET("/admin/table", controller.AdminTable) + g.GET("/admin/add", controller.AdminAdd) + g.GET("/admin/edit", controller.AdminEdit) + g.POST("/admin/ajax_save", controller.AdminAjaxSave) + g.POST("/admin/ajax_del", controller.AdminAjaxDel) + + // ===== 用户资料 ===== + g.GET("/user/edit", controller.UserEdit) + g.POST("/user/ajax_save", controller.UserAjaxSave) + }) + + // ===== Agent API(无需认证中间件,Agent 通过 IP 白名单或 token 调用)===== + s.Group("/server", func(g *ghttp.RouterGroup) { + g.POST("/api_save", controller.ServerApiSave) + g.POST("/api_status", controller.ServerApiStatus) + g.GET("/api_get", controller.ServerApiGet) + }) + s.Group("/task", func(g *ghttp.RouterGroup) { + g.POST("/api_task", controller.TaskApiTask) + g.POST("/api_start", controller.TaskApiStart) + g.POST("/api_pause", controller.TaskApiPause) + }) +} diff --git a/boot/tplfunc.go b/boot/tplfunc.go new file mode 100644 index 00000000..a27e4a43 --- /dev/null +++ b/boot/tplfunc.go @@ -0,0 +1,129 @@ +package boot + +import ( + "fmt" + "net/url" + "strings" + "time" + + "github.com/gogf/gf/v2/os/gview" + "github.com/gogf/gf/v2/util/gconv" +) + +func init() { + view := gview.Instance() + if err := view.SetConfigWithMap(map[string]interface{}{ + "Paths": []string{"resource/template"}, + }); err != nil { + // fallback - gview may not support SetConfigWithMap on singleton + } + + // urlfor 生成路由URL + view.BindFunc("urlfor", func(name string, params ...string) string { + route, ok := RouteMap[name] + if !ok { + return "#" + } + if len(params) >= 2 { + route = route + "?" + url.QueryEscape(params[0]) + "=" + url.QueryEscape(params[1]) + } + return route + }) + + // date 日期格式化(兼容多种格式) + view.BindFunc("date", func(t interface{}, format string) string { + var tm time.Time + switch v := t.(type) { + case time.Time: + tm = v + case int64: + tm = time.Unix(v, 0) + case int: + tm = time.Unix(int64(v), 0) + case string: + // 尝试解析时间戳字符串 + if i := gconv.Int64(v); i > 0 { + tm = time.Unix(i, 0) + } else { + return v + } + default: + return fmt.Sprintf("%v", t) + } + switch format { + case "Y-m-d H:i:s": + return tm.Format("2006-01-02 15:04:05") + case "Y-m-d": + return tm.Format("2006-01-02") + case "H:i:s": + return tm.Format("15:04:05") + case "m-d": + return tm.Format("01-02") + default: + return tm.Format(format) + } + }) + + // dateStr 时间戳转日期字符串 + view.BindFunc("dateStr", func(timestamp int64, format string) string { + t := time.Unix(timestamp, 0) + switch format { + case "Y-m-d H:i:s": + return t.Format("2006-01-02 15:04:05") + case "Y-m-d": + return t.Format("2006-01-02") + default: + return t.Format(format) + } + }) + + // substr 字符串截取 + view.BindFunc("substr", func(s string, start, length int) string { + runes := []rune(s) + if start >= len(runes) { + return "" + } + end := start + length + if end > len(runes) { + end = len(runes) + } + return string(runes[start:end]) + }) + + // str2html 将值渲染为HTML(支持任意类型) + view.BindFunc("str2html", func(s interface{}) string { + return fmt.Sprintf("%v", s) + }) + + // eq 判断相等 + view.BindFunc("eq", func(a, b interface{}) bool { + return fmt.Sprintf("%v", a) == fmt.Sprintf("%v", b) + }) + + // ne 判断不等 + view.BindFunc("ne", func(a, b interface{}) bool { + return fmt.Sprintf("%v", a) != fmt.Sprintf("%v", b) + }) + + // inArray 检查值是否在数组中 + view.BindFunc("inArray", func(value interface{}, arr []interface{}) bool { + for _, v := range arr { + if fmt.Sprintf("%v", v) == fmt.Sprintf("%v", value) { + return true + } + } + return false + }) + + // replace 字符串替换 + view.BindFunc("replace", func(s, old, new string) string { + return strings.Replace(s, old, new, -1) + }) + + view.BindFunc("split", func(s string) []string { + if s == "" { + return []string{} + } + return strings.Split(s, ",") + }) +} diff --git a/common/protocol.go b/common/protocol.go deleted file mode 100644 index 5a31f8db..00000000 --- a/common/protocol.go +++ /dev/null @@ -1,13 +0,0 @@ -/************************************************************ -** @Description: protol -** @Author: george hao -** @Date: 2019-06-27 15:33 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-27 15:33 -*************************************************************/ -package common - -type RpcResult struct { - Status int - Message string -} diff --git a/conf/app.conf b/conf/app.conf deleted file mode 100644 index 3fe5715d..00000000 --- a/conf/app.conf +++ /dev/null @@ -1,46 +0,0 @@ -AppName = PPGo_Job2 -HTTPPort = 8082 -RunMode = dev -SessionOn = true - -version= V2.8 - -# 允许同时运行的任务数 -jobs.pool = 1000 - -# 站点名称 -site.name = 定时任务管理器 - -#通知方式 0=邮件,1=信息,2=钉钉,3=微信 -notify.type = 0 - -# 数据库配置 -db.type = sqlite -db.host = localhost -db.user = root -db.password = "root" -db.port = 3306 -db.name = lmk -db.path = ./data/ppgo_job.db -db.prefix = pp_ -db.timezone = Asia/Shanghai - -# 邮件通知配置 -email.host = smtp.mxhichina.com -email.port = 25 -email.from = ci@xxx.cn -email.user = ci@xxx.cn -email.password = "xxxxxx" -email.pool = 10 - -# 短信通知方式配置 -msg.url = http://xx.com/api/tools/send_sms -msg.pool = 10 - -# 钉钉通知配置 -dingtalk.url = "https://oapi.dingtalk.com/robot/send?access_token=%s" -dingtalk.pool = 10 - -# 微信通知方式配置 -wechat.url = http://xx.com/api/tools/send_wechat -wechat.pool = 10 \ No newline at end of file diff --git a/config.yml b/config.yml new file mode 100644 index 00000000..c777a8ff --- /dev/null +++ b/config.yml @@ -0,0 +1,51 @@ +server: + address: ":8082" + name: "ppgo_job" + logPath: "resource/log/server" + logStdout: true + errorStack: true + accessLogEnabled: true + staticPath: "resource/static" + +# 模板路径使用默认 resource/template/ + +database: + default: + type: sqlite + name: "./data/ppgo_job.db" + +# 允许同时运行的任务数 +jobs: + pool: 1000 + +# 站点名称 +site: + name: "定时任务管理器" + +# 通知方式 0=邮件,1=短信,2=钉钉,3=微信 +notify: + type: 0 + +# 邮件通知配置 +email: + host: smtp.mxhichina.com + port: 25 + from: ci@xxx.cn + user: ci@xxx.cn + password: "xxxxxx" + pool: 10 + +# 短信通知方式配置 +msg: + url: http://xx.com/api/tools/send_sms + pool: 10 + +# 钉钉通知配置 +dingtalk: + url: "https://oapi.dingtalk.com/robot/send?access_token=%s" + pool: 10 + +# 微信通知方式配置 +wechat: + url: http://xx.com/api/tools/send_wechat + pool: 10 diff --git a/consts/consts.go b/consts/consts.go new file mode 100644 index 00000000..9e4bf4b0 --- /dev/null +++ b/consts/consts.go @@ -0,0 +1,63 @@ +package consts + +// 任务状态 +const ( + TaskStatusSuccess = 0 // 任务执行成功 + TaskStatusError = -1 // 任务执行出错 + TaskStatusTimeout = -2 // 任务执行超时 +) + +// 任务状态(业务状态) +const ( + TaskDeleted = -1 // 已删除 + TaskPaused = 0 // 已暂停 + TaskRunning = 1 // 运行中 + TaskPendingAudit = 2 // 待审核 + TaskAuditFailed = 3 // 审核失败 +) + +// 消息返回码 +const ( + MsgOK = 0 + MsgErr = -1 +) + +// 通知类型 +const ( + NotifyTypeEmail = 0 // 邮件 + NotifyTypeSMS = 1 // 短信 + NotifyTypeDingtalk = 2 // 钉钉 + NotifyTypeWechat = 3 // 微信 +) + +// 通知模板类型 +const ( + NotifyTplTypeSystem = "system" + NotifyTplTypeDefault = "default" +) + +// 连接类型 +const ( + ConnectionTypeSSH = 0 // SSH + ConnectionTypeTelnet = 1 // Telnet + ConnectionTypeAgent = 2 // Agent +) + +// 认证类型 +const ( + AuthTypePassword = 0 // 密码认证 + AuthTypeKey = 1 // 密钥认证 +) + +// 执行策略 +const ( + ServerTypeAll = 0 // 同时执行 + ServerTypePoll = 1 // 轮询 +) + +// 服务器状态 +const ( + ServerStatusNormal = 0 // 正常 + ServerStatusAbnormal = 1 // 异常 + ServerStatusDisabled = 2 // 已禁用 +) diff --git a/consts/consts_test.go b/consts/consts_test.go new file mode 100644 index 00000000..0da1da28 --- /dev/null +++ b/consts/consts_test.go @@ -0,0 +1,126 @@ +package consts + +import "testing" + +func TestTaskExecutionStatus(t *testing.T) { + tests := []struct { + name string + value int + want string + }{ + {"TaskStatusSuccess", TaskStatusSuccess, "0"}, + {"TaskStatusError", TaskStatusError, "-1"}, + {"TaskStatusTimeout", TaskStatusTimeout, "-2"}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.value; got != 0 && got != -1 && got != -2 { + t.Errorf("%s = %d, want one of {0, -1, -2}", tt.name, got) + } + }) + } + + // Verify specific values + if TaskStatusSuccess != 0 { + t.Errorf("TaskStatusSuccess = %d, want 0", TaskStatusSuccess) + } + if TaskStatusError != -1 { + t.Errorf("TaskStatusError = %d, want -1", TaskStatusError) + } + if TaskStatusTimeout != -2 { + t.Errorf("TaskStatusTimeout = %d, want -2", TaskStatusTimeout) + } +} + +func TestTaskBusinessStatus(t *testing.T) { + if TaskDeleted != -1 { + t.Errorf("TaskDeleted = %d, want -1", TaskDeleted) + } + if TaskPaused != 0 { + t.Errorf("TaskPaused = %d, want 0", TaskPaused) + } + if TaskRunning != 1 { + t.Errorf("TaskRunning = %d, want 1", TaskRunning) + } + if TaskPendingAudit != 2 { + t.Errorf("TaskPendingAudit = %d, want 2", TaskPendingAudit) + } + if TaskAuditFailed != 3 { + t.Errorf("TaskAuditFailed = %d, want 3", TaskAuditFailed) + } +} + +func TestMsgCodes(t *testing.T) { + if MsgOK != 0 { + t.Errorf("MsgOK = %d, want 0", MsgOK) + } + if MsgErr != -1 { + t.Errorf("MsgErr = %d, want -1", MsgErr) + } +} + +func TestNotifyTypes(t *testing.T) { + if NotifyTypeEmail != 0 { + t.Errorf("NotifyTypeEmail = %d, want 0", NotifyTypeEmail) + } + if NotifyTypeSMS != 1 { + t.Errorf("NotifyTypeSMS = %d, want 1", NotifyTypeSMS) + } + if NotifyTypeDingtalk != 2 { + t.Errorf("NotifyTypeDingtalk = %d, want 2", NotifyTypeDingtalk) + } + if NotifyTypeWechat != 3 { + t.Errorf("NotifyTypeWechat = %d, want 3", NotifyTypeWechat) + } +} + +func TestNotifyTplTypes(t *testing.T) { + if NotifyTplTypeSystem != "system" { + t.Errorf("NotifyTplTypeSystem = %q, want %q", NotifyTplTypeSystem, "system") + } + if NotifyTplTypeDefault != "default" { + t.Errorf("NotifyTplTypeDefault = %q, want %q", NotifyTplTypeDefault, "default") + } +} + +func TestConnectionTypes(t *testing.T) { + if ConnectionTypeSSH != 0 { + t.Errorf("ConnectionTypeSSH = %d, want 0", ConnectionTypeSSH) + } + if ConnectionTypeTelnet != 1 { + t.Errorf("ConnectionTypeTelnet = %d, want 1", ConnectionTypeTelnet) + } + if ConnectionTypeAgent != 2 { + t.Errorf("ConnectionTypeAgent = %d, want 2", ConnectionTypeAgent) + } +} + +func TestAuthTypes(t *testing.T) { + if AuthTypePassword != 0 { + t.Errorf("AuthTypePassword = %d, want 0", AuthTypePassword) + } + if AuthTypeKey != 1 { + t.Errorf("AuthTypeKey = %d, want 1", AuthTypeKey) + } +} + +func TestServerTypes(t *testing.T) { + if ServerTypeAll != 0 { + t.Errorf("ServerTypeAll = %d, want 0", ServerTypeAll) + } + if ServerTypePoll != 1 { + t.Errorf("ServerTypePoll = %d, want 1", ServerTypePoll) + } +} + +func TestServerStatuses(t *testing.T) { + if ServerStatusNormal != 0 { + t.Errorf("ServerStatusNormal = %d, want 0", ServerStatusNormal) + } + if ServerStatusAbnormal != 1 { + t.Errorf("ServerStatusAbnormal = %d, want 1", ServerStatusAbnormal) + } + if ServerStatusDisabled != 2 { + t.Errorf("ServerStatusDisabled = %d, want 2", ServerStatusDisabled) + } +} diff --git a/consts/tables.go b/consts/tables.go new file mode 100644 index 00000000..440c401b --- /dev/null +++ b/consts/tables.go @@ -0,0 +1,16 @@ +package consts + +// 数据库表名 +const ( + TableAdmin = "pp_uc_admin" + TableAuth = "pp_uc_auth" + TableRole = "pp_uc_role" + TableRoleAuth = "pp_uc_role_auth" + TableServer = "pp_task_server" + TableServerGroup = "pp_task_server_group" + TableTask = "pp_task" + TableTaskGroup = "pp_task_group" + TableTaskLog = "pp_task_log" + TableBan = "pp_task_ban" + TableNotifyTpl = "pp_notify_tpl" +) diff --git a/controller/admin.go b/controller/admin.go new file mode 100644 index 00000000..86c49f7e --- /dev/null +++ b/controller/admin.go @@ -0,0 +1,507 @@ +package controller + +import ( + "fmt" + "time" + + "ppgo_job/consts" + "ppgo_job/dao" + "ppgo_job/model/entity" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/util/gconv" +) + +// ==================== 服务器管理 ==================== + +// ServerAdd 新增服务器页面 +func ServerAdd(r *ghttp.Request) { + ctx := r.GetCtx() + groups, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + sg := make(map[int]string) + for _, g := range groups { + sg[g.Id] = g.GroupName + } + display(r, "server/add.html", g.Map{ + "pageTitle": "新增服务器", + "serverGroup": sg, + "flash": g.Map{"error": ""}, + }) +} + +// ServerEdit 编辑服务器页面 +func ServerEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + server, err := dao.TaskServer.GetById(ctx, id) + if err != nil || server == nil { + ajaxMsg(r, "服务器不存在", consts.MsgErr) + return + } + groups, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + sg := make(map[int]string) + for _, g := range groups { + sg[g.Id] = g.GroupName + } + display(r, "server/edit.html", g.Map{ + "pageTitle": "编辑服务器", + "server": gconv.Map(server), + "serverGroup": sg, + "flash": g.Map{"error": ""}, + }) +} + +// ServerAjaxSave 保存服务器 +// ServerCopy 复制服务器页面 +func ServerCopy(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + server, _ := dao.TaskServer.GetById(ctx, id) + if server == nil { + ajaxMsg(r, "服务器不存在", consts.MsgErr) + return + } + groups, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + sg := make(map[int]string) + for _, g := range groups { + sg[g.Id] = g.GroupName + } + r.Response.WriteTpl("server/copy.html", g.Map{ + "pageTitle": "复制服务器", + "server": gconv.Map(server), + "serverGroup": sg, + "flash": g.Map{"error": ""}, + }) +} + +func ServerAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + groupId := r.Get("group_id", 0).Int() + serverName := r.Get("server_name").String() + serverIp := r.Get("server_ip").String() + port := r.Get("port", 22).Int() + serverAccount := r.Get("server_account").String() + password := r.Get("password").String() + connType := r.Get("connection_type", 0).Int() + authType := r.Get("type", 0).Int() + privateKeySrc := r.Get("private_key_src").String() + detail := r.Get("detail").String() + + if serverName == "" || serverIp == "" || serverAccount == "" { + ajaxMsg(r, "服务器名称、IP、账号不能为空", consts.MsgErr) + return + } + + now := time.Now().Unix() + + if id > 0 { + srv, _ := dao.TaskServer.GetById(ctx, id) + if srv == nil { ajaxMsg(r, "服务器不存在", consts.MsgErr); return } + if password != "" { srv.Password = password } + if privateKeySrc != "" { srv.PrivateKeySrc = privateKeySrc } + srv.GroupId = groupId; srv.ServerName = serverName; srv.ServerIp = serverIp + srv.Port = port; srv.ServerAccount = serverAccount + srv.ConnectionType = connType; srv.Type = authType; srv.Detail = detail + srv.UpdateTime = now + _ = dao.TaskServer.Update(ctx, srv) + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + _, err := dao.TaskServer.Insert(ctx, &entity.TaskServer{ + GroupId: groupId, ServerName: serverName, ServerIp: serverIp, + Port: port, ServerAccount: serverAccount, Password: password, + ConnectionType: connType, Type: authType, + PrivateKeySrc: privateKeySrc, Detail: detail, + CreateTime: now, UpdateTime: now, Status: 0, + }) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +// ServerAjaxDel 删除服务器 +func ServerAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.TaskServer.Delete(ctx, id) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +// ServerAjaxTest 测试服务器连接 +func ServerAjaxTest(r *ghttp.Request) { + // 暂不实现实际测试,返回成功 + ajaxMsg(r, "连接测试功能暂未实现", consts.MsgOK) +} + +// ServerGetByGroupId 按分组获取服务器列表 +func ServerGetByGroupId(r *ghttp.Request) { + ctx := r.GetCtx() + groupId := r.Get("groupId", 0).Int() + list, _, _ := dao.TaskServer.GetList(ctx, 1, 1000, "group_id", groupId) + r.Response.WriteJson(list) +} + +// ServerApiSave Agent注册/更新API +func ServerApiSave(r *ghttp.Request) { + ajaxMsg(r, "Agent API 待完善", consts.MsgOK) +} + +// ServerApiStatus Agent更新状态API +func ServerApiStatus(r *ghttp.Request) { + ajaxMsg(r, "Agent API 待完善", consts.MsgOK) +} + +// ServerApiGet Agent获取信息API +func ServerApiGet(r *ghttp.Request) { + r.Response.WriteJson(g.Map{"status": 0, "message": "ok"}) +} + +// ==================== 任务分组 ==================== + +// GroupAdd 新增任务分组页面 +func GroupAdd(r *ghttp.Request) { + display(r, "group/add.html", g.Map{ + "pageTitle": "新增任务分组", + "flash": g.Map{"error": ""}, + }) +} + +// GroupEdit 编辑任务分组页面 +func GroupEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + group, _ := dao.Group.GetById(ctx, id) + if group == nil { ajaxMsg(r, "分组不存在", consts.MsgErr); return } + display(r, "group/edit.html", g.Map{ + "pageTitle": "编辑任务分组", + "group": gconv.Map(group), + "flash": g.Map{"error": ""}, + }) +} + +// GroupAjaxSave 保存任务分组 +func GroupAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + groupName := r.Get("group_name").String() + description := r.Get("description").String() + if groupName == "" { ajaxMsg(r, "分组名称不能为空", consts.MsgErr); return } + + now := time.Now().Unix() + if id > 0 { + g, _ := dao.Group.GetById(ctx, id) + if g == nil { ajaxMsg(r, "分组不存在", consts.MsgErr); return } + g.GroupName = groupName; g.Description = description; g.UpdateTime = now + _ = dao.Group.Update(ctx, g) + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + _, err := dao.Group.Insert(ctx, &entity.Group{ + GroupName: groupName, Description: description, + CreateTime: now, UpdateTime: now, Status: 1, + }) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +// GroupAjaxDel 删除任务分组 +func GroupAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Task.ResetGroupId(ctx, id) + _ = dao.Group.Delete(ctx, id) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +// ==================== 资源分组 ==================== + +func ServerGroupAdd(r *ghttp.Request) { + display(r, "servergroup/add.html", g.Map{ + "pageTitle": "新增资源分组", + "flash": g.Map{"error": ""}, + }) +} + +func ServerGroupEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + sg, _ := dao.ServerGroup.GetById(ctx, id) + if sg == nil { ajaxMsg(r, "分组不存在", consts.MsgErr); return } + display(r, "servergroup/edit.html", g.Map{ + "pageTitle": "编辑资源分组", + "serverGroup": gconv.Map(sg), + "flash": g.Map{"error": ""}, + }) +} + +func ServerGroupAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + groupName := r.Get("group_name").String() + description := r.Get("description").String() + if groupName == "" { ajaxMsg(r, "分组名称不能为空", consts.MsgErr); return } + + now := time.Now().Unix() + if id > 0 { + sg, _ := dao.ServerGroup.GetById(ctx, id) + if sg == nil { ajaxMsg(r, "分组不存在", consts.MsgErr); return } + sg.GroupName = groupName; sg.Description = description; sg.UpdateTime = now + _ = dao.ServerGroup.Update(ctx, sg) + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + _, err := dao.ServerGroup.Insert(ctx, &entity.ServerGroup{ + GroupName: groupName, Description: description, + CreateTime: now, UpdateTime: now, Status: 1, + }) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +func ServerGroupAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.ServerGroup.Delete(ctx, id) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +// ==================== 禁用命令 ==================== + +func BanAdd(r *ghttp.Request) { + display(r, "ban/add.html", g.Map{ + "pageTitle": "新增禁用命令", + "flash": g.Map{"error": ""}, + }) +} + +func BanEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + ban, _ := dao.Ban.GetById(ctx, id) + if ban == nil { ajaxMsg(r, "记录不存在", consts.MsgErr); return } + display(r, "ban/edit.html", g.Map{ + "pageTitle": "编辑禁用命令", + "ban": gconv.Map(ban), + "flash": g.Map{"error": ""}, + }) +} + +func BanAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + code := r.Get("code").String() + if code == "" { ajaxMsg(r, "命令关键字不能为空", consts.MsgErr); return } + + now := time.Now().Unix() + if id > 0 { + b, _ := dao.Ban.GetById(ctx, id) + if b == nil { ajaxMsg(r, "记录不存在", consts.MsgErr); return } + b.Code = code; b.UpdateTime = now + _ = dao.Ban.Update(ctx, b) + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + _, err := dao.Ban.Insert(ctx, &entity.Ban{Code: code, CreateTime: now, UpdateTime: now, Status: 1}) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +func BanAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Ban.Delete(ctx, id) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +// ==================== 通知模板 ==================== + +func NotifyTplList(r *ghttp.Request) { + display(r, "notifytpl/list.html", g.Map{ + "pageTitle": "通知模板", + "flash": g.Map{"error": ""}, + }) +} + +func NotifyTplTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + list, total, err := dao.NotifyTpl.GetList(ctx, page, limit) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, v := range list { + tplTypeText := "" + switch v.TplType { + case consts.NotifyTypeEmail: tplTypeText = "邮件" + case consts.NotifyTypeSMS: tplTypeText = "短信" + case consts.NotifyTypeDingtalk: tplTypeText = "钉钉" + case consts.NotifyTypeWechat: tplTypeText = "微信" + } + statusText := "正常" + if v.Status == 0 { statusText = "禁用" } + ct := ""; ut := "" + if v.CreateTime > 0 { ct = time.Unix(v.CreateTime, 0).Format("2006-01-02 15:04:05") } + if v.UpdateTime > 0 { ut = time.Unix(v.UpdateTime, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":v.Id,"type":v.Type,"tpl_name":v.TplName,"tpl_type_text":tplTypeText,"create_time":ct,"update_time":ut,"status_text":statusText}) + } + ajaxList(r, "成功", 0, total, rows) +} + +func NotifyTplAdd(r *ghttp.Request) { + display(r, "notifytpl/add.html", g.Map{ + "pageTitle": "新增通知模板", + "flash": g.Map{"error": ""}, + }) +} + +func NotifyTplEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + tpl, _ := dao.NotifyTpl.GetById(ctx, id) + if tpl == nil { ajaxMsg(r, "模板不存在", consts.MsgErr); return } + display(r, "notifytpl/edit.html", g.Map{ + "pageTitle": "编辑通知模板", + "notifyTpl": gconv.Map(tpl), + "flash": g.Map{"error": ""}, + }) +} + +func NotifyTplAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + tplName := r.Get("tpl_name").String() + tplType := r.Get("tpl_type", 0).Int() + title := r.Get("title").String() + content := r.Get("content").String() + tp := r.Get("type").String() + if tp == "" { tp = "default" } + + if tplName == "" { ajaxMsg(r, "模板名称不能为空", consts.MsgErr); return } + + now := time.Now().Unix() + if id > 0 { + t, _ := dao.NotifyTpl.GetById(ctx, id) + if t == nil { ajaxMsg(r, "模板不存在", consts.MsgErr); return } + t.TplName = tplName; t.TplType = tplType; t.Title = title + t.Content = content; t.Type = tp; t.UpdateTime = now + _ = dao.NotifyTpl.Update(ctx, t) + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + _, err := dao.NotifyTpl.Insert(ctx, &entity.NotifyTpl{ + TplName: tplName, TplType: tplType, Title: title, + Content: content, Type: tp, + CreateTime: now, UpdateTime: now, Status: 1, + }) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +func NotifyTplAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.NotifyTpl.Delete(ctx, id) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +func NotifyTplAjaxByType(r *ghttp.Request) { + ctx := r.GetCtx() + notifyType := r.Get("notify_type", 0).Int() + tpl, _ := dao.NotifyTpl.GetByTplType(ctx, notifyType, "system") + if tpl == nil { + tpl, _ = dao.NotifyTpl.GetByTplType(ctx, notifyType, "default") + } + if tpl == nil { + r.Response.WriteJson(g.Map{ + "code": 0, + "data": make([]g.Map, 0), + }) + return + } + r.Response.WriteJson(g.Map{ + "code": 0, + "data": []g.Map{ + { + "id": tpl.Id, + "tpl_name": tpl.TplName, + "title": tpl.Title, + "content": tpl.Content, + }, + }, + }) +} + +// ==================== 任务日志详情 ==================== + +func TaskLogDetail(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + log, _ := dao.TaskLog.GetById(ctx, id) + if log == nil { ajaxMsg(r, "日志不存在", consts.MsgErr); return } + + // 构建 taskLog map(模板使用下划线命名,与实体 json tag 不同) + taskLog := g.Map{ + "id": log.Id, + "task_id": log.TaskId, + "server_id": log.ServerId, + "server_name": log.ServerName, + "status": log.Status, + "process_time": log.ProcessTime, + "output": log.Output, + "error": log.Error, + "start_time": time.Unix(log.CreateTime, 0).Format("2006-01-02 15:04:05"), + "output_size": fmt.Sprintf("%d 字节", len(log.Output)), + } + + // 加载关联的任务 + task, _ := dao.Task.GetById(ctx, log.TaskId) + if task == nil { + display(r, "tasklog/detail.html", g.Map{ + "pageTitle": "日志详情", + "taskLog": taskLog, + "task": g.Map{}, + "flash": g.Map{"error": ""}, + }) + return + } + + st := "运行中" + if task.Status == -1 { st = "已删除" } else if task.Status == 0 { st = "已暂停" } else if task.Status == 2 { st = "待审核" } else if task.Status == 3 { st = "审核失败" } + groupName := "" + if g, _ := dao.Group.GetById(ctx, task.GroupId); g != nil { groupName = g.GroupName } + serverName := "本地服务器" + if task.ServerIds != "" && task.ServerIds != "0" { + if s, _ := dao.TaskServer.GetById(ctx, gconv.Int(task.ServerIds)); s != nil { serverName = s.ServerName } + } + notifyTplName := "" + if task.IsNotify == 1 && task.NotifyTplId > 0 { + if t, _ := dao.NotifyTpl.GetById(ctx, task.NotifyTplId); t != nil { notifyTplName = t.TplName } + } + createName := ""; updateName := "" + if a, _ := dao.Admin.GetById(ctx, task.CreateId); a != nil { createName = a.RealName } + if a, _ := dao.Admin.GetById(ctx, task.UpdateId); a != nil { updateName = a.RealName } + ct := ""; ut := "" + if task.CreateTime > 0 { ct = time.Unix(task.CreateTime, 0).Format("2006-01-02 15:04:05") } + if task.UpdateTime > 0 { ut = time.Unix(task.UpdateTime, 0).Format("2006-01-02 15:04:05") } + + display(r, "tasklog/detail.html", g.Map{ + "pageTitle": "日志详情", + "task": task, + "taskLog": taskLog, + "TextStatus": st, + "GroupName": groupName, + "serverName": serverName, + "NotifyTplName": notifyTplName, + "CreateName": createName, + "UpdateName": updateName, + "CreateTime": ct, + "UpdateTime": ut, + "flash": g.Map{"error": ""}, + }) +} diff --git a/controller/base.go b/controller/base.go new file mode 100644 index 00000000..e6552bd0 --- /dev/null +++ b/controller/base.go @@ -0,0 +1,39 @@ +package controller + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" +) + +// display 渲染页面模板(带 layout 布局) +func display(r *ghttp.Request, tpl string, data g.Map) { + // 公共布局数据 + layout := g.Map{ + "MainContent": tpl, + "flash": g.Map{"error": ""}, + "hideTop": false, + } + // 合并页面数据 + for k, v := range data { + layout[k] = v + } + r.Response.WriteTpl("public/layout.html", layout) +} + +// ajaxMsg 返回JSON消息 +func ajaxMsg(r *ghttp.Request, msg interface{}, msgno int) { + r.Response.WriteJson(g.Map{ + "status": msgno, + "message": msg, + }) +} + +// ajaxList 返回JSON列表(LayUI table 格式) +func ajaxList(r *ghttp.Request, msg interface{}, msgno int, count int, data interface{}) { + r.Response.WriteJson(g.Map{ + "code": msgno, + "msg": msg, + "count": count, + "data": data, + }) +} diff --git a/controller/home.go b/controller/home.go new file mode 100644 index 00000000..ce009429 --- /dev/null +++ b/controller/home.go @@ -0,0 +1,222 @@ +package controller + +import ( + "context" + "encoding/json" + "fmt" + "runtime" + "time" + + "ppgo_job/dao" + "ppgo_job/service/scheduler" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" +) + +// HomeIndex 首页 +func HomeIndex(r *ghttp.Request) { + ctx := r.GetCtx() + + taskTotal, _, _ := dao.Task.GetList(ctx, 1, 1) + taskEnabled, _ := dao.Task.GetEnabledList(ctx) + serverList, _, _ := dao.TaskServer.GetList(ctx, 1, 1000) + logNum, _ := dao.TaskLog.GetLogNum(ctx) + totalRunNum, _ := dao.Task.TotalRunNum(ctx) + + serverNormal := 0 + for _, s := range serverList { + if s.Status == 0 { + serverNormal++ + } + } + + loginUserId := r.GetCtxVar("loginUserId", 0).Int() + loginUserName := r.GetCtxVar("loginUserName", "admin").String() + sideMenu1 := r.GetCtxVar("SideMenu1", nil).Slice() + sideMenu2 := r.GetCtxVar("SideMenu2", nil).Slice() + + r.Response.WriteTpl("public/main.html", g.Map{ + "pageTitle": "首页", + "taskTotal": len(taskTotal), + "taskEnabled": len(taskEnabled), + "serverTotal": len(serverList), + "serverOk": serverNormal, + "logTotal": logNum, + "runTotal": totalRunNum, + "version": g.Cfg().MustGet(ctx, "version", "V2.8").String(), + "siteName": g.Cfg().MustGet(ctx, "site.name", "定时任务管理器").String(), + "loginUserId": loginUserId, + "loginUserName": loginUserName, + "SideMenu1": sideMenu1, + "SideMenu2": sideMenu2, + }) +} + +// HomeStart 仪表盘页面(被 iframe 嵌入) +func HomeStart(r *ghttp.Request) { + ctx := r.GetCtx() + + // 统计数据 + totalJobs, _, _ := dao.Task.GetList(ctx, 1, 1) + startJob := 0 + totalAudit := 0 + for _, t := range totalJobs { + if t.Status == 1 { + startJob++ + } + if t.Status == 2 { + totalAudit++ + } + } + + // 近期执行统计 + recentTime := time.Now().Unix() - 3600*24 + recentLogs, _, _ := dao.TaskLog.GetList(ctx, 1, 1000, "create_time >=", recentTime) + successNum := 0 + errorNum := 0 + for _, l := range recentLogs { + if l.Status == 0 { + successNum++ + } else if l.Status < 0 { + errorNum++ + } + } + + userNum := 1 + adminList, _, _ := dao.Admin.GetList(ctx, 1, 1000) + userNum = len(adminList) + + totalRunNum, _ := dao.Task.TotalRunNum(ctx) + totalLog, _ := dao.TaskLog.GetLogNum(ctx) + + // 图表数据 + now := time.Now() + days := make([]string, 7) + okNum := make([]int, 7) + errNum := make([]int, 7) + expiredNum := make([]int, 7) + for i := 6; i >= 0; i-- { + t := now.AddDate(0, 0, -i) + dayStart := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location()).Unix() + dayEnd := dayStart + 86400 + days[6-i] = t.Format("01-02") + logs, _, _ := dao.TaskLog.GetList(ctx, 1, 1000, "create_time >=", dayStart, "create_time <", dayEnd) + for _, l := range logs { + if l.Status == 0 { + okNum[6-i]++ + } else if l.Status == -2 { + expiredNum[6-i]++ + } else if l.Status == -1 { + errNum[6-i]++ + } + } + } + + // 系统信息 + sysInfo := SystemInfo(ctx) + + // 即将执行的任务(从调度器获取) + jobs := make([]g.Map, 0) + for _, entry := range scheduler.Scheduler.GetEntries() { + var taskId int + if _, err := fmt.Sscanf(entry.Name, "task_%d", &taskId); err == nil && taskId > 0 { + if t, _ := dao.Task.GetById(ctx, taskId); t != nil { + groupName := "" + if g, _ := dao.Group.GetById(ctx, t.GroupId); g != nil { + groupName = g.GroupName + } + jobs = append(jobs, g.Map{ + "task_id": taskId, + "task_name": t.TaskName, + "task_group": groupName, + "next_time": entry.RegisterTime.Format("15:04:05"), + }) + } + } + } + + // 最近执行失败的任务 + recentErrLogs, _, _ := dao.TaskLog.GetList(ctx, 1, 20, "status <", 0) + errLogs := make([]g.Map, 0) + for _, l := range recentErrLogs { + taskName := fmt.Sprintf("任务#%d", l.TaskId) + if t, _ := dao.Task.GetById(ctx, l.TaskId); t != nil { + taskName = t.TaskName + } + errLogs = append(errLogs, g.Map{ + "id": l.Id, + "task_name": taskName, + "start_time": time.Unix(l.CreateTime, 0).Format("2006-01-02 15:04:05"), + "status": l.Status, + }) + } + + r.Response.WriteTpl("home/start.html", g.Map{ + "startJob": startJob, + "totalAuditTask": totalAudit, + "successNum": successNum, + "errorNum": errorNum, + "userNum": userNum, + "totalJob": len(totalJobs), + "TaskTotalRunNum": totalRunNum, + "totalLog": totalLog, + "sysInfo": sysInfo, + "jobs": jobs, + "errLogs": errLogs, + "days": toJSON(days), + "errNum": toJSON(errNum), + "expiredNum": toJSON(expiredNum), + "okNum": toJSON(okNum), + }) +} + +// Help Cron帮助页 +func Help(r *ghttp.Request) { + r.Response.WriteTpl("public/help.html", g.Map{ + "pageTitle": "Cron 表达式帮助", + }) +} + +// SystemInfo 系统监控信息 +func SystemInfo(ctx context.Context) g.Map { + var m runtime.MemStats + runtime.ReadMemStats(&m) + now := time.Now().Unix() + + startTime := g.Cfg().MustGet(ctx, "server.startTime", now).Int64() + if startTime == 0 { + startTime = now + } + costTime := int(now - startTime) + + return g.Map{ + "服务运行时间": fmt.Sprintf("%d天%d小时%d分%d秒", costTime/(3600*24), costTime%(3600*24)/3600, costTime%3600/60, costTime%60), + "goroute数量": runtime.NumGoroutine(), + "cpu核心数": runtime.NumCPU(), + "当前内存使用量": FileSize(int64(m.Alloc)), + "内存占用量": FileSize(int64(m.Sys)), + "GC暂停时间": fmt.Sprintf("%.3fs", float64(m.PauseTotalNs)/1000/1000/1000), + } +} + +// toJSON 转为JSON字符串 +func toJSON(v interface{}) string { + b, err := json.Marshal(v) + if err != nil { + return "[]" + } + return string(b) +} + +// FileSize 格式化文件大小 +func FileSize(s int64) string { + if s < 1024 { + return fmt.Sprintf("%d B", s) + } else if s < 1024*1024 { + return fmt.Sprintf("%.1f KB", float64(s)/1024) + } else if s < 1024*1024*1024 { + return fmt.Sprintf("%.1f MB", float64(s)/(1024*1024)) + } + return fmt.Sprintf("%.1f GB", float64(s)/(1024*1024*1024)) +} diff --git a/controller/login.go b/controller/login.go new file mode 100644 index 00000000..6860563d --- /dev/null +++ b/controller/login.go @@ -0,0 +1,100 @@ +package controller + +import ( + "fmt" + "ppgo_job/dao" + "ppgo_job/libs" + "strings" + "time" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/util/gconv" + "github.com/gogf/gf/v2/util/grand" +) + +// Login 登录页面 +func Login(r *ghttp.Request) { + // 如果已经登录,跳转到首页 + auth := r.Cookie.Get("auth") + if auth != nil && auth.String() != "" { + parts := strings.Split(auth.String(), "|") + if len(parts) == 2 { + userId := gconv.Int(parts[0]) + hash := parts[1] + if userId > 0 && hash != "" { + // 进一步验证 cookie 是否有效(查数据库) + admin, err := dao.Admin.GetById(r.GetCtx(), userId) + if err == nil && admin != nil && admin.Status == 1 { + clientIp := r.GetClientIp() + expectedHash := libs.Sha256Hex([]byte(admin.Salt + "|" + clientIp + "|" + admin.Password)) + if hash == expectedHash { + r.Response.RedirectTo("/home") + return + } + } + } + } + // cookie 无效,清除它 + r.Cookie.Remove("auth") + } + r.Response.WriteTpl("login/login.html", g.Map{ + "siteName": g.Cfg().MustGet(r.GetCtx(), "site.name", "定时任务管理器").String(), + }) +} + +// LoginIn 登录提交 +func LoginIn(r *ghttp.Request) { + ctx := r.GetCtx() + username := r.Get("username", "").String() + password := r.Get("password", "").String() + + if username == "" || password == "" { + r.Response.WriteJson(g.Map{"status": -1, "message": "用户名或密码不能为空"}) + return + } + + admin, err := dao.Admin.GetByLoginName(ctx, username) + if err != nil || admin == nil { + r.Response.WriteJson(g.Map{"status": -1, "message": "用户名或密码错误"}) + return + } + + if admin.Status != 1 { + r.Response.WriteJson(g.Map{"status": -1, "message": "该账号已被禁用"}) + return + } + + // 验证密码(兼容新旧哈希格式) + if !libs.VerifyPassword(password, admin.Password, admin.Salt) { + r.Response.WriteJson(g.Map{"status": -1, "message": "用户名或密码错误"}) + return + } + + // 生成 auth cookie: userId|SHA256(salt|clientIp|password) + clientIp := r.GetClientIp() + authHash := libs.Sha256Hex([]byte(admin.Salt + "|" + clientIp + "|" + admin.Password)) + cookieValue := fmt.Sprintf("%d|%s", admin.Id, authHash) + + // 设置 cookie(HttpOnly 防止 XSS 窃取) + r.Cookie.SetCookie("auth", cookieValue, "/", "", 0, ghttp.CookieOptions{HttpOnly: true}) + + // 更新最后登录信息 + _ = dao.Admin.UpdateFields(ctx, admin.Id, g.Map{ + "last_login": time.Now().Unix(), + "last_ip": clientIp, + }) + + r.Response.WriteJson(g.Map{"status": 0, "message": "登录成功"}) +} + +// LoginOut 登出 +func LoginOut(r *ghttp.Request) { + r.Cookie.Remove("auth") + r.Response.RedirectTo("/") +} + +// 生成随机盐值(4位) +func genSalt() string { + return grand.S(4) +} diff --git a/controller/system.go b/controller/system.go new file mode 100644 index 00000000..cc794121 --- /dev/null +++ b/controller/system.go @@ -0,0 +1,308 @@ +package controller + +import ( + "ppgo_job/consts" + "ppgo_job/dao" + "ppgo_job/libs" + "ppgo_job/model/entity" + "strings" + "time" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/util/gconv" +) + +// ==================== 权限因子 ==================== + +func AuthAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + authName := r.Get("auth_name").String() + authUrl := r.Get("auth_url").String() + pid := r.Get("pid", 1).Int() + sort := r.Get("sort", 0).Int() + icon := r.Get("icon").String() + isShow := r.Get("is_show", 1).Int() + + if authName == "" { ajaxMsg(r, "权限名称不能为空", consts.MsgErr); return } + + now := time.Now().Unix() + if id > 0 { + a, _ := dao.Auth.GetById(ctx, id) + if a == nil { ajaxMsg(r, "权限不存在", consts.MsgErr); return } + a.AuthName = authName; a.AuthUrl = authUrl; a.Pid = pid + a.Sort = sort; a.Icon = icon; a.IsShow = isShow; a.UpdateTime = now + _ = dao.Auth.Update(ctx, a) + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + _, err := dao.Auth.Insert(ctx, &entity.Auth{ + AuthName: authName, AuthUrl: authUrl, Pid: pid, + Sort: sort, Icon: icon, IsShow: isShow, + CreateTime: now, UpdateTime: now, Status: 1, + }) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +func AuthAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + a, _ := dao.Auth.GetById(ctx, id) + if a == nil { ajaxMsg(r, "权限不存在", consts.MsgErr); return } + a.Status = 0; a.UpdateTime = time.Now().Unix() + _ = dao.Auth.Update(ctx, a) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +func AuthGetNodes(r *ghttp.Request) { + ctx := r.GetCtx() + list, _ := dao.Auth.GetList(ctx) + type node struct { + Id int `json:"id"` + Name string `json:"name"` + Pid int `json:"pId"` + Open bool `json:"open"` + } + nodes := make([]node, 0) + for _, a := range list { + if a.Status == 1 { + nodes = append(nodes, node{ + Id: a.Id, Name: a.AuthName, Pid: a.Pid, Open: true, + }) + } + } + if nodes == nil { + nodes = []node{} + } + r.Response.WriteJson(nodes) +} + +// AuthGetNode 获取单个权限节点 +func AuthGetNode(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { + r.Response.WriteJson(g.Map{"status": -1, "message": "参数错误"}) + return + } + a, _ := dao.Auth.GetById(ctx, id) + if a == nil { + r.Response.WriteJson(g.Map{"status": -1, "message": "权限不存在"}) + return + } + r.Response.WriteJson(g.Map{"status": 0, "message": a}) +} + +// ==================== 角色管理 ==================== +func RoleAdd(r *ghttp.Request) { + ctx := r.GetCtx() + authList, _ := dao.Auth.GetList(ctx) + sgl, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + tgl, _, _ := dao.Group.GetList(ctx, 1, 1000, "status", 1) + taskGroup := make(map[int]string) + for _, g := range tgl { taskGroup[g.Id] = g.GroupName } + display(r, "role/add.html", g.Map{ + "pageTitle": "新增角色", + "authList": authList, + "serverGroup": sgl, + "taskGroup": taskGroup, + "flash": g.Map{"error": ""}, + }) +} + +func RoleEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + role, _ := dao.Role.GetById(ctx, id) + if role == nil { ajaxMsg(r, "角色不存在", consts.MsgErr); return } + sgl, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + tgl, _, _ := dao.Group.GetList(ctx, 1, 1000, "status", 1) + taskGroup := make(map[int]string) + for _, g := range tgl { taskGroup[g.Id] = g.GroupName } + authList, _ := dao.Auth.GetList(ctx) + display(r, "role/edit.html", g.Map{ + "pageTitle": "编辑角色", + "role": gconv.Map(role), + "authList": authList, + "serverGroup": sgl, + "taskGroup": taskGroup, + "flash": g.Map{"error": ""}, + }) +} + +func RoleAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + roleName := r.Get("role_name").String() + detail := r.Get("detail").String() + authIdsStr := r.Get("auth_ids").String() + serverGroupIds := r.Get("server_group_ids").String() + taskGroupIds := r.Get("task_group_ids").String() + + if roleName == "" { ajaxMsg(r, "角色名称不能为空", consts.MsgErr); return } + + now := time.Now().Unix() + if id > 0 { + role, _ := dao.Role.GetById(ctx, id) + if role == nil { ajaxMsg(r, "角色不存在", consts.MsgErr); return } + role.RoleName = roleName; role.Detail = detail + role.ServerGroupIds = serverGroupIds; role.TaskGroupIds = taskGroupIds + role.UpdateTime = now + _ = dao.Role.Update(ctx, role) + // 更新权限关联 + if authIdsStr != "" { + authIds := strings.Split(authIdsStr, ",") + intIds := make([]int, 0) + for _, v := range authIds { + if aid := gconv.Int(v); aid > 0 { intIds = append(intIds, aid) } + } + _ = dao.RoleAuth.MultiAdd(ctx, id, intIds) + } + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + newId, err := dao.Role.Insert(ctx, &entity.Role{ + RoleName: roleName, Detail: detail, + ServerGroupIds: serverGroupIds, TaskGroupIds: taskGroupIds, + CreateTime: now, UpdateTime: now, Status: 1, + }) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + if authIdsStr != "" { + authIds := strings.Split(authIdsStr, ",") + intIds := make([]int, 0) + for _, v := range authIds { + if aid := gconv.Int(v); aid > 0 { intIds = append(intIds, aid) } + } + _ = dao.RoleAuth.BatchAdd(ctx, int(newId), intIds) + } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +func RoleAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + rl, _ := dao.Role.GetById(ctx, id) + if rl == nil { ajaxMsg(r, "角色不存在", consts.MsgErr); return } + rl.Status = 0; rl.UpdateTime = time.Now().Unix() + _ = dao.Role.Update(ctx, rl) + _ = dao.RoleAuth.DeleteByRoleId(ctx, id) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +// ==================== 管理员管理 ==================== + +func AdminAdd(r *ghttp.Request) { + ctx := r.GetCtx() + roles, _, _ := dao.Role.GetList(ctx, 1, 1000, "status", 1) + display(r, "admin/add.html", g.Map{ + "pageTitle": "新增管理员", + "roleList": roles, + "flash": g.Map{"error": ""}, + }) +} + +func AdminEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + admin, _ := dao.Admin.GetById(ctx, id) + if admin == nil { ajaxMsg(r, "管理员不存在", consts.MsgErr); return } + roles, _, _ := dao.Role.GetList(ctx, 1, 1000, "status", 1) + display(r, "admin/edit.html", g.Map{ + "pageTitle": "编辑管理员", + "admin": gconv.Map(admin), + "roleList": roles, + "flash": g.Map{"error": ""}, + }) +} + +func AdminAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + loginName := r.Get("login_name").String() + realName := r.Get("real_name").String() + password := r.Get("password").String() + roleIds := r.Get("role_ids").String() + phone := r.Get("phone").String() + email := r.Get("email").String() + + if loginName == "" { ajaxMsg(r, "登录名不能为空", consts.MsgErr); return } + + now := time.Now().Unix() + if id > 0 { + a, _ := dao.Admin.GetById(ctx, id) + if a == nil { ajaxMsg(r, "管理员不存在", consts.MsgErr); return } + a.RealName = realName; a.RoleIds = roleIds + a.Phone = phone; a.Email = email; a.UpdateTime = now + if password != "" { + pwd, salt := libs.HashPassword(password) + a.Password = pwd; a.Salt = salt + } + _ = dao.Admin.Update(ctx, a) + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + pwd, salt := libs.HashPassword("123456") + if password != "" { + pwd, salt = libs.HashPassword(password) + } + _, err := dao.Admin.Insert(ctx, &entity.Admin{ + LoginName: loginName, RealName: realName, + Password: pwd, Salt: salt, RoleIds: roleIds, + Phone: phone, Email: email, + CreateTime: now, UpdateTime: now, Status: 1, + }) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, "添加成功", consts.MsgOK) + } +} + +func AdminAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + a, _ := dao.Admin.GetById(ctx, id) + if a == nil { ajaxMsg(r, "管理员不存在", consts.MsgErr); return } + if a.Id == 1 { ajaxMsg(r, "不能禁用超级管理员", consts.MsgErr); return } + newStatus := 0 + if a.Status == 0 { newStatus = 1 } + _ = dao.Admin.UpdateFields(ctx, id, g.Map{"status": newStatus, "update_time": time.Now().Unix()}) + ajaxMsg(r, "操作成功", consts.MsgOK) +} + +// ==================== 用户资料 ==================== + +func UserAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + userId := r.GetCtxVar("userId", 0).Int() + if userId <= 0 { ajaxMsg(r, "未登录", consts.MsgErr); return } + + realName := r.Get("real_name").String() + phone := r.Get("phone").String() + email := r.Get("email").String() + dingtalk := r.Get("dingtalk").String() + wechat := r.Get("wechat").String() + oldPwd := r.Get("old_password").String() + newPwd := r.Get("new_password").String() + + admin, _ := dao.Admin.GetById(ctx, userId) + if admin == nil { ajaxMsg(r, "用户不存在", consts.MsgErr); return } + + now := time.Now().Unix() + admin.RealName = realName; admin.Phone = phone; admin.Email = email + admin.Dingtalk = dingtalk; admin.Wechat = wechat; admin.UpdateTime = now + + if newPwd != "" { + if !libs.VerifyPassword(oldPwd, admin.Password, admin.Salt) { + ajaxMsg(r, "旧密码错误", consts.MsgErr); return + } + pwd, salt := libs.HashPassword(newPwd) + admin.Password = pwd + admin.Salt = salt + } + + _ = dao.Admin.Update(ctx, admin) + ajaxMsg(r, "保存成功", consts.MsgOK) +} diff --git a/controller/task.go b/controller/task.go new file mode 100644 index 00000000..ec6c3307 --- /dev/null +++ b/controller/task.go @@ -0,0 +1,555 @@ +package controller + +import ( + "context" + "fmt" + "ppgo_job/consts" + "ppgo_job/dao" + "ppgo_job/model/entity" + "ppgo_job/service/scheduler" + "strings" + "time" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/os/gcron" + "github.com/gogf/gf/v2/util/gconv" +) + +// ===== 任务管理 ===== + +func TaskList(r *ghttp.Request) { + ctx := r.GetCtx() + groupId := r.Get("groupId", 0).Int() + groups, _, _ := dao.Group.GetList(ctx, 1, 1000, "status", 1) + taskGroup := make(map[int]string) + for _, g := range groups { taskGroup[g.Id] = g.GroupName } + display(r, "task/list.html", g.Map{"pageTitle":"任务管理","taskGroup":taskGroup,"groupId":groupId,"flash":g.Map{"error":""}}) +} + +func TaskTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + groupId := r.Get("groupId", -1).Int() + status := r.Get("status", -1).Int() + taskName := strings.TrimSpace(r.Get("task_name", "").String()) + var filters []interface{} + if groupId >= 0 { filters = append(filters, "group_id", groupId) } + if status >= 0 { filters = append(filters, "status >=", status) } + if taskName != "" { filters = append(filters, "task_name like", "%"+taskName+"%") } + list, total, err := dao.Task.GetList(ctx, page, limit, filters...) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, t := range list { + st := "运行中" + if t.Status == -1 { st = "已删除" } else if t.Status == 0 { st = "已暂停" } else if t.Status == 2 { st = "待审核" } else if t.Status == 3 { st = "审核失败" } + nt := "" + pt := ""; if t.PrevTime > 0 { pt = time.Unix(t.PrevTime, 0).Format("2006-01-02 15:04:05") } + ct := ""; ut := "" + if t.CreateTime > 0 { ct = time.Unix(t.CreateTime, 0).Format("2006-01-02 15:04:05") } + if t.UpdateTime > 0 { ut = time.Unix(t.UpdateTime, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":t.Id,"task_name":t.TaskName,"group_id":t.GroupId,"cron_spec":t.CronSpec,"command":t.Command,"status":t.Status,"status_text":st,"prev_time":t.PrevTime,"prev_time_str":pt,"next_time":nt,"execute_times":t.ExecuteTimes,"server_ids":t.ServerIds,"create_time_str":ct,"update_time_str":ut}) + } + ajaxList(r, "成功", 0, total, rows) +} + +func TaskAdd(r *ghttp.Request) { + ctx := r.GetCtx() + groups, _, _ := dao.Group.GetList(ctx, 1, 1000, "status", 1) + taskGroup := make(map[int]string) + for _, g := range groups { taskGroup[g.Id] = g.GroupName } + sgl, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + sl, _, _ := dao.TaskServer.GetList(ctx, 1, 1000) + serverGroup := make(map[int]g.Map) + for _, sg := range sgl { + servers := make(map[int]string) + for _, s := range sl { if s.GroupId == sg.Id { servers[s.Id] = s.ServerName } } + serverGroup[sg.Id] = g.Map{"GroupName":sg.GroupName,"Servers":servers} + } + al, _, _ := dao.Admin.GetList(ctx, 1, 1000) + adminInfo := make([]g.Map, 0) + for _, a := range al { adminInfo = append(adminInfo, g.Map{"Id":a.Id,"RealName":a.RealName}) } + display(r, "task/add.html", g.Map{"pageTitle":"新增任务","taskGroup":taskGroup,"serverGroup":serverGroup,"adminInfo":adminInfo,"flash":g.Map{"error":""}}) +} + +func TaskEdit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + task, _ := dao.Task.GetById(ctx, id) + if task == nil { ajaxMsg(r, "任务不存在", consts.MsgErr); return } + groups, _, _ := dao.Group.GetList(ctx, 1, 1000, "status", 1) + taskGroup := make(map[int]string) + for _, g := range groups { taskGroup[g.Id] = g.GroupName } + sgl, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + sl, _, _ := dao.TaskServer.GetList(ctx, 1, 1000) + serverGroup := make(map[int]g.Map) + for _, sg := range sgl { + servers := make(map[int]string) + for _, s := range sl { if s.GroupId == sg.Id { servers[s.Id] = s.ServerName } } + serverGroup[sg.Id] = g.Map{"GroupName": sg.GroupName, "Servers": servers} + } + al, _, _ := dao.Admin.GetList(ctx, 1, 1000) + adminInfo := make([]g.Map, 0) + for _, a := range al { adminInfo = append(adminInfo, g.Map{"Id": a.Id, "RealName": a.RealName}) } + tplList, _, _ := dao.NotifyTpl.GetList(ctx, 1, 1000) + userId := r.GetCtxVar("userId", 0).Int() + isAdmin := 0 + if userId == 1 { isAdmin = 1 } + display(r, "task/edit.html", g.Map{"pageTitle":"编辑任务","task":task,"taskGroup":taskGroup,"serverGroup":serverGroup,"adminInfo":adminInfo,"notifyTpl":tplList,"isAdmin":isAdmin,"flash":g.Map{"error":""}}) +} + +func TaskCopy(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + task, _ := dao.Task.GetById(ctx, id) + if task == nil { ajaxMsg(r, "任务不存在", consts.MsgErr); return } + groups, _, _ := dao.Group.GetList(ctx, 1, 1000, "status", 1) + taskGroup := make(map[int]string) + for _, g := range groups { taskGroup[g.Id] = g.GroupName } + sgl, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + sl, _, _ := dao.TaskServer.GetList(ctx, 1, 1000) + serverGroup := make(map[int]g.Map) + for _, sg := range sgl { + servers := make(map[int]string) + for _, s := range sl { if s.GroupId == sg.Id { servers[s.Id] = s.ServerName } } + serverGroup[sg.Id] = g.Map{"GroupName": sg.GroupName, "Servers": servers} + } + al, _, _ := dao.Admin.GetList(ctx, 1, 1000) + adminInfo := make([]g.Map, 0) + for _, a := range al { adminInfo = append(adminInfo, g.Map{"Id": a.Id, "RealName": a.RealName}) } + tplList, _, _ := dao.NotifyTpl.GetList(ctx, 1, 1000) + userId := r.GetCtxVar("userId", 0).Int() + isAdmin := 0 + if userId == 1 { isAdmin = 1 } + r.Response.WriteTpl("task/copy.html", g.Map{"pageTitle":"复制任务","task":task,"taskGroup":taskGroup,"serverGroup":serverGroup,"adminInfo":adminInfo,"notifyTpl":tplList,"isAdmin":isAdmin,"flash":g.Map{"error":""}}) +} + +func TaskDetail(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + task, _ := dao.Task.GetById(ctx, id) + if task == nil { ajaxMsg(r, "任务不存在", consts.MsgErr); return } + st := "运行中" + if task.Status == -1 { st = "已删除" } else if task.Status == 0 { st = "已暂停" } else if task.Status == 2 { st = "待审核" } else if task.Status == 3 { st = "审核失败" } + groupName := "" + if g, _ := dao.Group.GetById(ctx, task.GroupId); g != nil { groupName = g.GroupName } + serverName := "本地服务器" + if task.ServerIds != "" && task.ServerIds != "0" { + if s, _ := dao.TaskServer.GetById(ctx, gconv.Int(task.ServerIds)); s != nil { serverName = s.ServerName } + } + serverType := "同时执行" + if task.ServerType == 1 { serverType = "轮询执行" } + createName := ""; updateName := "" + if a, _ := dao.Admin.GetById(ctx, task.CreateId); a != nil { createName = a.RealName } + if a, _ := dao.Admin.GetById(ctx, task.UpdateId); a != nil { updateName = a.RealName } + notifyTplName := "" + if task.IsNotify == 1 && task.NotifyTplId > 0 { + if t, _ := dao.NotifyTpl.GetById(ctx, task.NotifyTplId); t != nil { notifyTplName = t.TplName } + } + al, _, _ := dao.Admin.GetList(ctx, 1, 1000) + adminInfo := make([]g.Map, 0) + for _, a := range al { adminInfo = append(adminInfo, g.Map{"Id":a.Id,"RealName":a.RealName}) } + ct := ""; ut := "" + if task.CreateTime > 0 { ct = time.Unix(task.CreateTime, 0).Format("2006-01-02 15:04:05") } + if task.UpdateTime > 0 { ut = time.Unix(task.UpdateTime, 0).Format("2006-01-02 15:04:05") } + r.Response.WriteTpl("task/detail.html", g.Map{ + "pageTitle":"任务详情","task":task,"TextStatus":st,"GroupName":groupName,"serverName":serverName, + "ServerType":serverType,"NotifyTplName":notifyTplName,"adminInfo":adminInfo, + "CreateName":createName,"UpdateName":updateName,"CreateTime":ct,"UpdateTime":ut,"flash":g.Map{"error":""}, + }) +} + +func TaskAjaxSave(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + taskName := r.Get("task_name").String() + cronSpec := r.Get("cron_spec").String() + command := r.Get("command").String() + groupId := r.Get("group_id", 0).Int() + serverIds := r.Get("server_ids").String() + serverType := r.Get("server_type", 0).Int() + concurrent := r.Get("concurrent", 0).Int() + timeout := r.Get("timeout", 0).Int() + isNotify := r.Get("is_notify", 0).Int() + notifyType := r.Get("notify_type", 0).Int() + notifyTplId := r.Get("notify_tpl_id", 0).Int() + notifyUserIds := r.Get("notify_user_ids").String() + description := r.Get("description").String() + if taskName == "" || cronSpec == "" || command == "" { ajaxMsg(r, "任务名称、Cron表达式、命令不能为空", consts.MsgErr); return } + // 验证 Cron 表达式(临时注册再移除,仅用于校验格式) + if _, err := gcron.AddSingleton(ctx, cronSpec, func(ctx context.Context) {}, "cron_validator"); err != nil { + ajaxMsg(r, "Cron表达式格式错误: "+err.Error(), consts.MsgErr) + return + } + gcron.Remove("cron_validator") + if err := scheduler.Scheduler.CheckCommand(ctx, command); err != nil { ajaxMsg(r, err.Error(), consts.MsgErr); return } + now := time.Now().Unix() + userId := r.GetCtxVar("userId", 0).Int() + if id > 0 { + task, _ := dao.Task.GetById(ctx, id) + if task == nil { ajaxMsg(r, "任务不存在", consts.MsgErr); return } + task.TaskName = taskName; task.Description = description; task.GroupId = groupId + task.ServerIds = serverIds; task.ServerType = serverType; task.CronSpec = cronSpec + task.Concurrent = concurrent; task.Command = command; task.Timeout = timeout + task.IsNotify = isNotify; task.NotifyType = notifyType; task.NotifyTplId = notifyTplId + task.NotifyUserIds = notifyUserIds; task.UpdateId = userId; task.UpdateTime = now + if err := dao.Task.Update(ctx, task); err != nil { ajaxMsg(r, "更新失败: "+err.Error(), consts.MsgErr); return } + if task.Status == 1 { scheduler.Scheduler.UpdateTask(ctx, task) } + ajaxMsg(r, "更新成功", consts.MsgOK) + } else { + status := 2 + if userId == 1 { status = 0 } + t := &entity.Task{ + TaskName: taskName, Description: description, GroupId: groupId, + ServerIds: serverIds, ServerType: serverType, CronSpec: cronSpec, + Concurrent: concurrent, Command: command, Timeout: timeout, + Status: status, IsNotify: isNotify, NotifyType: notifyType, + NotifyTplId: notifyTplId, NotifyUserIds: notifyUserIds, + CreateId: userId, UpdateId: userId, CreateTime: now, UpdateTime: now, + } + id, err := dao.Task.Insert(ctx, t) + if err != nil { ajaxMsg(r, "添加失败: "+err.Error(), consts.MsgErr); return } + ajaxMsg(r, id, consts.MsgOK) + } +} + +func TaskAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + task, _ := dao.Task.GetById(ctx, id) + if task == nil { ajaxMsg(r, "任务不存在", consts.MsgErr); return } + _ = dao.Task.Delete(ctx, id) + if task.Status == 1 { scheduler.Scheduler.RemoveTask(ctx, id) } + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +func TaskAjaxStart(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 1}) + task, _ := dao.Task.GetById(ctx, id) + if task != nil { scheduler.Scheduler.AddTask(ctx, task) } + ajaxMsg(r, "启动成功", consts.MsgOK) +} + +func TaskAjaxPause(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 0}) + scheduler.Scheduler.RemoveTask(ctx, id) + ajaxMsg(r, "暂停成功", consts.MsgOK) +} + +func TaskAjaxRun(r *ghttp.Request) { + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = scheduler.Scheduler.RunTaskNow(r.GetCtx(), id) + ajaxMsg(r, "任务已触发执行", consts.MsgOK) +} + +func TaskAuditList(r *ghttp.Request) { + display(r, "task/auditlist.html", g.Map{"pageTitle":"任务审核","flash":g.Map{"error":""}}) +} + +func TaskAjaxAudit(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 1}) + task, _ := dao.Task.GetById(ctx, id) + if task != nil { scheduler.Scheduler.AddTask(ctx, task) } + ajaxMsg(r, "审核通过,任务已启动", consts.MsgOK) +} + +func TaskAjaxNopass(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 3}) + ajaxMsg(r, "已设置为审核失败", consts.MsgOK) +} + +func TaskAjaxBatchStart(r *ghttp.Request) { + ctx := r.GetCtx() + ids := r.Get("ids").String() + for _, idStr := range strings.Split(ids, ",") { + if id := gconv.Int(strings.TrimSpace(idStr)); id > 0 { + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 1}) + if t, _ := dao.Task.GetById(ctx, id); t != nil { scheduler.Scheduler.AddTask(ctx, t) } + } + } + ajaxMsg(r, "批量启动成功", consts.MsgOK) +} + +func TaskAjaxBatchPause(r *ghttp.Request) { + ctx := r.GetCtx() + ids := r.Get("ids").String() + for _, idStr := range strings.Split(ids, ",") { + if id := gconv.Int(strings.TrimSpace(idStr)); id > 0 { + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 0}) + scheduler.Scheduler.RemoveTask(ctx, id) + } + } + ajaxMsg(r, "批量暂停成功", consts.MsgOK) +} + +func TaskAjaxBatchDel(r *ghttp.Request) { + ctx := r.GetCtx() + ids := r.Get("ids").String() + for _, idStr := range strings.Split(ids, ",") { + if id := gconv.Int(strings.TrimSpace(idStr)); id > 0 { + _ = dao.Task.Delete(ctx, id) + scheduler.Scheduler.RemoveTask(ctx, id) + } + } + ajaxMsg(r, "批量删除成功", consts.MsgOK) +} + +func TaskAjaxBatchAudit(r *ghttp.Request) { + ctx := r.GetCtx() + ids := r.Get("ids").String() + for _, idStr := range strings.Split(ids, ",") { + if id := gconv.Int(strings.TrimSpace(idStr)); id > 0 { + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 1}) + if t, _ := dao.Task.GetById(ctx, id); t != nil { scheduler.Scheduler.AddTask(ctx, t) } + } + } + ajaxMsg(r, "批量审核通过", consts.MsgOK) +} + +func TaskAjaxBatchNoPass(r *ghttp.Request) { + ctx := r.GetCtx() + ids := r.Get("ids").String() + for _, idStr := range strings.Split(ids, ",") { + if id := gconv.Int(strings.TrimSpace(idStr)); id > 0 { _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 3}) } + } + ajaxMsg(r, "批量审核不通过", consts.MsgOK) +} + +func TaskApiTask(r *ghttp.Request) { ajaxMsg(r, "API接口待完善", consts.MsgOK) } + +func TaskApiStart(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 1}) + if t, _ := dao.Task.GetById(ctx, id); t != nil { scheduler.Scheduler.AddTask(ctx, t) } + ajaxMsg(r, id, consts.MsgOK) +} + +func TaskApiPause(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.Task.UpdateFields(ctx, id, g.Map{"status": 0}) + scheduler.Scheduler.RemoveTask(ctx, id) + ajaxMsg(r, id, consts.MsgOK) +} + +func TaskLogAjaxDel(r *ghttp.Request) { + ctx := r.GetCtx() + id := r.Get("id", 0).Int() + if id <= 0 { ajaxMsg(r, "参数错误", consts.MsgErr); return } + _ = dao.TaskLog.DeleteById(ctx, id) + ajaxMsg(r, "删除成功", consts.MsgOK) +} + +// ===== 服务器管理 ===== + +func ServerList(r *ghttp.Request) { + ctx := r.GetCtx() + groups, _, _ := dao.ServerGroup.GetList(ctx, 1, 1000, "status", 1) + serverGroup := make(map[int]string) + for _, g := range groups { serverGroup[g.Id] = g.GroupName } + display(r, "server/list.html", g.Map{"pageTitle":"服务器列表","serverGroup":serverGroup,"flash":g.Map{"error":""}}) +} + +func ServerTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + groupId := r.Get("groupId", -1).Int() + var filters []interface{} + if groupId >= 0 { filters = append(filters, "group_id", groupId) } + list, total, err := dao.TaskServer.GetList(ctx, page, limit, filters...) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, s := range list { + statusText := "正常" + if s.Status == 1 { statusText = "异常" } else if s.Status == 2 { statusText = "已禁用" } + connType := "SSH" + if s.ConnectionType == 1 { connType = "Telnet" } else if s.ConnectionType == 2 { connType = "Agent" } + ct := ""; ut := "" + if s.CreateTime > 0 { ct = time.Unix(s.CreateTime, 0).Format("2006-01-02 15:04:05") } + if s.UpdateTime > 0 { ut = time.Unix(s.UpdateTime, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":s.Id,"server_name":s.ServerName,"server_ip":s.ServerIp,"port":s.Port,"status":s.Status,"statusText":statusText,"connTypeText":connType,"connection_type":s.ConnectionType,"create_time_str":ct,"update_time_str":ut}) + } + ajaxList(r, "成功", 0, total, rows) +} + +// ===== 任务分组 ===== + +func GroupList(r *ghttp.Request) { + display(r, "group/list.html", g.Map{"pageTitle":"任务分组","flash":g.Map{"error":""}}) +} + +func GroupTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + list, total, err := dao.Group.GetList(ctx, page, limit) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, v := range list { + ct := ""; ut := "" + if v.CreateTime > 0 { ct = time.Unix(v.CreateTime, 0).Format("2006-01-02 15:04:05") } + if v.UpdateTime > 0 { ut = time.Unix(v.UpdateTime, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":v.Id,"group_name":v.GroupName,"description":v.Description,"create_time":ct,"update_time":ut,"status":v.Status}) + } + ajaxList(r, "成功", 0, total, rows) +} + +// ===== 资源分组 ===== + +func ServerGroupList(r *ghttp.Request) { + display(r, "servergroup/list.html", g.Map{"pageTitle":"资源分组","flash":g.Map{"error":""}}) +} + +func ServerGroupTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + list, total, err := dao.ServerGroup.GetList(ctx, page, limit) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, v := range list { + ct := ""; ut := "" + if v.CreateTime > 0 { ct = time.Unix(v.CreateTime, 0).Format("2006-01-02 15:04:05") } + if v.UpdateTime > 0 { ut = time.Unix(v.UpdateTime, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":v.Id,"group_name":v.GroupName,"description":v.Description,"create_time":ct,"update_time":ut,"status":v.Status}) + } + ajaxList(r, "成功", 0, total, rows) +} + +// ===== 执行日志 ===== + +func TaskLogList(r *ghttp.Request) { + taskId := r.Get("task_id", 0).Int() + display(r, "tasklog/list.html", g.Map{"pageTitle":"执行日志","task_id":taskId,"flash":g.Map{"error":""}}) +} + +func TaskLogTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + taskId := r.Get("task_id", -1).Int() + var filters []interface{} + if taskId > 0 { filters = append(filters, "task_id", taskId) } + list, total, err := dao.TaskLog.GetList(ctx, page, limit, filters...) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, l := range list { + st := "成功" + if l.Status == -1 { st = "失败" } else if l.Status == -2 { st = "超时" } + startTime := "" + if l.CreateTime > 0 { + startTime = time.Unix(l.CreateTime, 0).Format("2006-01-02 15:04:05") + } + outputSize := len(l.Output) + sizeText := fmt.Sprintf("%d B", outputSize) + if outputSize >= 1024 { + sizeText = fmt.Sprintf("%.1f KB", float64(outputSize)/1024) + } + rows = append(rows, g.Map{ + "id": l.Id, "task_id": l.TaskId, "server_name": l.ServerName, + "status": l.Status, "statusText": st, + "process_time": l.ProcessTime, + "start_time": startTime, + "output_size": sizeText, + "output": l.Output, "error": l.Error, + }) + } + ajaxList(r, "成功", 0, total, rows) +} + +// ===== 禁用命令 ===== + +func BanList(r *ghttp.Request) { + display(r, "ban/list.html", g.Map{"pageTitle":"禁用命令","flash":g.Map{"error":""}}) +} + +func BanTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + list, total, err := dao.Ban.GetList(ctx, page, limit) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, v := range list { + ct := "" + if v.CreateTime > 0 { ct = time.Unix(v.CreateTime, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":v.Id,"code":v.Code,"create_time":ct,"status":v.Status}) + } + ajaxList(r, "成功", 0, total, rows) +} + +// ===== 权限管理 ===== + +func AuthIndex(r *ghttp.Request) { + display(r, "auth/list.html", g.Map{"pageTitle":"权限因子","flash":g.Map{"error":""}}) +} + +func RoleList(r *ghttp.Request) { + display(r, "role/list.html", g.Map{"pageTitle":"角色列表","flash":g.Map{"error":""}}) +} + +func RoleTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + list, total, err := dao.Role.GetList(ctx, page, limit) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, v := range list { + ct := ""; ut := "" + if v.CreateTime > 0 { ct = time.Unix(v.CreateTime, 0).Format("2006-01-02 15:04:05") } + if v.UpdateTime > 0 { ut = time.Unix(v.UpdateTime, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":v.Id,"role_name":v.RoleName,"detail":v.Detail,"create_time":ct,"update_time":ut,"status":v.Status}) + } + ajaxList(r, "成功", 0, total, rows) +} + +func AdminList(r *ghttp.Request) { + display(r, "admin/list.html", g.Map{"pageTitle":"管理员列表","flash":g.Map{"error":""}}) +} + +func AdminTable(r *ghttp.Request) { + ctx := r.GetCtx() + page := r.Get("page", 1).Int() + limit := r.Get("limit", 20).Int() + list, total, err := dao.Admin.GetList(ctx, page, limit) + if err != nil { ajaxList(r, "查询失败", consts.MsgErr, 0, nil); return } + rows := make([]g.Map, 0) + for _, a := range list { + statusText := "正常" + if a.Status == 0 { statusText = "禁用" } + ct := ""; ut := ""; lt := "" + if a.CreateTime > 0 { ct = time.Unix(a.CreateTime, 0).Format("2006-01-02 15:04:05") } + if a.UpdateTime > 0 { ut = time.Unix(a.UpdateTime, 0).Format("2006-01-02 15:04:05") } + if a.LastLogin > 0 { lt = time.Unix(a.LastLogin, 0).Format("2006-01-02 15:04:05") } + rows = append(rows, g.Map{"id":a.Id,"login_name":a.LoginName,"real_name":a.RealName,"email":a.Email,"phone":a.Phone,"status":a.Status,"statusText":statusText,"last_login":lt,"create_time_str":ct,"update_time_str":ut}) + } + ajaxList(r, "成功", 0, total, rows) +} + +func UserEdit(r *ghttp.Request) { + ctx := r.GetCtx() + userId := r.GetCtxVar("userId", 0).Int() + admin, _ := dao.Admin.GetById(ctx, userId) + if admin == nil { ajaxMsg(r, "用户不存在", consts.MsgErr); return } + display(r, "user/edit.html", g.Map{"pageTitle":"资料修改","admin":g.Map{"id":admin.Id,"login_name":admin.LoginName,"real_name":admin.RealName,"phone":admin.Phone,"email":admin.Email,"dingtalk":admin.Dingtalk,"wechat":admin.Wechat},"flash":g.Map{"error":""}}) +} diff --git a/controllers/admin.go b/controllers/admin.go deleted file mode 100644 index e502aa7a..00000000 --- a/controllers/admin.go +++ /dev/null @@ -1,222 +0,0 @@ -/********************************************** -** @Des: 管理员 -** @Author: haodaquan -** @Date: 2017-09-16 14:17:37 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:14:07 -***********************************************/ -package controllers - -import ( - "fmt" - "strconv" - "strings" - "time" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" -) - -type AdminController struct { - BaseController -} - -func (self *AdminController) List() { - self.Data["pageTitle"] = "管理员管理" - self.display() - //self.TplName = "admin/list.html" -} - -func (self *AdminController) Add() { - self.Data["pageTitle"] = "新增管理员" - // 角色 - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - result, _ := models.RoleGetList(1, 1000, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["role_name"] = v.RoleName - list[k] = row - } - - self.Data["role"] = list - - self.display() -} - -func (self *AdminController) Edit() { - self.Data["pageTitle"] = "编辑管理员" - - id, _ := self.GetInt("id", 0) - Admin, _ := models.AdminGetById(id) - row := make(map[string]interface{}) - row["id"] = Admin.Id - row["login_name"] = Admin.LoginName - row["real_name"] = Admin.RealName - row["phone"] = Admin.Phone - row["email"] = Admin.Email - row["dingtalk"] = Admin.Dingtalk - row["wechat"] = Admin.Wechat - row["role_ids"] = Admin.RoleIds - self.Data["admin"] = row - - role_ids := strings.Split(Admin.RoleIds, ",") - - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - result, _ := models.RoleGetList(1, 1000, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["checked"] = 0 - for i := 0; i < len(role_ids); i++ { - role_id, _ := strconv.Atoi(role_ids[i]) - if role_id == v.Id { - row["checked"] = 1 - } - fmt.Println(role_ids[i]) - } - row["id"] = v.Id - row["role_name"] = v.RoleName - list[k] = row - } - self.Data["role"] = list - self.display() -} - -func (self *AdminController) AjaxSave() { - Admin_id, _ := self.GetInt("id") - if Admin_id == 0 { - Admin := new(models.Admin) - Admin.LoginName = strings.TrimSpace(self.GetString("login_name")) - Admin.RealName = strings.TrimSpace(self.GetString("real_name")) - Admin.Phone = strings.TrimSpace(self.GetString("phone")) - Admin.Email = strings.TrimSpace(self.GetString("email")) - Admin.Dingtalk = strings.TrimSpace(self.GetString("dingtalk")) - Admin.Wechat = strings.TrimSpace(self.GetString("wechat")) - Admin.RoleIds = strings.TrimSpace(self.GetString("roleids")) - Admin.UpdateTime = time.Now().Unix() - Admin.UpdateId = self.userId - Admin.Status = 1 - - // 检查登录名是否已经存在 - _, err := models.AdminGetByName(Admin.LoginName) - - if err == nil { - self.ajaxMsg("登录名已经存在", MSG_ERR) - } - //新增 - pwd, salt := libs.Password(4, "") - Admin.Password = pwd - Admin.Salt = salt - Admin.CreateTime = time.Now().Unix() - Admin.CreateId = self.userId - if _, err := models.AdminAdd(Admin); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) - } - - Admin, _ := models.AdminGetById(Admin_id) - //修改 - Admin.Id = Admin_id - Admin.UpdateTime = time.Now().Unix() - Admin.UpdateId = self.userId - Admin.LoginName = strings.TrimSpace(self.GetString("login_name")) - Admin.RealName = strings.TrimSpace(self.GetString("real_name")) - Admin.Phone = strings.TrimSpace(self.GetString("phone")) - Admin.Email = strings.TrimSpace(self.GetString("email")) - Admin.Dingtalk = strings.TrimSpace(self.GetString("dingtalk")) - Admin.Wechat = strings.TrimSpace(self.GetString("wechat")) - Admin.RoleIds = strings.TrimSpace(self.GetString("roleids")) - Admin.UpdateTime = time.Now().Unix() - Admin.UpdateId = self.userId - Admin.Status = 1 - - resetPwd, _ := self.GetInt("reset_pwd") - if resetPwd == 1 { - pwd, salt := libs.Password(4, "") - Admin.Password = pwd - Admin.Salt = salt - } - - //普通管理员不可修改超级管理员资料 - if self.userId != 1 && Admin.Id == 1 { - self.ajaxMsg("不可修改超级管理员资料", MSG_ERR) - } - if err := Admin.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg(strconv.Itoa(resetPwd), MSG_OK) -} - -func (self *AdminController) AjaxDel() { - - Admin_id, _ := self.GetInt("id") - status := strings.TrimSpace(self.GetString("status")) - if Admin_id == 1 { - self.ajaxMsg("超级管理员不允许操作", MSG_ERR) - } - - Admin_status := 0 - if status == "enable" { - Admin_status = 1 - } - Admin, _ := models.AdminGetById(Admin_id) - Admin.UpdateTime = time.Now().Unix() - Admin.Status = Admin_status - Admin.Id = Admin_id - - if err := Admin.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("操作成功", MSG_OK) -} - -func (self *AdminController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - realName := strings.TrimSpace(self.GetString("realName")) - - StatusText := make(map[int]string) - StatusText[0] = "禁用" - StatusText[1] = "正常" - - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - // - if realName != "" { - filters = append(filters, "real_name__icontains", realName) - } - result, count := models.AdminGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["login_name"] = v.LoginName - row["real_name"] = v.RealName - row["phone"] = v.Phone - row["email"] = v.Email - row["dingtalk"] = v.Dingtalk - row["wechat"] = v.Wechat - row["role_ids"] = v.RoleIds - row["create_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - row["update_time"] = beego.Date(time.Unix(v.UpdateTime, 0), "Y-m-d H:i:s") - row["status"] = v.Status - row["status_text"] = StatusText[v.Status] - list[k] = row - } - self.ajaxList("成功", MSG_OK, count, list) -} diff --git a/controllers/auth.go b/controllers/auth.go deleted file mode 100644 index 23d00c9b..00000000 --- a/controllers/auth.go +++ /dev/null @@ -1,118 +0,0 @@ -/********************************************** -** @Des: 权限因子 -** @Author: haodaquan -** @Date: 2017-09-09 16:14:31 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:23:40 -***********************************************/ - -package controllers - -import ( - "fmt" - "strings" - "time" - - "github.com/george518/PPGo_Job/models" -) - -type AuthController struct { - BaseController -} - -func (self *AuthController) Index() { - - self.Data["pageTitle"] = "权限因子" - self.display() -} - -func (self *AuthController) List() { - self.Data["zTree"] = true //引入ztreecss - self.Data["pageTitle"] = "权限因子" - self.display() -} - -//获取全部节点 -func (self *AuthController) GetNodes() { - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - result, count := models.AuthGetList(1, 1000, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["pId"] = v.Pid - row["name"] = v.AuthName - row["open"] = true - list[k] = row - } - - self.ajaxList("成功", MSG_OK, count, list) -} - -//获取一个节点 -func (self *AuthController) GetNode() { - id, _ := self.GetInt("id") - result, _ := models.AuthGetById(id) - // if err == nil { - // self.ajaxMsg(err.Error(), MSG_ERR) - // } - row := make(map[string]interface{}) - row["id"] = result.Id - row["pid"] = result.Pid - row["auth_name"] = result.AuthName - row["auth_url"] = result.AuthUrl - row["sort"] = result.Sort - row["is_show"] = result.IsShow - row["icon"] = result.Icon - - fmt.Println(row) - - self.ajaxList("成功", MSG_OK, 0, row) -} - -//新增或修改 -func (self *AuthController) AjaxSave() { - auth := new(models.Auth) - auth.UserId = self.userId - auth.Pid, _ = self.GetInt("pid") - auth.AuthName = strings.TrimSpace(self.GetString("auth_name")) - auth.AuthUrl = strings.TrimSpace(self.GetString("auth_url")) - auth.Sort, _ = self.GetInt("sort") - auth.IsShow, _ = self.GetInt("is_show") - auth.Icon = strings.TrimSpace(self.GetString("icon")) - auth.UpdateTime = time.Now().Unix() - - auth.Status = 1 - - id, _ := self.GetInt("id") - if id == 0 { - //新增 - auth.CreateTime = time.Now().Unix() - auth.CreateId = self.userId - auth.UpdateId = self.userId - if _, err := models.AuthAdd(auth); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - } else { - auth.Id = id - auth.UpdateId = self.userId - if err := auth.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - } - - self.ajaxMsg("", MSG_OK) -} - -//删除 -func (self *AuthController) AjaxDel() { - id, _ := self.GetInt("id") - auth, _ := models.AuthGetById(id) - auth.Id = id - auth.Status = 0 - if err := auth.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} diff --git a/controllers/ban.go b/controllers/ban.go deleted file mode 100644 index 7d26714d..00000000 --- a/controllers/ban.go +++ /dev/null @@ -1,126 +0,0 @@ -/************************************************************ -** @Description: controllers -** @Author: haodaquan -** @Date: 2018-06-10 19:50 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-10 19:50 -*************************************************************/ -package controllers - -import ( - "strings" - "time" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/models" -) - -type BanController struct { - BaseController -} - -func (self *BanController) List() { - self.Data["pageTitle"] = "禁用命令管理" - self.display() -} - -func (self *BanController) Add() { - self.Data["pageTitle"] = "新增禁用命令" - - // 角色 - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - result, _ := models.RoleGetList(1, 1000, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["role_name"] = v.RoleName - list[k] = row - } - - self.Data["role"] = list - - self.display() -} - -func (self *BanController) Edit() { - self.Data["pageTitle"] = "编辑禁用命令" - - id, _ := self.GetInt("id", 0) - ban, _ := models.BanGetById(id) - row := make(map[string]interface{}) - row["id"] = ban.Id - row["code"] = ban.Code - self.Data["ban"] = row - self.display() -} - -func (self *BanController) AjaxSave() { - id, _ := self.GetInt("id") - if id == 0 { - ban := new(models.Ban) - ban.Code = strings.TrimSpace(self.GetString("code")) - ban.CreateTime = time.Now().Unix() - - if _, err := models.BanAdd(ban); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) - } - - ban, _ := models.BanGetById(id) - //修改 - ban.Id = id - ban.UpdateTime = time.Now().Unix() - ban.Code = strings.TrimSpace(self.GetString("code")) - - if err := ban.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *BanController) AjaxDel() { - id, _ := self.GetInt("id") - ban, _ := models.BanGetById(id) - ban.UpdateTime = time.Now().Unix() - ban.Status = 1 - - if err := ban.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("操作成功", MSG_OK) -} - -func (self *BanController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - code := strings.TrimSpace(self.GetString("code")) - - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - filters = append(filters, "status", 0) - if code != "" { - filters = append(filters, "code__icontains", code) - } - result, count := models.BanGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["code"] = v.Code - row["create_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - list[k] = row - } - self.ajaxList("成功", MSG_OK, count, list) -} diff --git a/controllers/common.go b/controllers/common.go deleted file mode 100644 index 41a22b4b..00000000 --- a/controllers/common.go +++ /dev/null @@ -1,358 +0,0 @@ -/********************************************** -** @Des: base controller -** @Author: haodaquan -** @Date: 2017-09-07 16:54:40 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-18 10:28:01 -***********************************************/ -package controllers - -import ( - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" - "strconv" - "strings" -) - -const ( - MSG_OK = 0 - MSG_ERR = -1 -) - -type BaseController struct { - beego.Controller - controllerName string - actionName string - user *models.Admin - userId int - userName string - loginName string - pageSize int - allowUrl string - serverGroups string - taskGroups string -} - -//前期准备 -func (self *BaseController) Prepare() { - self.pageSize = 20 - controllerName, actionName := self.GetControllerAndAction() - self.controllerName = strings.ToLower(controllerName[0 : len(controllerName)-10]) - self.actionName = strings.ToLower(actionName) - self.Data["version"] = beego.AppConfig.String("version") - self.Data["siteName"] = beego.AppConfig.String("site.name") - self.Data["curRoute"] = self.controllerName + "." + self.actionName - self.Data["curController"] = self.controllerName - self.Data["curAction"] = self.actionName - // noAuth := "ajaxsave/ajaxdel/table/loginin/loginout/getnodes/start" - // isNoAuth := strings.Contains(noAuth, self.actionName) - //fmt.Println(self.controllerName) - //if (strings.Compare(self.controllerName, "apidoc")) != 0 { - // - //} - - self.Auth() - self.Data["loginUserId"] = self.userId - self.Data["loginUserName"] = self.userName -} - -//登录权限验证 -func (self *BaseController) Auth() { - arr := strings.Split(self.Ctx.GetCookie("auth"), "|") - self.userId = 0 - if len(arr) == 2 { - idstr, password := arr[0], arr[1] - userId, _ := strconv.Atoi(idstr) - if userId > 0 { - user, err := models.AdminGetById(userId) - - if err == nil && password == libs.Md5([]byte(self.getClientIp()+"|"+user.Password+user.Salt)) { - self.userId = user.Id - self.loginName = user.LoginName - self.userName = user.RealName - self.user = user - self.AdminAuth() - self.dataAuth(user) - } - - isHasAuth := strings.Contains(self.allowUrl, self.controllerName+"/"+self.actionName) - noAuth := "ajaxsave/table/loginin/loginout/getnodes/start/apitask/apistart/apipause" - isNoAuth := strings.Contains(noAuth, self.actionName) - - if isHasAuth == false && isNoAuth == false { - if strings.Contains(self.actionName, "ajax") { - self.ajaxMsg("没有权限", MSG_ERR) - return - } - - flash := beego.NewFlash() - flash.Error("没有权限") - flash.Store(&self.Controller) - return - } - } - } - - if self.userId == 0 && - (self.controllerName != "login" && - self.actionName != "loginin" && - self.actionName != "apistart" && - self.actionName != "apitask" && - self.actionName != "apipause" && - self.actionName != "apisave" && - self.actionName != "apistatus" && - self.actionName != "apiget") { - self.redirect(beego.URLFor("LoginController.Login")) - } -} - -func (self *BaseController) dataAuth(user *models.Admin) { - if user.RoleIds == "0" || user.Id == 1 { - return - } - - Filters := make([]interface{}, 0) - Filters = append(Filters, "status", 1) - - RoleIdsArr := strings.Split(user.RoleIds, ",") - - RoleIds := make([]int, 0) - for _, v := range RoleIdsArr { - id, _ := strconv.Atoi(v) - RoleIds = append(RoleIds, id) - } - - Filters = append(Filters, "id__in", RoleIds) - - Result, _ := models.RoleGetList(1, 1000, Filters...) - serverGroups := "" - taskGroups := "" - for _, v := range Result { - serverGroups += v.ServerGroupIds + "," - taskGroups += v.TaskGroupIds + "," - } - - self.serverGroups = strings.Trim(serverGroups, ",") - self.taskGroups = strings.Trim(taskGroups, ",") -} - -func (self *BaseController) AdminAuth() { - // 左侧导航栏 - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - if self.userId != 1 { - //普通管理员 - adminAuthIds, _ := models.RoleAuthGetByIds(self.user.RoleIds) - adminAuthIdArr := strings.Split(adminAuthIds, ",") - filters = append(filters, "id__in", adminAuthIdArr) - } - result, _ := models.AuthGetList(1, 1000, filters...) - list := make([]map[string]interface{}, len(result)) - list2 := make([]map[string]interface{}, len(result)) - allow_url := "" - i, j := 0, 0 - for _, v := range result { - if v.AuthUrl != " " || v.AuthUrl != "/" { - allow_url += v.AuthUrl - } - row := make(map[string]interface{}) - if v.Pid == 1 && v.IsShow == 1 { - row["Id"] = int(v.Id) - row["Sort"] = v.Sort - row["AuthName"] = v.AuthName - row["AuthUrl"] = v.AuthUrl - row["Icon"] = v.Icon - row["Pid"] = int(v.Pid) - list[i] = row - i++ - } - if v.Pid != 1 && v.IsShow == 1 { - row["Id"] = int(v.Id) - row["Sort"] = v.Sort - row["AuthName"] = v.AuthName - row["AuthUrl"] = v.AuthUrl - row["Icon"] = v.Icon - row["Pid"] = int(v.Pid) - list2[j] = row - j++ - } - } - - self.Data["SideMenu1"] = list[:i] //一级菜单 - self.Data["SideMenu2"] = list2[:j] //二级菜单 - - self.allowUrl = allow_url + "/home/index" -} - -// 是否POST提交 -func (self *BaseController) isPost() bool { - return self.Ctx.Request.Method == "POST" -} - -//获取用户IP地址 -func (self *BaseController) getClientIp() string { - s := strings.Split(self.Ctx.Request.RemoteAddr, ":") - return s[0] -} - -// 重定向 -func (self *BaseController) redirect(url string) { - self.Redirect(url, 302) - self.StopRun() -} - -//加载模板 -func (self *BaseController) display(tpl ...string) { - var tplname string - if len(tpl) > 0 { - tplname = strings.Join([]string{tpl[0], "html"}, ".") - } else { - tplname = self.controllerName + "/" + self.actionName + ".html" - } - self.Layout = "public/layout.html" - self.TplName = tplname -} - -//ajax返回 -func (self *BaseController) ajaxMsg(msg interface{}, msgno int) { - out := make(map[string]interface{}) - out["status"] = msgno - out["message"] = msg - self.Data["json"] = out - self.ServeJSON() - self.StopRun() -} - -//ajax返回 列表 -func (self *BaseController) ajaxList(msg interface{}, msgno int, count int64, data interface{}) { - out := make(map[string]interface{}) - out["code"] = msgno - out["msg"] = msg - out["count"] = count - out["data"] = data - self.Data["json"] = out - self.ServeJSON() - self.StopRun() -} - -//资源分组信息 -func serverGroupLists(authStr string, adminId int) (sgl map[int]string) { - Filters := make([]interface{}, 0) - Filters = append(Filters, "status", 1) - if authStr != "0" && adminId != 1 { - serverGroupIdsArr := strings.Split(authStr, ",") - serverGroupIds := make([]int, 0) - for _, v := range serverGroupIdsArr { - id, _ := strconv.Atoi(v) - serverGroupIds = append(serverGroupIds, id) - } - Filters = append(Filters, "id__in", serverGroupIds) - } - - groupResult, n := models.ServerGroupGetList(1, 1000, Filters...) - sgl = make(map[int]string, n) - for _, gv := range groupResult { - sgl[gv.Id] = gv.GroupName - } - //sgl[0] = "默认分组" - return sgl -} - -func taskGroupLists(authStr string, adminId int) (gl map[int]string) { - groupFilters := make([]interface{}, 0) - groupFilters = append(groupFilters, "status", 1) - if authStr != "0" && adminId != 1 { - taskGroupIdsArr := strings.Split(authStr, ",") - taskGroupIds := make([]int, 0) - for _, v := range taskGroupIdsArr { - id, _ := strconv.Atoi(v) - taskGroupIds = append(taskGroupIds, id) - } - groupFilters = append(groupFilters, "id__in", taskGroupIds) - } - groupResult, n := models.GroupGetList(1, 1000, groupFilters...) - gl = make(map[int]string, n) - for _, gv := range groupResult { - gl[gv.Id] = gv.GroupName - } - return gl -} - -func serverListByGroupId(groupId int) []string { - Filters := make([]interface{}, 0) - Filters = append(Filters, "status", 1) - Filters = append(Filters, "group_id", groupId) - Result, _ := models.TaskServerGetList(1, 1000, Filters...) - - servers := make([]string, 0) - for _, v := range Result { - servers = append(servers, strconv.Itoa(v.Id), v.ServerName) - } - - return servers -} - -type AdminInfo struct { - Id int - Email string - Phone string - RealName string -} - -func AllAdminInfo(adminIds string) []*AdminInfo { - Filters := make([]interface{}, 0) - Filters = append(Filters, "status", 1) - //Filters = append(Filters, "id__gt", 1) - var notifyUserIds []int - if adminIds != "0" && adminIds != "" { - notifyUserIdsStr := strings.Split(adminIds, ",") - for _, v := range notifyUserIdsStr { - i, _ := strconv.Atoi(v) - notifyUserIds = append(notifyUserIds, i) - } - Filters = append(Filters, "id__in", notifyUserIds) - } - Result, _ := models.AdminGetList(1, 1000, Filters...) - - adminInfos := make([]*AdminInfo, 0) - for _, v := range Result { - ai := AdminInfo{ - Id: v.Id, - Email: v.Email, - Phone: v.Phone, - RealName: v.RealName, - } - adminInfos = append(adminInfos, &ai) - } - - return adminInfos -} - -type serverList struct { - GroupId int - GroupName string - Servers map[int]string -} - -func serverLists(authStr string, adminId int) (sls []serverList) { - serverGroup := serverGroupLists(authStr, adminId) - Filters := make([]interface{}, 0) - Filters = append(Filters, "status__in", []int{0, 1}) - - Result, _ := models.TaskServerGetList(1, 1000, Filters...) - for k, v := range serverGroup { - sl := serverList{} - sl.GroupId = k - sl.GroupName = v - servers := make(map[int]string) - for _, sv := range Result { - if sv.GroupId == k { - servers[sv.Id] = sv.ServerName - } - } - sl.Servers = servers - sls = append(sls, sl) - } - return sls -} diff --git a/controllers/home.go b/controllers/home.go deleted file mode 100644 index 9519eb5f..00000000 --- a/controllers/home.go +++ /dev/null @@ -1,183 +0,0 @@ -/********************************************** -** @Des: This file ... -** @Author: haodaquan -** @Date: 2017-09-08 10:21:13 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-09 18:04:41 -***********************************************/ -package controllers - -import ( - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/jobs" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" - "runtime" - "sort" - "strconv" - "time" -) - -type HomeController struct { - BaseController -} - -func (self *HomeController) Index() { - self.Data["pageTitle"] = "系统首页" - //self.display() - self.TplName = "public/main.html" -} - -func (self *HomeController) Help() { - self.Data["pageTitle"] = "Cron表达式说明" - //self.display() - self.TplName = "public/help.html" -} - -func (self *HomeController) Start() { - - //总任务数量 - _, count := models.TaskGetList(1, 10) - self.Data["totalJob"] = count - - //日志总量 - _, totalLog := models.TaskLogGetList(1, 10) - self.Data["totalLog"] = totalLog - - //待审核任务数量 - _, totalAuditTask := models.TaskGetList(1, 10, "status", 2) - self.Data["totalAuditTask"] = totalAuditTask - - //失败 - errorNum, err := models.GetLogNum(-1) - if err != nil { - errorNum = 0 - } - self.Data["errorNum"] = errorNum - - //成功 - successNum, err := models.GetLogNum(0) - if err != nil { - successNum = 0 - } - self.Data["successNum"] = successNum - - //用户数 - _, userNum := models.AdminGetList(1, 10, "status", 1) - self.Data["userNum"] = userNum - - //累计运行总次数 - n, err := models.TaskTotalRunNum() - if err != nil { - n = 0 - } - self.Data["TaskTotalRunNum"] = n - - groups_map := serverGroupLists(self.serverGroups, self.userId) - //计算总任务数量 - - // 即将执行的任务 - entries := jobs.GetEntries(30) - jobList := make([]map[string]interface{}, len(entries)) - startJob := 0 //即将执行的任务 - for k, v := range entries { - row := make(map[string]interface{}) - job := v.Job.(*jobs.Job) - task, _ := models.TaskGetById(job.GetId()) - row["task_id"] = job.GetId() - row["task_name"] = job.GetName() - row["task_group"] = groups_map[task.GroupId] - row["next_time"] = beego.Date(v.Next, "Y-m-d H:i:s") - jobList[k] = row - startJob++ - } - - self.Data["recentLogs"] = jobList - - // 最近执行失败的日志 - logs, _ := models.TaskLogGetList(1, 30, "status__lt", 0) - errLogs := make([]map[string]interface{}, len(logs)) - - for k, v := range logs { - task, err := models.TaskGetById(v.TaskId) - taskName := "" - if err == nil { - taskName = task.TaskName - } - - row := make(map[string]interface{}) - row["task_name"] = taskName - row["id"] = v.Id - row["start_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - row["process_time"] = float64(v.ProcessTime) / 1000 - row["ouput_size"] = libs.SizeFormat(float64(len(v.Output))) - row["error"] = beego.Substr(v.Error, 0, 100) - row["status"] = v.Status - errLogs[k] = row - - } - self.Data["errLogs"] = errLogs - self.Data["startJob"] = startJob - self.Data["jobs"] = jobList - - //折线图 - okRun := models.SumByDays(30, "0") - errRun := models.SumByDays(30, "-1") - expiredRun := models.SumByDays(30, "-2") - - days := []string{} - okNum := []int64{} - errNum := []int64{} - expiredNum := []int64{} - - type kv struct { - Key string - Value int64 - } - - //排序 - var ss []kv - for k, v := range okRun { - i, _ := strconv.ParseInt(v.(string), 10, 64) - ss = append(ss, kv{k, i}) - } - - sort.Slice(ss, func(i, j int) bool { - - return ss[i].Key < ss[j].Key - }) - - for _, v := range ss { - - days = append(days, v.Key) - okNum = append(okNum, v.Value) - - if _, ok := errRun[v.Key]; ok { - i, _ := strconv.ParseInt(errRun[v.Key].(string), 10, 64) - errNum = append(errNum, i) - } else { - errNum = append(errNum, 0) - } - - if _, ok := expiredRun[v.Key]; ok { - i, _ := strconv.ParseInt(expiredRun[v.Key].(string), 10, 64) - expiredNum = append(expiredNum, i) - } else { - expiredNum = append(expiredNum, 0) - } - } - - self.Data["days"] = days - self.Data["okNum"] = okNum - self.Data["errNum"] = errNum - self.Data["expiredNum"] = expiredNum - - self.Data["cpuNum"] = runtime.NumCPU() - - //系统运行信息 - info := libs.SystemInfo(models.StartTime) - self.Data["sysInfo"] = info - - self.Data["pageTitle"] = "系统概况" - self.display() -} diff --git a/controllers/login.go b/controllers/login.go deleted file mode 100644 index c438b42a..00000000 --- a/controllers/login.go +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************** -** @Des: login -** @Author: haodaquan -** @Date: 2017-09-07 16:30:10 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:55:21 -***********************************************/ -package controllers - -import ( - "strconv" - "time" - - "strings" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" -) - -type LoginController struct { - BaseController -} - -func (self *LoginController) Login() { - //if self.userId > 0 { - // self.redirect(beego.URLFor("HomeController.Index")) - //} - self.TplName = "login/login.html" -} - -//登录 TODO:XSRF过滤 -func (self *LoginController) LoginIn() { - - //self.ajaxMsg("登录成功", MSG_OK) - if self.userId > 0 { - self.ajaxMsg("登录成功", MSG_OK) - } - - if self.isPost() { - username := strings.TrimSpace(self.GetString("username")) - password := strings.TrimSpace(self.GetString("password")) - if username != "" && password != "" { - user, err := models.AdminGetByName(username) - if err != nil || user.Password != libs.Md5([]byte(password+user.Salt)) { - self.ajaxMsg("帐号或密码错误", MSG_ERR) - } else if user.Status == -1 { - self.ajaxMsg("该帐号已禁用", MSG_ERR) - } else { - user.LastIp = self.getClientIp() - user.LastLogin = time.Now().Unix() - user.Update() - authkey := libs.Md5([]byte(self.getClientIp() + "|" + user.Password + user.Salt)) - self.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey, 7*86400) - - self.ajaxMsg("登录成功", MSG_OK) - } - } - } - self.ajaxMsg("请求方式错误", MSG_ERR) -} - -//登出 -func (self *LoginController) LoginOut() { - self.Ctx.SetCookie("auth", "") - self.redirect(beego.URLFor("LoginController.Login")) -} - -func (self *LoginController) NoAuth() { - self.Ctx.WriteString("没有权限") -} diff --git a/controllers/notify_tpl.go b/controllers/notify_tpl.go deleted file mode 100644 index d4df8062..00000000 --- a/controllers/notify_tpl.go +++ /dev/null @@ -1,167 +0,0 @@ -/************************************************************ -** @Description: controllers -** @Author: Bee -** @Date: 2019-02-15 20:21 -** @Last Modified by: Bee -** @Last Modified time: 2019-02-15 20:21 -*************************************************************/ -package controllers - -import ( - "encoding/json" - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/models" - "strings" - "time" -) - -type NotifyTplController struct { - BaseController -} - -func (self *NotifyTplController) List() { - self.Data["pageTitle"] = "通知模板" - self.display() -} - -func (self *NotifyTplController) Add() { - self.Data["pageTitle"] = "新增通知模板" - self.Data["serverGroup"] = serverGroupLists(self.serverGroups, self.userId) - self.display() -} - -func (self *NotifyTplController) Edit() { - self.Data["pageTitle"] = "编辑通知模板" - - id, _ := self.GetInt("id", 0) - notifyTpl, _ := models.NotifyTplGetById(id) - row := make(map[string]interface{}) - row["id"] = notifyTpl.Id - row["tpl_name"] = notifyTpl.TplName - row["tpl_type"] = notifyTpl.TplType - row["title"] = notifyTpl.Title - row["content"] = notifyTpl.Content - row["status"] = notifyTpl.Status - self.Data["notifyTpl"] = row - self.display() -} - -func (self *NotifyTplController) AjaxSave() { - tpl_id, _ := self.GetInt("id") - if tpl_id == 0 { - notifyTpl := new(models.NotifyTpl) - notifyTpl.TplName = strings.TrimSpace(self.GetString("tpl_name")) - notifyTpl.TplType, _ = self.GetInt("tpl_type") - notifyTpl.Title = strings.TrimSpace(self.GetString("title")) - notifyTpl.Content = strings.TrimSpace(self.GetString("content")) - notifyTpl.CreateId = self.userId - notifyTpl.CreateTime = time.Now().Unix() - notifyTpl.Type = models.NotifyTplTypeDefault - notifyTpl.Status, _ = self.GetInt("status") - - if notifyTpl.TplType == 1 || notifyTpl.TplType == 2 || notifyTpl.TplType == 3 { - m := make(map[string]string) - err := json.Unmarshal([]byte(notifyTpl.Content), &m) - if err != nil { - self.ajaxMsg("模板内容格式错误,"+err.Error(), MSG_ERR) - } - } - - if _, err := models.NotifyTplAdd(notifyTpl); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) - } - - notifyTpl, _ := models.NotifyTplGetById(tpl_id) - //修改 - notifyTpl.Id = tpl_id - notifyTpl.UpdateId = self.userId - notifyTpl.UpdateTime = time.Now().Unix() - - notifyTpl.TplName = strings.TrimSpace(self.GetString("tpl_name")) - notifyTpl.TplType, _ = self.GetInt("tpl_type") - notifyTpl.Title = strings.TrimSpace(self.GetString("title")) - notifyTpl.Content = strings.TrimSpace(self.GetString("content")) - notifyTpl.Status, _ = self.GetInt("status") - - if notifyTpl.Type == models.NotifyTplTypeSystem { - self.ajaxMsg("系统模板禁止更新", MSG_ERR) - } - - if notifyTpl.TplType == 1 || notifyTpl.TplType == 2 || notifyTpl.TplType == 3 { - m := make(map[string]string) - err := json.Unmarshal([]byte(notifyTpl.Content), &m) - if err != nil { - self.ajaxMsg("模板内容格式错误,"+err.Error(), MSG_ERR) - } - } - - if err := notifyTpl.Update(); err != nil { - self.ajaxMsg("更新失败,"+err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *NotifyTplController) AjaxDel() { - id, _ := self.GetInt("id") - notifyTpl, _ := models.NotifyTplGetById(id) - - if notifyTpl.Type == models.NotifyTplTypeSystem { - self.ajaxMsg("系统模板禁止删除", MSG_ERR) - } - - if err := models.NotifyTplDelById(id); err != nil { - self.ajaxMsg("删除失败,"+err.Error(), MSG_ERR) - } - self.ajaxMsg("操作成功", MSG_OK) -} - -func (self *NotifyTplController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - tplName := strings.TrimSpace(self.GetString("tplName")) - StatusText := []string{ - "禁用", - "正常", - } - - TplTypeText := []string{ - "邮件", - "信息", - "钉钉", - "微信", - } - - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - - if tplName != "" { - filters = append(filters, "tpl_name__icontains", tplName) - } - result, count := models.NotifyTplGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["type"] = v.Type - row["tpl_name"] = v.TplName - row["tpl_type"] = v.TplType - row["tpl_type_text"] = TplTypeText[v.TplType] - row["status"] = v.Status - row["status_text"] = StatusText[v.Status] - row["create_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - row["update_time"] = beego.Date(time.Unix(v.UpdateTime, 0), "Y-m-d H:i:s") - list[k] = row - } - - self.ajaxList("成功", MSG_OK, count, list) -} diff --git a/controllers/role.go b/controllers/role.go deleted file mode 100644 index 2d9ef458..00000000 --- a/controllers/role.go +++ /dev/null @@ -1,191 +0,0 @@ -/********************************************** -** @Des: This file ... -** @Author: haodaquan -** @Date: 2017-09-14 14:23:32 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:31:13 -***********************************************/ -package controllers - -import ( - "strconv" - "strings" - "time" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/models" -) - -type RoleController struct { - BaseController -} - -func (self *RoleController) List() { - self.Data["pageTitle"] = "角色管理" - self.display() -} - -func (self *RoleController) Add() { - self.Data["zTree"] = true //引入ztreecss - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - self.Data["serverGroup"] = serverLists(self.serverGroups, self.userId) - self.Data["pageTitle"] = "新增角色" - self.display() -} -func (self *RoleController) Edit() { - self.Data["zTree"] = true //引入ztreecss - self.Data["pageTitle"] = "编辑角色" - - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - self.Data["serverGroup"] = serverLists(self.serverGroups, self.userId) - - id, _ := self.GetInt("id", 0) - role, _ := models.RoleGetById(id) - row := make(map[string]interface{}) - row["id"] = role.Id - row["role_name"] = role.RoleName - row["detail"] = role.Detail - row["task_group_ids"] = role.TaskGroupIds - row["server_group_ids"] = role.ServerGroupIds - self.Data["role"] = row - - //获取选择的树节点 - roleAuth, _ := models.RoleAuthGetById(id) - authId := make([]int, 0) - for _, v := range roleAuth { - authId = append(authId, v.AuthId) - } - - taskGroupIdsArr := strings.Split(role.TaskGroupIds, ",") - taskGroupIds := make([]int, 0) - for _, v := range taskGroupIdsArr { - id, _ := strconv.Atoi(v) - taskGroupIds = append(taskGroupIds, id) - } - - serverGroupIdsArr := strings.Split(role.ServerGroupIds, ",") - serverGroupIds := make([]int, 0) - for _, v := range serverGroupIdsArr { - id, _ := strconv.Atoi(v) - serverGroupIds = append(serverGroupIds, id) - } - - self.Data["server_group_ids"] = serverGroupIds - self.Data["task_group_ids"] = taskGroupIds - - self.Data["auth"] = authId - self.display() -} - -func (self *RoleController) AjaxSave() { - role := new(models.Role) - role.RoleName = strings.TrimSpace(self.GetString("role_name")) - role.Detail = strings.TrimSpace(self.GetString("detail")) - role.ServerGroupIds = strings.TrimSpace(self.GetString("server_group_ids")) - role.TaskGroupIds = strings.TrimSpace(self.GetString("task_group_ids")) - role.CreateTime = time.Now().Unix() - role.UpdateTime = time.Now().Unix() - role.Status = 1 - - auths := strings.TrimSpace(self.GetString("nodes_data")) - role_id, _ := self.GetInt("id") - if role_id == 0 { - //新增 - role.CreateTime = time.Now().Unix() - role.UpdateTime = time.Now().Unix() - role.CreateId = self.userId - role.UpdateId = self.userId - if id, err := models.RoleAdd(role); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } else { - ras := make([]models.RoleAuth, 0) - authsSlice := strings.Split(auths, ",") - for _, v := range authsSlice { - //ra := new(models.RoleAuth) - ra := models.RoleAuth{} - aid, _ := strconv.Atoi(v) - ra.AuthId = aid - ra.RoleId = id - ras = append(ras, ra) - } - if len(ras) > 0 { - models.RoleAuthBatchAdd(&ras) - } - } - self.ajaxMsg("", MSG_OK) - } - //修改 - role.Id = role_id - role.UpdateTime = time.Now().Unix() - role.UpdateId = self.userId - if err := role.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } else { - // 删除该角色权限 - models.RoleAuthDelete(role_id) - - ras := make([]models.RoleAuth, 0) - authsSlice := strings.Split(auths, ",") - for _, v := range authsSlice { - //ra := new(models.RoleAuth) - ra := models.RoleAuth{} - aid, _ := strconv.Atoi(v) - ra.AuthId = aid - ra.RoleId = int64(role_id) - ras = append(ras, ra) - } - if len(ras) > 0 { - models.RoleAuthBatchAdd(&ras) - } - } - self.ajaxMsg("", MSG_OK) -} - -func (self *RoleController) AjaxDel() { - - role_id, _ := self.GetInt("id") - role, _ := models.RoleGetById(role_id) - role.Status = 0 - role.Id = role_id - role.UpdateTime = time.Now().Unix() - - if err := role.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - // 删除该角色权限 - //models.RoleAuthDelete(role_id) - self.ajaxMsg("", MSG_OK) -} - -func (self *RoleController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - roleName := strings.TrimSpace(self.GetString("roleName")) - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - if roleName != "" { - filters = append(filters, "role_name__icontains", roleName) - } - result, count := models.RoleGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["role_name"] = v.RoleName - row["detail"] = v.Detail - row["create_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - row["update_time"] = beego.Date(time.Unix(v.UpdateTime, 0), "Y-m-d H:i:s") - list[k] = row - } - self.ajaxList("成功", MSG_OK, count, list) -} diff --git a/controllers/server.go b/controllers/server.go deleted file mode 100644 index c4bb4cea..00000000 --- a/controllers/server.go +++ /dev/null @@ -1,460 +0,0 @@ -/************************************************************ -** @Description: controllers -** @Author: haodaquan -** @Date: 2018-06-09 16:11 -** @Last Modified by: Bee -** @Last Modified time: 2019-02-17 22:15:15 -*************************************************************/ -package controllers - -import ( - "github.com/astaxie/beego/logs" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" - "strconv" - "strings" - "time" -) - -type ServerController struct { - BaseController -} - -func (self *ServerController) List() { - self.Data["pageTitle"] = "执行资源管理" - self.Data["serverGroup"] = serverGroupLists(self.serverGroups, self.userId) - self.display() -} - -func (self *ServerController) Add() { - self.Data["pageTitle"] = "新增执行资源" - self.Data["serverGroup"] = serverGroupLists(self.serverGroups, self.userId) - self.display() -} - -func (self *ServerController) GetServerByGroupId() { - gid, _ := self.GetInt("gid", 0) - if gid == 0 { - self.ajaxMsg("groupId is not exist", MSG_ERR) - } - - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - //serverName := strings.TrimSpace(self.GetString("serverName")) - StatusText := []string{ - "正常", - "禁用", - } - - loginType := [2]string{ - "密码", - "密钥", - } - - serverGroup := serverGroupLists(self.serverGroups, self.userId) - - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - filters = append(filters, "status", 0) - filters = append(filters, "group_id", gid) - - result, count := models.TaskServerGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["connection_type"] = v.ConnectionType - row["server_name"] = v.ServerName - row["detail"] = v.Detail - if serverGroup[v.GroupId] == "" { - v.GroupId = 0 - } - row["group_name"] = serverGroup[v.GroupId] - row["type"] = loginType[v.Type] - row["status"] = v.Status - row["status_text"] = StatusText[v.Status] - list[k] = row - } - - self.ajaxList("成功", MSG_OK, count, list) -} - -func (self *ServerController) Edit() { - self.Data["pageTitle"] = "编辑执行资源" - - id, _ := self.GetInt("id", 0) - server, _ := models.TaskServerGetById(id) - row := make(map[string]interface{}) - row["id"] = server.Id - row["connection_type"] = server.ConnectionType - row["server_name"] = server.ServerName - row["group_id"] = server.GroupId - row["server_ip"] = server.ServerIp - row["server_account"] = server.ServerAccount - row["server_outer_ip"] = server.ServerOuterIp - row["port"] = server.Port - row["type"] = server.Type - row["password"] = server.Password - row["public_key_src"] = server.PublicKeySrc - row["private_key_src"] = server.PrivateKeySrc - row["detail"] = server.Detail - self.Data["server"] = row - self.Data["serverGroup"] = serverGroupLists(self.serverGroups, self.userId) - self.display() -} - -func (self *ServerController) AjaxTestServer() { - - server := new(models.TaskServer) - server.ConnectionType, _ = self.GetInt("connection_type") - server.ServerName = strings.TrimSpace(self.GetString("server_name")) - server.ServerAccount = strings.TrimSpace(self.GetString("server_account")) - server.ServerOuterIp = strings.TrimSpace(self.GetString("server_outer_ip")) - server.ServerIp = strings.TrimSpace(self.GetString("server_ip")) - server.PrivateKeySrc = strings.TrimSpace(self.GetString("private_key_src")) - server.PublicKeySrc = strings.TrimSpace(self.GetString("public_key_src")) - server.Password = strings.TrimSpace(self.GetString("password")) - server.Detail = strings.TrimSpace(self.GetString("detail")) - server.Type, _ = self.GetInt("type") - server.Port, _ = self.GetInt("port") - server.GroupId, _ = self.GetInt("group_id") - - var err error - - if server.ConnectionType == 0 { - if server.Type == 0 { - //密码登录 - err = libs.RemoteCommandByPassword(server) - } - - if server.Type == 1 { - //密钥登录 - err = libs.RemoteCommandByKey(server) - } - - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("Success", MSG_OK) - } else if server.ConnectionType == 1 { - if server.Type == 0 { - //密码登录 - err = libs.RemoteCommandByTelnetPassword(server) - } else { - self.ajaxMsg("Telnet方式暂不支持密钥登陆!", MSG_ERR) - } - - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("Success", MSG_OK) - } else if server.ConnectionType == 2 { - - if err := libs.RemoteAgent(server); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } else { - self.ajaxMsg("Success", MSG_OK) - - } - } - - self.ajaxMsg("未知连接方式", MSG_ERR) -} - -func (self *ServerController) Copy() { - self.Data["pageTitle"] = "复制服务器资源" - - id, _ := self.GetInt("id", 0) - server, _ := models.TaskServerGetById(id) - row := make(map[string]interface{}) - row["id"] = server.Id - row["connection_type"] = server.ConnectionType - row["server_name"] = server.ServerName - row["group_id"] = server.GroupId - row["server_ip"] = server.ServerIp - row["server_account"] = server.ServerAccount - row["server_outer_ip"] = server.ServerOuterIp - row["port"] = server.Port - row["type"] = server.Type - row["password"] = server.Password - row["public_key_src"] = server.PublicKeySrc - row["private_key_src"] = server.PrivateKeySrc - row["detail"] = server.Detail - self.Data["server"] = row - self.Data["serverGroup"] = serverGroupLists(self.serverGroups, self.userId) - self.display() -} - -func (self *ServerController) AjaxSave() { - server_id, _ := self.GetInt("id") - if server_id == 0 { - server := new(models.TaskServer) - server.ConnectionType, _ = self.GetInt("connection_type") - server.ServerName = strings.TrimSpace(self.GetString("server_name")) - server.ServerAccount = strings.TrimSpace(self.GetString("server_account")) - server.ServerOuterIp = strings.TrimSpace(self.GetString("server_outer_ip")) - server.ServerIp = strings.TrimSpace(self.GetString("server_ip")) - server.PrivateKeySrc = strings.TrimSpace(self.GetString("private_key_src")) - server.PublicKeySrc = strings.TrimSpace(self.GetString("public_key_src")) - server.Password = strings.TrimSpace(self.GetString("password")) - - server.Detail = strings.TrimSpace(self.GetString("detail")) - server.Type, _ = self.GetInt("type") - server.Port, _ = self.GetInt("port") - server.GroupId, _ = self.GetInt("group_id") - - server.CreateTime = time.Now().Unix() - server.UpdateTime = time.Now().Unix() - server.Status = 0 - - if _, err := models.TaskServerAdd(server); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) - } - - server, _ := models.TaskServerGetById(server_id) - //修改 - server.Id = server_id - server.UpdateTime = time.Now().Unix() - - server.ConnectionType, _ = self.GetInt("connection_type") - server.ServerName = strings.TrimSpace(self.GetString("server_name")) - server.ServerAccount = strings.TrimSpace(self.GetString("server_account")) - server.ServerOuterIp = strings.TrimSpace(self.GetString("server_outer_ip")) - server.ServerIp = strings.TrimSpace(self.GetString("server_ip")) - server.PrivateKeySrc = strings.TrimSpace(self.GetString("private_key_src")) - server.PublicKeySrc = strings.TrimSpace(self.GetString("public_key_src")) - server.Detail = strings.TrimSpace(self.GetString("detail")) - server.Password = strings.TrimSpace(self.GetString("password")) - - server.Type, _ = self.GetInt("type") - server.Port, _ = self.GetInt("port") - server.GroupId, _ = self.GetInt("group_id") - - if err := server.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *ServerController) AjaxDel() { - id, _ := self.GetInt("id") - - if id == 1 { - self.ajaxMsg("默认分组id=1,禁止删除", MSG_ERR) - } - - server, _ := models.TaskServerGetById(id) - server.UpdateTime = time.Now().Unix() - server.Status = 2 - server.Id = id - - //TODO 查询服务器是否用于定时任务 - if err := server.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("操作成功", MSG_OK) -} - -func (self *ServerController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - serverGroupId, err := self.GetInt("serverGroupId") - - serverName := strings.TrimSpace(self.GetString("serverName")) - StatusText := []string{ - "", - "", - } - // - //loginType := [2]string{ - // "密码", - // "密钥", - //} - - connectionType := [3]string{ - "SSH", - "Telnet", - "Agent", - } - - serverGroup := serverGroupLists(self.serverGroups, self.userId) - - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - ids := []int{0, 1} - filters = append(filters, "status__in", ids) - - groupsIds := make([]int, 0) - if self.userId != 1 { - groups := strings.Split(self.serverGroups, ",") - - for _, v := range groups { - id, _ := strconv.Atoi(v) - if serverGroupId > 0 { - if id == serverGroupId { - groupsIds = append(groupsIds, id) - break - } - } else { - groupsIds = append(groupsIds, id) - } - } - filters = append(filters, "group_id__in", groupsIds) - } else if serverGroupId > 0 { - groupsIds = append(groupsIds, serverGroupId) - filters = append(filters, "group_id__in", groupsIds) - } - - if serverName != "" { - filters = append(filters, "server_name__icontains", serverName) - } - result, count := models.TaskServerGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["connection_type"] = connectionType[v.ConnectionType] - row["server_name"] = StatusText[v.Status] + " " + v.ServerName - row["detail"] = v.Detail - if serverGroup[v.GroupId] == "" { - v.GroupId = 0 - } - row["ip_port"] = v.ServerIp + ":" + strconv.Itoa(v.Port) - row["group_name"] = serverGroup[v.GroupId] - //row["type"] = loginType[v.Type] - row["status"] = v.Status - list[k] = row - } - - self.ajaxList("成功", MSG_OK, count, list) -} - -//以下函数为执行器接口 -//注册 -func (self *ServerController) ApiSave() { - //唯一确定值 ip+port - serverIp := strings.TrimSpace(self.GetString("server_ip")) - port, _ := self.GetInt("port") - - if serverIp == "" || port == 0 { - self.ajaxMsg("执行器和端口号必填", MSG_ERR) - } - - defaultActName := "agent-" + serverIp + "-" + strconv.Itoa(port) - - id := models.TaskServerForActuator(serverIp, port) - if id == 0 { - //新增 - server := new(models.TaskServer) - server.ConnectionType, _ = self.GetInt("connection_type", 3) - server.ServerName = strings.TrimSpace(self.GetString("server_name", defaultActName)) - server.ServerAccount = strings.TrimSpace(self.GetString("server_account", "agent")) - server.ServerOuterIp = strings.TrimSpace(self.GetString("server_outer_ip", "")) - server.ServerIp = strings.TrimSpace(self.GetString("server_ip")) - server.PrivateKeySrc = strings.TrimSpace(self.GetString("private_key_src", "")) - server.PublicKeySrc = strings.TrimSpace(self.GetString("public_key_src", "")) - server.Password = strings.TrimSpace(self.GetString("password", "agent")) - - server.Detail = strings.TrimSpace(self.GetString("detail", "")) - server.Type, _ = self.GetInt("type", 0) - server.Port, _ = self.GetInt("port") - server.GroupId, _ = self.GetInt("group_id", 0) - server.Status = 0 - - server.CreateTime = time.Now().Unix() - server.UpdateTime = time.Now().Unix() - server.Status = 0 - serverId, err := models.TaskServerAdd(server) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg(serverId, MSG_OK) - } else { - //修改状态 - server, _ := models.TaskServerGetById(id) - server.UpdateTime = time.Now().Unix() - server.Status, _ = self.GetInt("status", 0) - if err := server.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg(id, MSG_OK) - } - -} - -//检测0-正常,1-异常,2-删除 -func (self *ServerController) ApiStatus() { - //唯一确定值 ip+port - serverId := strings.TrimSpace(self.GetString("server_ip")) - port, _ := self.GetInt("port") - status, _ := self.GetInt("status", 0) - - if serverId == "" || port == 0 { - self.ajaxMsg("执行器和端口号必填", MSG_ERR) - } - - id := models.TaskServerForActuator(serverId, port) - if id == 0 { - self.ajaxMsg("执行器不存在", MSG_ERR) - } - - if status != 0 && status != 1 { - status = 0 - } - - server, _ := models.TaskServerGetById(id) - server.UpdateTime = time.Now().Unix() - server.Status = status - server.Id = id - - logs.Info(server) - - //TODO 查询执行器是否正在使用中 - if err := server.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg(id, MSG_OK) -} - -//获取 不检测执行器状态 -func (self *ServerController) ApiGet() { - //唯一确定值 ip+port - serverId := strings.TrimSpace(self.GetString("server_ip")) - port, _ := self.GetInt("port") - - if serverId == "" || port == 0 { - self.ajaxMsg("执行器和端口号必填", MSG_ERR) - } - - id := models.TaskServerForActuator(serverId, port) - if id == 0 { - self.ajaxMsg("执行器不存在", MSG_ERR) - } - - server, err := models.TaskServerGetById(id) - - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } else { - self.ajaxMsg(server, MSG_OK) - } -} diff --git a/controllers/server_group.go b/controllers/server_group.go deleted file mode 100644 index ad42408b..00000000 --- a/controllers/server_group.go +++ /dev/null @@ -1,143 +0,0 @@ -/************************************************************ -** @Description: controllers -** @Author: haodaquan -** @Date: 2018-06-08 21:57 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-08 21:57 -*************************************************************/ -package controllers - -import ( - "strings" - "time" - - "fmt" - - "strconv" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/models" -) - -type ServerGroupController struct { - BaseController -} - -func (self *ServerGroupController) List() { - self.Data["pageTitle"] = "资源分组管理" - self.display() -} - -func (self *ServerGroupController) Add() { - self.Data["pageTitle"] = "新增分组" - self.Data["hideTop"] = true - self.display() -} -func (self *ServerGroupController) Edit() { - self.Data["pageTitle"] = "编辑分组" - self.Data["hideTop"] = true - - id, _ := self.GetInt("id", 0) - group, _ := models.TaskGroupGetById(id) - row := make(map[string]interface{}) - row["id"] = group.Id - row["group_name"] = group.GroupName - row["description"] = group.Description - self.Data["group"] = row - self.display() -} - -func (self *ServerGroupController) AjaxSave() { - servergroup := new(models.ServerGroup) - servergroup.GroupName = strings.TrimSpace(self.GetString("group_name")) - servergroup.Description = strings.TrimSpace(self.GetString("description")) - servergroup.Status = 1 - - servergroup_id, _ := self.GetInt("id") - - fmt.Println(servergroup_id) - if servergroup_id == 0 { - //新增 - servergroup.CreateTime = time.Now().Unix() - servergroup.UpdateTime = time.Now().Unix() - servergroup.CreateId = self.userId - servergroup.UpdateId = self.userId - if _, err := models.ServerGroupAdd(servergroup); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) - } - //修改 - servergroup.Id = servergroup_id - servergroup.UpdateTime = time.Now().Unix() - servergroup.UpdateId = self.userId - if err := servergroup.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *ServerGroupController) AjaxDel() { - - group_id, _ := self.GetInt("id") - group, _ := models.TaskGroupGetById(group_id) - group.Status = 0 - group.Id = group_id - group.UpdateTime = time.Now().Unix() - //TODO 如果分组下有服务器 需要处理 - filters := make([]interface{}, 0) - filters = append(filters, "group_id", group_id) - filters = append(filters, "status", 0) - _, n := models.TaskServerGetList(1, 1, filters...) - if n > 0 { - self.ajaxMsg("分组下有服务器资源,请先处理", MSG_ERR) - } - if err := group.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *ServerGroupController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - groupName := strings.TrimSpace(self.GetString("groupName")) - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - - if self.userId != 1 { - groups := strings.Split(self.serverGroups, ",") - - groupsIds := make([]int, 0) - for _, v := range groups { - id, _ := strconv.Atoi(v) - groupsIds = append(groupsIds, id) - } - filters = append(filters, "id__in", groupsIds) - } - if groupName != "" { - filters = append(filters, "group_name__contains", groupName) - } - result, count := models.ServerGroupGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["group_name"] = v.GroupName - row["description"] = v.Description - row["create_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - row["update_time"] = beego.Date(time.Unix(v.UpdateTime, 0), "Y-m-d H:i:s") - list[k] = row - } - self.ajaxList("成功", MSG_OK, count, list) -} diff --git a/controllers/task.go b/controllers/task.go deleted file mode 100644 index ff9152ea..00000000 --- a/controllers/task.go +++ /dev/null @@ -1,912 +0,0 @@ -/************************************************************ -** @Description: controllers -** @Author: haodaquan -** @Date: 2018-06-11 21:11 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-11 21:11 -*************************************************************/ -package controllers - -import ( - "fmt" - "github.com/george518/PPGo_Job/libs" - "strconv" - "strings" - "time" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/crons" - "github.com/george518/PPGo_Job/jobs" - "github.com/george518/PPGo_Job/models" -) - -type TaskController struct { - BaseController -} - -func (self *TaskController) List() { - self.Data["pageTitle"] = "任务管理" - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - self.Data["groupId"] = 0 - //arr := strings.Split(self.Ctx.GetCookie("groupid"), "|") - //if len(arr) > 0 { - // self.Data["groupId"], _ = strconv.Atoi(arr[0]) - //} - self.display() -} - -func (self *TaskController) AuditList() { - self.Data["pageTitle"] = "任务审核" - self.display() -} - -func (self *TaskController) Add() { - self.Data["pageTitle"] = "新增任务" - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - self.Data["serverGroup"] = serverLists(self.serverGroups, self.userId) - self.Data["isAdmin"] = self.userId - self.Data["adminInfo"] = AllAdminInfo("") - self.display() -} - -func (self *TaskController) Edit() { - self.Data["pageTitle"] = "编辑任务" - - id, _ := self.GetInt("id") - task, err := models.TaskGetById(id) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - - if task.Status == 1 { - self.ajaxMsg("运行状态无法编辑任务,请先暂停任务", MSG_ERR) - } - self.Data["task"] = task - - self.Data["adminInfo"] = AllAdminInfo("") - - // 分组列表 - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - self.Data["serverGroup"] = serverLists(self.serverGroups, self.userId) - self.Data["isAdmin"] = self.userId - var notifyUserIds []int - if task.NotifyUserIds != "0" { - notifyUserIdsStr := strings.Split(task.NotifyUserIds, ",") - for _, v := range notifyUserIdsStr { - i, _ := strconv.Atoi(v) - notifyUserIds = append(notifyUserIds, i) - } - } - - self.Data["notify_user_ids"] = notifyUserIds - - server_ids := strings.Split(task.ServerIds, ",") - var server_ids_arr []int - for _, sv := range server_ids { - i, _ := strconv.Atoi(sv) - server_ids_arr = append(server_ids_arr, i) - } - - self.Data["service_ids"] = server_ids_arr - - notifyTplList, _, err := models.NotifyTplGetByTplTypeList(task.NotifyType) - tplList := make([]map[string]interface{}, len(notifyTplList)) - - if err == nil { - for k, v := range notifyTplList { - row := make(map[string]interface{}) - row["id"] = v.Id - row["tpl_name"] = v.TplName - row["tpl_type"] = v.TplType - tplList[k] = row - } - } - - self.Data["notifyTpl"] = tplList - - self.display() -} - -func (self *TaskController) Copy() { - self.Data["pageTitle"] = "复制任务" - self.Data["adminInfo"] = AllAdminInfo("") - - id, _ := self.GetInt("id") - task, err := models.TaskGetById(id) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - - //if task.Status == 1 { - // self.ajaxMsg("运行状态无法编辑任务,请先暂停任务", MSG_ERR) - //} - self.Data["task"] = task - - self.Data["adminInfo"] = AllAdminInfo("") - - // 分组列表 - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - self.Data["serverGroup"] = serverLists(self.serverGroups, self.userId) - self.Data["isAdmin"] = self.userId - var notifyUserIds []int - if task.NotifyUserIds != "0" { - notifyUserIdsStr := strings.Split(task.NotifyUserIds, ",") - for _, v := range notifyUserIdsStr { - i, _ := strconv.Atoi(v) - notifyUserIds = append(notifyUserIds, i) - } - } - - self.Data["notify_user_ids"] = notifyUserIds - - server_ids := strings.Split(task.ServerIds, ",") - var server_ids_arr []int - for _, sv := range server_ids { - i, _ := strconv.Atoi(sv) - server_ids_arr = append(server_ids_arr, i) - } - - self.Data["service_ids"] = server_ids_arr - - notifyTplList, _, err := models.NotifyTplGetByTplTypeList(task.NotifyType) - tplList := make([]map[string]interface{}, len(notifyTplList)) - - if err == nil { - for k, v := range notifyTplList { - row := make(map[string]interface{}) - row["id"] = v.Id - row["tpl_name"] = v.TplName - row["tpl_type"] = v.TplType - tplList[k] = row - } - } - - self.Data["notifyTpl"] = tplList - - self.display() -} - -func (self *TaskController) Detail() { - self.Data["pageTitle"] = "任务详细" - - id, _ := self.GetInt("id") - task, err := models.TaskGetById(id) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - - TextStatus := []string{ - " 暂停", - " 运行中", - " 待审核", - " 审核失败", - } - - self.Data["TextStatus"] = TextStatus[task.Status] - self.Data["CreateTime"] = beego.Date(time.Unix(task.CreateTime, 0), "Y-m-d H:i:s") - self.Data["UpdateTime"] = beego.Date(time.Unix(task.UpdateTime, 0), "Y-m-d H:i:s") - self.Data["task"] = task - // 分组列表 - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - - serverName := "" - if task.ServerIds == "0" { - serverName = "本地服务器
" - } else { - serverIdSli := strings.Split(task.ServerIds, ",") - for _, v := range serverIdSli { - if v == "0" { - serverName = "本地服务器
" - } - } - servers, n := models.TaskServerGetByIds(task.ServerIds) - if n > 0 { - for _, server := range servers { - fmt.Println(server.Status) - if server.Status != 0 { - serverName += server.ServerName + "
" - } else { - serverName += server.ServerName + "
" - } - } - } else { - serverName += "服务器异常!!" - } - } - - //执行策略 - self.Data["ServerType"] = "同时执行" - if task.ServerType == 1 { - self.Data["ServerType"] = "轮询执行" - } - - //任务分组 - groupName := "默认分组" - if task.GroupId > 0 { - group, err := models.GroupGetById(task.GroupId) - if err == nil { - groupName = group.GroupName - } - } - - self.Data["GroupName"] = groupName - - //创建人和修改人 - createName := "未知" - updateName := "未知" - if task.CreateId > 0 { - admin, err := models.AdminGetById(task.CreateId) - if err == nil { - createName = admin.RealName - } - } - - if task.UpdateId > 0 { - admin, err := models.AdminGetById(task.UpdateId) - if err == nil { - updateName = admin.RealName - } - } - - //是否出错通知 - self.Data["adminInfo"] = []*AdminInfo{} - if task.NotifyUserIds != "0" && task.NotifyUserIds != "" { - self.Data["adminInfo"] = AllAdminInfo(task.NotifyUserIds) - } - self.Data["CreateName"] = createName - self.Data["UpdateName"] = updateName - self.Data["serverName"] = serverName - - self.Data["NotifyTplName"] = "未知" - if task.IsNotify == 1 { - notifyTpl, err := models.NotifyTplGetById(task.NotifyTplId) - if err == nil { - self.Data["NotifyTplName"] = notifyTpl.TplName - } - } - - self.display() -} - -func (self *TaskController) AjaxSave() { - task_id, _ := self.GetInt("id") - if task_id == 0 { - task := new(models.Task) - task.CreateId = self.userId - task.GroupId, _ = self.GetInt("group_id") - task.TaskName = strings.TrimSpace(self.GetString("task_name")) - task.Description = strings.TrimSpace(self.GetString("description")) - task.Concurrent, _ = self.GetInt("concurrent") - task.ServerIds = strings.TrimSpace(self.GetString("server_ids")) - task.CronSpec = strings.TrimSpace(self.GetString("cron_spec")) - task.Command = strings.TrimSpace(self.GetString("command")) - task.Timeout, _ = self.GetInt("timeout") - task.IsNotify, _ = self.GetInt("is_notify") - task.ServerType, _ = self.GetInt("server_type") - - task.NotifyType, _ = self.GetInt("notify_type") - task.NotifyTplId, _ = self.GetInt("notify_tpl_id") - task.NotifyUserIds = strings.TrimSpace(self.GetString("notify_user_ids")) - - if task.IsNotify == 1 && task.NotifyTplId <= 0 { - self.ajaxMsg("请选择通知模板", MSG_ERR) - } - - msg, isBan := checkCommand(task.Command) - if !isBan { - self.ajaxMsg("含有禁止命令:"+msg, MSG_ERR) - } - - task.CreateTime = time.Now().Unix() - task.UpdateTime = time.Now().Unix() - task.Status = 2 //审核中 - if self.userId == 1 { - task.Status = 0 //审核中,超级管理员不需要 - } - if task.TaskName == "" || task.CronSpec == "" || task.Command == "" { - self.ajaxMsg("请填写完整信息", MSG_ERR) - } - - if _, err := cron.Parse(task.CronSpec); err != nil { - self.ajaxMsg("cron表达式无效", MSG_ERR) - } - if _, err := models.TaskAdd(task); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - - self.ajaxMsg("", MSG_OK) - } - - task, _ := models.TaskGetById(task_id) - //修改 - task.Id = task_id - task.UpdateTime = time.Now().Unix() - task.TaskName = strings.TrimSpace(self.GetString("task_name")) - task.Description = strings.TrimSpace(self.GetString("description")) - task.GroupId, _ = self.GetInt("group_id") - task.Concurrent, _ = self.GetInt("concurrent") - task.ServerIds = strings.TrimSpace(self.GetString("server_ids")) - task.CronSpec = strings.TrimSpace(self.GetString("cron_spec")) - task.Command = strings.TrimSpace(self.GetString("command")) - task.Timeout, _ = self.GetInt("timeout") - task.ServerType, _ = self.GetInt("server_type") - task.IsNotify, _ = self.GetInt("is_notify") - task.NotifyType, _ = self.GetInt("notify_type") - task.NotifyTplId, _ = self.GetInt("notify_tpl_id") - task.NotifyUserIds = strings.TrimSpace(self.GetString("notify_user_ids")) - task.UpdateId = self.userId - task.Status = 2 //审核中,超级管理员不需要 - - if task.IsNotify == 1 && task.NotifyTplId <= 0 { - self.ajaxMsg("请选择通知模板", MSG_ERR) - } - - if self.userId == 1 { - task.Status = 0 - } - msg, isBan := checkCommand(task.Command) - if !isBan { - self.ajaxMsg("含有禁止命令:"+msg, MSG_ERR) - } - - if _, err := cron.Parse(task.CronSpec); err != nil { - self.ajaxMsg("cron表达式无效", MSG_ERR) - } - - if err := task.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -//检查是否含有禁用命令 -func checkCommand(command string) (string, bool) { - - filters := make([]interface{}, 0) - filters = append(filters, "status", 0) - ban, _ := models.BanGetList(1, 1000, filters...) - for _, v := range ban { - if strings.Contains(command, v.Code) { - return v.Code, false - } - } - return "", true -} - -func (self *TaskController) AjaxAudit() { - - taskId, _ := self.GetInt("id") - if taskId == 0 { - self.ajaxMsg("任务不存在", MSG_ERR) - } - res := changeStatus(taskId, 0, self.userId) - if !res { - self.ajaxMsg("审核失败", MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxNopass() { - taskId, _ := self.GetInt("id") - if taskId == 0 { - self.ajaxMsg("任务不存在", MSG_ERR) - } - res := changeStatus(taskId, 3, self.userId) - if !res { - self.ajaxMsg("操作失败", MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxStart() { - taskId, _ := self.GetInt("id") - if taskId == 0 { - self.ajaxMsg("任务不存在", MSG_ERR) - } - - task, err := models.TaskGetById(taskId) - if err != nil { - self.ajaxMsg("查不到该任务", MSG_ERR) - } - - if task.Status != 0 { - self.ajaxMsg("任务状态有误", MSG_ERR) - } - - jobArr, err := jobs.NewJobFromTask(task) - - if err != nil { - self.ajaxMsg("创建任务失败", MSG_ERR) - } - - for _, job := range jobArr { - if jobs.AddJob(task.CronSpec, job) { - task.Status = 1 - task.Update() - } - } - - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxPause() { - taskId, _ := self.GetInt("id") - if taskId == 0 { - self.ajaxMsg("任务不存在", MSG_ERR) - } - - task, err := models.TaskGetById(taskId) - if err != nil { - self.ajaxMsg("查不到该任务", MSG_ERR) - } - - //移出任务 - TaskServerIdsArr := strings.Split(task.ServerIds, ",") - - for _, server_id := range TaskServerIdsArr { - server_id_int, _ := strconv.Atoi(server_id) - jobKey := libs.JobKey(task.Id, server_id_int) - jobs.RemoveJob(jobKey) - } - - task.Status = 0 - task.Update() - - self.ajaxMsg("", MSG_OK) - -} - -// 立即执行 -func (self *TaskController) AjaxRun() { - id, _ := self.GetInt("id") - task, err := models.TaskGetById(id) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - - jobArr, err := jobs.NewJobFromTask(task) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - for _, job := range jobArr { - job.Run() - } - - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxBatchStart() { - idArr := self.GetStrings("ids") - ids := strings.Split(idArr[0], ",") - if len(ids) < 1 { - self.ajaxMsg("请选择要操作的任务", MSG_ERR) - } - for _, v := range ids { - id, _ := strconv.Atoi(v) - if id < 1 { - continue - } - - if task, err := models.TaskGetById(id); err == nil { - jobArr, err := jobs.NewJobFromTask(task) - if err == nil { - for _, job := range jobArr { - jobs.AddJob(task.CronSpec, job) - } - - task.Status = 1 - task.Update() - } - } - } - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxBatchPause() { - idArr := self.GetStrings("ids") - ids := strings.Split(idArr[0], ",") - if len(ids) < 1 { - self.ajaxMsg("请选择要操作的任务", MSG_ERR) - } - for _, v := range ids { - id, _ := strconv.Atoi(v) - if id < 1 { - continue - } - - task, err := models.TaskGetById(id) - //移出任务 - TaskServerIdsArr := strings.Split(task.ServerIds, ",") - - for _, server_id := range TaskServerIdsArr { - server_id_int, _ := strconv.Atoi(server_id) - jobKey := libs.JobKey(task.Id, server_id_int) - jobs.RemoveJob(jobKey) - } - if err == nil { - task.Status = 0 - task.Update() - } - } - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxBatchDel() { - idArr := self.GetStrings("ids") - ids := strings.Split(idArr[0], ",") - if len(ids) < 1 { - self.ajaxMsg("请选择要操作的任务", MSG_ERR) - } - for _, v := range ids { - id, _ := strconv.Atoi(v) - if id < 1 { - continue - } - - task, _ := models.TaskGetById(id) - - //移出任务 - TaskServerIdsArr := strings.Split(task.ServerIds, ",") - - for _, server_id := range TaskServerIdsArr { - server_id_int, _ := strconv.Atoi(server_id) - jobKey := libs.JobKey(task.Id, server_id_int) - jobs.RemoveJob(jobKey) - } - models.TaskDel(id) - models.TaskLogDelByTaskId(id) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxBatchAudit() { - idArr := self.GetStrings("ids") - ids := strings.Split(idArr[0], ",") - if len(ids) < 1 { - self.ajaxMsg("请选择要操作的任务", MSG_ERR) - } - for _, v := range ids { - id, _ := strconv.Atoi(v) - if id < 1 { - continue - } - changeStatus(id, 0, self.userId) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) AjaxBatchNoPass() { - idArr := self.GetStrings("ids") - ids := strings.Split(idArr[0], ",") - if len(ids) < 1 { - self.ajaxMsg("请选择要操作的任务", MSG_ERR) - } - for _, v := range ids { - id, _ := strconv.Atoi(v) - if id < 1 { - continue - } - changeStatus(id, 3, self.userId) - } - self.ajaxMsg("", MSG_OK) -} - -func changeStatus(taskId, status, userId int) bool { - - if taskId == 0 { - return false - } - task, _ := models.TaskGetById(taskId) - //修改 - task.Id = taskId - task.UpdateTime = time.Now().Unix() - task.UpdateId = userId - task.Status = status //0,1,2,3,9 - - if err := task.Update(); err != nil { - return false - } - return true -} - -func (self *TaskController) AjaxDel() { - id, _ := self.GetInt("id") - task, _ := models.TaskGetById(id) - - task.UpdateTime = time.Now().Unix() - task.UpdateId = self.userId - task.Status = -1 - task.Id = id - - //TODO 查询服务器是否用于定时任务 - if err := task.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("操作成功", MSG_OK) -} - -func (self *TaskController) AjaxNotifyType() { - notifyType, _ := self.GetInt("notify_type") - result, count, _ := models.NotifyTplGetByTplTypeList(notifyType) - - list := make([]map[string]interface{}, len(result)) - - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["tpl_name"] = v.TplName - row["tpl_type"] = v.TplType - list[k] = row - } - - self.ajaxList("成功", MSG_OK, count, list) -} - -func (self *TaskController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - groupId, _ := self.GetInt("group_id", 0) - - //0-全部,-1如果存在,n,如果不存在,0 - - //if groupId == -1 { - // groupId = 0 - // arr := strings.Split(self.Ctx.GetCookie("groupid"), "|") - // if len(arr) > 0 { - // groupId, _ = strconv.Atoi(arr[0]) - // } - //} - - //if groupId > 0 { - // self.Ctx.SetCookie("groupid", strconv.Itoa(groupId)+"|job") - //} - - status, _ := self.GetInt("status") - taskName := strings.TrimSpace(self.GetString("task_name")) - - StatusText := []string{ - "", - "", - "", - "", - } - - taskGroup := taskGroupLists(self.taskGroups, self.userId) - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - - if status == 2 { - //审核中,审核失败 - ids := []int{2, 3} - filters = append(filters, "status__in", ids) - } else { - ids := []int{0, 1} - filters = append(filters, "status__in", ids) - } - //搜索全部 - if groupId == 0 { - if self.userId != 1 { - groups := strings.Split(self.taskGroups, ",") - groupsIds := make([]int, 0) - for _, v := range groups { - id, _ := strconv.Atoi(v) - groupsIds = append(groupsIds, id) - } - filters = append(filters, "group_id__in", groupsIds) - } - } else if groupId > 0 { - filters = append(filters, "group_id", groupId) - } - if taskName != "" { - filters = append(filters, "task_name__icontains", taskName) - } - - result, count := models.TaskGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - - groupName := "默认分组" - - if name, ok := taskGroup[v.GroupId]; ok { - groupName = name - } - - row["group_name"] = groupName - row["task_name"] = StatusText[v.Status] + " " + groupName + "-" + " " + v.TaskName - row["description"] = v.Description - - //row["status_text"] = StatusText[v.Status] - row["status"] = v.Status - row["pre_time"] = beego.Date(time.Unix(v.PrevTime, 0), "Y-m-d H:i:s") - row["execute_times"] = v.ExecuteTimes - row["cron_spec"] = v.CronSpec - - TaskServerIdsArr := strings.Split(v.ServerIds, ",") - serverId := 0 - if len(TaskServerIdsArr) > 0 { - serverId, _ = strconv.Atoi(TaskServerIdsArr[0]) - } - jobskey := libs.JobKey(v.Id, serverId) - e := jobs.GetEntryById(jobskey) - - if e != nil { - row["next_time"] = beego.Date(e.Next, "Y-m-d H:i:s") - row["prev_time"] = "-" - if e.Prev.Unix() > 0 { - row["prev_time"] = beego.Date(e.Prev, "Y-m-d H:i:s") - } else if v.PrevTime > 0 { - row["prev_time"] = beego.Date(time.Unix(v.PrevTime, 0), "Y-m-d H:i:s") - } - row["running"] = 1 - } else { - row["next_time"] = "-" - if v.PrevTime > 0 { - row["prev_time"] = beego.Date(time.Unix(v.PrevTime, 0), "Y-m-d H:i:s") - } else { - row["prev_time"] = "-" - } - row["running"] = 0 - } - - list[k] = row - } - - self.ajaxList("成功", MSG_OK, count, list) -} - -func (self *TaskController) ApiTask() { - task_id, _ := self.GetInt("id") - if task_id == 0 { - task := new(models.Task) - task.CreateId, _ = self.GetInt("create_id") - task.GroupId, _ = self.GetInt("group_id") - task.TaskName = strings.TrimSpace(self.GetString("task_name")) - task.Description = strings.TrimSpace(self.GetString("description")) - task.Concurrent, _ = self.GetInt("concurrent") - task.ServerIds = strings.TrimSpace(self.GetString("server_ids")) - task.CronSpec = strings.TrimSpace(self.GetString("cron_spec")) - task.Command = strings.TrimSpace(self.GetString("command")) - task.Timeout, _ = self.GetInt("timeout") - task.IsNotify, _ = self.GetInt("is_notify") - task.NotifyType, _ = self.GetInt("notify_type") - task.NotifyTplId, _ = self.GetInt("notify_tpl_id") - task.NotifyUserIds = strings.TrimSpace(self.GetString("notify_user_ids")) - - if task.IsNotify == 1 && task.NotifyTplId <= 0 { - self.ajaxMsg("请选择通知模板", MSG_ERR) - } - - msg, isBan := checkCommand(task.Command) - if !isBan { - self.ajaxMsg("含有禁止命令:"+msg, MSG_ERR) - } - - task.CreateTime = time.Now().Unix() - task.UpdateTime = time.Now().Unix() - task.Status = 0 //接口不需要审核 - - if task.TaskName == "" || task.CronSpec == "" || task.Command == "" { - self.ajaxMsg("请填写完整信息", MSG_ERR) - } - var id int64 - var err error - if _, err = cron.Parse(task.CronSpec); err != nil { - self.ajaxMsg("cron表达式无效", MSG_ERR) - } - - if id, err = models.TaskAdd(task); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - task_id = int(id) - self.ajaxMsg(task_id, MSG_OK) - } - - task, _ := models.TaskGetById(task_id) - - if task.Status == 1 { - self.ajaxMsg("运行状态无法编辑任务,请先暂停任务", MSG_ERR) - } - //修改 - task.Id = task_id - task.UpdateTime = time.Now().Unix() - task.TaskName = strings.TrimSpace(self.GetString("task_name")) - task.Description = strings.TrimSpace(self.GetString("description")) - task.GroupId, _ = self.GetInt("group_id") - task.Concurrent, _ = self.GetInt("concurrent") - task.ServerIds = strings.TrimSpace(self.GetString("server_ids")) - task.CronSpec = strings.TrimSpace(self.GetString("cron_spec")) - task.Command = strings.TrimSpace(self.GetString("command")) - task.Timeout, _ = self.GetInt("timeout") - task.IsNotify, _ = self.GetInt("is_notify") - task.NotifyType, _ = self.GetInt("notify_type") - task.NotifyTplId, _ = self.GetInt("notify_tpl_id") - task.NotifyUserIds = strings.TrimSpace(self.GetString("notify_user_ids")) - task.UpdateId, _ = self.GetInt("update_id") - task.Status = 0 //接口不需要 - - if task.IsNotify == 1 && task.NotifyTplId <= 0 { - self.ajaxMsg("请选择通知模板", MSG_ERR) - } - - msg, isBan := checkCommand(task.Command) - if !isBan { - self.ajaxMsg("含有禁止命令:"+msg, MSG_ERR) - } - - if _, err := cron.Parse(task.CronSpec); err != nil { - self.ajaxMsg("cron表达式无效", MSG_ERR) - } - - if err := task.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg(task_id, MSG_OK) -} - -func (self *TaskController) ApiStart() { - taskId, _ := self.GetInt("id") - if taskId == 0 { - self.ajaxMsg("任务不存在", MSG_ERR) - } - - task, err := models.TaskGetById(taskId) - if err != nil { - self.ajaxMsg("查不到该任务", MSG_ERR) - } - - if task.Status != 0 { - self.ajaxMsg("任务状态有误", MSG_ERR) - } - - jobArr, err := jobs.NewJobFromTask(task) - if err != nil { - self.ajaxMsg("创建任务失败", MSG_ERR) - } - - for _, job := range jobArr { - if jobs.AddJob(task.CronSpec, job) { - task.Status = 1 - task.Update() - } - } - - self.ajaxMsg("", MSG_OK) -} - -func (self *TaskController) ApiPause() { - taskId, _ := self.GetInt("id") - if taskId == 0 { - self.ajaxMsg("任务不存在", MSG_ERR) - } - - task, err := models.TaskGetById(taskId) - if err != nil { - self.ajaxMsg("查不到该任务", MSG_ERR) - } - - //移出任务 - TaskServerIdsArr := strings.Split(task.ServerIds, ",") - - for _, server_id := range TaskServerIdsArr { - server_id_int, _ := strconv.Atoi(server_id) - jobKey := libs.JobKey(task.Id, server_id_int) - jobs.RemoveJob(jobKey) - } - - task.Status = 0 - task.Update() - self.ajaxMsg("", MSG_OK) - -} diff --git a/controllers/task_group.go b/controllers/task_group.go deleted file mode 100644 index b914df2c..00000000 --- a/controllers/task_group.go +++ /dev/null @@ -1,142 +0,0 @@ -/************************************************************ -** @Description: controllers -** @Author: haodaquan -** @Date: 2018-06-10 22:24 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-10 22:24 -*************************************************************/ -package controllers - -import ( - "strings" - "time" - - "fmt" - - "strconv" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/models" -) - -type GroupController struct { - BaseController -} - -func (self *GroupController) List() { - self.Data["pageTitle"] = "任务分组管理" - self.display() -} - -func (self *GroupController) Add() { - self.Data["pageTitle"] = "新增分组" - self.Data["hideTop"] = true - self.display() -} -func (self *GroupController) Edit() { - self.Data["pageTitle"] = "编辑分组" - self.Data["hideTop"] = true - id, _ := self.GetInt("id", 0) - group, _ := models.GroupGetById(id) - row := make(map[string]interface{}) - row["id"] = group.Id - row["group_name"] = group.GroupName - row["description"] = group.Description - self.Data["group"] = row - self.display() -} - -func (self *GroupController) AjaxSave() { - group := new(models.Group) - group.GroupName = strings.TrimSpace(self.GetString("group_name")) - group.Description = strings.TrimSpace(self.GetString("description")) - group.Status = 1 - - group_id, _ := self.GetInt("id") - - fmt.Println(group_id) - if group_id == 0 { - //新增 - group.CreateTime = time.Now().Unix() - group.UpdateTime = time.Now().Unix() - group.CreateId = self.userId - group.UpdateId = self.userId - if _, err := models.GroupAdd(group); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) - } - //修改 - group.Id = group_id - group.UpdateTime = time.Now().Unix() - group.UpdateId = self.userId - if err := group.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *GroupController) AjaxDel() { - - group_id, _ := self.GetInt("id") - group, _ := models.GroupGetById(group_id) - group.Status = 0 - group.Id = group_id - group.UpdateTime = time.Now().Unix() - //TODO 如果分组下有任务 不处理 - //filters := make([]interface{}, 0) - //filters = append(filters, "group_id", group_id) - //filters = append(filters, "status", 0) - //_, n := models.TaskServerGetList(1, 1, filters...) - //if n > 0 { - // self.ajaxMsg("分组下有服务器资源,请先处理", MSG_ERR) - //} - if err := group.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("", MSG_OK) -} - -func (self *GroupController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - groupName := strings.TrimSpace(self.GetString("groupName")) - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - filters = append(filters, "status", 1) - - if self.userId != 1 { - groups := strings.Split(self.taskGroups, ",") - - groupsIds := make([]int, 0) - for _, v := range groups { - id, _ := strconv.Atoi(v) - groupsIds = append(groupsIds, id) - } - filters = append(filters, "id__in", groupsIds) - } - if groupName != "" { - filters = append(filters, "group_name__contains", groupName) - } - result, count := models.GroupGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["group_name"] = v.GroupName - row["description"] = v.Description - row["create_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - row["update_time"] = beego.Date(time.Unix(v.UpdateTime, 0), "Y-m-d H:i:s") - list[k] = row - } - self.ajaxList("成功", MSG_OK, count, list) -} diff --git a/controllers/task_log.go b/controllers/task_log.go deleted file mode 100644 index db04cd8e..00000000 --- a/controllers/task_log.go +++ /dev/null @@ -1,252 +0,0 @@ -/************************************************************ -** @Description: controllers -** @Author: george hao -** @Date: 2018-07-05 16:43 -** @Last Modified by: george hao -** @Last Modified time: 2018-07-05 16:43 -*************************************************************/ -package controllers - -import ( - "fmt" - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" - "strconv" - - "strings" - "time" -) - -type TaskLogController struct { - BaseController -} - -func (self *TaskLogController) List() { - taskId, err := self.GetInt("task_id") - if err != nil { - taskId = 1 - } - - task, err := models.TaskGetById(taskId) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.Data["pageTitle"] = "日志管理 - " + task.TaskName + "(#" + strconv.Itoa(task.Id) + ")" - self.Data["task_id"] = task.Id - self.display() -} - -func (self *TaskLogController) Table() { - //列表 - page, err := self.GetInt("page") - if err != nil { - page = 1 - } - limit, err := self.GetInt("limit") - if err != nil { - limit = 30 - } - - self.pageSize = limit - //查询条件 - filters := make([]interface{}, 0) - taskId, err := self.GetInt("task_id") - if err != nil { - taskId = 1 - } - - TextStatus := []string{ - " 超时", - " 错误", - " 正常", - } - - Status, err := self.GetInt("status") - - if err == nil && Status != 9 { - filters = append(filters, "status", Status) - } - filters = append(filters, "task_id", taskId) - - result, count := models.TaskLogGetList(page, self.pageSize, filters...) - list := make([]map[string]interface{}, len(result)) - - for k, v := range result { - row := make(map[string]interface{}) - row["id"] = v.Id - row["task_id"] = libs.JobKey(v.TaskId, v.ServerId) - row["start_time"] = beego.Date(time.Unix(v.CreateTime, 0), "Y-m-d H:i:s") - row["process_time"] = float64(v.ProcessTime) / 1000 - - row["server_id"] = v.ServerId - row["server_name"] = v.ServerName + "#" + strconv.Itoa(v.ServerId) - if v.Status == 0 { - row["output_size"] = libs.SizeFormat(float64(len(v.Output))) - } else { - row["output_size"] = libs.SizeFormat(float64(len(v.Error))) - } - index := v.Status + 2 - if index > 2 { - index = 2 - } - row["status"] = TextStatus[index] - - list[k] = row - } - - self.ajaxList("成功", MSG_OK, count, list) -} - -func (self *TaskLogController) Detail() { - - //日志内容 - id, _ := self.GetInt("id") - tasklog, err := models.TaskLogGetById(id) - - fmt.Println(tasklog) - if err != nil { - self.Ctx.WriteString("日志不存在") - return - } - LogTextStatus := []string{ - "超时", - " 错误", - " 正常", - } - row := make(map[string]interface{}) - row["id"] = tasklog.Id - row["task_id"] = tasklog.TaskId - row["start_time"] = beego.Date(time.Unix(tasklog.CreateTime, 0), "Y-m-d H:i:s") - row["process_time"] = float64(tasklog.ProcessTime) / 1000 - if tasklog.Status == 0 { - row["output_size"] = libs.SizeFormat(float64(len(tasklog.Output))) - } else { - row["output_size"] = libs.SizeFormat(float64(len(tasklog.Error))) - } - - row["server_name"] = tasklog.ServerName - - row["output"] = tasklog.Output - row["error"] = tasklog.Error - - index := tasklog.Status + 2 - if index > 2 { - index = 2 - } - row["status"] = LogTextStatus[index] - - self.Data["taskLog"] = row - - //任务详情 - task, err := models.TaskGetById(tasklog.TaskId) - if err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - TextStatus := []string{ - " 暂停", - " 运行中", - " 待审核", - " 审核失败", - } - - self.Data["TextStatus"] = TextStatus[task.Status] - self.Data["CreateTime"] = beego.Date(time.Unix(task.CreateTime, 0), "Y-m-d H:i:s") - self.Data["UpdateTime"] = beego.Date(time.Unix(task.UpdateTime, 0), "Y-m-d H:i:s") - self.Data["task"] = task - // 分组列表 - self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId) - - serverName := "" - if task.ServerIds == "0" { - serverName = "本地服务器" - } else { - - serverIdSli := strings.Split(task.ServerIds, ",") - for _, v := range serverIdSli { - if v == "0" { - serverName = "本地服务器 " - } - } - servers, n := models.TaskServerGetByIds(task.ServerIds) - if n > 0 { - for _, server := range servers { - if server.Status != 0 { - serverName += server.ServerName + "【无效】 " - } else { - serverName += server.ServerName + " " - } - } - } else { - serverName = "服务器异常!! " - } - } - - self.Data["serverName"] = serverName - - //任务分组 - groupName := "默认分组" - if task.GroupId > 0 { - group, err := models.GroupGetById(task.GroupId) - if err == nil { - groupName = group.GroupName - } - } - self.Data["GroupName"] = groupName - - //创建人和修改人 - createName := "未知" - updateName := "未知" - if task.CreateId > 0 { - admin, err := models.AdminGetById(task.CreateId) - if err == nil { - createName = admin.RealName - } - } - - if task.UpdateId > 0 { - admin, err := models.AdminGetById(task.UpdateId) - if err == nil { - updateName = admin.RealName - } - } - - //是否出错通知 - self.Data["adminInfo"] = []int{0} - if task.NotifyUserIds != "0" && task.NotifyUserIds != "" { - self.Data["adminInfo"] = AllAdminInfo(task.NotifyUserIds) - } - self.Data["CreateName"] = createName - self.Data["UpdateName"] = updateName - self.Data["pageTitle"] = "日志详细" + "(#" + strconv.Itoa(id) + ")" - - self.Data["NotifyTplName"] = "未知" - if task.IsNotify == 1 { - notifyTpl, err := models.NotifyTplGetById(task.NotifyTplId) - if err == nil { - self.Data["NotifyTplName"] = notifyTpl.TplName - } - } - - self.display() -} - -// 批量操作日志 -func (self *TaskLogController) AjaxDel() { - ids := self.GetStrings("ids") - idArr := strings.Split(ids[0], ",") - - if len(idArr) < 1 { - self.ajaxMsg("请选择要操作的项目", MSG_ERR) - } - - for _, v := range idArr { - id, _ := strconv.Atoi(v) - if id < 1 { - continue - } - models.TaskLogDelById(id) - } - - self.ajaxMsg("", MSG_OK) -} diff --git a/controllers/user.go b/controllers/user.go deleted file mode 100644 index d1a3a535..00000000 --- a/controllers/user.go +++ /dev/null @@ -1,82 +0,0 @@ -/********************************************** -** @Des: 用户 -** @Author: haodaquan -** @Date: 2017-09-16 14:17:37 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:14:07 -***********************************************/ -package controllers - -import ( - "strings" - "time" - - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" -) - -type UserController struct { - BaseController -} - -func (self *UserController) Edit() { - self.Data["pageTitle"] = "资料修改" - id := self.userId - Admin, _ := models.AdminGetById(id) - row := make(map[string]interface{}) - row["id"] = Admin.Id - row["login_name"] = Admin.LoginName - row["real_name"] = Admin.RealName - row["phone"] = Admin.Phone - row["email"] = Admin.Email - row["dingtalk"] = Admin.Dingtalk - row["wechat"] = Admin.Wechat - self.Data["admin"] = row - self.display() -} - -func (self *UserController) AjaxSave() { - Admin_id, _ := self.GetInt("id") - Admin, _ := models.AdminGetById(Admin_id) - //修改 - Admin.Id = Admin_id - Admin.UpdateTime = time.Now().Unix() - Admin.UpdateId = self.userId - Admin.LoginName = strings.TrimSpace(self.GetString("login_name")) - Admin.RealName = strings.TrimSpace(self.GetString("real_name")) - Admin.Phone = strings.TrimSpace(self.GetString("phone")) - Admin.Email = strings.TrimSpace(self.GetString("email")) - Admin.Dingtalk = strings.TrimSpace(self.GetString("dingtalk")) - Admin.Wechat = strings.TrimSpace(self.GetString("wechat")) - - resetPwd := self.GetString("reset_pwd") - if resetPwd == "1" { - pwdOld := strings.TrimSpace(self.GetString("password_old")) - pwdOldMd5 := libs.Md5([]byte(pwdOld + Admin.Salt)) - if Admin.Password != pwdOldMd5 { - self.ajaxMsg("旧密码错误", MSG_ERR) - } - - pwdNew1 := strings.TrimSpace(self.GetString("password_new1")) - pwdNew2 := strings.TrimSpace(self.GetString("password_new2")) - - if len(pwdNew1) < 6 { - self.ajaxMsg("密码长度需要六位以上", MSG_ERR) - } - if pwdNew1 != pwdNew2 { - self.ajaxMsg("两次密码不一致", MSG_ERR) - } - - pwd, salt := libs.Password(4, pwdNew1) - Admin.Password = pwd - Admin.Salt = salt - } - Admin.UpdateTime = time.Now().Unix() - Admin.UpdateId = self.userId - Admin.Status = 1 - - if err := Admin.Update(); err != nil { - self.ajaxMsg(err.Error(), MSG_ERR) - } - self.ajaxMsg("修改成功", MSG_OK) -} diff --git a/crons/LICENSE b/crons/LICENSE deleted file mode 100644 index 3a0f627f..00000000 --- a/crons/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (C) 2012 Rob Figueiredo -All Rights Reserved. - -MIT LICENSE - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/crons/README.md b/crons/README.md deleted file mode 100644 index 157ed082..00000000 --- a/crons/README.md +++ /dev/null @@ -1,2 +0,0 @@ -[![GoDoc](http://godoc.org/github.com/robfig/cron?status.png)](http://godoc.org/github.com/robfig/cron) -[![Build Status](https://travis-ci.org/robfig/cron.svg?branch=master)](https://travis-ci.org/robfig/cron) diff --git a/crons/constantdelay.go b/crons/constantdelay.go deleted file mode 100644 index cd6e7b1b..00000000 --- a/crons/constantdelay.go +++ /dev/null @@ -1,27 +0,0 @@ -package cron - -import "time" - -// ConstantDelaySchedule represents a simple recurring duty cycle, e.g. "Every 5 minutes". -// It does not support jobs more frequent than once a second. -type ConstantDelaySchedule struct { - Delay time.Duration -} - -// Every returns a crontab Schedule that activates once every duration. -// Delays of less than a second are not supported (will round up to 1 second). -// Any fields less than a Second are truncated. -func Every(duration time.Duration) ConstantDelaySchedule { - if duration < time.Second { - duration = time.Second - } - return ConstantDelaySchedule{ - Delay: duration - time.Duration(duration.Nanoseconds())%time.Second, - } -} - -// Next returns the next time this should be run. -// This rounds so that the next activation time will be on the second. -func (schedule ConstantDelaySchedule) Next(t time.Time) time.Time { - return t.Add(schedule.Delay - time.Duration(t.Nanosecond())*time.Nanosecond) -} diff --git a/crons/constantdelay_test.go b/crons/constantdelay_test.go deleted file mode 100644 index f43a58ad..00000000 --- a/crons/constantdelay_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package cron - -import ( - "testing" - "time" -) - -func TestConstantDelayNext(t *testing.T) { - tests := []struct { - time string - delay time.Duration - expected string - }{ - // Simple cases - {"Mon Jul 9 14:45 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"}, - {"Mon Jul 9 14:59 2012", 15 * time.Minute, "Mon Jul 9 15:14 2012"}, - {"Mon Jul 9 14:59:59 2012", 15 * time.Minute, "Mon Jul 9 15:14:59 2012"}, - - // Wrap around hours - {"Mon Jul 9 15:45 2012", 35 * time.Minute, "Mon Jul 9 16:20 2012"}, - - // Wrap around days - {"Mon Jul 9 23:46 2012", 14 * time.Minute, "Tue Jul 10 00:00 2012"}, - {"Mon Jul 9 23:45 2012", 35 * time.Minute, "Tue Jul 10 00:20 2012"}, - {"Mon Jul 9 23:35:51 2012", 44*time.Minute + 24*time.Second, "Tue Jul 10 00:20:15 2012"}, - {"Mon Jul 9 23:35:51 2012", 25*time.Hour + 44*time.Minute + 24*time.Second, "Thu Jul 11 01:20:15 2012"}, - - // Wrap around months - {"Mon Jul 9 23:35 2012", 91*24*time.Hour + 25*time.Minute, "Thu Oct 9 00:00 2012"}, - - // Wrap around minute, hour, day, month, and year - {"Mon Dec 31 23:59:45 2012", 15 * time.Second, "Tue Jan 1 00:00:00 2013"}, - - // Round to nearest second on the delay - {"Mon Jul 9 14:45 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"}, - - // Round up to 1 second if the duration is less. - {"Mon Jul 9 14:45:00 2012", 15 * time.Millisecond, "Mon Jul 9 14:45:01 2012"}, - - // Round to nearest second when calculating the next time. - {"Mon Jul 9 14:45:00.005 2012", 15 * time.Minute, "Mon Jul 9 15:00 2012"}, - - // Round to nearest second for both. - {"Mon Jul 9 14:45:00.005 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"}, - } - - for _, c := range tests { - actual := Every(c.delay).Next(getTime(c.time)) - expected := getTime(c.expected) - if actual != expected { - t.Errorf("%s, \"%s\": (expected) %v != %v (actual)", c.time, c.delay, expected, actual) - } - } -} diff --git a/crons/cron.go b/crons/cron.go deleted file mode 100644 index c5cb0657..00000000 --- a/crons/cron.go +++ /dev/null @@ -1,222 +0,0 @@ -// This library implements a cron spec parser and runner. See the README for -// more details. -package cron - -import ( - "sort" - "time" -) - -// 删除job的检查函数,返回true则删除 -type RemoveCheckFunc func(e *Entry) bool - -// Cron keeps track of any number of entries, invoking the associated func as -// specified by the schedule. It may be started, stopped, and the entries may -// be inspected while running. -// Cron保持任意数量的条目的轨道,调用相关的func时间表指定。它可以被启动,停止和条目,可运行的同时进行检查。 -type Cron struct { - entries []*Entry //任务 - stop chan struct{} //停止的通道 - add chan *Entry //添加新任务的方式 - remove chan RemoveCheckFunc - snapshot chan []*Entry //请求获取任务快照的方式 - running bool -} - -// Job is an interface for submitted cron jobs. -type Job interface { - Run() -} - -// The Schedule describes a job's duty cycle. -type Schedule interface { - // Return the next activation time, later than the given time. - // Next is invoked initially, and then each time the job is run. - Next(time.Time) time.Time -} - -// Entry consists of a schedule and the func to execute on that schedule. -type Entry struct { - // The schedule on which this job should be run. - Schedule Schedule - - // The next time the job will run. This is the zero time if Cron has not been - // started or this entry's schedule is unsatisfiable - Next time.Time - - // The last time this job was run. This is the zero time if the job has never - // been run. - Prev time.Time - - // The Job to run. - Job Job -} - -// byTime is a wrapper for sorting the entry array by time -// (with zero time at the end). -type byTime []*Entry - -func (s byTime) Len() int { return len(s) } -func (s byTime) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byTime) Less(i, j int) bool { - // Two zero times should return false. - // Otherwise, zero is "greater" than any other time. - // (To sort it at the end of the list.) - if s[i].Next.IsZero() { - return false - } - if s[j].Next.IsZero() { - return true - } - return s[i].Next.Before(s[j].Next) -} - -// New returns a new Cron job runner. -func New() *Cron { - return &Cron{ - entries: nil, - add: make(chan *Entry), - remove: make(chan RemoveCheckFunc), - stop: make(chan struct{}), - snapshot: make(chan []*Entry), - running: false, - } -} - -// A wrapper that turns a func() into a cron.Job -type FuncJob func() - -func (f FuncJob) Run() { f() } - -// AddFunc adds a func to the Cron to be run on the given schedule. -func (c *Cron) AddFunc(spec string, cmd func()) error { - return c.AddJob(spec, FuncJob(cmd)) -} - -// AddFunc adds a Job to the Cron to be run on the given schedule. -func (c *Cron) AddJob(spec string, cmd Job) error { - schedule, err := Parse(spec) - if err != nil { - return err - } - c.Schedule(schedule, cmd) - return nil -} - -func (c *Cron) RemoveJob(cb RemoveCheckFunc) { - c.remove <- cb -} - -// Schedule adds a Job to the Cron to be run on the given schedule. -func (c *Cron) Schedule(schedule Schedule, cmd Job) { - entry := &Entry{ - Schedule: schedule, - Job: cmd, - } - if !c.running { - c.entries = append(c.entries, entry) - return - } - - c.add <- entry -} - -// Entries returns a snapshot of the cron entries. -func (c *Cron) Entries() []*Entry { - if c.running { - c.snapshot <- nil - x := <-c.snapshot - return x - } - return c.entrySnapshot() -} - -// Start the cron scheduler in its own go-routine. -func (c *Cron) Start() { - c.running = true - - go c.run() -} - -// Run the scheduler.. this is private just due to the need to synchronize -// access to the 'running' state variable. -func (c *Cron) run() { - // Figure out the next activation times for each entry. - now := time.Now().Local() - for _, entry := range c.entries { - entry.Next = entry.Schedule.Next(now) - } - - for { - // Determine the next entry to run. - sort.Sort(byTime(c.entries)) - - var effective time.Time - if len(c.entries) == 0 || c.entries[0].Next.IsZero() { - // If there are no entries yet, just sleep - it still handles new entries - // and stop requests. - effective = now.AddDate(10, 0, 0) - } else { - effective = c.entries[0].Next - } - - select { - case now = <-time.After(effective.Sub(now)): - // Run every entry whose next time was this effective time. - for _, e := range c.entries { - if e.Next != effective { - break - } - go e.Job.Run() - e.Prev = e.Next - e.Next = e.Schedule.Next(effective) - } - continue - - case newEntry := <-c.add: - c.entries = append(c.entries, newEntry) - newEntry.Next = newEntry.Schedule.Next(now) - - case cb := <-c.remove: - newEntries := make([]*Entry, 0) - for _, e := range c.entries { - if !cb(e) { - newEntries = append(newEntries, e) - } - } - c.entries = newEntries - - case <-c.snapshot: - c.snapshot <- c.entrySnapshot() - - case <-c.stop: - return - } - - // 'now' should be updated after newEntry and snapshot cases. - now = time.Now().Local() - } -} - -// Stop stops the cron scheduler if it is running; otherwise it does nothing. -func (c *Cron) Stop() { - if !c.running { - return - } - c.stop <- struct{}{} - c.running = false -} - -// entrySnapshot returns a copy of the current cron entry list. -func (c *Cron) entrySnapshot() []*Entry { - entries := []*Entry{} - for _, e := range c.entries { - entries = append(entries, &Entry{ - Schedule: e.Schedule, - Next: e.Next, - Prev: e.Prev, - Job: e.Job, - }) - } - return entries -} diff --git a/crons/cron_test.go b/crons/cron_test.go deleted file mode 100644 index 78ac3cd8..00000000 --- a/crons/cron_test.go +++ /dev/null @@ -1,262 +0,0 @@ -package cron - -import ( - "fmt" - "sync" - "testing" - "time" -) - -// Many tests schedule a job for every second, and then wait at most a second -// for it to run. This amount is just slightly larger than 1 second to -// compensate for a few milliseconds of runtime. -const ONE_SECOND = 1*time.Second + 10*time.Millisecond - -// Start and stop cron with no entries. -func TestNoEntries(t *testing.T) { - cron := New() - cron.Start() - - select { - case <-time.After(ONE_SECOND): - t.FailNow() - case <-stop(cron): - } -} - -// Start, stop, then add an entry. Verify entry doesn't run. -func TestStopCausesJobsToNotRun(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(1) - - cron := New() - cron.Start() - cron.Stop() - cron.AddFunc("* * * * * ?", func() { wg.Done() }) - - select { - case <-time.After(ONE_SECOND): - // No job ran! - case <-wait(wg): - t.FailNow() - } -} - -// Add a job, start cron, expect it runs. -func TestAddBeforeRunning(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(1) - - cron := New() - cron.AddFunc("* * * * * ?", func() { wg.Done() }) - cron.Start() - defer cron.Stop() - - // Give cron 2 seconds to run our job (which is always activated). - select { - case <-time.After(ONE_SECOND): - t.FailNow() - case <-wait(wg): - } -} - -// Start cron, add a job, expect it runs. -func TestAddWhileRunning(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(1) - - cron := New() - cron.Start() - defer cron.Stop() - cron.AddFunc("* * * * * ?", func() { wg.Done() }) - - select { - case <-time.After(ONE_SECOND): - t.FailNow() - case <-wait(wg): - } -} - -// Test timing with Entries. -func TestSnapshotEntries(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(1) - - cron := New() - cron.AddFunc("@every 2s", func() { wg.Done() }) - cron.Start() - defer cron.Stop() - - // Cron should fire in 2 seconds. After 1 second, call Entries. - select { - case <-time.After(ONE_SECOND): - cron.Entries() - } - - // Even though Entries was called, the cron should fire at the 2 second mark. - select { - case <-time.After(ONE_SECOND): - t.FailNow() - case <-wait(wg): - } - -} - -// Test that the entries are correctly sorted. -// Add a bunch of long-in-the-future entries, and an immediate entry, and ensure -// that the immediate entry runs immediately. -// Also: Test that multiple jobs run in the same instant. -func TestMultipleEntries(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(2) - - cron := New() - cron.AddFunc("0 0 0 1 1 ?", func() {}) - cron.AddFunc("* * * * * ?", func() { wg.Done() }) - cron.AddFunc("0 0 0 31 12 ?", func() {}) - cron.AddFunc("* * * * * ?", func() { wg.Done() }) - - cron.Start() - defer cron.Stop() - - select { - case <-time.After(ONE_SECOND): - t.FailNow() - case <-wait(wg): - } -} - -// Test running the same job twice. -func TestRunningJobTwice(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(2) - - cron := New() - cron.AddFunc("0 0 0 1 1 ?", func() {}) - cron.AddFunc("0 0 0 31 12 ?", func() {}) - cron.AddFunc("* * * * * ?", func() { wg.Done() }) - - cron.Start() - defer cron.Stop() - - select { - case <-time.After(2 * ONE_SECOND): - t.FailNow() - case <-wait(wg): - } -} - -func TestRunningMultipleSchedules(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(2) - - cron := New() - cron.AddFunc("0 0 0 1 1 ?", func() {}) - cron.AddFunc("0 0 0 31 12 ?", func() {}) - cron.AddFunc("* * * * * ?", func() { wg.Done() }) - cron.Schedule(Every(time.Minute), FuncJob(func() {})) - cron.Schedule(Every(time.Second), FuncJob(func() { wg.Done() })) - cron.Schedule(Every(time.Hour), FuncJob(func() {})) - - cron.Start() - defer cron.Stop() - - select { - case <-time.After(2 * ONE_SECOND): - t.FailNow() - case <-wait(wg): - } -} - -// Test that the cron is run in the local time zone (as opposed to UTC). -func TestLocalTimezone(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(1) - - now := time.Now().Local() - spec := fmt.Sprintf("%d %d %d %d %d ?", - now.Second()+1, now.Minute(), now.Hour(), now.Day(), now.Month()) - - cron := New() - cron.AddFunc(spec, func() { wg.Done() }) - cron.Start() - defer cron.Stop() - - select { - case <-time.After(ONE_SECOND): - t.FailNow() - case <-wait(wg): - } -} - -// Test that calling stop before start silently returns without -// blocking the stop channel. -func TestStopWithoutStart(t *testing.T) { - cron := New() - cron.Stop() -} - -type testJob struct { - wg *sync.WaitGroup - name string -} - -func (t testJob) Run() { - t.wg.Done() -} - -// Simple test using Runnables. -func TestJob(t *testing.T) { - wg := &sync.WaitGroup{} - wg.Add(1) - - cron := New() - cron.AddJob("0 0 0 30 Feb ?", testJob{wg, "job0"}) - cron.AddJob("0 0 0 1 1 ?", testJob{wg, "job1"}) - cron.AddJob("* * * * * ?", testJob{wg, "job2"}) - cron.AddJob("1 0 0 1 1 ?", testJob{wg, "job3"}) - cron.Schedule(Every(5*time.Second+5*time.Nanosecond), testJob{wg, "job4"}) - cron.Schedule(Every(5*time.Minute), testJob{wg, "job5"}) - - cron.Start() - defer cron.Stop() - - select { - case <-time.After(ONE_SECOND): - t.FailNow() - case <-wait(wg): - } - - // Ensure the entries are in the right order. - expecteds := []string{"job2", "job4", "job5", "job1", "job3", "job0"} - - var actuals []string - for _, entry := range cron.Entries() { - actuals = append(actuals, entry.Job.(testJob).name) - } - - for i, expected := range expecteds { - if actuals[i] != expected { - t.Errorf("Jobs not in the right order. (expected) %s != %s (actual)", expecteds, actuals) - t.FailNow() - } - } -} - -func wait(wg *sync.WaitGroup) chan bool { - ch := make(chan bool) - go func() { - wg.Wait() - ch <- true - }() - return ch -} - -func stop(cron *Cron) chan bool { - ch := make(chan bool) - go func() { - cron.Stop() - ch <- true - }() - return ch -} diff --git a/crons/doc.go b/crons/doc.go deleted file mode 100644 index dbdf5012..00000000 --- a/crons/doc.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Package cron implements a cron spec parser and job runner. - -Usage - -Callers may register Funcs to be invoked on a given schedule. Cron will run -them in their own goroutines. - - c := cron.New() - c.AddFunc("0 30 * * * *", func() { fmt.Println("Every hour on the half hour") }) - c.AddFunc("@hourly", func() { fmt.Println("Every hour") }) - c.AddFunc("@every 1h30m", func() { fmt.Println("Every hour thirty") }) - c.Start() - .. - // Funcs are invoked in their own goroutine, asynchronously. - ... - // Funcs may also be added to a running Cron - c.AddFunc("@daily", func() { fmt.Println("Every day") }) - .. - // Inspect the cron job entries' next and previous run times. - inspect(c.Entries()) - .. - c.Stop() // Stop the scheduler (does not stop any jobs already running). - -CRON Expression Format - -A cron expression represents a set of times, using 6 space-separated fields. - - Field name | Mandatory? | Allowed values | Allowed special characters - ---------- | ---------- | -------------- | -------------------------- - Seconds | Yes | 0-59 | * / , - - Minutes | Yes | 0-59 | * / , - - Hours | Yes | 0-23 | * / , - - Day of month | Yes | 1-31 | * / , - ? - Month | Yes | 1-12 or JAN-DEC | * / , - - Day of week | Yes | 0-6 or SUN-SAT | * / , - ? - -Note: Month and Day-of-week field values are case insensitive. "SUN", "Sun", -and "sun" are equally accepted. - -Special Characters - -Asterisk ( * ) - -The asterisk indicates that the cron expression will match for all values of the -field; e.g., using an asterisk in the 5th field (month) would indicate every -month. - -Slash ( / ) - -Slashes are used to describe increments of ranges. For example 3-59/15 in the -1st field (minutes) would indicate the 3rd minute of the hour and every 15 -minutes thereafter. The form "*\/..." is equivalent to the form "first-last/...", -that is, an increment over the largest possible range of the field. The form -"N/..." is accepted as meaning "N-MAX/...", that is, starting at N, use the -increment until the end of that specific range. It does not wrap around. - -Comma ( , ) - -Commas are used to separate items of a list. For example, using "MON,WED,FRI" in -the 5th field (day of week) would mean Mondays, Wednesdays and Fridays. - -Hyphen ( - ) - -Hyphens are used to define ranges. For example, 9-17 would indicate every -hour between 9am and 5pm inclusive. - -Question mark ( ? ) - -Question mark may be used instead of '*' for leaving either day-of-month or -day-of-week blank. - -Predefined schedules - -You may use one of several pre-defined schedules in place of a cron expression. - - Entry | Description | Equivalent To - ----- | ----------- | ------------- - @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 * - @monthly | Run once a month, midnight, first of month | 0 0 0 1 * * - @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0 - @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * * - @hourly | Run once an hour, beginning of hour | 0 0 * * * * - -Intervals - -You may also schedule a job to execute at fixed intervals. This is supported by -formatting the cron spec like this: - - @every - -where "duration" is a string accepted by time.ParseDuration -(http://golang.org/pkg/time/#ParseDuration). - -For example, "@every 1h30m10s" would indicate a schedule that activates every -1 hour, 30 minutes, 10 seconds. - -Note: The interval does not take the job runtime into account. For example, -if a job takes 3 minutes to run, and it is scheduled to run every 5 minutes, -it will have only 2 minutes of idle time between each run. - -Time zones - -All interpretation and scheduling is done in the machine's local time zone (as -provided by the Go time package (http://www.golang.org/pkg/time). - -Be aware that jobs scheduled during daylight-savings leap-ahead transitions will -not be run! - -Thread safety - -Since the Cron service runs concurrently with the calling code, some amount of -care must be taken to ensure proper synchronization. - -All cron methods are designed to be correctly synchronized as long as the caller -ensures that invocations have a clear happens-before ordering between them. - -Implementation - -Cron entries are stored in an array, sorted by their next activation time. Cron -sleeps until the next job is due to be run. - -Upon waking: - - it runs each entry that is active on that second - - it calculates the next run times for the jobs that were run - - it re-sorts the array of entries by next activation time. - - it goes to sleep until the soonest job. -*/ -package cron diff --git a/crons/parser.go b/crons/parser.go deleted file mode 100644 index 4224fa93..00000000 --- a/crons/parser.go +++ /dev/null @@ -1,231 +0,0 @@ -package cron - -import ( - "fmt" - "log" - "math" - "strconv" - "strings" - "time" -) - -// Parse returns a new crontab schedule representing the given spec. -// It returns a descriptive error if the spec is not valid. -// -// It accepts -// - Full crontab specs, e.g. "* * * * * ?" -// - Descriptors, e.g. "@midnight", "@every 1h30m" -func Parse(spec string) (_ Schedule, err error) { - // Convert panics into errors - defer func() { - if recovered := recover(); recovered != nil { - err = fmt.Errorf("%v", recovered) - } - }() - - if spec[0] == '@' { - return parseDescriptor(spec), nil - } - - // Split on whitespace. We require 5 or 6 fields. - // (second) (minute) (hour) (day of month) (month) (day of week, optional) - fields := strings.Fields(spec) - if len(fields) != 5 && len(fields) != 6 { - log.Panicf("Expected 5 or 6 fields, found %d: %s", len(fields), spec) - } - - // If a sixth field is not provided (DayOfWeek), then it is equivalent to star. - if len(fields) == 5 { - fields = append(fields, "*") - } - - schedule := &SpecSchedule{ - Second: getField(fields[0], seconds), - Minute: getField(fields[1], minutes), - Hour: getField(fields[2], hours), - Dom: getField(fields[3], dom), - Month: getField(fields[4], months), - Dow: getField(fields[5], dow), - } - - return schedule, nil -} - -// getField returns an Int with the bits set representing all of the times that -// the field represents. A "field" is a comma-separated list of "ranges". -func getField(field string, r bounds) uint64 { - // list = range {"," range} - var bits uint64 - ranges := strings.FieldsFunc(field, func(r rune) bool { return r == ',' }) - for _, expr := range ranges { - bits |= getRange(expr, r) - } - return bits -} - -// getRange returns the bits indicated by the given expression: -// number | number "-" number [ "/" number ] -func getRange(expr string, r bounds) uint64 { - - var ( - start, end, step uint - rangeAndStep = strings.Split(expr, "/") - lowAndHigh = strings.Split(rangeAndStep[0], "-") - singleDigit = len(lowAndHigh) == 1 - ) - - var extra_star uint64 - if lowAndHigh[0] == "*" || lowAndHigh[0] == "?" { - start = r.min - end = r.max - extra_star = starBit - } else { - start = parseIntOrName(lowAndHigh[0], r.names) - switch len(lowAndHigh) { - case 1: - end = start - case 2: - end = parseIntOrName(lowAndHigh[1], r.names) - default: - log.Panicf("Too many hyphens: %s", expr) - } - } - - switch len(rangeAndStep) { - case 1: - step = 1 - case 2: - step = mustParseInt(rangeAndStep[1]) - - // Special handling: "N/step" means "N-max/step". - if singleDigit { - end = r.max - } - default: - log.Panicf("Too many slashes: %s", expr) - } - - if start < r.min { - log.Panicf("Beginning of range (%d) below minimum (%d): %s", start, r.min, expr) - } - if end > r.max { - log.Panicf("End of range (%d) above maximum (%d): %s", end, r.max, expr) - } - if start > end { - log.Panicf("Beginning of range (%d) beyond end of range (%d): %s", start, end, expr) - } - - return getBits(start, end, step) | extra_star -} - -// parseIntOrName returns the (possibly-named) integer contained in expr. -func parseIntOrName(expr string, names map[string]uint) uint { - if names != nil { - if namedInt, ok := names[strings.ToLower(expr)]; ok { - return namedInt - } - } - return mustParseInt(expr) -} - -// mustParseInt parses the given expression as an int or panics. -func mustParseInt(expr string) uint { - num, err := strconv.Atoi(expr) - if err != nil { - log.Panicf("Failed to parse int from %s: %s", expr, err) - } - if num < 0 { - log.Panicf("Negative number (%d) not allowed: %s", num, expr) - } - - return uint(num) -} - -// getBits sets all bits in the range [min, max], modulo the given step size. -func getBits(min, max, step uint) uint64 { - var bits uint64 - - // If step is 1, use shifts. - if step == 1 { - return ^(math.MaxUint64 << (max + 1)) & (math.MaxUint64 << min) - } - - // Else, use a simple loop. - for i := min; i <= max; i += step { - bits |= 1 << i - } - return bits -} - -// all returns all bits within the given bounds. (plus the star bit) -func all(r bounds) uint64 { - return getBits(r.min, r.max, 1) | starBit -} - -// parseDescriptor returns a pre-defined schedule for the expression, or panics -// if none matches. -func parseDescriptor(spec string) Schedule { - switch spec { - case "@yearly", "@annually": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: 1 << dom.min, - Month: 1 << months.min, - Dow: all(dow), - } - - case "@monthly": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: 1 << dom.min, - Month: all(months), - Dow: all(dow), - } - - case "@weekly": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: all(dom), - Month: all(months), - Dow: 1 << dow.min, - } - - case "@daily", "@midnight": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: all(dom), - Month: all(months), - Dow: all(dow), - } - - case "@hourly": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: all(hours), - Dom: all(dom), - Month: all(months), - Dow: all(dow), - } - } - - const every = "@every " - if strings.HasPrefix(spec, every) { - duration, err := time.ParseDuration(spec[len(every):]) - if err != nil { - log.Panicf("Failed to parse duration %s: %s", spec, err) - } - return Every(duration) - } - - log.Panicf("Unrecognized descriptor: %s", spec) - return nil -} diff --git a/crons/parser_test.go b/crons/parser_test.go deleted file mode 100644 index 9050cf78..00000000 --- a/crons/parser_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package cron - -import ( - "reflect" - "testing" - "time" -) - -func TestRange(t *testing.T) { - ranges := []struct { - expr string - min, max uint - expected uint64 - }{ - {"5", 0, 7, 1 << 5}, - {"0", 0, 7, 1 << 0}, - {"7", 0, 7, 1 << 7}, - - {"5-5", 0, 7, 1 << 5}, - {"5-6", 0, 7, 1<<5 | 1<<6}, - {"5-7", 0, 7, 1<<5 | 1<<6 | 1<<7}, - - {"5-6/2", 0, 7, 1 << 5}, - {"5-7/2", 0, 7, 1<<5 | 1<<7}, - {"5-7/1", 0, 7, 1<<5 | 1<<6 | 1<<7}, - - {"*", 1, 3, 1<<1 | 1<<2 | 1<<3 | starBit}, - {"*/2", 1, 3, 1<<1 | 1<<3 | starBit}, - } - - for _, c := range ranges { - actual := getRange(c.expr, bounds{c.min, c.max, nil}) - if actual != c.expected { - t.Errorf("%s => (expected) %d != %d (actual)", c.expr, c.expected, actual) - } - } -} - -func TestField(t *testing.T) { - fields := []struct { - expr string - min, max uint - expected uint64 - }{ - {"5", 1, 7, 1 << 5}, - {"5,6", 1, 7, 1<<5 | 1<<6}, - {"5,6,7", 1, 7, 1<<5 | 1<<6 | 1<<7}, - {"1,5-7/2,3", 1, 7, 1<<1 | 1<<5 | 1<<7 | 1<<3}, - } - - for _, c := range fields { - actual := getField(c.expr, bounds{c.min, c.max, nil}) - if actual != c.expected { - t.Errorf("%s => (expected) %d != %d (actual)", c.expr, c.expected, actual) - } - } -} - -func TestBits(t *testing.T) { - allBits := []struct { - r bounds - expected uint64 - }{ - {minutes, 0xfffffffffffffff}, // 0-59: 60 ones - {hours, 0xffffff}, // 0-23: 24 ones - {dom, 0xfffffffe}, // 1-31: 31 ones, 1 zero - {months, 0x1ffe}, // 1-12: 12 ones, 1 zero - {dow, 0x7f}, // 0-6: 7 ones - } - - for _, c := range allBits { - actual := all(c.r) // all() adds the starBit, so compensate for that.. - if c.expected|starBit != actual { - t.Errorf("%d-%d/%d => (expected) %b != %b (actual)", - c.r.min, c.r.max, 1, c.expected|starBit, actual) - } - } - - bits := []struct { - min, max, step uint - expected uint64 - }{ - - {0, 0, 1, 0x1}, - {1, 1, 1, 0x2}, - {1, 5, 2, 0x2a}, // 101010 - {1, 4, 2, 0xa}, // 1010 - } - - for _, c := range bits { - actual := getBits(c.min, c.max, c.step) - if c.expected != actual { - t.Errorf("%d-%d/%d => (expected) %b != %b (actual)", - c.min, c.max, c.step, c.expected, actual) - } - } -} - -func TestSpecSchedule(t *testing.T) { - entries := []struct { - expr string - expected Schedule - }{ - {"* 5 * * * *", &SpecSchedule{all(seconds), 1 << 5, all(hours), all(dom), all(months), all(dow)}}, - {"@every 5m", ConstantDelaySchedule{time.Duration(5) * time.Minute}}, - } - - for _, c := range entries { - actual, err := Parse(c.expr) - if err != nil { - t.Error(err) - } - if !reflect.DeepEqual(actual, c.expected) { - t.Errorf("%s => (expected) %b != %b (actual)", c.expr, c.expected, actual) - } - } -} diff --git a/crons/spec.go b/crons/spec.go deleted file mode 100644 index afa5ac86..00000000 --- a/crons/spec.go +++ /dev/null @@ -1,159 +0,0 @@ -package cron - -import "time" - -// SpecSchedule specifies a duty cycle (to the second granularity), based on a -// traditional crontab specification. It is computed initially and stored as bit sets. -type SpecSchedule struct { - Second, Minute, Hour, Dom, Month, Dow uint64 -} - -// bounds provides a range of acceptable values (plus a map of name to value). -type bounds struct { - min, max uint - names map[string]uint -} - -// The bounds for each field. -var ( - seconds = bounds{0, 59, nil} - minutes = bounds{0, 59, nil} - hours = bounds{0, 23, nil} - dom = bounds{1, 31, nil} - months = bounds{1, 12, map[string]uint{ - "jan": 1, - "feb": 2, - "mar": 3, - "apr": 4, - "may": 5, - "jun": 6, - "jul": 7, - "aug": 8, - "sep": 9, - "oct": 10, - "nov": 11, - "dec": 12, - }} - dow = bounds{0, 6, map[string]uint{ - "sun": 0, - "mon": 1, - "tue": 2, - "wed": 3, - "thu": 4, - "fri": 5, - "sat": 6, - }} -) - -const ( - // Set the top bit if a star was included in the expression. - starBit = 1 << 63 -) - -// Next returns the next time this schedule is activated, greater than the given -// time. If no time can be found to satisfy the schedule, return the zero time. -func (s *SpecSchedule) Next(t time.Time) time.Time { - // General approach: - // For Month, Day, Hour, Minute, Second: - // Check if the time value matches. If yes, continue to the next field. - // If the field doesn't match the schedule, then increment the field until it matches. - // While incrementing the field, a wrap-around brings it back to the beginning - // of the field list (since it is necessary to re-verify previous field - // values) - - // Start at the earliest possible time (the upcoming second). - t = t.Add(1*time.Second - time.Duration(t.Nanosecond())*time.Nanosecond) - - // This flag indicates whether a field has been incremented. - added := false - - // If no time is found within five years, return zero. - yearLimit := t.Year() + 5 - -WRAP: - if t.Year() > yearLimit { - return time.Time{} - } - - // Find the first applicable month. - // If it's this month, then do nothing. - for 1< 0 - dowMatch bool = 1< 0 - ) - - if s.Dom&starBit > 0 || s.Dow&starBit > 0 { - return domMatch && dowMatch - } - return domMatch || dowMatch -} diff --git a/crons/spec_test.go b/crons/spec_test.go deleted file mode 100644 index 41540bca..00000000 --- a/crons/spec_test.go +++ /dev/null @@ -1,204 +0,0 @@ -package cron - -import ( - "testing" - "time" -) - -func TestActivation(t *testing.T) { - tests := []struct { - time, spec string - expected bool - }{ - // Every fifteen minutes. - {"Mon Jul 9 15:00 2012", "0 0/15 * * *", true}, - {"Mon Jul 9 15:45 2012", "0 0/15 * * *", true}, - {"Mon Jul 9 15:40 2012", "0 0/15 * * *", false}, - - // Every fifteen minutes, starting at 5 minutes. - {"Mon Jul 9 15:05 2012", "0 5/15 * * *", true}, - {"Mon Jul 9 15:20 2012", "0 5/15 * * *", true}, - {"Mon Jul 9 15:50 2012", "0 5/15 * * *", true}, - - // Named months - {"Sun Jul 15 15:00 2012", "0 0/15 * * Jul", true}, - {"Sun Jul 15 15:00 2012", "0 0/15 * * Jun", false}, - - // Everything set. - {"Sun Jul 15 08:30 2012", "0 30 08 ? Jul Sun", true}, - {"Sun Jul 15 08:30 2012", "0 30 08 15 Jul ?", true}, - {"Mon Jul 16 08:30 2012", "0 30 08 ? Jul Sun", false}, - {"Mon Jul 16 08:30 2012", "0 30 08 15 Jul ?", false}, - - // Predefined schedules - {"Mon Jul 9 15:00 2012", "@hourly", true}, - {"Mon Jul 9 15:04 2012", "@hourly", false}, - {"Mon Jul 9 15:00 2012", "@daily", false}, - {"Mon Jul 9 00:00 2012", "@daily", true}, - {"Mon Jul 9 00:00 2012", "@weekly", false}, - {"Sun Jul 8 00:00 2012", "@weekly", true}, - {"Sun Jul 8 01:00 2012", "@weekly", false}, - {"Sun Jul 8 00:00 2012", "@monthly", false}, - {"Sun Jul 1 00:00 2012", "@monthly", true}, - - // Test interaction of DOW and DOM. - // If both are specified, then only one needs to match. - {"Sun Jul 15 00:00 2012", "0 * * 1,15 * Sun", true}, - {"Fri Jun 15 00:00 2012", "0 * * 1,15 * Sun", true}, - {"Wed Aug 1 00:00 2012", "0 * * 1,15 * Sun", true}, - - // However, if one has a star, then both need to match. - {"Sun Jul 15 00:00 2012", "0 * * * * Mon", false}, - {"Sun Jul 15 00:00 2012", "0 * * */10 * Sun", false}, - {"Mon Jul 9 00:00 2012", "0 * * 1,15 * *", false}, - {"Sun Jul 15 00:00 2012", "0 * * 1,15 * *", true}, - {"Sun Jul 15 00:00 2012", "0 * * */2 * Sun", true}, - } - - for _, test := range tests { - sched, err := Parse(test.spec) - if err != nil { - t.Error(err) - continue - } - actual := sched.Next(getTime(test.time).Add(-1 * time.Second)) - expected := getTime(test.time) - if test.expected && expected != actual || !test.expected && expected == actual { - t.Errorf("Fail evaluating %s on %s: (expected) %s != %s (actual)", - test.spec, test.time, expected, actual) - } - } -} - -func TestNext(t *testing.T) { - runs := []struct { - time, spec string - expected string - }{ - // Simple cases - {"Mon Jul 9 14:45 2012", "0 0/15 * * *", "Mon Jul 9 15:00 2012"}, - {"Mon Jul 9 14:59 2012", "0 0/15 * * *", "Mon Jul 9 15:00 2012"}, - {"Mon Jul 9 14:59:59 2012", "0 0/15 * * *", "Mon Jul 9 15:00 2012"}, - - // Wrap around hours - {"Mon Jul 9 15:45 2012", "0 20-35/15 * * *", "Mon Jul 9 16:20 2012"}, - - // Wrap around days - {"Mon Jul 9 23:46 2012", "0 */15 * * *", "Tue Jul 10 00:00 2012"}, - {"Mon Jul 9 23:45 2012", "0 20-35/15 * * *", "Tue Jul 10 00:20 2012"}, - {"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 * * *", "Tue Jul 10 00:20:15 2012"}, - {"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 1/2 * *", "Tue Jul 10 01:20:15 2012"}, - {"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 10-12 * *", "Tue Jul 10 10:20:15 2012"}, - - {"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 1/2 */2 * *", "Thu Jul 11 01:20:15 2012"}, - {"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 * 9-20 * *", "Wed Jul 10 00:20:15 2012"}, - {"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 * 9-20 Jul *", "Wed Jul 10 00:20:15 2012"}, - - // Wrap around months - {"Mon Jul 9 23:35 2012", "0 0 0 9 Apr-Oct ?", "Thu Aug 9 00:00 2012"}, - {"Mon Jul 9 23:35 2012", "0 0 0 */5 Apr,Aug,Oct Mon", "Mon Aug 6 00:00 2012"}, - {"Mon Jul 9 23:35 2012", "0 0 0 */5 Oct Mon", "Mon Oct 1 00:00 2012"}, - - // Wrap around years - {"Mon Jul 9 23:35 2012", "0 0 0 * Feb Mon", "Mon Feb 4 00:00 2013"}, - {"Mon Jul 9 23:35 2012", "0 0 0 * Feb Mon/2", "Fri Feb 1 00:00 2013"}, - - // Wrap around minute, hour, day, month, and year - {"Mon Dec 31 23:59:45 2012", "0 * * * * *", "Tue Jan 1 00:00:00 2013"}, - - // Leap year - {"Mon Jul 9 23:35 2012", "0 0 0 29 Feb ?", "Mon Feb 29 00:00 2016"}, - - // Daylight savings time 2am EST (-5) -> 3am EDT (-4) - {"2012-03-11T00:00:00-0500", "0 30 2 11 Mar ?", "2013-03-11T02:30:00-0400"}, - - // hourly job - {"2012-03-11T00:00:00-0500", "0 0 * * * ?", "2012-03-11T01:00:00-0500"}, - {"2012-03-11T01:00:00-0500", "0 0 * * * ?", "2012-03-11T03:00:00-0400"}, - {"2012-03-11T03:00:00-0400", "0 0 * * * ?", "2012-03-11T04:00:00-0400"}, - {"2012-03-11T04:00:00-0400", "0 0 * * * ?", "2012-03-11T05:00:00-0400"}, - - // 1am nightly job - {"2012-03-11T00:00:00-0500", "0 0 1 * * ?", "2012-03-11T01:00:00-0500"}, - {"2012-03-11T01:00:00-0500", "0 0 1 * * ?", "2012-03-12T01:00:00-0400"}, - - // 2am nightly job (skipped) - {"2012-03-11T00:00:00-0500", "0 0 2 * * ?", "2012-03-12T02:00:00-0400"}, - - // Daylight savings time 2am EDT (-4) => 1am EST (-5) - {"2012-11-04T00:00:00-0400", "0 30 2 04 Nov ?", "2012-11-04T02:30:00-0500"}, - {"2012-11-04T01:45:00-0400", "0 30 1 04 Nov ?", "2012-11-04T01:30:00-0500"}, - - // hourly job - {"2012-11-04T00:00:00-0400", "0 0 * * * ?", "2012-11-04T01:00:00-0400"}, - {"2012-11-04T01:00:00-0400", "0 0 * * * ?", "2012-11-04T01:00:00-0500"}, - {"2012-11-04T01:00:00-0500", "0 0 * * * ?", "2012-11-04T02:00:00-0500"}, - - // 1am nightly job (runs twice) - {"2012-11-04T00:00:00-0400", "0 0 1 * * ?", "2012-11-04T01:00:00-0400"}, - {"2012-11-04T01:00:00-0400", "0 0 1 * * ?", "2012-11-04T01:00:00-0500"}, - {"2012-11-04T01:00:00-0500", "0 0 1 * * ?", "2012-11-05T01:00:00-0500"}, - - // 2am nightly job - {"2012-11-04T00:00:00-0400", "0 0 2 * * ?", "2012-11-04T02:00:00-0500"}, - {"2012-11-04T02:00:00-0500", "0 0 2 * * ?", "2012-11-05T02:00:00-0500"}, - - // 3am nightly job - {"2012-11-04T00:00:00-0400", "0 0 3 * * ?", "2012-11-04T03:00:00-0500"}, - {"2012-11-04T03:00:00-0500", "0 0 3 * * ?", "2012-11-05T03:00:00-0500"}, - - // Unsatisfiable - {"Mon Jul 9 23:35 2012", "0 0 0 30 Feb ?", ""}, - {"Mon Jul 9 23:35 2012", "0 0 0 31 Apr ?", ""}, - } - - for _, c := range runs { - sched, err := Parse(c.spec) - if err != nil { - t.Error(err) - continue - } - actual := sched.Next(getTime(c.time)) - expected := getTime(c.expected) - if !actual.Equal(expected) { - t.Errorf("%s, \"%s\": (expected) %v != %v (actual)", c.time, c.spec, expected, actual) - } - } -} - -func TestErrors(t *testing.T) { - invalidSpecs := []string{ - "xyz", - "60 0 * * *", - "0 60 * * *", - "0 0 * * XYZ", - } - for _, spec := range invalidSpecs { - _, err := Parse(spec) - if err == nil { - t.Error("expected an error parsing: ", spec) - } - } -} - -func getTime(value string) time.Time { - if value == "" { - return time.Time{} - } - t, err := time.Parse("Mon Jan 2 15:04 2006", value) - if err != nil { - t, err = time.Parse("Mon Jan 2 15:04:05 2006", value) - if err != nil { - t, err = time.Parse("2006-01-02T15:04:05-0700", value) - if err != nil { - panic(err) - } - // Daylight savings time tests require location - if ny, err := time.LoadLocation("America/New_York"); err == nil { - t = t.In(ny) - } - } - } - - return t -} diff --git a/dao/admin.go b/dao/admin.go new file mode 100644 index 00000000..f0032c6b --- /dev/null +++ b/dao/admin.go @@ -0,0 +1,45 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + + "github.com/gogf/gf/v2/frame/g" +) + +var Admin = new(adminDao) +type adminDao struct{} + +func (d *adminDao) Insert(ctx context.Context, data *entity.Admin) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableAdmin, data) +} +func (d *adminDao) GetById(ctx context.Context, id int) (*entity.Admin, error) { + var result *entity.Admin; err := GetById(ctx, consts.TableAdmin, id, &result); return result, err +} +func (d *adminDao) GetByLoginName(ctx context.Context, loginName string) (*entity.Admin, error) { + var result *entity.Admin + err := g.DB().Model(consts.TableAdmin).Ctx(ctx).Where(entity.AdminCols.LoginName, loginName).Scan(&result) + return result, err +} +func (d *adminDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.Admin, int, error) { + m := g.DB().Model(consts.TableAdmin).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.Admin + err = m.Limit(limit).Offset(offset).Order(entity.AdminCols.Id + " desc").Scan(&result) + return result, total, err +} +func (d *adminDao) Update(ctx context.Context, data *entity.Admin) error { + return Update(ctx, consts.TableAdmin, data, g.Map{entity.AdminCols.Id: data.Id}) +} +func (d *adminDao) UpdateFields(ctx context.Context, id int, data g.Map) error { + return Update(ctx, consts.TableAdmin, data, g.Map{entity.AdminCols.Id: id}) +} +func (d *adminDao) GetAllEnabled(ctx context.Context) ([]*entity.Admin, error) { + var result []*entity.Admin + err := g.DB().Model(consts.TableAdmin).Ctx(ctx).Where(entity.AdminCols.Status, 1).Scan(&result) + return result, err +} diff --git a/dao/auth.go b/dao/auth.go new file mode 100644 index 00000000..e54a2f55 --- /dev/null +++ b/dao/auth.go @@ -0,0 +1,33 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +var Auth = new(authDao) +type authDao struct{} + +func (d *authDao) Insert(ctx context.Context, data *entity.Auth) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableAuth, data) +} +func (d *authDao) GetById(ctx context.Context, id int) (*entity.Auth, error) { + var result *entity.Auth; err := GetById(ctx, consts.TableAuth, id, &result); return result, err +} +func (d *authDao) GetList(ctx context.Context, filters ...interface{}) ([]*entity.Auth, error) { + m := g.DB().Model(consts.TableAuth).Ctx(ctx) + m = buildFilters(m, filters) + var result []*entity.Auth + err := m.Order(entity.AuthCols.Sort + " asc, " + entity.AuthCols.Id + " asc").Scan(&result) + return result, err +} +func (d *authDao) GetByIds(ctx context.Context, ids []int) ([]*entity.Auth, error) { + var result []*entity.Auth + err := g.DB().Model(consts.TableAuth).Ctx(ctx).Where(entity.AuthCols.Id+"__in", ids).Scan(&result) + return result, err +} +func (d *authDao) Update(ctx context.Context, data *entity.Auth) error { + return Update(ctx, consts.TableAuth, data, g.Map{entity.AuthCols.Id: data.Id}) +} diff --git a/dao/ban.go b/dao/ban.go new file mode 100644 index 00000000..f9c3b1cb --- /dev/null +++ b/dao/ban.go @@ -0,0 +1,34 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +var Ban = new(banDao) +type banDao struct{} + +func (d *banDao) Insert(ctx context.Context, data *entity.Ban) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableBan, data) +} +func (d *banDao) GetById(ctx context.Context, id int) (*entity.Ban, error) { + var result *entity.Ban; err := GetById(ctx, consts.TableBan, id, &result); return result, err +} +func (d *banDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.Ban, int, error) { + m := g.DB().Model(consts.TableBan).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.Ban + err = m.Limit(limit).Offset(offset).Order(entity.BanCols.Id + " desc").Scan(&result) + return result, total, err +} +func (d *banDao) Update(ctx context.Context, data *entity.Ban) error { + return Update(ctx, consts.TableBan, data, g.Map{entity.BanCols.Id: data.Id}) +} +func (d *banDao) Delete(ctx context.Context, id int) error { + return Delete(ctx, consts.TableBan, g.Map{entity.BanCols.Id: id}) +} diff --git a/dao/common.go b/dao/common.go new file mode 100644 index 00000000..4ab14eee --- /dev/null +++ b/dao/common.go @@ -0,0 +1,76 @@ +package dao + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ParsePage 解析分页参数 +func ParsePage(pageNum, pageSize int) (offset, limit int) { + if pageNum < 1 { + pageNum = 1 + } + if pageSize < 1 { + pageSize = 20 + } + if pageSize > 1000 { + pageSize = 1000 + } + offset = (pageNum - 1) * pageSize + limit = pageSize + return +} + +// InsertAndGetId 插入并返回自增ID(排除 id 字段让 SQLite 自增) +func InsertAndGetId(ctx context.Context, table string, data interface{}) (id int64, err error) { + r, err := g.DB().Model(table).Ctx(ctx).FieldsEx("id").Data(data).Insert() + if err != nil { + return 0, err + } + return r.LastInsertId() +} + +// Update 更新数据 +func Update(ctx context.Context, table string, data interface{}, where interface{}) (err error) { + _, err = g.DB().Model(table).Ctx(ctx).Data(data).Where(where).Update() + return +} + +// Delete 删除数据 +func Delete(ctx context.Context, table string, where interface{}) (err error) { + _, err = g.DB().Model(table).Ctx(ctx).Where(where).Delete() + return +} + +// GetById 根据主键查询 +func GetById(ctx context.Context, table string, id int, result interface{}) error { + r, err := g.DB().Model(table).Ctx(ctx).Where("id", id).One() + if err != nil { + return err + } + if r == nil { + return nil + } + return r.Struct(result) +} + +// Count 计数 +func Count(ctx context.Context, table string, where interface{}) (int, error) { + return g.DB().Model(table).Ctx(ctx).Where(where).Count() +} + +// buildFilters 构建过滤条件 +func buildFilters(m *gdb.Model, filters []interface{}) *gdb.Model { + if len(filters) > 0 { + for k := 0; k < len(filters); k += 2 { + if k+1 < len(filters) { + if key, ok := filters[k].(string); ok { + m = m.Where(key, filters[k+1]) + } + } + } + } + return m +} diff --git a/dao/common_test.go b/dao/common_test.go new file mode 100644 index 00000000..888e3871 --- /dev/null +++ b/dao/common_test.go @@ -0,0 +1,112 @@ +package dao + +import ( + "testing" +) + +func TestParsePage(t *testing.T) { + tests := []struct { + name string + pageNum int + pageSize int + wantOffset int + wantLimit int + }{ + {"normal first page", 1, 20, 0, 20}, + {"second page", 2, 20, 20, 20}, + {"page 5", 5, 10, 40, 10}, + {"page 0 treated as 1", 0, 20, 0, 20}, + {"negative page treated as 1", -1, 20, 0, 20}, + {"page size 0 defaults to 20", 1, 0, 0, 20}, + {"negative page size defaults to 20", 1, -5, 0, 20}, + {"page size capped at 1000", 1, 5000, 0, 1000}, + {"page size exactly 1000", 1, 1000, 0, 1000}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotOffset, gotLimit := ParsePage(tt.pageNum, tt.pageSize) + if gotOffset != tt.wantOffset { + t.Errorf("ParsePage(%d, %d) offset = %d, want %d", tt.pageNum, tt.pageSize, gotOffset, tt.wantOffset) + } + if gotLimit != tt.wantLimit { + t.Errorf("ParsePage(%d, %d) limit = %d, want %d", tt.pageNum, tt.pageSize, gotLimit, tt.wantLimit) + } + }) + } +} + +func TestParsePagePage3Size15(t *testing.T) { + offset, limit := ParsePage(3, 15) + if offset != 30 { + t.Errorf("offset = %d, want 30", offset) + } + if limit != 15 { + t.Errorf("limit = %d, want 15", limit) + } +} + +// TestFilterLogic tests the filter pairing logic that buildFilters relies on. +// The actual buildFilters function requires a real gdb.DB connection, so we +// validate the K/V pairing semantics here directly. +func TestFilterLogic(t *testing.T) { + tests := []struct { + name string + filters []interface{} + wantOK int // expected number of valid (string, value) pairs + }{ + {"nil filters", nil, 0}, + {"empty filters", []interface{}{}, 0}, + {"single pair", []interface{}{"status", 1}, 1}, + {"two pairs", []interface{}{"status", 1, "group_id", 5}, 2}, + {"odd number of args", []interface{}{"status", 1, "group_id"}, 1}, + {"non-string key", []interface{}{123, "value"}, 0}, + {"mixed valid and invalid", []interface{}{"status", 1, 123, "value", "group_id", 5}, 2}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + pairs := 0 + if tt.filters != nil { + for k := 0; k < len(tt.filters); k += 2 { + if k+1 < len(tt.filters) { + if _, ok := tt.filters[k].(string); ok { + pairs++ + } + } + } + } + if pairs != tt.wantOK { + t.Errorf("有效过滤对数量 = %d, 期望 %d", pairs, tt.wantOK) + } + }) + } + + // Also verify that the logic never panics on edge cases + edgeCases := []struct { + name string + filters []interface{} + }{ + {"nil", nil}, + {"empty", []interface{}{}}, + {"odd length", []interface{}{"status", 1, "group_id"}}, + {"non-string key", []interface{}{123, "value"}}, + } + for _, ec := range edgeCases { + t.Run("no_panic_"+ec.name, func(t *testing.T) { + defer func() { + if r := recover(); r != nil { + t.Errorf("unexpected panic: %v", r) + } + }() + if ec.filters == nil { + return + } + for k := 0; k < len(ec.filters); k += 2 { + if k+1 < len(ec.filters) { + if _, ok := ec.filters[k].(string); ok { + _ = ec.filters[k+1] + } + } + } + }) + } +} diff --git a/dao/notify_tpl.go b/dao/notify_tpl.go new file mode 100644 index 00000000..28bdc018 --- /dev/null +++ b/dao/notify_tpl.go @@ -0,0 +1,39 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +var NotifyTpl = new(notifyTplDao) +type notifyTplDao struct{} + +func (d *notifyTplDao) Insert(ctx context.Context, data *entity.NotifyTpl) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableNotifyTpl, data) +} +func (d *notifyTplDao) GetById(ctx context.Context, id int) (*entity.NotifyTpl, error) { + var result *entity.NotifyTpl; err := GetById(ctx, consts.TableNotifyTpl, id, &result); return result, err +} +func (d *notifyTplDao) GetByTplType(ctx context.Context, tplType int, tplTypeName string) (*entity.NotifyTpl, error) { + var result *entity.NotifyTpl + err := g.DB().Model(consts.TableNotifyTpl).Ctx(ctx).Where(entity.NotifyTplCols.TplType, tplType).Where(entity.NotifyTplCols.Type, tplTypeName).Where(entity.NotifyTplCols.Status, 1).Scan(&result) + return result, err +} +func (d *notifyTplDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.NotifyTpl, int, error) { + m := g.DB().Model(consts.TableNotifyTpl).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.NotifyTpl + err = m.Limit(limit).Offset(offset).Order(entity.NotifyTplCols.Id + " desc").Scan(&result) + return result, total, err +} +func (d *notifyTplDao) Update(ctx context.Context, data *entity.NotifyTpl) error { + return Update(ctx, consts.TableNotifyTpl, data, g.Map{entity.NotifyTplCols.Id: data.Id}) +} +func (d *notifyTplDao) Delete(ctx context.Context, id int) error { + return Delete(ctx, consts.TableNotifyTpl, g.Map{entity.NotifyTplCols.Id: id}) +} diff --git a/dao/role.go b/dao/role.go new file mode 100644 index 00000000..a2d17157 --- /dev/null +++ b/dao/role.go @@ -0,0 +1,31 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +var Role = new(roleDao) +type roleDao struct{} + +func (d *roleDao) Insert(ctx context.Context, data *entity.Role) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableRole, data) +} +func (d *roleDao) GetById(ctx context.Context, id int) (*entity.Role, error) { + var result *entity.Role; err := GetById(ctx, consts.TableRole, id, &result); return result, err +} +func (d *roleDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.Role, int, error) { + m := g.DB().Model(consts.TableRole).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.Role + err = m.Limit(limit).Offset(offset).Order(entity.RoleCols.Id + " desc").Scan(&result) + return result, total, err +} +func (d *roleDao) Update(ctx context.Context, data *entity.Role) error { + return Update(ctx, consts.TableRole, data, g.Map{entity.RoleCols.Id: data.Id}) +} diff --git a/dao/role_auth.go b/dao/role_auth.go new file mode 100644 index 00000000..fe9717d6 --- /dev/null +++ b/dao/role_auth.go @@ -0,0 +1,52 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "strings" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" +) + +var RoleAuth = new(roleAuthDao) +type roleAuthDao struct{} + +func (d *roleAuthDao) Add(ctx context.Context, data *entity.RoleAuth) error { + _, err := g.DB().Model(consts.TableRoleAuth).Ctx(ctx).Data(data).Insert() + return err +} +func (d *roleAuthDao) BatchAdd(ctx context.Context, roleId int, authIds []int) error { + for _, authId := range authIds { + if err := d.Add(ctx, &entity.RoleAuth{AuthId: authId, RoleId: roleId}); err != nil { return err } + } + return nil +} +func (d *roleAuthDao) MultiAdd(ctx context.Context, roleId int, authIds []int) error { + _, err := g.DB().Model(consts.TableRoleAuth).Ctx(ctx).Where(entity.RoleAuthCols.RoleId, roleId).Delete() + if err != nil { return err } + return d.BatchAdd(ctx, roleId, authIds) +} +func (d *roleAuthDao) GetAuthIdsByRoleIds(ctx context.Context, roleIds string) (string, error) { + roleIdArr := strings.Split(roleIds, ",") + intIds := make([]int, 0) + for _, v := range roleIdArr { + if id := gconv.Int(v); id > 0 { intIds = append(intIds, id) } + } + if len(intIds) == 0 { return "", nil } + + r, err := g.DB().Model(consts.TableRoleAuth).Ctx(ctx).Where(entity.RoleAuthCols.RoleId+"__in", intIds).All() + if err != nil { return "", err } + authIdSet := make(map[int]bool) + for _, item := range r { + authIdSet[item[entity.RoleAuthCols.AuthId].Int()] = true + } + ids := make([]string, 0) + for id := range authIdSet { ids = append(ids, gconv.String(id)) } + return strings.Join(ids, ","), nil +} +func (d *roleAuthDao) DeleteByRoleId(ctx context.Context, roleId int) error { + _, err := g.DB().Model(consts.TableRoleAuth).Ctx(ctx).Where(entity.RoleAuthCols.RoleId, roleId).Delete() + return err +} diff --git a/dao/server.go b/dao/server.go new file mode 100644 index 00000000..d9671932 --- /dev/null +++ b/dao/server.go @@ -0,0 +1,47 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +var TaskServer = new(taskServerDao) +type taskServerDao struct{} + +func (d *taskServerDao) Insert(ctx context.Context, data *entity.TaskServer) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableServer, data) +} +func (d *taskServerDao) GetById(ctx context.Context, id int) (*entity.TaskServer, error) { + var result *entity.TaskServer; err := GetById(ctx, consts.TableServer, id, &result); return result, err +} +func (d *taskServerDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.TaskServer, int, error) { + m := g.DB().Model(consts.TableServer).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.TaskServer + err = m.Limit(limit).Offset(offset).Order(entity.TaskServerCols.Id + " desc").Scan(&result) + return result, total, err +} +func (d *taskServerDao) GetByIds(ctx context.Context, ids []int) ([]*entity.TaskServer, error) { + var result []*entity.TaskServer + err := g.DB().Model(consts.TableServer).Ctx(ctx).Where(entity.TaskServerCols.Id+"__in", ids).Scan(&result) + return result, err +} +func (d *taskServerDao) Update(ctx context.Context, data *entity.TaskServer) error { + return Update(ctx, consts.TableServer, data, g.Map{entity.TaskServerCols.Id: data.Id}) +} +func (d *taskServerDao) UpdateFields(ctx context.Context, id int, data g.Map) error { + return Update(ctx, consts.TableServer, data, g.Map{entity.TaskServerCols.Id: id}) +} +func (d *taskServerDao) Delete(ctx context.Context, id int) error { + return Delete(ctx, consts.TableServer, g.Map{entity.TaskServerCols.Id: id}) +} +func (d *taskServerDao) GetByIpAndPort(ctx context.Context, ip string, port int) (*entity.TaskServer, error) { + var result *entity.TaskServer + err := g.DB().Model(consts.TableServer).Ctx(ctx).Where(entity.TaskServerCols.ServerIp, ip).Where(entity.TaskServerCols.Port, port).Scan(&result) + return result, err +} diff --git a/dao/server_group.go b/dao/server_group.go new file mode 100644 index 00000000..4ee2c793 --- /dev/null +++ b/dao/server_group.go @@ -0,0 +1,34 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +var ServerGroup = new(serverGroupDao) +type serverGroupDao struct{} + +func (d *serverGroupDao) Insert(ctx context.Context, data *entity.ServerGroup) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableServerGroup, data) +} +func (d *serverGroupDao) GetById(ctx context.Context, id int) (*entity.ServerGroup, error) { + var result *entity.ServerGroup; err := GetById(ctx, consts.TableServerGroup, id, &result); return result, err +} +func (d *serverGroupDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.ServerGroup, int, error) { + m := g.DB().Model(consts.TableServerGroup).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.ServerGroup + err = m.Limit(limit).Offset(offset).Order(entity.ServerGroupCols.Id + " desc").Scan(&result) + return result, total, err +} +func (d *serverGroupDao) Update(ctx context.Context, data *entity.ServerGroup) error { + return Update(ctx, consts.TableServerGroup, data, g.Map{entity.ServerGroupCols.Id: data.Id}) +} +func (d *serverGroupDao) Delete(ctx context.Context, id int) error { + return Delete(ctx, consts.TableServerGroup, g.Map{entity.ServerGroupCols.Id: id}) +} diff --git a/dao/task.go b/dao/task.go new file mode 100644 index 00000000..aafe8314 --- /dev/null +++ b/dao/task.go @@ -0,0 +1,62 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + + "github.com/gogf/gf/v2/frame/g" +) + +var Task = new(taskDao) +type taskDao struct{} + +func (d *taskDao) Insert(ctx context.Context, data *entity.Task) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableTask, data) +} + +func (d *taskDao) GetById(ctx context.Context, id int) (*entity.Task, error) { + var result *entity.Task + err := GetById(ctx, consts.TableTask, id, &result) + return result, err +} + +func (d *taskDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.Task, int, error) { + m := g.DB().Model(consts.TableTask).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.Task + err = m.Limit(limit).Offset(offset).Order(entity.TaskCols.Status + " desc, " + entity.TaskCols.TaskName + " asc, " + entity.TaskCols.Id + " desc").Scan(&result) + return result, total, err +} + +func (d *taskDao) GetEnabledList(ctx context.Context) ([]*entity.Task, error) { + var result []*entity.Task + err := g.DB().Model(consts.TableTask).Ctx(ctx).Where(entity.TaskCols.Status, 1).Scan(&result) + return result, err +} + +func (d *taskDao) Update(ctx context.Context, data *entity.Task) error { + return Update(ctx, consts.TableTask, data, g.Map{entity.TaskCols.Id: data.Id}) +} + +func (d *taskDao) UpdateFields(ctx context.Context, id int, data g.Map) error { + return Update(ctx, consts.TableTask, data, g.Map{entity.TaskCols.Id: id}) +} + +func (d *taskDao) Delete(ctx context.Context, id int) error { + return d.UpdateFields(ctx, id, g.Map{entity.TaskCols.Status: -1}) +} + +func (d *taskDao) ResetGroupId(ctx context.Context, groupId int) error { + _, err := g.DB().Model(consts.TableTask).Ctx(ctx).Where(entity.TaskCols.GroupId, groupId).Data(g.Map{entity.TaskCols.GroupId: 0}).Update() + return err +} + +func (d *taskDao) TotalRunNum(ctx context.Context) (int64, error) { + r, err := g.DB().Model(consts.TableTask).Ctx(ctx).Fields("COALESCE(SUM(" + entity.TaskCols.ExecuteTimes + "), 0) as num").One() + if err != nil { return 0, err } + return r["num"].Int64(), nil +} diff --git a/dao/task_group.go b/dao/task_group.go new file mode 100644 index 00000000..69c66b69 --- /dev/null +++ b/dao/task_group.go @@ -0,0 +1,34 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + "github.com/gogf/gf/v2/frame/g" +) + +var Group = new(groupDao) +type groupDao struct{} + +func (d *groupDao) Insert(ctx context.Context, data *entity.Group) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableTaskGroup, data) +} +func (d *groupDao) GetById(ctx context.Context, id int) (*entity.Group, error) { + var result *entity.Group; err := GetById(ctx, consts.TableTaskGroup, id, &result); return result, err +} +func (d *groupDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.Group, int, error) { + m := g.DB().Model(consts.TableTaskGroup).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.Group + err = m.Limit(limit).Offset(offset).Order(entity.GroupCols.Id + " desc").Scan(&result) + return result, total, err +} +func (d *groupDao) Update(ctx context.Context, data *entity.Group) error { + return Update(ctx, consts.TableTaskGroup, data, g.Map{entity.GroupCols.Id: data.Id}) +} +func (d *groupDao) Delete(ctx context.Context, id int) error { + return Delete(ctx, consts.TableTaskGroup, g.Map{entity.GroupCols.Id: id}) +} diff --git a/dao/task_log.go b/dao/task_log.go new file mode 100644 index 00000000..3e490be0 --- /dev/null +++ b/dao/task_log.go @@ -0,0 +1,52 @@ +package dao + +import ( + "context" + "ppgo_job/consts" + "ppgo_job/model/entity" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +var TaskLog = new(taskLogDao) +type taskLogDao struct{} + +func (d *taskLogDao) Insert(ctx context.Context, data *entity.TaskLog) (id int64, err error) { + return InsertAndGetId(ctx, consts.TableTaskLog, data) +} + +func (d *taskLogDao) GetById(ctx context.Context, id int) (*entity.TaskLog, error) { + var result *entity.TaskLog + err := GetById(ctx, consts.TableTaskLog, id, &result) + return result, err +} + +func (d *taskLogDao) GetList(ctx context.Context, pageNum, pageSize int, filters ...interface{}) ([]*entity.TaskLog, int, error) { + m := g.DB().Model(consts.TableTaskLog).Ctx(ctx) + m = buildFilters(m, filters) + total, err := m.Count() + if err != nil { return nil, 0, err } + offset, limit := ParsePage(pageNum, pageSize) + var result []*entity.TaskLog + err = m.Limit(limit).Offset(offset).Order(entity.TaskLogCols.Id + " desc").Scan(&result) + return result, total, err +} + +func (d *taskLogDao) DeleteById(ctx context.Context, id int) error { + return Delete(ctx, consts.TableTaskLog, g.Map{entity.TaskLogCols.Id: id}) +} + +func (d *taskLogDao) DeleteByTaskId(ctx context.Context, taskId int) error { + return Delete(ctx, consts.TableTaskLog, g.Map{entity.TaskLogCols.TaskId: taskId}) +} + +func (d *taskLogDao) GetLogNum(ctx context.Context) (int, error) { + return Count(ctx, consts.TableTaskLog, nil) +} + +func (d *taskLogDao) SumByDays(ctx context.Context, days int) (gdb.Result, error) { + return g.DB().Model(consts.TableTaskLog).Ctx(ctx). + Fields("strftime('%Y-%m-%d', create_time, 'unixepoch') as date, COUNT(*) as total"). + Where("create_time > ?", 0).Group("date").OrderAsc("date").All() +} diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 6abf7601..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: '2' -services: - web: - build: - context: . - dockerfile: .docker/web/Dockerfile - # ports from container exposed to the docker machine and the guest machine - ports: - # 80 on the host, 8080 on the guest. Websever listens on 8080 - - "8080:8080" # http - # - "443:443" # https - # file with environment declarations for the container - env_file: - - .docker/web/.env - # Link to containers in another service - depends_on: - - db - command: ["./wait-for-it.sh", "db:3306", "--", "./PPGo_Job"] - # sync workspace folder with /go - db: - image: mysql:5.7 - ports: - - "3306:3306" - environment: - MYSQL_USER: gotest - MYSQL_PASSWORD: gotest - MYSQL_ROOT_PASSWORD: gotest - MYSQL_DATABASE: local_gotest - # sync folders. MySQL data is stored outside container so that rebuilding doesn't clear db. - # folder is at workspace root. - volumes: - - .docker/_local_mysql_data:/var/lib/mysql - - .docker/db:/docker-entrypoint-initdb.d \ No newline at end of file diff --git a/go.mod b/go.mod index 26a86d05..977c77af 100644 --- a/go.mod +++ b/go.mod @@ -1,39 +1,45 @@ -module PPGo_Job +module ppgo_job -go 1.26.0 +go 1.26 require ( - github.com/astaxie/beego v1.12.3 - github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 - github.com/george518/PPGo_Job v2.8.0+incompatible - github.com/go-sql-driver/mysql v1.9.3 - github.com/linxiaozhi/go-telnet v0.0.0-20190217183315-a500ff0c2efc - github.com/mattn/go-sqlite3 v2.0.3+incompatible - github.com/pkg/errors v0.9.1 - golang.org/x/crypto v0.53.0 + github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.10.2 + github.com/gogf/gf/v2 v2.10.2 ) require ( - filippo.io/edwards25519 v1.2.0 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/hashicorp/golang-lru v1.0.2 // indirect - github.com/klauspost/compress v1.18.6 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.12.3 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.23.2 // indirect - github.com/prometheus/client_model v0.6.2 // indirect - github.com/prometheus/common v0.67.5 // indirect - github.com/prometheus/procfs v0.20.1 // indirect - github.com/rogpeppe/go-internal v1.14.1 // indirect - github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 // indirect - go.yaml.in/yaml/v2 v2.4.4 // indirect - golang.org/x/net v0.56.0 // indirect + github.com/BurntSushi/toml v1.5.0 // indirect + github.com/clbanning/mxj/v2 v2.7.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/emirpasic/gods/v2 v2.0.0-alpha // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/glebarez/go-sqlite v1.21.2 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grokify/html-strip-tags-go v0.1.0 // indirect + github.com/magiconair/properties v1.8.10 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/olekukonko/errors v1.1.0 // indirect + github.com/olekukonko/ll v0.0.9 // indirect + github.com/olekukonko/tablewriter v1.1.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/rivo/uniseg v0.2.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.38.0 // indirect + go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/trace v1.38.0 // indirect + golang.org/x/net v0.55.0 // indirect golang.org/x/sys v0.46.0 // indirect golang.org/x/text v0.38.0 // indirect - google.golang.org/protobuf v1.36.11 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + modernc.org/libc v1.22.5 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.5.0 // indirect + modernc.org/sqlite v1.23.1 // indirect ) diff --git a/go.sum b/go.sum index 5c0eb362..f10df9fa 100644 --- a/go.sum +++ b/go.sum @@ -1,218 +1,100 @@ -filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= -filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk= -github.com/astaxie/beego v1.12.3 h1:SAQkdD2ePye+v8Gn1r4X6IKZM1wd28EyUOVQ3PDSOOQ= -github.com/astaxie/beego v1.12.3/go.mod h1:p3qIm0Ryx7zeBHLljmd7omloyca1s4yu1a8kM1FkpIA= -github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 h1:OYA+5W64v3OgClL+IrOD63t4i/RW7RqrAVl9LTZ9UqQ= -github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394/go.mod h1:Q8n74mJTIgjX4RBBcHnJ05h//6/k6foqmgE45jTQtxg= -github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ= -github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= -github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= -github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U= -github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= -github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= -github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= -github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/george518/PPGo_Job v2.8.0+incompatible h1:cSii3OAs9PfygboD8bpUZI/+raGmqW8z2GVA4nE37Hk= -github.com/george518/PPGo_Job v2.8.0+incompatible/go.mod h1:D/af0ZB2/BqQXpXz6nm+oMrQX1Z3pitGRUwOxoby3ig= -github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo= -github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/emirpasic/gods/v2 v2.0.0-alpha h1:dwFlh8pBg1VMOXWGipNMRt8v96dKAIvBehtCt6OtunU= +github.com/emirpasic/gods/v2 v2.0.0-alpha/go.mod h1:W0y4M2dtBB9U5z3YlghmpuUhiaZT2h6yoeE+C1sCp6A= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo= +github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.10.2 h1:KLS68SWS2W749x7e+eCCOO3UD2Sbw+bIbLEPR8o1FXw= +github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.10.2/go.mod h1:uLcsu73PfpyhRc0Jq0gGAWQjN1tyGU9iBRrYgt/lu7g= +github.com/gogf/gf/v2 v2.10.2 h1:46IO0Uc8e85/FqdftJFskfDejJLBL0JBnGS5qOftUu8= +github.com/gogf/gf/v2 v2.10.2/go.mod h1:Svl1N+E8G/QshU2DUbh/3J/AJauqCgUnxHurXWR4Qx0= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= -github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4= +github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ= -github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= -github.com/linxiaozhi/go-telnet v0.0.0-20190217183315-a500ff0c2efc h1:FQTpORWGxHvz83hOXnlbdSuraUA4fumQ0dPDdCaxN7g= -github.com/linxiaozhi/go-telnet v0.0.0-20190217183315-a500ff0c2efc/go.mod h1:kkwxiW1i3uS0OgPQO4bkgBDeJuinEx1uR5DOGE12IQA= -github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= -github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= +github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM= +github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y= +github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI= +github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g= +github.com/olekukonko/tablewriter v1.1.0 h1:N0LHrshF4T39KvI96fn6GT8HEjXRXYNDrDjKFDB7RIY= +github.com/olekukonko/tablewriter v1.1.0/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= -github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= -github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= -github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= -github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= -github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= -github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= -github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 h1:v9ezJDHA1XGxViAUSIoO/Id7Fl63u6d0YmsAm+/p2hs= -github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02/go.mod h1:RF16/A3L0xSa0oSERcnhd8Pu3IXSDZSK2gmGIMsttFE= -github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= -github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s= -github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= -github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= -github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= -github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc= -github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= +go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= +go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= +go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= +go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= +go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= +go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= +go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= -go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= -golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= -golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= +golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= +modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM= +modernc.org/sqlite v1.23.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= diff --git a/integration_test.go b/integration_test.go new file mode 100644 index 00000000..b1b8da2c --- /dev/null +++ b/integration_test.go @@ -0,0 +1,630 @@ +package main + +import ( + "context" + "fmt" + "io" + "net/http" + "net/url" + "os" + "strings" + "testing" + "time" + + _ "ppgo_job/boot" + + "github.com/gogf/gf/v2/frame/g" +) + +const testPort = ":18082" +const testBaseURL = "http://127.0.0.1" + testPort + +func TestMain(m *testing.M) { + // Switch the server to a test port so we don't conflict with a dev instance + s := g.Server() + s.SetPort(18082) + + // Start server non-blocking + go s.Start() + + // Wait for the server to be ready + ready := false + for i := 0; i < 40; i++ { + resp, err := http.Get(testBaseURL + "/") + if err == nil { + resp.Body.Close() + ready = true + break + } + time.Sleep(250 * time.Millisecond) + } + if !ready { + fmt.Println("WARNING: Server did not start within timeout. Integration tests may fail.") + } + + code := m.Run() + + s.Shutdown() + os.Exit(code) +} + +// --- HTTP test helpers --- + +func httpGet(path string, cookies []*http.Cookie) (int, string, error) { + req, _ := http.NewRequest("GET", testBaseURL+path, nil) + if cookies != nil { + for _, c := range cookies { + req.AddCookie(c) + } + } + client := &http.Client{ + Timeout: 5 * time.Second, + CheckRedirect: func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse // don't follow redirects + }, + } + resp, err := client.Do(req) + if err != nil { + return 0, "", err + } + defer resp.Body.Close() + body, _ := io.ReadAll(resp.Body) + return resp.StatusCode, string(body), nil +} + +func httpPost(path string, data url.Values, cookies []*http.Cookie) (int, string, error) { + bodyReader := strings.NewReader(data.Encode()) + req, _ := http.NewRequest("POST", testBaseURL+path, bodyReader) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + if cookies != nil { + for _, c := range cookies { + req.AddCookie(c) + } + } + client := &http.Client{ + Timeout: 5 * time.Second, + CheckRedirect: func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + }, + } + resp, err := client.Do(req) + if err != nil { + return 0, "", err + } + defer resp.Body.Close() + body, _ := io.ReadAll(resp.Body) + return resp.StatusCode, string(body), nil +} + +func loginCookies(t *testing.T) []*http.Cookie { + req, _ := http.NewRequest("POST", testBaseURL+"/login_in", + strings.NewReader(url.Values{"username": {"admin"}, "password": {"123456"}}.Encode())) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + client := &http.Client{ + Timeout: 5 * time.Second, + CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }, + } + resp, err := client.Do(req) + if err != nil { + t.Fatalf("login failed: %v", err) + return nil + } + defer resp.Body.Close() + body, _ := io.ReadAll(resp.Body) + if !strings.Contains(string(body), `"status":0`) { + t.Fatalf("login failed, body: %s", body) + } + return resp.Cookies() +} + +// ===================== Tests ===================== + +func TestLoginPage(t *testing.T) { + code, body, err := httpGet("/", nil) + if err != nil { + t.Fatalf("GET /: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, "登录") && !strings.Contains(body, "login") { + t.Error("body should contain login text") + } +} + +func TestLogin(t *testing.T) { + tests := []struct { + name string + username string + password string + wantCode int + }{ + {"correct credentials", "admin", "123456", 0}, + {"wrong password", "admin", "wrongpass", -1}, + {"wrong username", "nonexistent", "123456", -1}, + {"empty username", "", "123456", -1}, + {"empty password", "admin", "", -1}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, body, err := httpPost("/login_in", url.Values{ + "username": {tt.username}, + "password": {tt.password}, + }, nil) + if err != nil { + t.Fatalf("POST /login_in: %v", err) + } + if !strings.Contains(body, fmt.Sprintf(`"status":%d`, tt.wantCode)) { + t.Errorf("body does not contain status:%d — body: %s", tt.wantCode, body) + } + }) + } +} + +func TestAuthRequired(t *testing.T) { + paths := []string{"/home", "/home/start", "/task/list", "/server/list", "/group/list", "/admin/list", "/role/list"} + for _, p := range paths { + t.Run(p, func(t *testing.T) { + code, _, err := httpGet(p, nil) + if err != nil { + t.Fatalf("GET %s: %v", p, err) + } + if code != http.StatusFound { + t.Errorf("GET %s (no auth) = %d, want redirect 302", p, code) + } + }) + } +} + +func TestHomePage(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/home", cookies) + if err != nil { + t.Fatalf("GET /home: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, "首页") { + t.Error("home page should contain '首页'") + } +} + +func TestHomeStart(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/home/start", cookies) + if err != nil { + t.Fatalf("GET /home/start: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + // Rendered template substitutes {{.startJob}} etc. with integer values, + // so we check for static UI text and structural content instead + for _, s := range []string{ + "即将执行的任务", "待审核任务数量", "近期执行成功", "近期执行失败", + "当前用户总数", "定时任务总数量", "累计运行次数", "当前日志总量", + "系统概况", "运行概况", + } { + if !strings.Contains(body, s) { + t.Errorf("body missing expected text: %s", s) + } + } +} + +func TestTaskTable(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/task/table", cookies) + if err != nil { + t.Fatalf("GET /task/table: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, `"code":`) || !strings.Contains(body, `"data"`) { + t.Errorf("response missing JSON fields: %s", body) + } +} + +func TestServerTable(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/server/table", cookies) + if err != nil { + t.Fatalf("GET /server/table: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, `"code":`) { + t.Errorf("response missing JSON fields: %s", body) + } +} + +func TestTaskCRUD(t *testing.T) { + cookies := loginCookies(t) + ctx := context.Background() + + // Create + _, body, err := httpPost("/task/ajax_save", url.Values{ + "task_name": {"test-crud-task"}, + "cron_spec": {"0 */5 * * * *"}, + "command": {"echo ok"}, + "timeout": {"30"}, + }, cookies) + if err != nil { + t.Fatalf("POST /task/ajax_save: %v", err) + } + if !strings.Contains(body, `"status":0`) { + t.Errorf("create failed: %s", body) + } + // Cleanup + if _, err := g.DB().Exec(ctx, "DELETE FROM pp_task WHERE task_name = ?", "test-crud-task"); err != nil { //nolint + t.Logf("cleanup: %v", err) + } +} + +func TestTaskStartStop(t *testing.T) { + cookies := loginCookies(t) + // Start a non-existent task => error + _, body, err := httpPost("/task/ajax_start", url.Values{"id": {"99999"}}, cookies) + if err != nil { + t.Fatalf("POST /task/ajax_start: %v", err) + } + // Should still succeed (it's a soft action that just updates DB) + if !strings.Contains(body, `"status":0`) { + t.Logf("start non-existent task response: %s", body) + } + + // Pause with invalid id + _, body, err = httpPost("/task/ajax_pause", url.Values{"id": {"99999"}}, cookies) + if err != nil { + t.Fatalf("POST /task/ajax_pause: %v", err) + } + // Should succeed (soft action) + if !strings.Contains(body, `"status":0`) { + t.Logf("pause non-existent task response: %s", body) + } +} + +func TestGroupCRUD(t *testing.T) { + cookies := loginCookies(t) + ctx := context.Background() + + // Create + _, body, err := httpPost("/group/ajax_save", url.Values{ + "group_name": {"test-group"}, + "description": {"created by test"}, + }, cookies) + if err != nil { + t.Fatalf("POST /group/ajax_save: %v", err) + } + if !strings.Contains(body, `"status":0`) { + t.Errorf("create group failed: %s", body) + } + // Cleanup + g.DB().Exec(ctx, "DELETE FROM pp_task_group WHERE group_name = ?", "test-group") //nolint +} + +func TestBanCRUD(t *testing.T) { + cookies := loginCookies(t) + ctx := context.Background() + + _, body, err := httpPost("/ban/ajax_save", url.Values{ + "code": {"rm -rf"}, + }, cookies) + if err != nil { + t.Fatalf("POST /ban/ajax_save: %v", err) + } + if !strings.Contains(body, `"status":0`) { + t.Errorf("create ban failed: %s", body) + } + g.DB().Exec(ctx, "DELETE FROM pp_task_ban WHERE code = ?", "rm -rf") //nolint +} + +func TestAllTemplatesRender(t *testing.T) { + cookies := loginCookies(t) + pages := []string{ + "/task/list", "/task/add", "/task/audit_list", + "/server/list", "/server/add", + "/group/list", "/group/add", + "/server_group/list", "/server_group/add", + "/ban/list", "/ban/add", + "/notify_tpl/list", "/notify_tpl/add", + "/auth/index", + "/role/list", "/role/add", + "/admin/list", "/admin/add", + "/task_log/list", + "/user/edit", + "/help", + } + for _, p := range pages { + t.Run(p, func(t *testing.T) { + code, body, err := httpGet(p, cookies) + if err != nil { + t.Fatalf("GET %s: %v", p, err) + } + if code != http.StatusOK { + t.Errorf("GET %s = %d, want 200", p, code) + } + if strings.Contains(body, "template not found") || strings.Contains(body, "ERROR") { + t.Errorf("GET %s has template error", p) + } + }) + } +} + +func TestAdminEditPage(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/admin/edit?id=1", cookies) + if err != nil { + t.Fatalf("GET /admin/edit: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, "admin") { + t.Error("edit page should contain user info") + } +} + +func TestStaticFiles(t *testing.T) { + files := []string{ + "/static/layui/css/layui.css", + "/static/layui/layui.js", + "/static/admin/css/main.css", + "/static/admin/images/default.png", + "/static/admin/images/favicon.ico", + "/static/font-awesome/css/font-awesome.min.css", + } + for _, f := range files { + t.Run(f, func(t *testing.T) { + code, _, err := httpGet(f, nil) + if err != nil { + t.Fatalf("GET %s: %v", f, err) + } + if code != http.StatusOK { + t.Errorf("GET %s = %d, want 200", f, code) + } + }) + } +} + +func TestDatabaseHasSeedData(t *testing.T) { + ctx := context.Background() + + // Use Count (supported by all GoFrame versions) instead of GetScan with basic types + count, err := g.DB().Model("pp_uc_admin").Ctx(ctx).Count() + if err != nil { + t.Fatalf("admin count: %v", err) + } + if count < 1 { + t.Error("admin table should have seed data") + } + count, err = g.DB().Model("pp_uc_auth").Ctx(ctx).Count() + if err != nil { + t.Fatalf("auth count: %v", err) + } + if count < 1 { + t.Error("auth table should have seed data") + } +} + +func TestCORSHeader(t *testing.T) { + req, _ := http.NewRequest("OPTIONS", testBaseURL+"/", nil) + client := &http.Client{Timeout: 5 * time.Second} + resp, err := client.Do(req) + if err != nil { + t.Fatalf("OPTIONS /: %v", err) + } + defer resp.Body.Close() + if resp.Header.Get("Access-Control-Allow-Origin") == "" { + t.Error("CORS Access-Control-Allow-Origin header not set") + } +} + +// ==================== 日志管理 ==================== + +// TestTaskLogTable tests the task log list JSON endpoint +func TestTaskLogTable(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/task_log/table", cookies) + if err != nil { + t.Fatalf("GET /task_log/table: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, `"code":`) || !strings.Contains(body, `"data"`) { + t.Errorf("response missing JSON fields: %s", body) + } + // Filter by task_id + code2, body2, err2 := httpGet("/task_log/table?task_id=1", cookies) + if err2 != nil { + t.Fatalf("GET /task_log/table?task_id=1: %v", err2) + } + if code2 != http.StatusOK { + t.Errorf("status = %d, want %d", code2, http.StatusOK) + } + if !strings.Contains(body2, `"code":`) { + t.Errorf("response missing code field: %s", body2) + } +} + +// TestTaskLogDetail tests the log detail page rendering (with real log data if available) +func TestTaskLogDetail(t *testing.T) { + cookies := loginCookies(t) + // Try viewing a specific log (id=1 may or may not exist; either 200 or error msg is OK) + code, body, err := httpGet("/task_log/detail?id=1", cookies) + if err != nil { + t.Fatalf("GET /task_log/detail: %v", err) + } + if code == http.StatusOK { + // Rendered successfully — check for expected template elements + if !strings.Contains(body, "日志") && !strings.Contains(body, "任务") { + t.Log("log detail page rendered (no specific content check)") + } + } + // Non-existent log should return error + code2, body2, err2 := httpGet("/task_log/detail?id=99999", cookies) + if err2 != nil { + t.Fatalf("GET /task_log/detail?id=99999: %v", err2) + } + if code2 != http.StatusOK { + t.Errorf("status for missing log = %d, want 200", code2) + } + // Should show error message in flash + if strings.Contains(body2, "不存在") { + t.Log("non-existent log correctly reported") + } +} + +// ==================== 权限管理 ==================== + +// TestAuthGetNodes tests the auth tree node (zTree format) endpoint +func TestAuthGetNodes(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/auth/get_nodes", cookies) + if err != nil { + t.Fatalf("GET /auth/get_nodes: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + // Should return JSON array with id, name, pId fields + if !strings.Contains(body, `"id"`) || !strings.Contains(body, `"name"`) || !strings.Contains(body, `"pId"`) { + t.Errorf("auth nodes missing required fields: %s", body[:min(len(body), 200)]) + } +} + +// TestRoleTable tests the role list JSON endpoint +func TestRoleTable(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/role/table", cookies) + if err != nil { + t.Fatalf("GET /role/table: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, `"code":`) || !strings.Contains(body, `"data"`) { + t.Errorf("response missing JSON fields: %s", body) + } +} + +// TestAdminTable tests the admin list JSON endpoint +func TestAdminTable(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/admin/table", cookies) + if err != nil { + t.Fatalf("GET /admin/table: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, `"code":`) || !strings.Contains(body, `"data"`) { + t.Errorf("response missing JSON fields: %s", body) + } + // Should include admin user data + if !strings.Contains(body, "admin") { + t.Log("admin table body: " + body[:min(len(body), 200)]) + } +} + +// TestRoleCRUD tests role creation and cleanup +func TestRoleCRUD(t *testing.T) { + cookies := loginCookies(t) + ctx := context.Background() + + // Create a role + _, body, err := httpPost("/role/ajax_save", url.Values{ + "role_name": {"test-role"}, + "detail": {"created by test"}, + "auth_ids": {"1,2,3"}, + }, cookies) + if err != nil { + t.Fatalf("POST /role/ajax_save: %v", err) + } + if !strings.Contains(body, `"status":0`) { + t.Errorf("create role failed: %s", body) + } + // Cleanup + g.DB().Exec(ctx, "DELETE FROM pp_uc_role WHERE role_name = ?", "test-role") //nolint +} + +// TestRoleEdit tests the role edit page +func TestRoleEdit(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/role/edit?id=1", cookies) + if err != nil { + t.Fatalf("GET /role/edit: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if strings.Contains(body, "模板错误") || strings.Contains(body, "ERROR") { + t.Error("role edit page has template errors") + } +} + +// ==================== 首页仪表盘 ==================== + +// TestDashboardStats tests the dashboard statistical data +func TestDashboardStats(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/home/start", cookies) + if err != nil { + t.Fatalf("GET /home/start: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + // Check that echarts library loads + code2, _, err2 := httpGet("/static/echarts/echarts.min.js", nil) + if err2 != nil { + t.Fatalf("GET echarts: %v", err2) + } + if code2 != http.StatusOK { + t.Errorf("echarts static file status = %d, want 200", code2) + } + // Check chart data is present in the rendered page + if !strings.Contains(body, "运行概况") { + t.Error("dashboard missing chart title") + } +} + +// TestBanTable tests the ban list JSON endpoint +func TestBanTable(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/ban/table", cookies) + if err != nil { + t.Fatalf("GET /ban/table: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, `"code":`) || !strings.Contains(body, `"data"`) { + t.Errorf("response missing JSON fields: %s", body) + } +} + +// TestNotifyTplTable tests the notify template list JSON endpoint +func TestNotifyTplTable(t *testing.T) { + cookies := loginCookies(t) + code, body, err := httpGet("/notify_tpl/table", cookies) + if err != nil { + t.Fatalf("GET /notify_tpl/table: %v", err) + } + if code != http.StatusOK { + t.Errorf("status = %d, want %d", code, http.StatusOK) + } + if !strings.Contains(body, `"code":`) || !strings.Contains(body, `"data"`) { + t.Errorf("response missing JSON fields: %s", body) + } +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/jobs/cron.go b/jobs/cron.go deleted file mode 100644 index 65fdd2ab..00000000 --- a/jobs/cron.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -* @Author: haodaquan -* @Date: 2017-06-21 12:54:47 -* @Last Modified by: haodaquan -* @Last Modified time: 2017-06-23 11:04:25 - */ - -package jobs - -import ( - "sync" - - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/crons" -) - -var ( - mainCron *cron.Cron - workPool chan bool - lock sync.Mutex -) - -func init() { - if size, _ := beego.AppConfig.Int("jobs.pool"); size > 0 { - workPool = make(chan bool, size) - } - mainCron = cron.New() - mainCron.Start() -} - -func AddJob(spec string, job *Job) bool { - lock.Lock() - defer lock.Unlock() - - if GetEntryById(job.JobKey) != nil { - return false - } - err := mainCron.AddJob(spec, job) - if err != nil { - beego.Error("AddJob: ", err.Error()) - return false - } - //fmt.Println(job) - return true -} - -func RemoveJob(jobKey int) { - mainCron.RemoveJob(func(e *cron.Entry) bool { - if v, ok := e.Job.(*Job); ok { - if v.JobKey == jobKey { - return true - } - } - return false - }) -} - -func GetEntryById(jobKey int) *cron.Entry { - entries := mainCron.Entries() - for _, e := range entries { - if v, ok := e.Job.(*Job); ok { - if v.JobKey == jobKey { - return e - } - } - } - return nil -} - -func GetEntries(size int) []*cron.Entry { - ret := mainCron.Entries() - if len(ret) > size { - return ret[:size] - } - return ret -} diff --git a/jobs/init.go b/jobs/init.go deleted file mode 100644 index be40bed2..00000000 --- a/jobs/init.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -* @Author: haodaquan -* @Date: 2017-06-21 12:55:19 -* @Last Modified by: haodaquan -* @Last Modified time: 2017-06-21 13:03:06 - */ - -package jobs - -import ( - "fmt" - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/models" - "os/exec" - "time" -) - -func InitJobs() { - list, _ := models.TaskGetList(1, 1000000, "status", 1) - for _, task := range list { - jobs, err := NewJobFromTask(task) - if err != nil { - beego.Error("InitJobs:", err.Error()) - continue - } - - for _, job := range jobs { - AddJob(task.CronSpec, job) - } - - } -} - -func runCmdWithTimeout(cmd *exec.Cmd, timeout time.Duration) (error, bool) { - done := make(chan error) - go func() { - done <- cmd.Wait() - }() - - var err error - select { - case <-time.After(timeout): - beego.Warn(fmt.Sprintf("任务执行时间超过%d秒,进程将被强制杀掉: %d", int(timeout/time.Second), cmd.Process.Pid)) - go func() { - <-done // 读出上面的goroutine数据,避免阻塞导致无法退出 - }() - if err = cmd.Process.Kill(); err != nil { - beego.Error(fmt.Sprintf("进程无法杀掉: %d, 错误信息: %s", cmd.Process.Pid, err)) - } - return err, true - case err = <-done: - return err, false - } -} diff --git a/jobs/job.go b/jobs/job.go deleted file mode 100644 index 68e645b8..00000000 --- a/jobs/job.go +++ /dev/null @@ -1,841 +0,0 @@ -/* -* @Author: haodaquan -* @Date: 2017-06-21 12:56:08 -* @Last Modified by: Bee -* @Last Modified time: 2019-02-17 22:10:15 - */ - -package jobs - -import ( - "bytes" - "errors" - "fmt" - "github.com/astaxie/beego/logs" - "github.com/george518/PPGo_Job/libs" - "github.com/george518/PPGo_Job/models" - "io/ioutil" - "net" - "net/rpc" - "net/rpc/jsonrpc" - "os/exec" - "runtime/debug" - "sync" - "time" - - "runtime" - "strconv" - "strings" - - "encoding/json" - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/notify" - "github.com/linxiaozhi/go-telnet" - "golang.org/x/crypto/ssh" -) - -type Job struct { - JobKey int // jobId = id*10000+serverId - Id int // taskID - LogId int64 // 日志记录ID - ServerId int // 执行器信息 - ServerName string // 执行器名称 - ServerType int // 执行器类型,2-agent 1-telnet 0-ssh - Name string // 任务名称 - Task *models.Task // 任务对象 - RunFunc func(time.Duration) *JobResult // 执行函数 - Status int // 任务状态,大于0表示正在执行中 - Concurrent bool // 同一个任务是否允许并行执行 -} - -type JobResult struct { - OutMsg string - ErrMsg string - IsOk bool - IsTimeout bool -} - -//调度计数器 -var Counter sync.Map - -func GetCounter(key string) int { - if v, ok := Counter.LoadOrStore(key, 0); ok { - n := v.(int) - return n - } - return 0 -} - -func SetCounter(key string) { - if v, ok := Counter.Load(key); ok { - n := v.(int) - m := n + 1 - if n > 1000 { - m = 0 - } - Counter.Store(key, m) - } -} - -func NewJobFromTask(task *models.Task) ([]*Job, error) { - if task.Id < 1 { - return nil, fmt.Errorf("ToJob: 缺少id") - } - - if task.ServerIds == "" { - return nil, fmt.Errorf("任务执行失败,找不到执行的服务器") - } - - TaskServerIdsArr := strings.Split(task.ServerIds, ",") - jobArr := make([]*Job, 0) - for _, server_id := range TaskServerIdsArr { - if server_id == "0" { - //本地执行 - job := NewCommandJob(task.Id, 0, task.TaskName, task.Command) - job.Task = task - job.Concurrent = false - if task.Concurrent == 1 { - job.Concurrent = true - } - //job.Concurrent = task.Concurrent == 1 - job.ServerId = 0 - job.ServerName = "本地服务器" - jobArr = append(jobArr, job) - } else { - server_id_int, _ := strconv.Atoi(server_id) - //远程执行 - server, _ := models.TaskServerGetById(server_id_int) - - if server.Status == 2 { - fmt.Println("服务器已禁用") - continue - } - - if server.ConnectionType == 0 { - if server.Type == 0 { - //密码验证登录服务器 - job := RemoteCommandJobByPassword(task.Id, server_id_int, task.TaskName, task.Command, server) - job.Task = task - job.Concurrent = false - if task.Concurrent == 1 { - job.Concurrent = true - } - //job.Concurrent = task.Concurrent == 1 - job.ServerId = server_id_int - job.ServerName = server.ServerName - jobArr = append(jobArr, job) - } else { - job := RemoteCommandJob(task.Id, server_id_int, task.TaskName, task.Command, server) - job.Task = task - job.Concurrent = false - if task.Concurrent == 1 { - job.Concurrent = true - } - //job.Concurrent = task.Concurrent == 1 - job.ServerId = server_id_int - job.ServerName = server.ServerName - jobArr = append(jobArr, job) - } - } else if server.ConnectionType == 1 { - if server.Type == 0 { - //密码验证登录服务器 - job := RemoteCommandJobByTelnetPassword(task.Id, server_id_int, task.TaskName, task.Command, server) - job.Task = task - job.Concurrent = false - if task.Concurrent == 1 { - job.Concurrent = true - } - //job.Concurrent = task.Concurrent == 1 - job.ServerId = server_id_int - job.ServerName = server.ServerName - jobArr = append(jobArr, job) - } - } else if server.ConnectionType == 2 { - //密码验证登录服务器 - job := RemoteCommandJobByAgentPassword(task.Id, server_id_int, task.TaskName, task.Command, server) - job.Task = task - job.Concurrent = false - if task.Concurrent == 1 { - job.Concurrent = true - } - //job.Concurrent = task.Concurrent == 1 - job.ServerId = server_id_int - job.ServerName = server.ServerName - jobArr = append(jobArr, job) - - } - } - } - - return jobArr, nil -} - -func NewCommandJob(id int, serverId int, name string, command string) *Job { - job := &Job{ - Id: id, - Name: name, - } - - job.JobKey = libs.JobKey(id, serverId) - job.RunFunc = func(timeout time.Duration) (jobresult *JobResult) { - bufOut := new(bytes.Buffer) - bufErr := new(bytes.Buffer) - //cmd := exec.Command("/bin/bash", "-c", command) - var cmd *exec.Cmd - if runtime.GOOS == "windows" { - cmd = exec.Command("CMD", "/C", command) - } else { - cmd = exec.Command("sh", "-c", command) - } - cmd.Stdout = bufOut - cmd.Stderr = bufErr - cmd.Start() - err, isTimeout := runCmdWithTimeout(cmd, timeout) - jobresult = new(JobResult) - jobresult.OutMsg = bufOut.String() - jobresult.ErrMsg = bufErr.String() - - jobresult.IsOk = true - if err != nil { - jobresult.IsOk = false - } - - jobresult.IsTimeout = isTimeout - - return jobresult - } - return job -} - -//远程执行任务 密钥验证 -func RemoteCommandJob(id int, serverId int, name string, command string, servers *models.TaskServer) *Job { - job := &Job{ - Id: id, - Name: name, - ServerId: serverId, - } - - job.JobKey = libs.JobKey(id, serverId) - - job.RunFunc = func(timeout time.Duration) (jobresult *JobResult) { - jobresult = new(JobResult) - jobresult.OutMsg = "" - jobresult.ErrMsg = "" - jobresult.IsTimeout = false - jobresult.IsOk = true - - key, err := ioutil.ReadFile(servers.PrivateKeySrc) - if err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("读取私钥失败,%v", err.Error()) - return - } - // Create the Signer for this private key. - signer, err := ssh.ParsePrivateKey(key) - if err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("创建签名失败,%v", err.Error()) - return - } - addr := fmt.Sprintf("%s:%d", servers.ServerIp, servers.Port) - config := &ssh.ClientConfig{ - User: servers.ServerAccount, - Auth: []ssh.AuthMethod{ - // Use the PublicKeys method for remote authentication. - ssh.PublicKeys(signer), - }, - //HostKeyCallback: ssh.FixedHostKey(hostKey), - HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error { - return nil - }, - } - // Connect to the remote server and perform the SSH handshake.47.93.220.5 - client, err := ssh.Dial("tcp", addr, config) - if err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败,%v", err.Error()) - return - } - - defer client.Close() - - session, err := client.NewSession() - if err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败,%v", err.Error()) - return - } - defer session.Close() - - // Once a Session is created, you can execute a single command on - // the remote side using the Run method. - - var b bytes.Buffer - var c bytes.Buffer - session.Stdout = &b - session.Stderr = &c - jobresult.IsTimeout = false - //session.Output(command) - if err := session.Run(command); err != nil { - jobresult.ErrMsg = c.String() - jobresult.OutMsg = b.String() - jobresult.IsOk = false - return - } - jobresult.OutMsg = b.String() - jobresult.ErrMsg = c.String() - jobresult.IsOk = true - - return - } - return job -} - -func RemoteCommandJobByPassword(id int, serverId int, name string, command string, servers *models.TaskServer) *Job { - var ( - auth []ssh.AuthMethod - addr string - clientConfig *ssh.ClientConfig - client *ssh.Client - session *ssh.Session - err error - ) - - job := &Job{ - Id: id, - Name: name, - ServerId: serverId, - ServerType: servers.ConnectionType, - } - job.JobKey = libs.JobKey(id, serverId) - job.RunFunc = func(timeout time.Duration) (jobresult *JobResult) { - jobresult = new(JobResult) - jobresult.OutMsg = "" - jobresult.ErrMsg = "" - jobresult.IsTimeout = false - jobresult.IsOk = true - - // get auth method - auth = make([]ssh.AuthMethod, 0) - auth = append(auth, ssh.Password(servers.Password)) - - clientConfig = &ssh.ClientConfig{ - User: servers.ServerAccount, - Auth: auth, - HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error { - return nil - }, - //Timeout: 1000 * time.Second, - } - - // connet to ssh - addr = fmt.Sprintf("%s:%d", servers.ServerIp, servers.Port) - - if client, err = ssh.Dial("tcp", addr, clientConfig); err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("连接服务器失败,%v", err.Error()) - return - } - - defer client.Close() - - // create session - if session, err = client.NewSession(); err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("连接服务器失败,%v", err.Error()) - return - } - - var b bytes.Buffer - var c bytes.Buffer - session.Stdout = &b - session.Stderr = &c - //session.Output(command) - if err := session.Run(command); err != nil { - jobresult.IsOk = false - } - jobresult.OutMsg = b.String() - jobresult.ErrMsg = c.String() - return - } - - return job -} - -func RemoteCommandJobByTelnetPassword(id int, serverId int, name string, command string, servers *models.TaskServer) *Job { - - job := &Job{ - Id: id, - Name: name, - ServerId: serverId, - } - - job.JobKey = libs.JobKey(id, serverId) - job.RunFunc = func(timeout time.Duration) (jobresult *JobResult) { - jobresult = new(JobResult) - jobresult.OutMsg = "" - jobresult.ErrMsg = "" - jobresult.IsTimeout = false - jobresult.IsOk = true - - addr := fmt.Sprintf("%s:%d", servers.ServerIp, servers.Port) - conn, err := gote.DialTimeout("tcp", addr, timeout) - if err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败0,%v", err.Error()) - return - } - - defer conn.Close() - - buf := make([]byte, 4096) - - if _, err = conn.Read(buf); err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败-1,%v", err.Error()) - return - } - - if _, err = conn.Write([]byte(servers.ServerAccount + "\r\n")); err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败-2,%v", err.Error()) - return - } - - if _, err = conn.Read(buf); err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败-3,%v", err.Error()) - return - } - - if _, err = conn.Write([]byte(servers.Password + "\r\n")); err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败-4,%v", err.Error()) - return - } - - if _, err = conn.Read(buf); err != nil { - jobresult.IsOk = false - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败-5,%v", err.Error()) - return - } - - loginStr := libs.GbkAsUtf8(string(buf[:])) - if !strings.Contains(loginStr, ">") { - jobresult.ErrMsg = jobresult.ErrMsg + "Login failed!" - jobresult.IsOk = false - return - } - - commandArr := strings.Split(command, "\n") - - out, n := "", 0 - for _, c := range commandArr { - _, err = conn.Write([]byte(c + "\r\n")) - if err != nil { - jobresult.ErrMsg = fmt.Sprintf("服务器连接失败-6,%v", err.Error()) - jobresult.IsOk = false - return - } - - n, err = conn.Read(buf) - - out = out + libs.GbkAsUtf8(string(buf[0:n])) - if err != nil || - strings.Contains(out, "'"+c+"' is not recognized as an internal or external command") || - strings.Contains(out, "'"+c+"' 不是内部或外部命令,也不是可运行的程序") { - jobresult.ErrMsg = jobresult.ErrMsg + " " + libs.GbkAsUtf8(string(buf[0:n])) - jobresult.IsOk = false - jobresult.OutMsg = out - return - } - } - jobresult.IsOk = true - jobresult.OutMsg = out - return - } - - return job -} - -func RemoteCommandJobByAgentPassword(id int, serverId int, name string, command string, servers *models.TaskServer) *Job { - - job := &Job{ - Id: id, - Name: name, - ServerType: servers.ConnectionType, - } - - job.JobKey = libs.JobKey(id, serverId) - job.RunFunc = func(timeout time.Duration) *JobResult { - return new(JobResult) - } - return job - -} - -func (j *Job) GetStatus() int { - return j.Status -} - -func (j *Job) GetName() string { - return j.Name -} - -func (j *Job) GetId() int { - return j.Id -} - -func (j *Job) GetLogId() int64 { - return j.LogId -} - -type RpcResult struct { - Status int - Message string -} - -func (j *Job) agentRun() (reply *JobResult) { - - server, _ := models.TaskServerGetById(j.ServerId) - conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", server.ServerIp, server.Port)) - reply = new(JobResult) - if err != nil { - logs.Error("Net error:", err) - reply.IsOk = false - reply.ErrMsg = "Net error:" + err.Error() - reply.IsTimeout = false - reply.OutMsg = "" - return reply - } - - defer conn.Close() - client := rpc.NewClientWithCodec(jsonrpc.NewClientCodec(conn)) - - defer client.Close() - reply = new(JobResult) - - task := j.Task - err = client.Call("RpcTask.RunTask", task, &reply) - if err != nil { - reply.IsOk = false - reply.ErrMsg = "Net error:" + err.Error() - reply.IsTimeout = false - reply.OutMsg = "" - return reply - } - return -} - -func TestServer(server *models.TaskServer) error { - if server.ConnectionType == 0 { - switch server.Type { - case 0: - //密码登录 - return libs.RemoteCommandByPassword(server) - case 1: - //密钥登录 - return libs.RemoteCommandByKey(server) - default: - return errors.New("未知的登录方式") - - } - } else if server.ConnectionType == 1 { - if server.Type == 0 { - //密码登录] - return libs.RemoteCommandByTelnetPassword(server) - } else { - return errors.New("Telnet方式暂不支持密钥登陆!") - } - - } else if server.ConnectionType == 2 { - return libs.RemoteAgent(server) - } - - return errors.New("未知错误") -} - -func PollServer(j *Job) bool { - //判断是否是当前执行器执行 - TaskServerIdsArr := strings.Split(j.Task.ServerIds, ",") - num := len(TaskServerIdsArr) - - if num == 0 { - return false - } - - count := GetCounter(strconv.Itoa(j.Task.Id)) - index := count % num - pollServerId, _ := strconv.Atoi(TaskServerIdsArr[index]) - - if j.ServerId != pollServerId { - return false - } - - //本地服务器 - if pollServerId == 0 { - return true - } - - //判断执行器或者服务器是否存活 - server, _ := models.TaskServerGetById(pollServerId) - - if server.Status != 0 { - return false - } - - if err := TestServer(server); err != nil { - server.Status = 1 - server.Update() - return false - } else { - server.Status = 0 - server.Update() - } - - return true - -} - -func (j *Job) Run() { - //执行策略 轮询 - if j.Task.ServerType == 1 { - if !PollServer(j) { - return - } else { - SetCounter(strconv.Itoa(j.Task.Id)) - } - } - - if !j.Concurrent && j.Status > 0 { - beego.Warn(fmt.Sprintf("任务[%d]上一次执行尚未结束,本次被忽略。", j.JobKey)) - return - } - - defer func() { - if err := recover(); err != nil { - beego.Error(err, "\n", string(debug.Stack())) - } - }() - - if workPool != nil { - workPool <- true - defer func() { - <-workPool - }() - } - - beego.Debug(fmt.Sprintf("开始执行任务: %d", j.JobKey)) - - j.Status++ - defer func() { - j.Status-- - }() - - t := time.Now() - timeout := time.Duration(time.Hour * 24) - if j.Task.Timeout > 0 { - timeout = time.Second * time.Duration(j.Task.Timeout) - } - - var jobResult = new(JobResult) - //anget - if j.ServerType == 2 { - jobResult = j.agentRun() - } else { - jobResult = j.RunFunc(timeout) - } - - ut := time.Now().Sub(t) / time.Millisecond - - // 插入日志 - log := new(models.TaskLog) - log.TaskId = j.Id - log.ServerId = j.ServerId - log.ServerName = j.ServerName - log.Output = jobResult.OutMsg - log.Error = jobResult.ErrMsg - log.ProcessTime = int(ut) - log.CreateTime = t.Unix() - - if jobResult.IsTimeout { - log.Status = models.TASK_TIMEOUT - log.Error = fmt.Sprintf("任务执行超过 %d 秒\n----------------------\n%s\n", int(timeout/time.Second), jobResult.ErrMsg) - } else if !jobResult.IsOk { - log.Status = models.TASK_ERROR - log.Error = "ERROR:" + jobResult.ErrMsg - } - - if log.Status < 0 && j.Task.IsNotify == 1 { - if j.Task.NotifyUserIds != "0" && j.Task.NotifyUserIds != "" { - adminInfo := AllAdminInfo(j.Task.NotifyUserIds) - phone := make(map[string]string, 0) - dingtalk := make(map[string]string, 0) - wechat := make(map[string]string, 0) - toEmail := "" - for _, v := range adminInfo { - if v.Phone != "0" && v.Phone != "" { - phone[v.Phone] = v.Phone - } - if v.Email != "0" && v.Email != "" { - toEmail += v.Email + ";" - } - if v.Dingtalk != "0" && v.Dingtalk != "" { - dingtalk[v.Dingtalk] = v.Dingtalk - } - if v.Wechat != "0" && v.Wechat != "" { - wechat[v.Wechat] = v.Wechat - } - } - toEmail = strings.TrimRight(toEmail, ";") - - TextStatus := []string{ - "超时", - "错误", - "正常", - } - - status := log.Status + 2 - - title, content, taskOutput, errOutput := "", "", "", "" - - notifyTpl, err := models.NotifyTplGetById(j.Task.NotifyTplId) - if err != nil { - notifyTpl, err := models.NotifyTplGetByTplType(j.Task.NotifyType, models.NotifyTplTypeSystem) - if err == nil { - title = notifyTpl.Title - content = notifyTpl.Content - } - } else { - title = notifyTpl.Title - content = notifyTpl.Content - } - - taskOutput = strings.Replace(log.Output, "\n", " ", -1) - taskOutput = strings.Replace(taskOutput, "\"", "\\\"", -1) - errOutput = strings.Replace(log.Error, "\n", " ", -1) - errOutput = strings.Replace(errOutput, "\"", "\\\"", -1) - - if title != "" { - title = strings.Replace(title, "{{TaskId}}", strconv.Itoa(j.Task.Id), -1) - title = strings.Replace(title, "{{ServerId}}", strconv.Itoa(j.ServerId), -1) - title = strings.Replace(title, "{{TaskName}}", j.Task.TaskName, -1) - title = strings.Replace(title, "{{ExecuteCommand}}", j.Task.Command, -1) - title = strings.Replace(title, "{{ExecuteTime}}", beego.Date(time.Unix(log.CreateTime, 0), "Y-m-d H:i:s"), -1) - title = strings.Replace(title, "{{ProcessTime}}", strconv.FormatFloat(float64(log.ProcessTime)/1000, 'f', 6, 64), -1) - title = strings.Replace(title, "{{ExecuteStatus}}", TextStatus[status], -1) - title = strings.Replace(title, "{{TaskOutput}}", taskOutput, -1) - title = strings.Replace(title, "{{ErrorOutput}}", errOutput, -1) - } - - if content != "" { - content = strings.Replace(content, "{{TaskId}}", strconv.Itoa(j.Task.Id), -1) - content = strings.Replace(content, "{{ServerId}}", strconv.Itoa(j.ServerId), -1) - content = strings.Replace(content, "{{TaskName}}", j.Task.TaskName, -1) - content = strings.Replace(content, "{{ExecuteCommand}}", strings.Replace(j.Task.Command, "\"", "\\\"", -1), -1) - content = strings.Replace(content, "{{ExecuteTime}}", beego.Date(time.Unix(log.CreateTime, 0), "Y-m-d H:i:s"), -1) - content = strings.Replace(content, "{{ProcessTime}}", strconv.FormatFloat(float64(log.ProcessTime)/1000, 'f', 6, 64), -1) - content = strings.Replace(content, "{{ExecuteStatus}}", TextStatus[status], -1) - content = strings.Replace(content, "{{TaskOutput}}", taskOutput, -1) - content = strings.Replace(content, "{{ErrorOutput}}", errOutput, -1) - } - - if j.Task.NotifyType == 0 && toEmail != "" { - //邮件 - mailtype := "html" - ok := notify.SendToChan(toEmail, title, content, mailtype) - if !ok { - fmt.Println("发送邮件错误", toEmail) - } - } else if j.Task.NotifyType == 1 && len(phone) > 0 { - //信息 - param := make(map[string]string) - err := json.Unmarshal([]byte(content), ¶m) - if err != nil { - fmt.Println("发送信息错误", err) - return - } - - ok := notify.SendSmsToChan(phone, param) - if !ok { - fmt.Println("发送信息错误", phone) - } - } else if j.Task.NotifyType == 2 && len(dingtalk) > 0 { - //钉钉 - param := make(map[string]interface{}) - - err := json.Unmarshal([]byte(content), ¶m) - if err != nil { - fmt.Println("发送钉钉错误", err) - return - } - - ok := notify.SendDingtalkToChan(dingtalk, param) - if !ok { - fmt.Println("发送钉钉错误", dingtalk) - } - } else if j.Task.NotifyType == 3 && len(wechat) > 0 { - //微信 - param := make(map[string]string) - err := json.Unmarshal([]byte(content), ¶m) - if err != nil { - fmt.Println("发送微信错误", err) - return - } - - ok := notify.SendWechatToChan(phone, param) - if !ok { - fmt.Println("发送微信错误", phone) - } - } - } - } - - j.LogId, _ = models.TaskLogAdd(log) - - // 更新上次执行时间 - j.Task.PrevTime = t.Unix() - j.Task.ExecuteTimes++ - j.Task.Update("PrevTime", "ExecuteTimes") -} - -//冗余代码 -type adminInfo struct { - Id int - Email string - Phone string - Dingtalk string - Wechat string - RealName string -} - -func AllAdminInfo(adminIds string) []*adminInfo { - Filters := make([]interface{}, 0) - Filters = append(Filters, "status", 1) - //Filters = append(Filters, "id__gt", 1) - var notifyUserIds []int - if adminIds != "0" && adminIds != "" { - notifyUserIdsStr := strings.Split(adminIds, ",") - for _, v := range notifyUserIdsStr { - i, _ := strconv.Atoi(v) - notifyUserIds = append(notifyUserIds, i) - } - Filters = append(Filters, "id__in", notifyUserIds) - } - Result, _ := models.AdminGetList(1, 1000, Filters...) - - adminInfos := make([]*adminInfo, 0) - for _, v := range Result { - ai := adminInfo{ - Id: v.Id, - Email: v.Email, - Phone: v.Phone, - Dingtalk: v.Dingtalk, - Wechat: v.Wechat, - RealName: v.RealName, - } - adminInfos = append(adminInfos, &ai) - } - - return adminInfos -} diff --git a/libs/convert.go b/libs/convert.go deleted file mode 100644 index d615ddcc..00000000 --- a/libs/convert.go +++ /dev/null @@ -1,15 +0,0 @@ -/************************************************************ -** @Description: convert -** @Author: george hao -** @Date: 2019-06-28 09:34 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-28 09:34 -*************************************************************/ -package libs - -import "fmt" - -//查看数据类型 -func DataType(i interface{}) string { - return fmt.Sprintf("%T", i) -} diff --git a/libs/file.go b/libs/file.go deleted file mode 100644 index 6f1d78eb..00000000 --- a/libs/file.go +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************ -** @Description: libs -** @Author: george hao -** @Date: 2018-08-13 11:17 -** @Last Modified by: george hao -** @Last Modified time: 2018-08-13 11:17 -*************************************************************/ -package libs - -import ( - "fmt" - "math" - "net/http" - "os" - "path/filepath" - "strings" -) - -func Exist(path string) bool { - _, err := os.Stat(path) - return err == nil || os.IsExist(err) -} - -func GetCurrentDirectory() (string, error) { - dir, err := filepath.Abs(filepath.Dir(os.Args[0])) - if err != nil { - return "", err - } - return filepath.Clean(strings.Replace(dir, "\\", "/", -1)), nil - -} - -func IsTextFile(data []byte) bool { - if len(data) == 0 { - return true - } - return strings.Contains(http.DetectContentType(data), "text/") -} -func IsImageFile(data []byte) bool { - return strings.Contains(http.DetectContentType(data), "image/") -} -func IsPDFFile(data []byte) bool { - return strings.Contains(http.DetectContentType(data), "application/pdf") -} -func IsVideoFile(data []byte) bool { - return strings.Contains(http.DetectContentType(data), "video/") -} - -const ( - Byte = 1 - KByte = Byte * 1024 - MByte = KByte * 1024 - GByte = MByte * 1024 - TByte = GByte * 1024 - PByte = TByte * 1024 - EByte = PByte * 1024 -) - -var bytesSizeTable = map[string]uint64{ - "b": Byte, - "kb": KByte, - "mb": MByte, - "gb": GByte, - "tb": TByte, - "pb": PByte, - "eb": EByte, -} - -func logn(n, b float64) float64 { - return math.Log(n) / math.Log(b) -} -func humanateBytes(s uint64, base float64, sizes []string) string { - if s < 10 { - return fmt.Sprintf("%d B", s) - } - e := math.Floor(logn(float64(s), base)) - suffix := sizes[int(e)] - val := float64(s) / math.Pow(base, math.Floor(e)) - f := "%.0f" - if val < 10 { - f = "%.1f" - } - return fmt.Sprintf(f+" %s", val, suffix) -} -func FileSize(s int64) string { - sizes := []string{"B", "KB", "MB", "GB", "TB", "PB", "EB"} - return humanateBytes(uint64(s), 1024, sizes) -} diff --git a/libs/http.go b/libs/http.go deleted file mode 100644 index 95ee2fbe..00000000 --- a/libs/http.go +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************ -** @Description: libs -** @Author: george hao -** @Date: 2018-08-09 13:29 -** @Last Modified by: Bee -** @Last Modified time: 2019-02-15 13:50 -*************************************************************/ -package libs - -import ( - "github.com/pkg/errors" - "io" - "io/ioutil" - "net/http" - "strings" -) - -func HttpGet(url string, param map[string]string) (string, error) { - - if url == "" { - return "", errors.Errorf("url %s is not exists", url) - } - paramStr := "" - for k, v := range param { - paramStr += k + "=" + v + "&" - } - paramStr = strings.TrimRight(paramStr, "&") - - if paramStr != "" { - if strings.Contains(url, "?") { - url += "&" + paramStr - } else { - url += "?" + paramStr - } - } - - resp, err := http.Get(url) - - if err != nil { - return "", err - } - - defer resp.Body.Close() - - body, err := ioutil.ReadAll(resp.Body) - - if err != nil { - return "", err - } - - return string(body), nil -} - -func HttpPost(url string, contentType string, body io.Reader) (string, error) { - - resp, err := http.Post(url, contentType, body) - - if err != nil { - return "", err - } - - defer resp.Body.Close() - - resBody, err := ioutil.ReadAll(resp.Body) - - if err != nil { - return "", err - } - - return string(resBody), nil -} diff --git a/libs/ip.go b/libs/ip.go deleted file mode 100644 index bcee9aa6..00000000 --- a/libs/ip.go +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************ -** @Description: ip -** @Author: george hao -** @Date: 2019-06-27 09:20 -** @Last Modified by: george hao -** @Last Modified time: 2019-06-27 09:20 -*************************************************************/ -package libs - -import ( - "io/ioutil" - "net" - "net/http" -) - -func GetHostIp(IpType int) string { - if IpType == 0 { - return LocalIp() - } else { - return PublicIp() - } -} - -func LocalIp() string { - - addrs, err := net.InterfaceAddrs() - if err != nil { - return "" - } - for _, address := range addrs { - // 检查ip地址判断是否回环地址 - if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { - if ipnet.IP.To4() != nil { - return ipnet.IP.String() - } - } - } - return "" -} - -func PublicIp() string { - resp, err := http.Get("http://myexternalip.com/raw") - if err != nil { - return "" - } - defer resp.Body.Close() - content, _ := ioutil.ReadAll(resp.Body) - //buf := new(bytes.Buffer) - //buf.ReadFrom(resp.Body) - //s := buf.String() - return string(content) -} diff --git a/libs/monitor.go b/libs/monitor.go deleted file mode 100644 index deff043b..00000000 --- a/libs/monitor.go +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************ -** @Description: libs -** @Author: george hao -** @Date: 2018-08-13 11:16 -** @Last Modified by: george hao -** @Last Modified time: 2018-08-13 11:16 -*************************************************************/ -package libs - -import ( - "fmt" - "runtime" - "time" -) - -func SystemInfo(startTime int64) map[string]interface{} { - - var afterLastGC string - goNum := runtime.NumGoroutine() - cpuNum := runtime.NumCPU() - mstat := &runtime.MemStats{} - runtime.ReadMemStats(mstat) - now := time.Now().Unix() - //costTime := int(time.Now().Sub(startTime).Seconds()) - costTime := int(now - startTime) - mb := 1024 * 1024 - - if mstat.LastGC != 0 { - afterLastGC = fmt.Sprintf("%.1fs", float64(time.Now().UnixNano()-int64(mstat.LastGC))/1000/1000/1000) - } else { - afterLastGC = "0" - } - - return map[string]interface{}{ - "服务运行时间": fmt.Sprintf("%d天%d小时%d分%d秒", costTime/(3600*24), costTime%(3600*24)/3600, costTime%3600/60, costTime%(60)), - "goroute数量": goNum, - "cpu核心数": cpuNum, - - "当前内存使用量": FileSize(int64(mstat.Alloc)), - "所有被分配的内存": FileSize(int64(mstat.TotalAlloc)), - "内存占用量": FileSize(int64(mstat.Sys)), - "指针查找次数": mstat.Lookups, - "内存分配次数": mstat.Mallocs, - "内存释放次数": mstat.Frees, - "距离上次GC时间": afterLastGC, - - // "当前 Heap 内存使用量": file.FileSize(int64(mstat.HeapAlloc)), - // "Heap 内存占用量": file.FileSize(int64(mstat.HeapSys)), - // "Heap 内存空闲量": file.FileSize(int64(mstat.HeapIdle)), - // "正在使用的 Heap 内存": file.FileSize(int64(mstat.HeapInuse)), - // "被释放的 Heap 内存": file.FileSize(int64(mstat.HeapReleased)), - // "Heap 对象数量": mstat.HeapObjects, - - "下次GC内存回收量": fmt.Sprintf("%.3fMB", float64(mstat.NextGC)/float64(mb)), - "GC暂停时间总量": fmt.Sprintf("%.3fs", float64(mstat.PauseTotalNs)/1000/1000/1000), - "上次GC暂停时间": fmt.Sprintf("%.3fs", float64(mstat.PauseNs[(mstat.NumGC+255)%256])/1000/1000/1000), - } -} diff --git a/libs/server.go b/libs/server.go deleted file mode 100644 index d74d0e7f..00000000 --- a/libs/server.go +++ /dev/null @@ -1,150 +0,0 @@ -/************************************************************ -** @Description: server -** @Author: george hao -** @Date: 2019-07-02 11:16 -** @Last Modified by: george hao -** @Last Modified time: 2019-07-02 11:16 -*************************************************************/ -package libs - -import ( - "fmt" - "github.com/george518/PPGo_Job/common" - "github.com/george518/PPGo_Job/models" - "github.com/linxiaozhi/go-telnet" - "github.com/pkg/errors" - "golang.org/x/crypto/ssh" - "io/ioutil" - "net" - "net/rpc" - "net/rpc/jsonrpc" - "strconv" - "strings" - "time" -) - -func RemoteCommandByTelnetPassword(servers *models.TaskServer) error { - - addr := fmt.Sprintf("%s:%d", servers.ServerIp, servers.Port) - conn, err := gote.DialTimeout("tcp", addr, time.Second*10) - if err != nil { - return err - } - - defer conn.Close() - - buf := make([]byte, 4096) - _, err = conn.Read(buf) - if err != nil { - return err - } - - _, err = conn.Write([]byte(servers.ServerAccount + "\r\n")) - if err != nil { - return err - } - - _, err = conn.Read(buf) - if err != nil { - return err - } - - _, err = conn.Write([]byte(servers.Password + "\r\n")) - if err != nil { - return err - } - - _, err = conn.Read(buf) - if err != nil { - return err - } - - str := GbkAsUtf8(string(buf[:])) - - if strings.Contains(str, ">") { - return nil - } - - return errors.Errorf("连接失败!") -} - -func RemoteCommandByPassword(servers *models.TaskServer) error { - var ( - auth []ssh.AuthMethod - addr string - clientConfig *ssh.ClientConfig - ) - - auth = make([]ssh.AuthMethod, 0) - auth = append(auth, ssh.Password(servers.Password)) - - clientConfig = &ssh.ClientConfig{ - User: servers.ServerAccount, - Auth: auth, - HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error { - return nil - }, - Timeout: 5 * time.Second, - } - - addr = fmt.Sprintf("%s:%d", servers.ServerIp, servers.Port) - client, err := ssh.Dial("tcp", addr, clientConfig) - if err == nil { - defer client.Close() - } - return err -} - -func RemoteCommandByKey(servers *models.TaskServer) error { - key, err := ioutil.ReadFile(servers.PrivateKeySrc) - if err != nil { - return err - } - - signer, err := ssh.ParsePrivateKey(key) - if err != nil { - return err - } - addr := fmt.Sprintf("%s:%d", servers.ServerIp, servers.Port) - config := &ssh.ClientConfig{ - User: servers.ServerAccount, - Auth: []ssh.AuthMethod{ - // Use the PublicKeys method for remote authentication. - ssh.PublicKeys(signer), - }, - //HostKeyCallback: ssh.FixedHostKey(hostKey), - HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error { - return nil - }, - Timeout: 5 * time.Second, - } - - client, err := ssh.Dial("tcp", addr, config) - if err == nil { - client.Close() - } - return err -} - -func RemoteAgent(servers *models.TaskServer) error { - - conn, err := net.Dial("tcp", servers.ServerIp+":"+strconv.Itoa(servers.Port)) - if err != nil { - return err - } - defer conn.Close() - client := rpc.NewClientWithCodec(jsonrpc.NewClientCodec(conn)) - var reply *common.RpcResult - defer client.Close() - - ping := "ping" - err = client.Call("RpcTask.HeartBeat", ping, &reply) - if err != nil { - return err - } - if reply.Status == 200 { - return nil - } else { - return fmt.Errorf("链接错误:%v", reply.Message) - } -} diff --git a/libs/string.go b/libs/string.go index 09f4f9e7..4e1363f2 100644 --- a/libs/string.go +++ b/libs/string.go @@ -1,83 +1,56 @@ -/********************************************** -** @Des: This file ... -** @Author: haodaquan -** @Date: 2017-09-08 00:24:25 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 10:12:06 -***********************************************/ - package libs import ( "crypto/md5" + "crypto/sha256" + "encoding/hex" "fmt" - "github.com/axgle/mahonia" - "math/rand" - "regexp" - "time" + "strings" + + "github.com/gogf/gf/v2/util/grand" ) -var emailPattern = regexp.MustCompile("[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[a-zA-Z0-9](?:[\\w-]*[\\w])?") - +// Md5 计算MD5哈希(仅用于向后兼容旧密码验证) func Md5(buf []byte) string { - hash := md5.New() - hash.Write(buf) - return fmt.Sprintf("%x", hash.Sum(nil)) + return fmt.Sprintf("%x", md5.Sum(buf)) } -func SizeFormat(size float64) string { - units := []string{"Byte", "KB", "MB", "GB", "TB"} - n := 0 - for size > 1024 { - size /= 1024 - n += 1 +// HashPassword 生成密码哈希(使用 SHA-256 + 随机盐值) +// 格式: $sha256$$ +func HashPassword(password string) (string, string) { + salt := grand.S(16) + h := sha256.Sum256([]byte(salt + password)) + hash := fmt.Sprintf("$sha256$%s$%x", salt, h) + return hash, salt +} + +// VerifyPassword 验证密码,兼容新旧两种哈希格式 +func VerifyPassword(password, storedHash, salt string) bool { + // 新格式: $sha256$$ + if strings.HasPrefix(storedHash, "$sha256$") { + parts := strings.Split(storedHash, "$") + if len(parts) != 4 { + return false + } + h := sha256.Sum256([]byte(parts[2] + password)) + expected := fmt.Sprintf("$sha256$%s$%x", parts[2], h) + return storedHash == expected } - - return fmt.Sprintf("%.2f %s", size, units[n]) + // 旧格式: MD5(password + salt) + return Md5([]byte(password+salt)) == storedHash } -func IsEmail(b []byte) bool { - return emailPattern.Match(b) -} - -func Password(len int, pwdO string) (pwd string, salt string) { - salt = GetRandomString(4) - defaultPwd := "george518" - if pwdO != "" { - defaultPwd = pwdO +// Password 生成密码和盐值(已弃用,使用 HashPassword 代替) +func Password(length int, pwdO string) (pwd string, salt string) { + if pwdO == "" { + pwdO = "george518" } - pwd = Md5([]byte(defaultPwd + salt)) - return pwd, salt + pwd, salt = HashPassword(pwdO) + return } -// 生成32位MD5 -// func MD5(text string) string{ -// ctx := md5.New() -// ctx.Write([]byte(text)) -// return hex.EncodeToString(ctx.Sum(nil)) -// } - -//生成随机字符串 -func GetRandomString(lens int) string { - str := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - bytes := []byte(str) - result := []byte{} - r := rand.New(rand.NewSource(time.Now().UnixNano())) - for i := 0; i < lens; i++ { - result = append(result, bytes[r.Intn(len(bytes))]) - } - return string(result) -} - -func GbkAsUtf8(str string) string { - srcDecoder := mahonia.NewDecoder("gbk") - desDecoder := mahonia.NewDecoder("utf-8") - resStr := srcDecoder.ConvertString(str) - _, resBytes, _ := desDecoder.Translate([]byte(resStr), true) - return string(resBytes) -} - -//任务识别码 -func JobKey(taskId, serverId int) int { - return taskId*100000 + serverId +// Sha256Hex 计算 SHA-256 十六进制字符串 +func Sha256Hex(data []byte) string { + h := sha256.Sum256(data) + return hex.EncodeToString(h[:]) } diff --git a/libs/string_test.go b/libs/string_test.go new file mode 100644 index 00000000..8bad56c2 --- /dev/null +++ b/libs/string_test.go @@ -0,0 +1,122 @@ +package libs + +import ( + "strings" + "testing" +) + +func TestMd5(t *testing.T) { + tests := []struct { + input string + expected string + }{ + {"hello", "5d41402abc4b2a76b9719d911017c592"}, + {"123456", "e10adc3949ba59abbe56e057f20f883e"}, + {"", "d41d8cd98f00b204e9800998ecf8427e"}, + } + for _, tt := range tests { + result := Md5([]byte(tt.input)) + if result != tt.expected { + t.Errorf("Md5(%q) = %q, want %q", tt.input, result, tt.expected) + } + } +} + +func TestHashPassword(t *testing.T) { + password := "test123" + hash, salt := HashPassword(password) + + if hash == "" { + t.Error("HashPassword() returned empty hash") + } + if salt == "" { + t.Error("HashPassword() returned empty salt") + } + if !strings.HasPrefix(hash, "$sha256$") { + t.Errorf("HashPassword() hash %q does not have $sha256$ prefix", hash) + } + + // Verify the hash can be verified + if !VerifyPassword(password, hash, salt) { + t.Error("VerifyPassword() failed for freshly generated hash") + } + + // Wrong password should fail + if VerifyPassword("wrong", hash, salt) { + t.Error("VerifyPassword() should fail for wrong password") + } +} + +func TestVerifyPassword_NewFormat(t *testing.T) { + hash, salt := HashPassword("mypassword") + if !VerifyPassword("mypassword", hash, salt) { + t.Error("VerifyPassword should verify $sha256$ format") + } + if VerifyPassword("notmypassword", hash, salt) { + t.Error("VerifyPassword should reject wrong password for $sha256$ format") + } +} + +func TestVerifyPassword_OldFormat(t *testing.T) { + // Old format: MD5(password + salt) + oldHash := Md5([]byte("oldpass" + "abcd")) + if !VerifyPassword("oldpass", oldHash, "abcd") { + t.Error("VerifyPassword should verify old MD5 format") + } + if VerifyPassword("wrongpass", oldHash, "abcd") { + t.Error("VerifyPassword should reject wrong password for old MD5 format") + } +} + +func TestVerifyPassword_MalformedHash(t *testing.T) { + // Malformed $sha256$ hash (only 2 parts instead of 4) + malformed := "$sha256$toofew" + if VerifyPassword("anything", malformed, "salt") { + t.Error("VerifyPassword should reject malformed hash") + } +} + +func TestPassword(t *testing.T) { + // Default password when empty + pwd, salt := Password(0, "") + if pwd == "" || salt == "" { + t.Error("Password() with empty input should return non-empty hash/salt") + } + if !strings.HasPrefix(pwd, "$sha256$") { + t.Errorf("Password() hash should have $sha256$ prefix, got %q", pwd) + } + + // Custom password + pwd2, salt2 := Password(0, "custompass") + if pwd2 == "" || salt2 == "" { + t.Error("Password() with custom password should return non-empty hash/salt") + } + if !VerifyPassword("custompass", pwd2, salt2) { + t.Error("Password() hash should verify with original password") + } +} + +func TestSha256Hex(t *testing.T) { + tests := []struct { + input string + expected string + }{ + {"hello", "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"}, + {"", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + } + for _, tt := range tests { + result := Sha256Hex([]byte(tt.input)) + if result != tt.expected { + t.Errorf("Sha256Hex(%q) = %q, want %q", tt.input, result, tt.expected) + } + } +} + +func FuzzVerifyPassword(f *testing.F) { + f.Add("password123", "$sha256$salt1234$ab12cd34ef56", "salt1234") + f.Add("abc", "5d41402abc4b2a76b9719d911017c592", "salt") + f.Fuzz(func(t *testing.T, password, hash, salt string) { + // Should not panic with any input + _ = VerifyPassword(password, hash, salt) + }) +} diff --git a/main.go b/main.go index b997db1c..ff78ca0b 100644 --- a/main.go +++ b/main.go @@ -1,28 +1,15 @@ -/************************************************************ -** @Description: PPGo_Job2 -** @Author: haodaquan -** @Date: 2018-06-05 22:24 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-05 22:24 -*************************************************************/ package main import ( - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/jobs" - "github.com/george518/PPGo_Job/models" - _ "github.com/george518/PPGo_Job/routers" - "time" + "context" + _ "ppgo_job/boot" + + "github.com/gogf/gf/v2/frame/g" ) -func init() { - - //初始化数据模型 - var StartTime = time.Now().Unix() - models.Init(StartTime) - jobs.InitJobs() -} - func main() { - beego.Run() + ctx := context.Background() + g.Log().Info(ctx, "PPGo_Job 服务启动中...") + + g.Server().Run() } diff --git a/middleware/auth.go b/middleware/auth.go new file mode 100644 index 00000000..1009158d --- /dev/null +++ b/middleware/auth.go @@ -0,0 +1,154 @@ +package middleware + +import ( + "ppgo_job/dao" + "ppgo_job/libs" + "ppgo_job/model/entity" + "strings" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/util/gconv" +) + +// Auth 认证中间件 — 解析Cookie,注入用户信息 +func Auth(r *ghttp.Request) { + ctx := r.GetCtx() + + // 读取 auth cookie + authCookie := r.Cookie.Get("auth") + if authCookie == nil { + redirectToLogin(r) + return + } + + authStr := authCookie.String() + parts := strings.Split(authStr, "|") + if len(parts) != 2 { + redirectToLogin(r) + return + } + + userId := gconv.Int(parts[0]) + hash := parts[1] + if userId < 1 || hash == "" { + redirectToLogin(r) + return + } + + // 查询用户 + admin, err := dao.Admin.GetById(ctx, userId) + if err != nil || admin == nil || admin.Status != 1 { + redirectToLogin(r) + return + } + + // 验证 hash + clientIp := r.GetClientIp() + expectedHash := libs.Sha256Hex([]byte(admin.Salt + "|" + clientIp + "|" + admin.Password)) + if hash != expectedHash { + redirectToLogin(r) + return + } + + // 注入用户信息 + r.SetCtxVar("userId", admin.Id) + r.SetCtxVar("loginUserId", admin.Id) + r.SetCtxVar("loginUserName", admin.RealName) + r.SetCtxVar("user", admin) + + // 加载权限数据 + loadPermissions(r, admin) + + r.Middleware.Next() +} + +// AuthCheck 权限检查中间件 +func AuthCheck(r *ghttp.Request) { + userId := r.GetCtxVar("userId", 0).Int() + if userId == 0 { + redirectToLogin(r) + return + } + r.Middleware.Next() +} + +// loadPermissions 加载权限和菜单 +func loadPermissions(r *ghttp.Request, admin *entity.Admin) { + ctx := r.GetCtx() + + // 从角色的权限关联获取可访问的URL + var allowUrls []string + + // 侧边栏菜单 + authList, _ := dao.Auth.GetList(ctx, "status", 1) + menu1 := make([]g.Map, 0) + menu2 := make([]g.Map, 0) + + for _, v := range authList { + if v.Pid == 0 && v.IsShow == 1 { + allowUrls = append(allowUrls, v.AuthUrl) + menu1 = append(menu1, g.Map{ + "Id": v.Id, + "Sort": v.Sort, + "AuthName": v.AuthName, + "AuthUrl": v.AuthUrl, + "Icon": v.Icon, + "Pid": v.Pid, + }) + } else if v.Pid != 0 && v.IsShow == 1 { + allowUrls = append(allowUrls, v.AuthUrl) + menu2 = append(menu2, g.Map{ + "Id": v.Id, + "Sort": v.Sort, + "AuthName": v.AuthName, + "AuthUrl": v.AuthUrl, + "Icon": v.Icon, + "Pid": v.Pid, + }) + } + } + + r.SetCtxVar("SideMenu1", menu1) + r.SetCtxVar("SideMenu2", menu2) + r.SetCtxVar("allowUrl", strings.Join(allowUrls, ",")) + + // 数据权限 + roleIds := admin.RoleIds + if roleIds == "" || roleIds == "0" || admin.Id == 1 { + r.SetCtxVar("serverGroups", "") // 全部 + r.SetCtxVar("taskGroups", "") // 全部 + return + } + + // 非超级管理员,按角色限制数据范围 + roleIdArr := strings.Split(roleIds, ",") + allServerGroups := make([]string, 0) + allTaskGroups := make([]string, 0) + for _, rid := range roleIdArr { + if id := gconv.Int(rid); id > 0 { + role, _ := dao.Role.GetById(ctx, id) + if role != nil { + if role.ServerGroupIds != "" { + allServerGroups = append(allServerGroups, role.ServerGroupIds) + } + if role.TaskGroupIds != "" { + allTaskGroups = append(allTaskGroups, role.TaskGroupIds) + } + } + } + } + r.SetCtxVar("serverGroups", strings.Join(allServerGroups, ",")) + r.SetCtxVar("taskGroups", strings.Join(allTaskGroups, ",")) +} + +func redirectToLogin(r *ghttp.Request) { + if r.IsAjaxRequest() { + r.Response.WriteJson(g.Map{"status": -1, "message": "请先登录"}) + } else { + r.Response.RedirectTo("/") + } + r.Exit() +} + +// redirectToLogin 重定向到登录页 diff --git a/model/entity/admin.go b/model/entity/admin.go new file mode 100644 index 00000000..e772bee3 --- /dev/null +++ b/model/entity/admin.go @@ -0,0 +1,48 @@ +package entity + +// Admin 管理员用户 +type Admin struct { + Id int `orm:"id" json:"id"` + LoginName string `orm:"login_name" json:"loginName"` + RealName string `orm:"real_name" json:"realName"` + Password string `orm:"password" json:"-"` + RoleIds string `orm:"role_ids" json:"roleIds"` + Phone string `orm:"phone" json:"phone"` + Email string `orm:"email" json:"email"` + Dingtalk string `orm:"dingtalk" json:"dingtalk"` + Wechat string `orm:"wechat" json:"wechat"` + Salt string `orm:"salt" json:"-"` + LastLogin int64 `orm:"last_login" json:"lastLogin"` + LastIp string `orm:"last_ip" json:"lastIp"` + Status int `orm:"status" json:"status"` + CreateId int `orm:"create_id" json:"createId"` + UpdateId int `orm:"update_id" json:"updateId"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` +} + +// AdminCols 字段常量 +var AdminCols = struct { + Id, LoginName, RealName, Password, RoleIds string + Phone, Email, Dingtalk, Wechat, Salt string + LastLogin, LastIp, Status string + CreateId, UpdateId, CreateTime, UpdateTime string +}{ + Id: "id", + LoginName: "login_name", + RealName: "real_name", + Password: "password", + RoleIds: "role_ids", + Phone: "phone", + Email: "email", + Dingtalk: "dingtalk", + Wechat: "wechat", + Salt: "salt", + LastLogin: "last_login", + LastIp: "last_ip", + Status: "status", + CreateId: "create_id", + UpdateId: "update_id", + CreateTime: "create_time", + UpdateTime: "update_time", +} diff --git a/model/entity/auth.go b/model/entity/auth.go new file mode 100644 index 00000000..1cf0cb72 --- /dev/null +++ b/model/entity/auth.go @@ -0,0 +1,39 @@ +package entity + +// Auth 权限因子 +type Auth struct { + Id int `orm:"id" json:"id"` + AuthName string `orm:"auth_name" json:"authName"` + AuthUrl string `orm:"auth_url" json:"authUrl"` + UserId int `orm:"user_id" json:"userId"` + Pid int `orm:"pid" json:"pid"` + Sort int `orm:"sort" json:"sort"` + Icon string `orm:"icon" json:"icon"` + IsShow int `orm:"is_show" json:"isShow"` + Status int `orm:"status" json:"status"` + CreateId int `orm:"create_id" json:"createId"` + UpdateId int `orm:"update_id" json:"updateId"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` +} + +// AuthCols 字段常量 +var AuthCols = struct { + Id, AuthName, AuthUrl, UserId, Pid string + Sort, Icon, IsShow, Status string + CreateId, UpdateId, CreateTime, UpdateTime string +}{ + Id: "id", + AuthName: "auth_name", + AuthUrl: "auth_url", + UserId: "user_id", + Pid: "pid", + Sort: "sort", + Icon: "icon", + IsShow: "is_show", + Status: "status", + CreateId: "create_id", + UpdateId: "update_id", + CreateTime: "create_time", + UpdateTime: "update_time", +} diff --git a/model/entity/ban.go b/model/entity/ban.go new file mode 100644 index 00000000..2efcc466 --- /dev/null +++ b/model/entity/ban.go @@ -0,0 +1,21 @@ +package entity + +// Ban 禁用命令 +type Ban struct { + Id int `orm:"id" json:"id"` + Code string `orm:"code" json:"code"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` + Status int `orm:"status" json:"status"` +} + +// BanCols 字段常量 +var BanCols = struct { + Id, Code, CreateTime, UpdateTime, Status string +}{ + Id: "id", + Code: "code", + CreateTime: "create_time", + UpdateTime: "update_time", + Status: "status", +} diff --git a/model/entity/notify_tpl.go b/model/entity/notify_tpl.go new file mode 100644 index 00000000..e0d7256d --- /dev/null +++ b/model/entity/notify_tpl.go @@ -0,0 +1,35 @@ +package entity + +// NotifyTpl 通知模板 +type NotifyTpl struct { + Id int `orm:"id" json:"id"` + Type string `orm:"type" json:"type"` + TplName string `orm:"tpl_name" json:"tplName"` + TplType int `orm:"tpl_type" json:"tplType"` + Title string `orm:"title" json:"title"` + Content string `orm:"content" json:"content"` + Status int `orm:"status" json:"status"` + CreateId int `orm:"create_id" json:"createId"` + UpdateId int `orm:"update_id" json:"updateId"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` +} + +// NotifyTplCols 字段常量 +var NotifyTplCols = struct { + Id, Type, TplName, TplType string + Title, Content, Status string + CreateId, UpdateId, CreateTime, UpdateTime string +}{ + Id: "id", + Type: "type", + TplName: "tpl_name", + TplType: "tpl_type", + Title: "title", + Content: "content", + Status: "status", + CreateId: "create_id", + UpdateId: "update_id", + CreateTime: "create_time", + UpdateTime: "update_time", +} diff --git a/model/entity/role.go b/model/entity/role.go new file mode 100644 index 00000000..4b5a8db9 --- /dev/null +++ b/model/entity/role.go @@ -0,0 +1,32 @@ +package entity + +// Role 角色 +type Role struct { + Id int `orm:"id" json:"id"` + RoleName string `orm:"role_name" json:"roleName"` + Detail string `orm:"detail" json:"detail"` + ServerGroupIds string `orm:"server_group_ids" json:"serverGroupIds"` + TaskGroupIds string `orm:"task_group_ids" json:"taskGroupIds"` + Status int `orm:"status" json:"status"` + CreateId int `orm:"create_id" json:"createId"` + UpdateId int `orm:"update_id" json:"updateId"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` +} + +// RoleCols 字段常量 +var RoleCols = struct { + Id, RoleName, Detail, ServerGroupIds, TaskGroupIds string + Status, CreateId, UpdateId, CreateTime, UpdateTime string +}{ + Id: "id", + RoleName: "role_name", + Detail: "detail", + ServerGroupIds: "server_group_ids", + TaskGroupIds: "task_group_ids", + Status: "status", + CreateId: "create_id", + UpdateId: "update_id", + CreateTime: "create_time", + UpdateTime: "update_time", +} diff --git a/model/entity/role_auth.go b/model/entity/role_auth.go new file mode 100644 index 00000000..291d948a --- /dev/null +++ b/model/entity/role_auth.go @@ -0,0 +1,15 @@ +package entity + +// RoleAuth 角色-权限关联 +type RoleAuth struct { + AuthId int `orm:"auth_id" json:"authId"` + RoleId int `orm:"role_id" json:"roleId"` +} + +// RoleAuthCols 字段常量 +var RoleAuthCols = struct { + AuthId, RoleId string +}{ + AuthId: "auth_id", + RoleId: "role_id", +} diff --git a/model/entity/server.go b/model/entity/server.go new file mode 100644 index 00000000..b62b22aa --- /dev/null +++ b/model/entity/server.go @@ -0,0 +1,46 @@ +package entity + +// TaskServer 执行服务器 +type TaskServer struct { + Id int `orm:"id" json:"id"` + GroupId int `orm:"group_id" json:"groupId"` + ConnectionType int `orm:"connection_type" json:"connectionType"` + ServerName string `orm:"server_name" json:"serverName"` + ServerAccount string `orm:"server_account" json:"serverAccount"` + ServerOuterIp string `orm:"server_outer_ip" json:"serverOuterIp"` + ServerIp string `orm:"server_ip" json:"serverIp"` + Port int `orm:"port" json:"port"` + Password string `orm:"password" json:"-"` + PrivateKeySrc string `orm:"private_key_src" json:"privateKeySrc"` + PublicKeySrc string `orm:"public_key_src" json:"publicKeySrc"` + Type int `orm:"type" json:"type"` + Detail string `orm:"detail" json:"detail"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` + Status int `orm:"status" json:"status"` +} + +// TaskServerCols 字段常量 +var TaskServerCols = struct { + Id, GroupId, ConnectionType, ServerName, ServerAccount string + ServerOuterIp, ServerIp, Port, Password string + PrivateKeySrc, PublicKeySrc, Type, Detail string + CreateTime, UpdateTime, Status string +}{ + Id: "id", + GroupId: "group_id", + ConnectionType: "connection_type", + ServerName: "server_name", + ServerAccount: "server_account", + ServerOuterIp: "server_outer_ip", + ServerIp: "server_ip", + Port: "port", + Password: "password", + PrivateKeySrc: "private_key_src", + PublicKeySrc: "public_key_src", + Type: "type", + Detail: "detail", + CreateTime: "create_time", + UpdateTime: "update_time", + Status: "status", +} diff --git a/model/entity/server_group.go b/model/entity/server_group.go new file mode 100644 index 00000000..e384a972 --- /dev/null +++ b/model/entity/server_group.go @@ -0,0 +1,28 @@ +package entity + +// ServerGroup 服务器组 +type ServerGroup struct { + Id int `orm:"id" json:"id"` + GroupName string `orm:"group_name" json:"groupName"` + Description string `orm:"description" json:"description"` + CreateId int `orm:"create_id" json:"createId"` + UpdateId int `orm:"update_id" json:"updateId"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` + Status int `orm:"status" json:"status"` +} + +// ServerGroupCols 字段常量 +var ServerGroupCols = struct { + Id, GroupName, Description string + CreateId, UpdateId, CreateTime, UpdateTime, Status string +}{ + Id: "id", + GroupName: "group_name", + Description: "description", + CreateId: "create_id", + UpdateId: "update_id", + CreateTime: "create_time", + UpdateTime: "update_time", + Status: "status", +} diff --git a/model/entity/task.go b/model/entity/task.go new file mode 100644 index 00000000..d5932755 --- /dev/null +++ b/model/entity/task.go @@ -0,0 +1,57 @@ +package entity + +// Task 定时任务 +type Task struct { + Id int `orm:"id" json:"id"` + GroupId int `orm:"group_id" json:"groupId"` + ServerIds string `orm:"server_ids" json:"serverIds"` + ServerType int `orm:"server_type" json:"serverType"` + TaskName string `orm:"task_name" json:"taskName"` + Description string `orm:"description" json:"description"` + CronSpec string `orm:"cron_spec" json:"cronSpec"` + Concurrent int `orm:"concurrent" json:"concurrent"` + Command string `orm:"command" json:"command"` + Timeout int `orm:"timeout" json:"timeout"` + ExecuteTimes int `orm:"execute_times" json:"executeTimes"` + PrevTime int64 `orm:"prev_time" json:"prevTime"` + Status int `orm:"status" json:"status"` + IsNotify int `orm:"is_notify" json:"isNotify"` + NotifyType int `orm:"notify_type" json:"notifyType"` + NotifyTplId int `orm:"notify_tpl_id" json:"notifyTplId"` + NotifyUserIds string `orm:"notify_user_ids" json:"notifyUserIds"` + CreateId int `orm:"create_id" json:"createId"` + UpdateId int `orm:"update_id" json:"updateId"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` +} + +// TaskCols 字段常量 +var TaskCols = struct { + Id, GroupId, ServerIds, ServerType, TaskName string + Description, CronSpec, Concurrent, Command string + Timeout, ExecuteTimes, PrevTime, Status string + IsNotify, NotifyType, NotifyTplId, NotifyUserIds string + CreateId, UpdateId, CreateTime, UpdateTime string +}{ + Id: "id", + GroupId: "group_id", + ServerIds: "server_ids", + ServerType: "server_type", + TaskName: "task_name", + Description: "description", + CronSpec: "cron_spec", + Concurrent: "concurrent", + Command: "command", + Timeout: "timeout", + ExecuteTimes: "execute_times", + PrevTime: "prev_time", + Status: "status", + IsNotify: "is_notify", + NotifyType: "notify_type", + NotifyTplId: "notify_tpl_id", + NotifyUserIds: "notify_user_ids", + CreateId: "create_id", + UpdateId: "update_id", + CreateTime: "create_time", + UpdateTime: "update_time", +} diff --git a/model/entity/task_group.go b/model/entity/task_group.go new file mode 100644 index 00000000..104215fd --- /dev/null +++ b/model/entity/task_group.go @@ -0,0 +1,28 @@ +package entity + +// Group 任务分组 +type Group struct { + Id int `orm:"id" json:"id"` + GroupName string `orm:"group_name" json:"groupName"` + Description string `orm:"description" json:"description"` + CreateId int `orm:"create_id" json:"createId"` + UpdateId int `orm:"update_id" json:"updateId"` + CreateTime int64 `orm:"create_time" json:"createTime"` + UpdateTime int64 `orm:"update_time" json:"updateTime"` + Status int `orm:"status" json:"status"` +} + +// GroupCols 字段常量 +var GroupCols = struct { + Id, GroupName, Description string + CreateId, UpdateId, CreateTime, UpdateTime, Status string +}{ + Id: "id", + GroupName: "group_name", + Description: "description", + CreateId: "create_id", + UpdateId: "update_id", + CreateTime: "create_time", + UpdateTime: "update_time", + Status: "status", +} diff --git a/model/entity/task_log.go b/model/entity/task_log.go new file mode 100644 index 00000000..4bc068a7 --- /dev/null +++ b/model/entity/task_log.go @@ -0,0 +1,30 @@ +package entity + +// TaskLog 任务执行日志 +type TaskLog struct { + Id int `orm:"id" json:"id"` + TaskId int `orm:"task_id" json:"taskId"` + ServerId int `orm:"server_id" json:"serverId"` + ServerName string `orm:"server_name" json:"serverName"` + Output string `orm:"output" json:"output"` + Error string `orm:"error" json:"error"` + Status int `orm:"status" json:"status"` + ProcessTime int `orm:"process_time" json:"processTime"` + CreateTime int64 `orm:"create_time" json:"createTime"` +} + +// TaskLogCols 字段常量 +var TaskLogCols = struct { + Id, TaskId, ServerId, ServerName string + Output, Error, Status, ProcessTime, CreateTime string +}{ + Id: "id", + TaskId: "task_id", + ServerId: "server_id", + ServerName: "server_name", + Output: "output", + Error: "error", + Status: "status", + ProcessTime: "process_time", + CreateTime: "create_time", +} diff --git a/models/admin.go b/models/admin.go deleted file mode 100644 index 0dc630e0..00000000 --- a/models/admin.go +++ /dev/null @@ -1,98 +0,0 @@ -/********************************************** -** @Des: This file ... -** @Author: haodaquan -** @Date: 2017-09-16 15:42:43 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:48:17 -***********************************************/ -package models - -import ( - "github.com/astaxie/beego/orm" -) - -type Admin struct { - Id int - LoginName string - RealName string - Password string - RoleIds string - Phone string - Email string - Dingtalk string - Wechat string - Salt string - LastLogin int64 - LastIp string - Status int - CreateId int - UpdateId int - CreateTime int64 - UpdateTime int64 -} - -func (a *Admin) TableName() string { - return TableName("uc_admin") -} - -func AdminAdd(a *Admin) (int64, error) { - return orm.NewOrm().Insert(a) -} - -func AdminGetByName(loginName string) (*Admin, error) { - a := new(Admin) - err := orm.NewOrm().QueryTable(TableName("uc_admin")).Filter("login_name", loginName).One(a) - if err != nil { - return nil, err - } - return a, nil -} - -func AdminGetList(page, pageSize int, filters ...interface{}) ([]*Admin, int64) { - offset := (page - 1) * pageSize - list := make([]*Admin, 0) - query := orm.NewOrm().QueryTable(TableName("uc_admin")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&list) - return list, total -} - -func AdminGetById(id int) (*Admin, error) { - r := new(Admin) - err := orm.NewOrm().QueryTable(TableName("uc_admin")).Filter("id", id).One(r) - if err != nil { - return nil, err - } - return r, nil -} - -func (a *Admin) Update(fields ...string) error { - if _, err := orm.NewOrm().Update(a, fields...); err != nil { - return err - } - return nil -} - -// func RoleAuthDelete(id int) (int64, error) { -// query := orm.NewOrm().QueryTable(TableName("role_auth")) -// return query.Filter("role_id", id).Delete() -// } - -// func RoleAuthMultiAdd(ras []*RoleAuth) (n int, err error) { -// query := orm.NewOrm().QueryTable(TableName("role_auth")) -// i, _ := query.PrepareInsert() -// for _, ra := range ras { -// _, err := i.Insert(ra) -// if err == nil { -// n = n + 1 -// } -// } -// i.Close() // 别忘记关闭 statement -// return n, err -// } diff --git a/models/auth.go b/models/auth.go deleted file mode 100644 index e33defbb..00000000 --- a/models/auth.go +++ /dev/null @@ -1,92 +0,0 @@ -/********************************************** -** @Des: 权限因子 -** @Author: haodaquan -** @Date: 2017-09-09 20:50:36 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 21:42:08 -***********************************************/ -package models - -import ( - "fmt" - - "github.com/astaxie/beego/orm" -) - -type Auth struct { - Id int - AuthName string - AuthUrl string - UserId int - Pid int - Sort int - Icon string - IsShow int - Status int - CreateId int - UpdateId int - CreateTime int64 - UpdateTime int64 -} - -func (a *Auth) TableName() string { - return TableName("uc_auth") -} - -func AuthGetList(page, pageSize int, filters ...interface{}) ([]*Auth, int64) { - offset := (page - 1) * pageSize - list := make([]*Auth, 0) - query := orm.NewOrm().QueryTable(TableName("uc_auth")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("pid", "sort").Limit(pageSize, offset).All(&list) - - return list, total -} - -func AuthGetListByIds(authIds string, userId int) ([]*Auth, error) { - - list1 := make([]*Auth, 0) - var list []orm.Params - //list:=[]orm.Params - var err error - if userId == 1 { - //超级管理员 - _, err = orm.NewOrm().Raw("select id,auth_name,auth_url,pid,icon,is_show from pp_uc_auth where status=? order by pid asc,sort asc", 1).Values(&list) - } else { - _, err = orm.NewOrm().Raw("select id,auth_name,auth_url,pid,icon,is_show from pp_uc_auth where status=1 and id in("+authIds+") order by pid asc,sort asc", authIds).Values(&list) - } - - for k, v := range list { - fmt.Println(k, v) - } - - fmt.Println(list) - return list1, err -} - -func AuthAdd(auth *Auth) (int64, error) { - return orm.NewOrm().Insert(auth) -} - -func AuthGetById(id int) (*Auth, error) { - a := new(Auth) - - err := orm.NewOrm().QueryTable(TableName("uc_auth")).Filter("id", id).One(a) - if err != nil { - return nil, err - } - return a, nil -} - -func (a *Auth) Update(fields ...string) error { - if _, err := orm.NewOrm().Update(a, fields...); err != nil { - return err - } - return nil -} diff --git a/models/ban.go b/models/ban.go deleted file mode 100644 index a1e98fa4..00000000 --- a/models/ban.go +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************ -** @Description: models -** @Author: haodaquan -** @Date: 2018-06-10 19:51 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-10 19:51 -*************************************************************/ -package models - -import ( - "fmt" - - "github.com/astaxie/beego/orm" -) - -type Ban struct { - Id int - Code string - CreateTime int64 - UpdateTime int64 - Status int -} - -func (t *Ban) TableName() string { - return TableName("task_ban") -} - -func (t *Ban) Update(fields ...string) error { - if t.Code == "" { - return fmt.Errorf("命令不能为空") - } - if _, err := orm.NewOrm().Update(t, fields...); err != nil { - return err - } - return nil -} - -func BanAdd(obj *Ban) (int64, error) { - if obj.Code == "" { - return 0, fmt.Errorf("命令不能为空") - } - return orm.NewOrm().Insert(obj) -} - -func BanGetById(id int) (*Ban, error) { - obj := &Ban{ - Id: id, - } - err := orm.NewOrm().Read(obj) - if err != nil { - return nil, err - } - return obj, nil -} - -func BanDelById(id int) error { - _, err := orm.NewOrm().QueryTable(TableName("task_ban")).Filter("id", id).Delete() - return err -} - -func BanGetList(page, pageSize int, filters ...interface{}) ([]*Ban, int64) { - offset := (page - 1) * pageSize - list := make([]*Ban, 0) - query := orm.NewOrm().QueryTable(TableName("task_ban")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&list) - return list, total -} diff --git a/models/init.go b/models/init.go deleted file mode 100644 index 65181c55..00000000 --- a/models/init.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -* @Author: haodaquan -* @Date: 2017-06-20 09:44:44 -* @Last Modified by: Bee -* @Last Modified time: 2019-02-15 22:12 - */ - -package models - -import ( - "net/url" - "os" - "path/filepath" - - "github.com/astaxie/beego" - "github.com/astaxie/beego/orm" - _ "github.com/go-sql-driver/mysql" - _ "github.com/mattn/go-sqlite3" -) - -var StartTime int64 - -func Init(startTime int64) { - StartTime = startTime - dbType := beego.AppConfig.String("db.type") - if dbType == "" { - dbType = "mysql" - } - - if dbType == "sqlite" { - dbpath := beego.AppConfig.String("db.path") - if dbpath == "" { - dbpath = "./data/ppgo_job.db" - } - - dir := filepath.Dir(dbpath) - if err := os.MkdirAll(dir, os.ModePerm); err != nil { - panic(err) - } - - dsn := dbpath - orm.RegisterDataBase("default", "sqlite3", dsn) - orm.RegisterModel( - new(Admin), - new(Auth), - new(Role), - new(RoleAuth), - new(ServerGroup), - new(TaskServer), - new(Ban), - new(Group), - new(Task), - new(TaskLog), - new(NotifyTpl), - ) - - if beego.AppConfig.String("runmode") == "dev" { - orm.Debug = true - } - } else { - dbhost := beego.AppConfig.String("db.host") - dbport := beego.AppConfig.String("db.port") - dbuser := beego.AppConfig.String("db.user") - dbpassword := beego.AppConfig.String("db.password") - dbname := beego.AppConfig.String("db.name") - timezone := beego.AppConfig.String("db.timezone") - if dbport == "" { - dbport = "3306" - } - dsn := dbuser + ":" + dbpassword + "@tcp(" + dbhost + ":" + dbport + ")/" + dbname + "?charset=utf8" - if timezone != "" { - dsn = dsn + "&loc=" + url.QueryEscape(timezone) - } - orm.RegisterDataBase("default", "mysql", dsn) - orm.RegisterModel( - new(Admin), - new(Auth), - new(Role), - new(RoleAuth), - new(ServerGroup), - new(TaskServer), - new(Ban), - new(Group), - new(Task), - new(TaskLog), - new(NotifyTpl), - ) - - if beego.AppConfig.String("runmode") == "dev" { - orm.Debug = true - } - } -} - -func TableName(name string) string { - return beego.AppConfig.String("db.prefix") + name -} diff --git a/models/notify_tpl.go b/models/notify_tpl.go deleted file mode 100644 index 5b020969..00000000 --- a/models/notify_tpl.go +++ /dev/null @@ -1,117 +0,0 @@ -/************************************************************ -** @Description: models -** @Author: Bee -** @Date: 2019-02-15 20:21 -** @Last Modified by: Bee -** @Last Modified time: 2019-02-15 20:21 -*************************************************************/ -package models - -import ( - "fmt" - "github.com/astaxie/beego/orm" - "time" -) - -const ( - NotifyTplTypeSystem = "system" - NotifyTplTypeDefault = "default" -) - -type NotifyTpl struct { - Id int - Type string - TplName string - TplType int - Title string - Content string - Status int - CreateId int - UpdateId int - CreateTime int64 - UpdateTime int64 -} - -func (t *NotifyTpl) TableName() string { - return TableName("notify_tpl") -} - -func (t *NotifyTpl) Update(fields ...string) error { - if t.TplName == "" { - return fmt.Errorf("模板名称不能为空") - } - - if t.Content == "" { - return fmt.Errorf("模板内容不能为空") - } - - if t.CreateTime == 0 { - t.CreateTime = time.Now().Unix() - } - - if _, err := orm.NewOrm().Update(t, fields...); err != nil { - return err - } - return nil -} - -func NotifyTplAdd(obj *NotifyTpl) (int64, error) { - if obj.TplName == "" { - return 0, fmt.Errorf("模板名称不能为空") - } - if obj.Content == "" { - return 0, fmt.Errorf("模板内容不能为空") - } - if obj.CreateTime == 0 { - obj.CreateTime = time.Now().Unix() - } - return orm.NewOrm().Insert(obj) -} - -func NotifyTplGetByTplType(tpl_type int, typestr string) (NotifyTpl, error) { - var obj NotifyTpl - err := orm.NewOrm().QueryTable(TableName("notify_tpl")).Filter("type", typestr).Filter("tpl_type", tpl_type).Filter("status", 1).Limit(1).One(&obj) - if err != nil { - return obj, err - } - - return obj, nil -} - -func NotifyTplGetById(id int) (*NotifyTpl, error) { - obj := &NotifyTpl{ - Id: id, - } - err := orm.NewOrm().Read(obj) - if err != nil { - return nil, err - } - return obj, nil -} - -func NotifyTplGetByTplTypeList(tpl_type int) ([]*NotifyTpl, int64, error) { - list := make([]*NotifyTpl, 0) - total, err := orm.NewOrm().QueryTable(TableName("notify_tpl")).Filter("tpl_type", tpl_type).Filter("status", 1).All(&list) - return list, total, err -} - -func NotifyTplDelById(id int) error { - _, err := orm.NewOrm().QueryTable(TableName("notify_tpl")).Filter("id", id).Delete() - return err -} - -func NotifyTplGetList(page, pageSize int, filters ...interface{}) ([]*NotifyTpl, int64) { - - offset := (page - 1) * pageSize - list := make([]*NotifyTpl, 0) - query := orm.NewOrm().QueryTable(TableName("notify_tpl")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&list) - return list, total -} diff --git a/models/role.go b/models/role.go deleted file mode 100644 index 1527a5a5..00000000 --- a/models/role.go +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************** -** @Des: This file ... -** @Author: haodaquan -** @Date: 2017-09-14 15:24:51 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:48:52 -***********************************************/ -package models - -import ( - "github.com/astaxie/beego/orm" -) - -type Role struct { - Id int - RoleName string - Detail string - ServerGroupIds string - TaskGroupIds string - Status int - CreateId int - UpdateId int - CreateTime int64 - UpdateTime int64 -} - -func (a *Role) TableName() string { - return TableName("uc_role") -} - -func RoleGetList(page, pageSize int, filters ...interface{}) ([]*Role, int64) { - offset := (page - 1) * pageSize - list := make([]*Role, 0) - query := orm.NewOrm().QueryTable(TableName("uc_role")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&list) - return list, total -} - -func RoleAdd(role *Role) (int64, error) { - id, err := orm.NewOrm().Insert(role) - if err != nil { - return 0, err - } - return id, nil -} - -func RoleGetById(id int) (*Role, error) { - r := new(Role) - err := orm.NewOrm().QueryTable(TableName("uc_role")).Filter("id", id).One(r) - if err != nil { - return nil, err - } - return r, nil -} - -func (r *Role) Update(fields ...string) error { - if _, err := orm.NewOrm().Update(r, fields...); err != nil { - return err - } - return nil -} diff --git a/models/role_auth.go b/models/role_auth.go deleted file mode 100644 index 4a913926..00000000 --- a/models/role_auth.go +++ /dev/null @@ -1,82 +0,0 @@ -/********************************************** -** @Des: This file ... -** @Author: haodaquan -** @Date: 2017-09-15 11:44:13 -** @Last Modified by: haodaquan -** @Last Modified time: 2017-09-17 11:49:13 -***********************************************/ -package models - -import ( - "bytes" - "strconv" - "strings" - - "github.com/astaxie/beego/orm" -) - -type RoleAuth struct { - AuthId int `orm:"pk"` - RoleId int64 -} - -func (ra *RoleAuth) TableName() string { - return TableName("uc_role_auth") -} - -func RoleAuthAdd(ra *RoleAuth) (int64, error) { - return orm.NewOrm().Insert(ra) -} - -func RoleAuthBatchAdd(ras *[]RoleAuth) (int64, error) { - return orm.NewOrm().InsertMulti(100, ras) -} - -func RoleAuthGetById(id int) ([]*RoleAuth, error) { - list := make([]*RoleAuth, 0) - query := orm.NewOrm().QueryTable(TableName("uc_role_auth")) - _, err := query.Filter("role_id", id).All(&list, "AuthId") - if err != nil { - return nil, err - } - return list, nil -} - -func RoleAuthDelete(id int) (int64, error) { - _, err := orm.NewOrm().Raw("DELETE FROM `pp_uc_role_auth` WHERE `role_id` = ?", - strconv.Itoa(id)).Exec() - return 0, err -} - -//获取多个 -func RoleAuthGetByIds(RoleIds string) (Authids string, err error) { - list := make([]*RoleAuth, 0) - query := orm.NewOrm().QueryTable(TableName("uc_role_auth")) - ids := strings.Split(RoleIds, ",") - _, err = query.Filter("role_id__in", ids).All(&list, "AuthId") - if err != nil { - return "", err - } - b := bytes.Buffer{} - for _, v := range list { - if v.AuthId != 0 && v.AuthId != 1 { - b.WriteString(strconv.Itoa(v.AuthId)) - b.WriteString(",") - } - } - Authids = strings.TrimRight(b.String(), ",") - return Authids, nil -} - -func RoleAuthMultiAdd(ras []*RoleAuth) (n int, err error) { - query := orm.NewOrm().QueryTable(TableName("uc_role_auth")) - i, _ := query.PrepareInsert() - for _, ra := range ras { - _, err := i.Insert(ra) - if err == nil { - n = n + 1 - } - } - i.Close() // 别忘记关闭 statement - return n, err -} diff --git a/models/server.go b/models/server.go deleted file mode 100644 index 1bac635e..00000000 --- a/models/server.go +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************************ -** @Description: models -** @Author: haodaquan -** @Date: 2018-06-09 16:11 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-09 16:11 -*************************************************************/ -package models - -import ( - "fmt" - "strconv" - "strings" - - "github.com/astaxie/beego/orm" -) - -type TaskServer struct { - Id int - GroupId int - ConnectionType int - ServerName string - ServerAccount string - ServerOuterIp string - ServerIp string - Port int - Password string - PrivateKeySrc string - PublicKeySrc string - Type int - Detail string - CreateTime int64 - UpdateTime int64 - Status int -} - -func (t *TaskServer) TableName() string { - return TableName("task_server") -} - -func (t *TaskServer) Update(fields ...string) error { - if t.ServerName == "" { - return fmt.Errorf("服务器名不能为空") - } - if t.ServerIp == "" { - return fmt.Errorf("服务器IP不能为空") - } - - if t.ServerAccount == "" { - return fmt.Errorf("登录账户不能为空") - } - - if t.Type == 0 && t.Password == "" { - return fmt.Errorf("服务器密码不能为空") - } - - if t.Type == 1 && t.PrivateKeySrc == "" { - return fmt.Errorf("私钥不能为空") - } - - if _, err := orm.NewOrm().Update(t, fields...); err != nil { - return err - } - return nil -} - -func TaskServerAdd(obj *TaskServer) (int64, error) { - if obj.ServerName == "" { - return 0, fmt.Errorf("服务器名不能为空") - } - if obj.ServerIp == "" { - return 0, fmt.Errorf("服务器IP不能为空") - } - - if obj.ServerAccount == "" { - return 0, fmt.Errorf("登录账户不能为空") - } - - if obj.Type == 0 && obj.Password == "" { - return 0, fmt.Errorf("服务器密码不能为空") - } - - if obj.Type == 1 && obj.PrivateKeySrc == "" { - return 0, fmt.Errorf("私钥不能为空") - } - return orm.NewOrm().Insert(obj) -} - -func TaskServerGetById(id int) (*TaskServer, error) { - obj := &TaskServer{ - Id: id, - } - err := orm.NewOrm().Read(obj) - if err != nil { - return nil, err - } - return obj, nil -} - -func TaskServerForActuator(serverIp string, port int) int { - serverFilters := make([]interface{}, 0) - serverFilters = append(serverFilters, "status__in", []int{0, 1}) - serverFilters = append(serverFilters, "server_ip", serverIp) - serverFilters = append(serverFilters, "port", port) - - server, _ := TaskServerGetList(1, 1, serverFilters...) - - if len(server) == 1 { - return server[0].Id - } - return 0 -} - -// -func TaskServerGetByIds(ids string) ([]*TaskServer, int64) { - - serverFilters := make([]interface{}, 0) - //serverFilters = append(serverFilters, "status", 1) - - TaskServerIdsArr := strings.Split(ids, ",") - TaskServerIds := make([]int, 0) - for _, v := range TaskServerIdsArr { - id, _ := strconv.Atoi(v) - TaskServerIds = append(TaskServerIds, id) - } - serverFilters = append(serverFilters, "id__in", TaskServerIds) - return TaskServerGetList(1, 1000, serverFilters...) -} - -func TaskServerDelById(id int) error { - _, err := orm.NewOrm().QueryTable(TableName("task_server")).Filter("id", id).Delete() - return err -} - -func TaskServerGetList(page, pageSize int, filters ...interface{}) ([]*TaskServer, int64) { - - offset := (page - 1) * pageSize - list := make([]*TaskServer, 0) - query := orm.NewOrm().QueryTable(TableName("task_server")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&list) - return list, total -} diff --git a/models/server_group.go b/models/server_group.go deleted file mode 100644 index 064ffbe5..00000000 --- a/models/server_group.go +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************ -** @Description: models -** @Author: haodaquan -** @Date: 2018-06-08 21:49 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-08 21:49 -*************************************************************/ -package models - -import ( - "fmt" - - "github.com/astaxie/beego/orm" -) - -type ServerGroup struct { - Id int - CreateId int - UpdateId int - GroupName string - Description string - CreateTime int64 - UpdateTime int64 - Status int -} - -func (t *ServerGroup) TableName() string { - return TableName("task_server_group") -} - -func (t *ServerGroup) Update(fields ...string) error { - if t.GroupName == "" { - return fmt.Errorf("组名不能为空") - } - if _, err := orm.NewOrm().Update(t, fields...); err != nil { - return err - } - return nil -} - -func ServerGroupAdd(obj *ServerGroup) (int64, error) { - if obj.GroupName == "" { - return 0, fmt.Errorf("组名不能为空") - } - return orm.NewOrm().Insert(obj) -} - -func TaskGroupGetById(id int) (*ServerGroup, error) { - obj := &ServerGroup{ - Id: id, - } - err := orm.NewOrm().Read(obj) - if err != nil { - return nil, err - } - return obj, nil -} - -func ServerGroupDelById(id int) error { - _, err := orm.NewOrm().QueryTable(TableName("task_server_group")).Filter("id", id).Delete() - return err -} - -func ServerGroupGetList(page, pageSize int, filters ...interface{}) ([]*ServerGroup, int64) { - offset := (page - 1) * pageSize - list := make([]*ServerGroup, 0) - query := orm.NewOrm().QueryTable(TableName("task_server_group")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&list) - return list, total -} diff --git a/models/task.go b/models/task.go deleted file mode 100644 index 94c07c73..00000000 --- a/models/task.go +++ /dev/null @@ -1,128 +0,0 @@ -/************************************************************ -** @Description: models -** @Author: haodaquan -** @Date: 2018-06-11 21:26 -** @Last Modified by: Bee -** @Last Modified time: 2019-02-15 21:32 -*************************************************************/ -package models - -import ( - "fmt" - "time" - - "github.com/astaxie/beego/orm" -) - -const ( - TASK_SUCCESS = 0 // 任务执行成功 - TASK_ERROR = -1 // 任务执行出错 - TASK_TIMEOUT = -2 // 任务执行超时 -) - -type Task struct { - Id int - GroupId int - ServerIds string - ServerType int - TaskName string - Description string - CronSpec string - Concurrent int - Command string - Timeout int - ExecuteTimes int - PrevTime int64 - Status int - IsNotify int - NotifyType int - NotifyTplId int - NotifyUserIds string - CreateId int - UpdateId int - CreateTime int64 - UpdateTime int64 -} - -func (t *Task) TableName() string { - return TableName("task") -} - -func (t *Task) Update(fields ...string) error { - if _, err := orm.NewOrm().Update(t, fields...); err != nil { - return err - } - return nil -} - -func TaskAdd(task *Task) (int64, error) { - if task.TaskName == "" { - return 0, fmt.Errorf("任务名称不能为空") - } - - if task.CronSpec == "" { - return 0, fmt.Errorf("时间表达式不能为空") - } - if task.Command == "" { - return 0, fmt.Errorf("命令内容不能为空") - } - if task.CreateTime == 0 { - task.CreateTime = time.Now().Unix() - } - return orm.NewOrm().Insert(task) -} - -func TaskGetList(page, pageSize int, filters ...interface{}) ([]*Task, int64) { - offset := (page - 1) * pageSize - - tasks := make([]*Task, 0) - - query := orm.NewOrm().QueryTable(TableName("task")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-status", "task_name", "-id").Limit(pageSize, offset).All(&tasks) - - return tasks, total -} - -func TaskResetGroupId(groupId int) (int64, error) { - return orm.NewOrm().QueryTable(TableName("task")).Filter("group_id", groupId).Update(orm.Params{ - "group_id": 0, - }) -} - -func TaskGetById(id int) (*Task, error) { - task := &Task{ - Id: id, - } - - err := orm.NewOrm().Read(task) - if err != nil { - return nil, err - } - return task, nil -} - -// 修改为逻辑删除 -func TaskDel(id int) (int64, error) { - return orm.NewOrm().QueryTable(TableName("task")).Filter("id", id).Update(orm.Params{ - "status": -1, - }) - //_, err := orm.NewOrm().QueryTable(TableName("task")).Filter("id", id).Delete() - //return err -} - -// 运行总次数 -func TaskTotalRunNum() (int64, error) { - var total int64 - err := orm.NewOrm().Raw("SELECT COALESCE(SUM(execute_times), 0) as num FROM " + TableName("task")).QueryRow(&total) - if err != nil { - return 0, err - } - return total, nil -} diff --git a/models/task_group.go b/models/task_group.go deleted file mode 100644 index 0b336027..00000000 --- a/models/task_group.go +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************ -** @Description: models -** @Author: haodaquan -** @Date: 2018-06-10 22:24 -** @Last Modified by: haodaquan -** @Last Modified time: 2018-06-10 22:24 -*************************************************************/ - -package models - -import ( - "fmt" - - "github.com/astaxie/beego/orm" -) - -type Group struct { - Id int - CreateId int - UpdateId int - GroupName string - Description string - CreateTime int64 - UpdateTime int64 - Status int -} - -func (t *Group) TableName() string { - return TableName("task_group") -} - -func (t *Group) Update(fields ...string) error { - if t.GroupName == "" { - return fmt.Errorf("组名不能为空") - } - if _, err := orm.NewOrm().Update(t, fields...); err != nil { - return err - } - return nil -} - -func GroupAdd(obj *Group) (int64, error) { - if obj.GroupName == "" { - return 0, fmt.Errorf("组名不能为空") - } - return orm.NewOrm().Insert(obj) -} - -func GroupGetById(id int) (*Group, error) { - obj := &Group{ - Id: id, - } - err := orm.NewOrm().Read(obj) - if err != nil { - return nil, err - } - return obj, nil -} - -func GroupDelById(id int) error { - _, err := orm.NewOrm().QueryTable(TableName("task_group")).Filter("id", id).Delete() - return err -} - -func GroupGetList(page, pageSize int, filters ...interface{}) ([]*Group, int64) { - offset := (page - 1) * pageSize - list := make([]*Group, 0) - query := orm.NewOrm().QueryTable(TableName("task_group")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&list) - return list, total -} diff --git a/models/task_log.go b/models/task_log.go deleted file mode 100644 index f0d2b3e5..00000000 --- a/models/task_log.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -* @Author: haodaquan -* @Date: 2017-06-21 12:23:22 -* @Last Modified by: haodaquan -* @Last Modified time: 2017-06-22 14:57:13 - */ - -package models - -import ( - "encoding/json" - "github.com/astaxie/beego/cache" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/orm" - "time" -) - -type TaskLog struct { - Id int - TaskId int - ServerId int - ServerName string - Output string - Error string - Status int - ProcessTime int - CreateTime int64 -} - -var RunNumCache, _ = cache.NewCache("memory", `{"interval":60}`) - -func (t *TaskLog) TableName() string { - return TableName("task_log") -} - -func TaskLogAdd(t *TaskLog) (int64, error) { - return orm.NewOrm().Insert(t) -} - -func TaskLogGetList(page, pageSize int, filters ...interface{}) ([]*TaskLog, int64) { - offset := (page - 1) * pageSize - - logs := make([]*TaskLog, 0) - - query := orm.NewOrm().QueryTable(TableName("task_log")) - if len(filters) > 0 { - l := len(filters) - for k := 0; k < l; k += 2 { - query = query.Filter(filters[k].(string), filters[k+1]) - } - } - - total, _ := query.Count() - query.OrderBy("-id").Limit(pageSize, offset).All(&logs) - - return logs, total -} - -func TaskLogGetById(id int) (*TaskLog, error) { - obj := &TaskLog{ - Id: id, - } - - err := orm.NewOrm().Read(obj) - if err != nil { - return nil, err - } - return obj, nil -} - -func TaskLogDelById(id int) error { - _, err := orm.NewOrm().Delete(&TaskLog{Id: id}) - return err -} - -func TaskLogDelByTaskId(taskId int) (int64, error) { - return orm.NewOrm().QueryTable(TableName("task_log")).Filter("task_id", taskId).Delete() -} - -func GetLogNum(status int) (int64, error) { - return orm.NewOrm().QueryTable(TableName("task_log")).Filter("status", status).Count() -} - -type SumDays struct { - Day string - Sum int -} - -func SumByDays(limit int, status string) orm.Params { - - var m = map[string]string{ - "0": "okNum", - "-1": "errNum", - "-2": "expiredRun"} - - res := make(orm.Params) - key := m[status] - - if RunNumCache.IsExist(key) { - json.Unmarshal(RunNumCache.Get(key).([]byte), &res) - logs.Info("cache") - return res - } - _, err := orm.NewOrm().Raw("SELECT FROM_UNIXTIME(create_time,'%Y-%m-%d') days,COUNT(id) count FROM pp_task_log WHERE status in(?) GROUP BY days ORDER BY days DESC limit ?;", - status, limit).RowsToMap(&res, "days", "count") - - if err != nil { - return nil - } - - data, err := json.Marshal(res) - if err != nil { - return nil - } - RunNumCache.Put(key, data, 2*time.Hour) - return res - -} diff --git a/notify/dingtalk.go b/notify/dingtalk.go deleted file mode 100644 index 9e841a38..00000000 --- a/notify/dingtalk.go +++ /dev/null @@ -1,84 +0,0 @@ -/************************************************************ -** @Description: notify -** @Author: Bee -** @Date: 2018-02-15 11:02 -** @Last Modified by: Bee -** @Last Modified time: 2018-02-15 11:02 -*************************************************************/ -package notify - -import ( - "bytes" - "encoding/json" - "fmt" - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/libs" - "log" - "time" -) - -type Dingtalk struct { - Dingtalks map[string]string - Content map[string]interface{} -} - -var DingtalkChan chan *Dingtalk -var DingtalkUrl string - -func init() { - DingtalkUrl = beego.AppConfig.String("dingtalk.url") - poolSize, _ := beego.AppConfig.Int("dingtalk.pool") - - //创建通道 - DingtalkChan = make(chan *Dingtalk, poolSize) - - go func() { - for { - select { - case m, ok := <-DingtalkChan: - if !ok { - return - } - if err := m.SendDingtalk(); err != nil { - beego.Error("SendDingtalk:", err.Error()) - - } - } - } - }() - -} - -func SendDingtalkToChan(dingtalks map[string]string, content map[string]interface{}) bool { - dingTalk := &Dingtalk{ - Dingtalks: dingtalks, - Content: content, - } - - select { - case DingtalkChan <- dingTalk: - return true - case <-time.After(time.Second * 3): - return false - } -} - -func (s *Dingtalk) SendDingtalk() error { - - for _, v := range s.Dingtalks { - body, err := json.Marshal(s.Content) - if err != nil { - log.Println(err) - return err - } - - url := fmt.Sprintf(DingtalkUrl, v) - _, resErr := libs.HttpPost(url, "application/json;charset=utf-8", bytes.NewBuffer(body)) - if resErr != nil { - log.Println(resErr) - return resErr - } - return nil - } - return nil -} diff --git a/notify/email.go b/notify/email.go deleted file mode 100644 index 0623ee9b..00000000 --- a/notify/email.go +++ /dev/null @@ -1,190 +0,0 @@ -/************************************************************ -** @Description: notify -** @Author: george hao -** @Date: 2018-08-08 12:59 -** @Last Modified by: gwalker -** @Last Modified time: 2018-11-26 14:57 -*************************************************************/ -package notify - -import ( - "crypto/tls" - "fmt" - "github.com/astaxie/beego" - "net" - "net/smtp" - "strings" - "time" -) - -type PEmailConfig struct { - Host string - Port string - User string - Pwd string - From string -} - -type PEmail struct { - Config *PEmailConfig - Subject string - Body string - To string - Format string -} - -var ( - mailChan chan *PEmail - config *PEmailConfig -) - -func init() { - - poolSize, _ := beego.AppConfig.Int("email.pool") - host := beego.AppConfig.String("email.host") - port := beego.AppConfig.String("email.port") - user := beego.AppConfig.String("email.user") - pwd := beego.AppConfig.String("email.password") - from := beego.AppConfig.String("email.from") - - config = &PEmailConfig{ - Host: host, - From: from, - Port: port, - User: user, - Pwd: pwd, - } - - //创建通道 - mailChan = make(chan *PEmail, poolSize) - - go func() { - for { - select { - case m, ok := <-mailChan: - if !ok { - return - } - if err := m.SendToEmail(); err != nil { - beego.Error("SendMail:", err.Error()) - } - } - } - }() -} - -func SendToChan(to, subject, body, mailtype string) bool { - email := &PEmail{ - Config: config, - Body: body, - Subject: subject, - Format: mailtype, - To: to, - } - select { - case mailChan <- email: - return true - case <-time.After(time.Second * 3): - return false - } - -} - -func (pe *PEmail) SendToEmail() error { - auth := smtp.PlainAuth("", pe.Config.User, pe.Config.Pwd, pe.Config.Host) - contentType := GetContentTypeString(pe.Format) - - msg := []byte("To: " + pe.To + "\r\nFrom: " + pe.Config.User + - "\r\nSubject: " + pe.Subject + "\r\n" + contentType + "\r\n\r\n" + pe.Body) - - sendTo := strings.Split(pe.To, ";") - - var err error - - if pe.Config.Port == "25" { - err = SendMailUsing25(pe.Config.Host,pe.Config.Port,auth,pe.Config.User,sendTo,msg) - } else if pe.Config.Port == "465" { - err = SendMailUsing465(pe.Config.Host,pe.Config.Port,auth,pe.Config.User,sendTo,msg) - } else{ - err = fmt.Errorf("%s","other ports are not supported,please check the app.conf configuration file") - } - - return err -} - - - -func GetContentTypeString ( format string ) string { - var contentType string - if format == "" { - contentType = "Content-Type: text/plain" + "; charset=UTF-8" - } else { - contentType = "Content-Type: text/" + format + "; charset=UTF-8" - } - return contentType -} - - -func SendMailUsing25(addr string, port string, auth smtp.Auth, from string, to []string, msg []byte) (err error) { - err = smtp.SendMail(addr+":"+port, auth, from, to, msg) - return err -} - - - -func SendMailUsing465(addr string,port string, auth smtp.Auth, from string, to []string, msg []byte) (err error) { - c, err := Dial(addr+":"+port) - if err != nil { - return err - } - defer c.Close() - - if auth != nil { - if ok, _ := c.Extension("AUTH"); ok { - if err = c.Auth(auth); err != nil { - return err - } - } - } - - if err = c.Mail(from); err != nil { - return err - } - - - for _, addr := range to { - if err = c.Rcpt(addr); err != nil { - fmt.Print(err) - return err - - } - } - - - w, err := c.Data() - if err != nil { - return err - } - - _, err = w.Write(msg) - if err != nil { - return err - } - - err = w.Close() - if err != nil { - return err - } - return c.Quit() -} - - -func Dial(addr string) (*smtp.Client, error) { - conn, err := tls.Dial("tcp", addr, nil) - if err != nil { - return nil, err - } - //分解主机端口字符串 - host, _, _ := net.SplitHostPort(addr) - return smtp.NewClient(conn, host) -} diff --git a/notify/sms.go b/notify/sms.go deleted file mode 100644 index df238b25..00000000 --- a/notify/sms.go +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************ -** @Description: notify -** @Author: george hao -** @Date: 2018-08-09 13:05 -** @Last Modified by: Bee -** @Last Modified time: 2019-02-15 13:50 -*************************************************************/ -package notify - -import ( - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/libs" - "log" - "time" - "encoding/json" - "github.com/pkg/errors" -) - -type SmsAjaxReturn struct { - Status int `json:"status"` - Message string `json:"message"` - Data interface{} `json:"data"` -} - -type Sms struct { - Mobiles map[string]string - Param map[string]string -} - -var SmsChan chan *Sms -var SmsUrl string - -func init() { - SmsUrl = beego.AppConfig.String("msg.url") - poolSize, _ := beego.AppConfig.Int("msg.pool") - - //创建通道 - SmsChan = make(chan *Sms, poolSize) - - go func() { - for { - select { - case m, ok := <-SmsChan: - if !ok { - return - } - if err := m.SendSms(); err != nil { - beego.Error("SendSms:", err.Error()) - } - } - } - }() - -} - -func SendSmsToChan(mobiles map[string]string, param map[string]string) bool { - sms := &Sms{ - Mobiles: mobiles, - Param: param, - } - - select { - case SmsChan <- sms: - return true - case <-time.After(time.Second * 3): - return false - } -} - -func (s *Sms) SendSms() error { - - for _, v := range s.Mobiles { - s.Param["mobile"] = v - res, err := libs.HttpGet(SmsUrl, s.Param) - - if err != nil { - log.Println(err) - return err - } - - ajaxData := SmsAjaxReturn{} - jsonErr := json.Unmarshal([]byte(res), &ajaxData) - - if jsonErr != nil { - return jsonErr - } - - if ajaxData.Status != 200 { - return errors.Errorf("msg %s", ajaxData.Message) - } - - return nil - - } - return nil -} diff --git a/notify/wechat.go b/notify/wechat.go deleted file mode 100644 index a1d45a89..00000000 --- a/notify/wechat.go +++ /dev/null @@ -1,89 +0,0 @@ -package notify - -import ( - "github.com/astaxie/beego" - "github.com/george518/PPGo_Job/libs" - "log" - "time" - "encoding/json" - "github.com/pkg/errors" -) - -type WechatAjaxReturn struct { - Status int `json:"status"` - Message string `json:"message"` - Data interface{} `json:"data"` -} - -type Wechat struct { - Accounts map[string]string - Param map[string]string -} - -var WechatChan chan *Wechat -var WechatUrl string - -func init() { - WechatUrl = beego.AppConfig.String("wechat.url") - poolSize, _ := beego.AppConfig.Int("wechat.pool") - - //创建通道 - WechatChan = make(chan *Wechat, poolSize) - - go func() { - for { - select { - case m, ok := <-WechatChan: - if !ok { - return - } - if err := m.SendWechat(); err != nil { - beego.Error("SendWechat:", err.Error()) - } - } - } - }() - -} - -func SendWechatToChan(accounts map[string]string, param map[string]string) bool { - wechat := &Wechat{ - Accounts: accounts, - Param: param, - } - - select { - case WechatChan <- wechat: - return true - case <-time.After(time.Second * 3): - return false - } -} - -func (s *Wechat) SendWechat() error { - - for _, v := range s.Accounts { - s.Param["account"] = v - res, err := libs.HttpGet(WechatUrl, s.Param) - - if err != nil { - log.Println(err) - return err - } - - ajaxData := WechatAjaxReturn{} - jsonErr := json.Unmarshal([]byte(res), &ajaxData) - - if jsonErr != nil { - return jsonErr - } - - if ajaxData.Status != 200 { - return errors.Errorf("msg %s", ajaxData.Message) - } - - return nil - - } - return nil -} diff --git a/package.sh b/package.sh deleted file mode 100755 index f5d7dfff..00000000 --- a/package.sh +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/env bash -# @Author: ouqiang -# @Link https://github.com/ouqiang/gocron -# @Last Modified by: Bee -# @Last Modified time: 2019-02-18 10:22:13 - -# 生成压缩包 xx.tar.gz或xx.zip -# 使用 ./package.sh -a amd64 -p linux -v v2.0.0 - -# 任何命令返回非0值退出 -set -o errexit -# 使用未定义的变量退出 -set -o nounset -# 管道中任一命令执行失败退出 -set -o pipefail - -eval $(go env) - -# 二进制文件名 -BINARY_NAME='' -# main函数所在文件 -MAIN_FILE="" - -# 提取git最新tag作为应用版本 -VERSION='' -# 最新git commit id -GIT_COMMIT_ID='' - -# 外部输入的系统 -INPUT_OS=() -# 外部输入的架构 -INPUT_ARCH=() -# 未指定OS,默认值 -DEFAULT_OS=${GOHOSTOS} -# 未指定ARCH,默认值 -DEFAULT_ARCH=${GOHOSTARCH} -# 支持的系统 -SUPPORT_OS=(linux darwin windows) -# 支持的架构 -SUPPORT_ARCH=(386 amd64) - -# 编译参数 -LDFLAGS='' -# 需要打包的文件 -INCLUDE_FILE=() -# linux需要打包的文件 -INCLUDE_LINUX_FILE=() -# darwin需要打包的文件 -INCLUDE_DARWIN_FILE=() -# windows需要打包的文件 -INCLUDE_WINDOWS_FILE=() - -# 打包文件生成目录 -PACKAGE_DIR='' -# 编译文件生成目录 -BUILD_DIR='' - -# 获取git 最新tag name -git_latest_tag() { - local COMMIT_ID="" - local TAG_NAME="" - COMMIT_ID=`git rev-list --tags --max-count=1` - TAG_NAME=`git describe --tags "${COMMIT_ID}"` - - echo ${TAG_NAME} -} - -# 获取git 最新commit id -git_latest_commit() { - echo "$(git rev-parse --short HEAD)" -} - -# 打印信息 -print_message() { - echo "$1" -} - -# 打印信息后推出 -print_message_and_exit() { - if [[ -n $1 ]]; then - print_message "$1" - fi - exit 1 -} - -# 设置系统、CPU架构 -set_os_arch() { - if [[ ${#INPUT_OS[@]} = 0 ]];then - INPUT_OS=("${DEFAULT_OS}") - fi - - if [[ ${#INPUT_ARCH[@]} = 0 ]];then - INPUT_ARCH=("${DEFAULT_ARCH}") - fi - - for OS in "${INPUT_OS[@]}"; do - if [[ ! "${SUPPORT_OS[*]}" =~ ${OS} ]]; then - print_message_and_exit "不支持的系统${OS}" - fi - done - - for ARCH in "${INPUT_ARCH[@]}";do - if [[ ! "${SUPPORT_ARCH[*]}" =~ ${ARCH} ]]; then - print_message_and_exit "不支持的CPU架构${ARCH}" - fi - done -} - -# 初始化 -init() { - set_os_arch - - if [[ -z "${VERSION}" ]];then - VERSION=`git_latest_tag` - fi - GIT_COMMIT_ID=`git_latest_commit` - LDFLAGS="-w -X 'main.AppVersion=${VERSION}' -X 'main.BuildDate=`date '+%Y-%m-%d %H:%M:%S'`' -X 'main.GitCommit=${GIT_COMMIT_ID}'" - - PACKAGE_DIR=${BINARY_NAME}-package - BUILD_DIR=${BINARY_NAME}-build - - if [[ -d ${BUILD_DIR} ]];then - rm -rf ${BUILD_DIR} - fi -# if [[ -d ${PACKAGE_DIR} ]];then -# rm -rf ${PACKAGE_DIR} -# fi - - mkdir -p ${BUILD_DIR} - mkdir -p ${PACKAGE_DIR} -} - -# 编译 -build() { - local FILENAME='' - for OS in "${INPUT_OS[@]}";do - for ARCH in "${INPUT_ARCH[@]}";do - if [[ "${OS}" = "windows" ]];then - FILENAME=${BINARY_NAME}.exe - else - FILENAME=${BINARY_NAME} - fi - env CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/${BINARY_NAME}-${OS}-${ARCH}/${FILENAME} ${MAIN_FILE} - done - done -} - -# 打包 -package_binary() { - cd ${BUILD_DIR} - - for OS in "${INPUT_OS[@]}";do - for ARCH in "${INPUT_ARCH[@]}";do - package_file ${BINARY_NAME}-${OS}-${ARCH} - if [[ "${OS}" = "windows" ]];then - zip -rq ../${PACKAGE_DIR}/${BINARY_NAME}-${VERSION}-${OS}-${ARCH}.zip ${BINARY_NAME}-${OS}-${ARCH} - else - tar czf ../${PACKAGE_DIR}/${BINARY_NAME}-${VERSION}-${OS}-${ARCH}.tar.gz ${BINARY_NAME}-${OS}-${ARCH} - fi - done - done - - cd ${OLDPWD} -} - -# 打包文件 -package_file() { - if [[ "${#INCLUDE_FILE[@]}" = "0" ]];then - return - fi - for item in "${INCLUDE_FILE[@]}"; do - cp -r ../${item} $1 - done - - for OS in "${INPUT_OS[@]}";do - if [[ "${OS}" = "linux" ]];then - for item in "${INCLUDE_LINUX_FILE[@]}"; do - cp -r ../${item} $1 - done - elif [[ "${OS}" = "darwin" ]];then - for item in "${INCLUDE_DARWIN_FILE[@]}"; do - cp -r ../${item} $1 - done - elif [[ "${OS}" = "windows" ]];then - for item in "${INCLUDE_WINDOWS_FILE[@]}"; do - cp -r ../${item} $1 - done - fi - done -} - -# 清理 -clean() { - if [[ -d ${BUILD_DIR} ]];then - rm -rf ${BUILD_DIR} - fi -} - -# 运行 -run() { - init - build - package_binary - clean -} - -package_ppgo_job() { - BINARY_NAME='PPGo_Job' - MAIN_FILE="./main.go" - INCLUDE_FILE=("conf" "static" "views" "ppgo_job2.sql") - INCLUDE_LINUX_FILE=("run.sh") - INCLUDE_DARWIN_FILE=("run.sh") - INCLUDE_WINDOWS_FILE=("run.bat") - - run -} - -# p 平台 linux darwin windows -# a 架构 386 amd64 -# v 版本号 默认取git最新tag -while getopts "p:a:v:" OPT; -do - case ${OPT} in - p) IPS=',' read -r -a INPUT_OS <<< "${OPTARG}" - ;; - a) IPS=',' read -r -a INPUT_ARCH <<< "${OPTARG}" - ;; - v) VERSION=$OPTARG - ;; - *) - ;; - esac -done - -package_ppgo_job diff --git a/static/admin/css/app.css b/resource/static/admin/css/app.css similarity index 100% rename from static/admin/css/app.css rename to resource/static/admin/css/app.css diff --git a/static/admin/css/main.css b/resource/static/admin/css/main.css similarity index 100% rename from static/admin/css/main.css rename to resource/static/admin/css/main.css diff --git a/static/admin/images/default.png b/resource/static/admin/images/default.png similarity index 100% rename from static/admin/images/default.png rename to resource/static/admin/images/default.png diff --git a/static/admin/images/favicon.ico b/resource/static/admin/images/favicon.ico similarity index 100% rename from static/admin/images/favicon.ico rename to resource/static/admin/images/favicon.ico diff --git a/static/admin/images/header.jpg b/resource/static/admin/images/header.jpg similarity index 100% rename from static/admin/images/header.jpg rename to resource/static/admin/images/header.jpg diff --git a/static/admin/images/logo.png b/resource/static/admin/images/logo.png similarity index 100% rename from static/admin/images/logo.png rename to resource/static/admin/images/logo.png diff --git a/static/admin/js/formSelects-v3.js b/resource/static/admin/js/formSelects-v3.js similarity index 99% rename from static/admin/js/formSelects-v3.js rename to resource/static/admin/js/formSelects-v3.js index edd1f20f..a777e422 100644 --- a/static/admin/js/formSelects-v3.js +++ b/resource/static/admin/js/formSelects-v3.js @@ -2,11 +2,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -/** - * name: formSelects - * 基于Layui Select多选 - * version: 3.0.9.0607 - * https://faysunshine.com/layui/template/formSelects-v3/formSelects-v3.js +/** + * name: formSelects + * 基于Layui Select多选 + * version: 3.0.9.0607 + * https://faysunshine.com/layui/template/formSelects-v3/formSelects-v3.js */ (function (layui, window, factory) { if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') { diff --git a/static/admin/js/jquery.min.js b/resource/static/admin/js/jquery.min.js similarity index 100% rename from static/admin/js/jquery.min.js rename to resource/static/admin/js/jquery.min.js diff --git a/static/echarts/echarts.min.js b/resource/static/echarts/echarts.min.js similarity index 100% rename from static/echarts/echarts.min.js rename to resource/static/echarts/echarts.min.js diff --git a/static/font-awesome/css/font-awesome.css b/resource/static/font-awesome/css/font-awesome.css old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/css/font-awesome.css rename to resource/static/font-awesome/css/font-awesome.css diff --git a/static/font-awesome/css/font-awesome.min.css b/resource/static/font-awesome/css/font-awesome.min.css old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/css/font-awesome.min.css rename to resource/static/font-awesome/css/font-awesome.min.css diff --git a/static/font-awesome/fonts/FontAwesome.otf b/resource/static/font-awesome/fonts/FontAwesome.otf old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/fonts/FontAwesome.otf rename to resource/static/font-awesome/fonts/FontAwesome.otf diff --git a/static/font-awesome/fonts/fontawesome-webfont.eot b/resource/static/font-awesome/fonts/fontawesome-webfont.eot old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/fonts/fontawesome-webfont.eot rename to resource/static/font-awesome/fonts/fontawesome-webfont.eot diff --git a/static/font-awesome/fonts/fontawesome-webfont.svg b/resource/static/font-awesome/fonts/fontawesome-webfont.svg old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/fonts/fontawesome-webfont.svg rename to resource/static/font-awesome/fonts/fontawesome-webfont.svg diff --git a/static/font-awesome/fonts/fontawesome-webfont.ttf b/resource/static/font-awesome/fonts/fontawesome-webfont.ttf old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/fonts/fontawesome-webfont.ttf rename to resource/static/font-awesome/fonts/fontawesome-webfont.ttf diff --git a/static/font-awesome/fonts/fontawesome-webfont.woff b/resource/static/font-awesome/fonts/fontawesome-webfont.woff old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/fonts/fontawesome-webfont.woff rename to resource/static/font-awesome/fonts/fontawesome-webfont.woff diff --git a/static/font-awesome/fonts/fontawesome-webfont.woff2 b/resource/static/font-awesome/fonts/fontawesome-webfont.woff2 old mode 100755 new mode 100644 similarity index 100% rename from static/font-awesome/fonts/fontawesome-webfont.woff2 rename to resource/static/font-awesome/fonts/fontawesome-webfont.woff2 diff --git a/static/layui/css/layui.css b/resource/static/layui/css/layui.css old mode 100755 new mode 100644 similarity index 99% rename from static/layui/css/layui.css rename to resource/static/layui/css/layui.css index 91887d8d..c9f076d4 --- a/static/layui/css/layui.css +++ b/resource/static/layui/css/layui.css @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ .layui-inline,img{display:inline-block;vertical-align:middle}h1,h2,h3,h4,h5,h6{font-weight:400}.layui-edge,.layui-header,.layui-inline,.layui-main{position:relative}.layui-btn,.layui-edge,.layui-inline,img{vertical-align:middle}.layui-btn,.layui-disabled,.layui-icon,.layui-unselect{-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none}blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}a:active,a:hover{outline:0}img{border:none}li{list-style:none}table{border-collapse:collapse;border-spacing:0}h4,h5,h6{font-size:100%}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}body{line-height:24px;font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}hr{height:1px;margin:10px 0;border:0;clear:both}a{color:#333;text-decoration:none}a:hover{color:#777}a cite{font-style:normal;*cursor:pointer}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-box,.layui-box *{box-sizing:content-box}.layui-clear{clear:both;*zoom:1}.layui-clear:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-inline{*display:inline;*zoom:1}.layui-edge{display:inline-block;width:0;height:0;border-width:6px;border-style:dashed;border-color:transparent;overflow:hidden}.layui-edge-top{top:-4px;border-bottom-color:#999;border-bottom-style:solid}.layui-edge-right{border-left-color:#999;border-left-style:solid}.layui-edge-bottom{top:2px;border-top-color:#999;border-top-style:solid}.layui-edge-left{border-right-color:#999;border-right-style:solid}.layui-elip{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-disabled,.layui-disabled:hover{color:#d2d2d2!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=240);src:url(../font/iconfont.eot?v=240#iefix) format('embedded-opentype'),url(../font/iconfont.svg?v=240#iconfont) format('svg'),url(../font/iconfont.woff?v=240) format('woff'),url(../font/iconfont.ttf?v=240) format('truetype')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-icon-reply-fill:before{content:"\e611"}.layui-icon-set-fill:before{content:"\e614"}.layui-icon-menu-fill:before{content:"\e60f"}.layui-icon-search:before{content:"\e615"}.layui-icon-share:before{content:"\e641"}.layui-icon-set-sm:before{content:"\e620"}.layui-icon-engine:before{content:"\e628"}.layui-icon-close:before{content:"\1006"}.layui-icon-close-fill:before{content:"\1007"}.layui-icon-chart-screen:before{content:"\e629"}.layui-icon-star:before{content:"\e600"}.layui-icon-circle-dot:before{content:"\e617"}.layui-icon-chat:before{content:"\e606"}.layui-icon-release:before{content:"\e609"}.layui-icon-list:before{content:"\e60a"}.layui-icon-chart:before{content:"\e62c"}.layui-icon-ok-circle:before{content:"\1005"}.layui-icon-layim-theme:before{content:"\e61b"}.layui-icon-table:before{content:"\e62d"}.layui-icon-right:before{content:"\e602"}.layui-icon-left:before{content:"\e603"}.layui-icon-cart-simple:before{content:"\e698"}.layui-icon-face-cry:before{content:"\e69c"}.layui-icon-face-smile:before{content:"\e6af"}.layui-icon-survey:before{content:"\e6b2"}.layui-icon-tree:before{content:"\e62e"}.layui-icon-upload-circle:before{content:"\e62f"}.layui-icon-add-circle:before{content:"\e61f"}.layui-icon-download-circle:before{content:"\e601"}.layui-icon-templeate-1:before{content:"\e630"}.layui-icon-util:before{content:"\e631"}.layui-icon-face-surprised:before{content:"\e664"}.layui-icon-edit:before{content:"\e642"}.layui-icon-speaker:before{content:"\e645"}.layui-icon-down:before{content:"\e61a"}.layui-icon-file:before{content:"\e621"}.layui-icon-layouts:before{content:"\e632"}.layui-icon-rate-half:before{content:"\e6c9"}.layui-icon-add-circle-fine:before{content:"\e608"}.layui-icon-prev-circle:before{content:"\e633"}.layui-icon-read:before{content:"\e705"}.layui-icon-404:before{content:"\e61c"}.layui-icon-carousel:before{content:"\e634"}.layui-icon-help:before{content:"\e607"}.layui-icon-code-circle:before{content:"\e635"}.layui-icon-water:before{content:"\e636"}.layui-icon-username:before{content:"\e66f"}.layui-icon-find-fill:before{content:"\e670"}.layui-icon-about:before{content:"\e60b"}.layui-icon-location:before{content:"\e715"}.layui-icon-up:before{content:"\e619"}.layui-icon-pause:before{content:"\e651"}.layui-icon-date:before{content:"\e637"}.layui-icon-layim-uploadfile:before{content:"\e61d"}.layui-icon-delete:before{content:"\e640"}.layui-icon-play:before{content:"\e652"}.layui-icon-top:before{content:"\e604"}.layui-icon-friends:before{content:"\e612"}.layui-icon-refresh-3:before{content:"\e9aa"}.layui-icon-ok:before{content:"\e605"}.layui-icon-layer:before{content:"\e638"}.layui-icon-face-smile-fine:before{content:"\e60c"}.layui-icon-dollar:before{content:"\e659"}.layui-icon-group:before{content:"\e613"}.layui-icon-layim-download:before{content:"\e61e"}.layui-icon-picture-fine:before{content:"\e60d"}.layui-icon-link:before{content:"\e64c"}.layui-icon-diamond:before{content:"\e735"}.layui-icon-log:before{content:"\e60e"}.layui-icon-rate-solid:before{content:"\e67a"}.layui-icon-fonts-del:before{content:"\e64f"}.layui-icon-unlink:before{content:"\e64d"}.layui-icon-fonts-clear:before{content:"\e639"}.layui-icon-triangle-r:before{content:"\e623"}.layui-icon-circle:before{content:"\e63f"}.layui-icon-radio:before{content:"\e643"}.layui-icon-align-center:before{content:"\e647"}.layui-icon-align-right:before{content:"\e648"}.layui-icon-align-left:before{content:"\e649"}.layui-icon-loading-1:before{content:"\e63e"}.layui-icon-return:before{content:"\e65c"}.layui-icon-fonts-strong:before{content:"\e62b"}.layui-icon-upload:before{content:"\e67c"}.layui-icon-dialogue:before{content:"\e63a"}.layui-icon-video:before{content:"\e6ed"}.layui-icon-headset:before{content:"\e6fc"}.layui-icon-cellphone-fine:before{content:"\e63b"}.layui-icon-add-1:before{content:"\e654"}.layui-icon-face-smile-b:before{content:"\e650"}.layui-icon-fonts-html:before{content:"\e64b"}.layui-icon-form:before{content:"\e63c"}.layui-icon-cart:before{content:"\e657"}.layui-icon-camera-fill:before{content:"\e65d"}.layui-icon-tabs:before{content:"\e62a"}.layui-icon-fonts-code:before{content:"\e64e"}.layui-icon-fire:before{content:"\e756"}.layui-icon-set:before{content:"\e716"}.layui-icon-fonts-u:before{content:"\e646"}.layui-icon-triangle-d:before{content:"\e625"}.layui-icon-tips:before{content:"\e702"}.layui-icon-picture:before{content:"\e64a"}.layui-icon-more-vertical:before{content:"\e671"}.layui-icon-flag:before{content:"\e66c"}.layui-icon-loading:before{content:"\e63d"}.layui-icon-fonts-i:before{content:"\e644"}.layui-icon-refresh-1:before{content:"\e666"}.layui-icon-rmb:before{content:"\e65e"}.layui-icon-home:before{content:"\e68e"}.layui-icon-user:before{content:"\e770"}.layui-icon-notice:before{content:"\e667"}.layui-icon-login-weibo:before{content:"\e675"}.layui-icon-voice:before{content:"\e688"}.layui-icon-upload-drag:before{content:"\e681"}.layui-icon-login-qq:before{content:"\e676"}.layui-icon-snowflake:before{content:"\e6b1"}.layui-icon-file-b:before{content:"\e655"}.layui-icon-template:before{content:"\e663"}.layui-icon-auz:before{content:"\e672"}.layui-icon-console:before{content:"\e665"}.layui-icon-app:before{content:"\e653"}.layui-icon-prev:before{content:"\e65a"}.layui-icon-website:before{content:"\e7ae"}.layui-icon-next:before{content:"\e65b"}.layui-icon-component:before{content:"\e857"}.layui-icon-more:before{content:"\e65f"}.layui-icon-login-wechat:before{content:"\e677"}.layui-icon-shrink-right:before{content:"\e668"}.layui-icon-spread-left:before{content:"\e66b"}.layui-icon-camera:before{content:"\e660"}.layui-icon-note:before{content:"\e66e"}.layui-icon-refresh:before{content:"\e669"}.layui-icon-female:before{content:"\e661"}.layui-icon-male:before{content:"\e662"}.layui-icon-password:before{content:"\e673"}.layui-icon-senior:before{content:"\e674"}.layui-icon-theme:before{content:"\e66a"}.layui-icon-tread:before{content:"\e6c5"}.layui-icon-praise:before{content:"\e6c6"}.layui-icon-star-fill:before{content:"\e658"}.layui-icon-rate:before{content:"\e67b"}.layui-icon-template-1:before{content:"\e656"}.layui-icon-vercode:before{content:"\e679"}.layui-icon-cellphone:before{content:"\e678"}.layui-icon-screen-full:before{content:"\e622"}.layui-icon-screen-restore:before{content:"\e758"}.layui-icon-cols:before{content:"\e610"}.layui-icon-export:before{content:"\e67d"}.layui-icon-print:before{content:"\e66d"}.layui-icon-slider:before{content:"\e714"}.layui-main{width:1140px;margin:0 auto}.layui-header{z-index:1000;height:60px}.layui-header a:hover{transition:all .5s;-webkit-transition:all .5s}.layui-side{position:fixed;left:0;top:0;bottom:0;z-index:999;width:200px;overflow-x:hidden}.layui-side-scroll{position:relative;width:220px;height:100%;overflow-x:hidden}.layui-body{position:absolute;left:200px;right:0;top:0;bottom:0;z-index:998;width:auto;overflow:hidden;overflow-y:auto;box-sizing:border-box}.layui-layout-body{overflow:hidden}.layui-layout-admin .layui-header{background-color:#23262E}.layui-layout-admin .layui-side{top:60px;width:200px;overflow-x:hidden}.layui-layout-admin .layui-body{top:60px;bottom:44px}.layui-layout-admin .layui-main{width:auto;margin:0 15px}.layui-layout-admin .layui-footer{position:fixed;left:200px;right:0;bottom:0;height:44px;line-height:44px;padding:0 15px;background-color:#eee}.layui-layout-admin .layui-logo{position:absolute;left:0;top:0;width:200px;height:100%;line-height:60px;text-align:center;color:#009688;font-size:16px}.layui-layout-admin .layui-header .layui-nav{background:0 0}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}.layui-container{position:relative;margin:0 auto;padding:0 15px;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}.layui-row:after,.layui-row:before{content:'';display:block;clear:both}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9,.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9,.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9,.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{position:relative;display:block;box-sizing:border-box}.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{float:left}.layui-col-xs1{width:8.33333333%}.layui-col-xs2{width:16.66666667%}.layui-col-xs3{width:25%}.layui-col-xs4{width:33.33333333%}.layui-col-xs5{width:41.66666667%}.layui-col-xs6{width:50%}.layui-col-xs7{width:58.33333333%}.layui-col-xs8{width:66.66666667%}.layui-col-xs9{width:75%}.layui-col-xs10{width:83.33333333%}.layui-col-xs11{width:91.66666667%}.layui-col-xs12{width:100%}.layui-col-xs-offset1{margin-left:8.33333333%}.layui-col-xs-offset2{margin-left:16.66666667%}.layui-col-xs-offset3{margin-left:25%}.layui-col-xs-offset4{margin-left:33.33333333%}.layui-col-xs-offset5{margin-left:41.66666667%}.layui-col-xs-offset6{margin-left:50%}.layui-col-xs-offset7{margin-left:58.33333333%}.layui-col-xs-offset8{margin-left:66.66666667%}.layui-col-xs-offset9{margin-left:75%}.layui-col-xs-offset10{margin-left:83.33333333%}.layui-col-xs-offset11{margin-left:91.66666667%}.layui-col-xs-offset12{margin-left:100%}@media screen and (max-width:768px){.layui-hide-xs{display:none!important}.layui-show-xs-block{display:block!important}.layui-show-xs-inline{display:inline!important}.layui-show-xs-inline-block{display:inline-block!important}}@media screen and (min-width:768px){.layui-container{width:750px}.layui-hide-sm{display:none!important}.layui-show-sm-block{display:block!important}.layui-show-sm-inline{display:inline!important}.layui-show-sm-inline-block{display:inline-block!important}.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9{float:left}.layui-col-sm1{width:8.33333333%}.layui-col-sm2{width:16.66666667%}.layui-col-sm3{width:25%}.layui-col-sm4{width:33.33333333%}.layui-col-sm5{width:41.66666667%}.layui-col-sm6{width:50%}.layui-col-sm7{width:58.33333333%}.layui-col-sm8{width:66.66666667%}.layui-col-sm9{width:75%}.layui-col-sm10{width:83.33333333%}.layui-col-sm11{width:91.66666667%}.layui-col-sm12{width:100%}.layui-col-sm-offset1{margin-left:8.33333333%}.layui-col-sm-offset2{margin-left:16.66666667%}.layui-col-sm-offset3{margin-left:25%}.layui-col-sm-offset4{margin-left:33.33333333%}.layui-col-sm-offset5{margin-left:41.66666667%}.layui-col-sm-offset6{margin-left:50%}.layui-col-sm-offset7{margin-left:58.33333333%}.layui-col-sm-offset8{margin-left:66.66666667%}.layui-col-sm-offset9{margin-left:75%}.layui-col-sm-offset10{margin-left:83.33333333%}.layui-col-sm-offset11{margin-left:91.66666667%}.layui-col-sm-offset12{margin-left:100%}}@media screen and (min-width:992px){.layui-container{width:970px}.layui-hide-md{display:none!important}.layui-show-md-block{display:block!important}.layui-show-md-inline{display:inline!important}.layui-show-md-inline-block{display:inline-block!important}.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9{float:left}.layui-col-md1{width:8.33333333%}.layui-col-md2{width:16.66666667%}.layui-col-md3{width:25%}.layui-col-md4{width:33.33333333%}.layui-col-md5{width:41.66666667%}.layui-col-md6{width:50%}.layui-col-md7{width:58.33333333%}.layui-col-md8{width:66.66666667%}.layui-col-md9{width:75%}.layui-col-md10{width:83.33333333%}.layui-col-md11{width:91.66666667%}.layui-col-md12{width:100%}.layui-col-md-offset1{margin-left:8.33333333%}.layui-col-md-offset2{margin-left:16.66666667%}.layui-col-md-offset3{margin-left:25%}.layui-col-md-offset4{margin-left:33.33333333%}.layui-col-md-offset5{margin-left:41.66666667%}.layui-col-md-offset6{margin-left:50%}.layui-col-md-offset7{margin-left:58.33333333%}.layui-col-md-offset8{margin-left:66.66666667%}.layui-col-md-offset9{margin-left:75%}.layui-col-md-offset10{margin-left:83.33333333%}.layui-col-md-offset11{margin-left:91.66666667%}.layui-col-md-offset12{margin-left:100%}}@media screen and (min-width:1200px){.layui-container{width:1170px}.layui-hide-lg{display:none!important}.layui-show-lg-block{display:block!important}.layui-show-lg-inline{display:inline!important}.layui-show-lg-inline-block{display:inline-block!important}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9{float:left}.layui-col-lg1{width:8.33333333%}.layui-col-lg2{width:16.66666667%}.layui-col-lg3{width:25%}.layui-col-lg4{width:33.33333333%}.layui-col-lg5{width:41.66666667%}.layui-col-lg6{width:50%}.layui-col-lg7{width:58.33333333%}.layui-col-lg8{width:66.66666667%}.layui-col-lg9{width:75%}.layui-col-lg10{width:83.33333333%}.layui-col-lg11{width:91.66666667%}.layui-col-lg12{width:100%}.layui-col-lg-offset1{margin-left:8.33333333%}.layui-col-lg-offset2{margin-left:16.66666667%}.layui-col-lg-offset3{margin-left:25%}.layui-col-lg-offset4{margin-left:33.33333333%}.layui-col-lg-offset5{margin-left:41.66666667%}.layui-col-lg-offset6{margin-left:50%}.layui-col-lg-offset7{margin-left:58.33333333%}.layui-col-lg-offset8{margin-left:66.66666667%}.layui-col-lg-offset9{margin-left:75%}.layui-col-lg-offset10{margin-left:83.33333333%}.layui-col-lg-offset11{margin-left:91.66666667%}.layui-col-lg-offset12{margin-left:100%}}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space3{margin:-1.5px}.layui-col-space3>*{padding:1.5px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space8{margin:-3.5px}.layui-col-space8>*{padding:3.5px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-elem-quote{margin-bottom:10px;padding:15px;line-height:22px;border-left:5px solid #009688;border-radius:0 2px 2px 0;background-color:#f2f2f2}.layui-quote-nm{border-style:solid;border-width:1px 1px 1px 5px;background:0 0}.layui-elem-field{margin-bottom:10px;padding:0;border-width:1px;border-style:solid}.layui-elem-field legend{margin-left:20px;padding:0 10px;font-size:20px;font-weight:300}.layui-field-title{margin:10px 0 20px;border-width:1px 0 0}.layui-field-box{padding:10px 15px}.layui-field-title .layui-field-box{padding:10px 0}.layui-progress{position:relative;height:6px;border-radius:20px;background-color:#e2e2e2}.layui-progress-bar{position:absolute;left:0;top:0;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:#5FB878;transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-20px;line-height:18px;font-size:12px;color:#666}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:#f2f2f2;cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{display:none;padding:10px 15px;line-height:22px;color:#666}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}.layui-card{margin-bottom:15px;border-radius:2px;background-color:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.layui-card:last-child{margin-bottom:0}.layui-card-header{position:relative;height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f6f6f6;color:#333;border-radius:2px 2px 0 0;font-size:14px}.layui-bg-black,.layui-bg-blue,.layui-bg-cyan,.layui-bg-green,.layui-bg-orange,.layui-bg-red{color:#fff!important}.layui-card-body{position:relative;padding:10px 15px;line-height:24px}.layui-card-body[pad15]{padding:15px}.layui-card-body[pad20]{padding:20px}.layui-card-body .layui-table{margin:5px 0}.layui-card .layui-tab{margin:0}.layui-panel-window{position:relative;padding:15px;border-radius:0;border-top:5px solid #E6E6E6;background-color:#fff}.layui-auxiliar-moving{position:fixed;left:0;right:0;top:0;bottom:0;width:100%;height:100%;background:0 0;z-index:9999999999}.layui-form-label,.layui-form-mid,.layui-form-select,.layui-input-block,.layui-input-inline,.layui-textarea{position:relative}.layui-bg-red{background-color:#FF5722!important}.layui-bg-orange{background-color:#FFB800!important}.layui-bg-green{background-color:#009688!important}.layui-bg-cyan{background-color:#2F4056!important}.layui-bg-blue{background-color:#1E9FFF!important}.layui-bg-black{background-color:#393D49!important}.layui-bg-gray{background-color:#eee!important;color:#666!important}.layui-badge-rim,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-elem-field,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-input,.layui-layedit,.layui-layedit-tool,.layui-quote-nm,.layui-select,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after,.layui-textarea{border-color:#e6e6e6}.layui-timeline-item:before,hr{background-color:#e6e6e6}.layui-text{line-height:22px;font-size:14px;color:#666}.layui-text h1,.layui-text h2,.layui-text h3{font-weight:500;color:#333}.layui-text h1{font-size:30px}.layui-text h2{font-size:24px}.layui-text h3{font-size:18px}.layui-text a:not(.layui-btn){color:#01AAED}.layui-text a:not(.layui-btn):hover{text-decoration:underline}.layui-text ul{padding:5px 0 5px 15px}.layui-text ul li{margin-top:5px;list-style-type:disc}.layui-text em,.layui-word-aux{color:#999!important;padding:0 5px!important}.layui-btn{display:inline-block;height:38px;line-height:38px;padding:0 18px;background-color:#009688;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border:none;border-radius:2px;cursor:pointer}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80);color:#fff}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn+.layui-btn{margin-left:10px}.layui-btn-container{font-size:0}.layui-btn-container .layui-btn{margin-right:10px;margin-bottom:10px}.layui-btn-container .layui-btn+.layui-btn{margin-left:0}.layui-table .layui-btn-container .layui-btn{margin-bottom:9px}.layui-btn-radius{border-radius:100px}.layui-btn .layui-icon{margin-right:3px;font-size:18px;vertical-align:bottom;vertical-align:middle\9}.layui-btn-primary{border:1px solid #C9C9C9;background-color:#fff;color:#555}.layui-btn-primary:hover{border-color:#009688;color:#333}.layui-btn-normal{background-color:#1E9FFF}.layui-btn-warm{background-color:#FFB800}.layui-btn-danger{background-color:#FF5722}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border:1px solid #e6e6e6;background-color:#FBFBFB;color:#C9C9C9;cursor:not-allowed;opacity:1}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-sm i{font-size:16px!important}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:14px!important}.layui-btn-group{display:inline-block;vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-left:1px solid rgba(255,255,255,.5);border-radius:0}.layui-btn-group .layui-btn-primary{border-left:none}.layui-btn-group .layui-btn-primary:hover{border-color:#C9C9C9;color:#009688}.layui-btn-group .layui-btn:first-child{border-left:none;border-radius:2px 0 0 2px}.layui-btn-group .layui-btn-primary:first-child{border-left:1px solid #c9c9c9}.layui-btn-group .layui-btn:last-child{border-radius:0 2px 2px 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}.layui-btn-fluid{width:100%}.layui-input,.layui-select,.layui-textarea{height:38px;line-height:1.3;line-height:38px\9;border-width:1px;border-style:solid;background-color:#fff;border-radius:2px}.layui-input::-webkit-input-placeholder,.layui-select::-webkit-input-placeholder,.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-input,.layui-textarea{display:block;width:100%;padding-left:10px}.layui-input:hover,.layui-textarea:hover{border-color:#D2D2D2!important}.layui-input:focus,.layui-textarea:focus{border-color:#C9C9C9!important}.layui-textarea{min-height:100px;height:auto;line-height:20px;padding:6px 10px;resize:vertical}.layui-select{padding:0 10px}.layui-form input[type=checkbox],.layui-form input[type=radio],.layui-form select{display:none}.layui-form [lay-ignore]{display:initial}.layui-form-item{margin-bottom:15px;clear:both;*zoom:1}.layui-form-item:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-form-label{float:left;display:block;padding:9px 15px;width:80px;font-weight:400;line-height:20px;text-align:right}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#FF5722!important}.layui-form-select .layui-input{padding-right:30px;cursor:pointer}.layui-form-select .layui-edge{position:absolute;right:10px;top:50%;margin-top:-3px;cursor:pointer;border-width:6px;border-top-color:#c2c2c2;border-top-style:solid;transition:all .3s;-webkit-transition:all .3s}.layui-form-select dl{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #d2d2d2;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12);box-sizing:border-box}.layui-form-select dl dd,.layui-form-select dl dt{padding:0 10px;line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-form-select dl dt{font-size:12px;color:#999}.layui-form-select dl dd{cursor:pointer}.layui-form-select dl dd:hover{background-color:#f2f2f2;-webkit-transition:.5s all;transition:.5s all}.layui-form-select .layui-select-group dd{padding-left:20px}.layui-form-select dl dd.layui-select-tips{padding-left:10px!important;color:#999}.layui-form-select dl dd.layui-this{background-color:#5FB878;color:#fff}.layui-form-checkbox,.layui-form-select dl dd.layui-disabled{background-color:#fff}.layui-form-selected dl{display:block}.layui-form-checkbox,.layui-form-checkbox *,.layui-form-switch{display:inline-block;vertical-align:middle}.layui-form-selected .layui-edge{margin-top:-9px;-webkit-transform:rotate(180deg);transform:rotate(180deg);margin-top:-3px\9}:root .layui-form-selected .layui-edge{margin-top:-9px\0/IE9}.layui-form-selectup dl{top:auto;bottom:42px}.layui-select-none{margin:5px 0;text-align:center;color:#999}.layui-select-disabled .layui-disabled{border-color:#eee!important}.layui-select-disabled .layui-edge{border-top-color:#d2d2d2}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:#d2d2d2;color:#fff;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layui-form-checkbox:hover span{background-color:#c2c2c2}.layui-form-checkbox i{position:absolute;right:0;top:0;width:30px;height:28px;border:1px solid #d2d2d2;border-left:none;border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:#c2c2c2;color:#c2c2c2}.layui-form-checked,.layui-form-checked:hover{border-color:#5FB878}.layui-form-checked span,.layui-form-checked:hover span{background-color:#5FB878}.layui-form-checked i,.layui-form-checked:hover i{color:#5FB878}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:#5FB878;color:#fff}.layui-form-checked[lay-skin=primary] i{border-color:#5FB878;background-color:#5FB878;color:#fff}.layui-checkbox-disbaled[lay-skin=primary] span{background:0 0!important;color:#c2c2c2}.layui-checkbox-disbaled[lay-skin=primary]:hover i{border-color:#d2d2d2}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-form-switch{position:relative;height:22px;line-height:22px;min-width:35px;padding:0 5px;margin-top:8px;border:1px solid #d2d2d2;border-radius:20px;cursor:pointer;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch i{position:absolute;left:5px;top:3px;width:16px;height:16px;border-radius:20px;background-color:#d2d2d2;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch em{position:relative;top:0;width:25px;margin-left:21px;padding:0!important;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px}.layui-form-onswitch{border-color:#5FB878;background-color:#5FB878}.layui-checkbox-disbaled,.layui-checkbox-disbaled i{border-color:#e2e2e2!important}.layui-form-onswitch i{left:100%;margin-left:-21px;background-color:#fff}.layui-form-onswitch em{margin-left:5px;margin-right:21px;color:#fff!important}.layui-checkbox-disbaled span{background-color:#e2e2e2!important}.layui-checkbox-disbaled:hover i{color:#fff!important}[lay-radio]{display:none}.layui-form-radio,.layui-form-radio *{display:inline-block;vertical-align:middle}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:#c2c2c2}.layui-form-radio>i:hover,.layui-form-radioed>i{color:#5FB878}.layui-radio-disbaled>i{color:#e2e2e2!important}.layui-form-pane .layui-form-label{width:110px;padding:8px 15px;height:38px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#FBFBFB;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box}.layui-form-pane .layui-input-inline{margin-left:-1px}.layui-form-pane .layui-input-block{margin-left:110px;left:-1px}.layui-form-pane .layui-input{border-radius:0 2px 2px 0}.layui-form-pane .layui-form-text .layui-form-label{float:none;width:100%;border-radius:2px;box-sizing:border-box;text-align:left}.layui-form-pane .layui-form-text .layui-input-inline{display:block;margin:0;top:-1px;clear:both}.layui-form-pane .layui-form-text .layui-input-block{margin:0;left:0;top:-1px}.layui-form-pane .layui-form-text .layui-textarea{min-height:100px;border-radius:0 0 2px 2px}.layui-form-pane .layui-form-checkbox{margin:4px 0 4px 10px}.layui-form-pane .layui-form-radio,.layui-form-pane .layui-form-switch{margin-top:6px;margin-left:10px}.layui-form-pane .layui-form-item[pane]{position:relative;border-width:1px;border-style:solid}.layui-form-pane .layui-form-item[pane] .layui-form-label{position:absolute;left:0;top:0;height:100%;border-width:0 1px 0 0}.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:110px}@media screen and (max-width:450px){.layui-form-item .layui-form-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-form-item .layui-inline{display:block;margin-right:0;margin-bottom:20px;clear:both}.layui-form-item .layui-inline:after{content:'\20';clear:both;display:block;height:0}.layui-form-item .layui-input-inline{display:block;float:none;left:-3px;width:auto;margin:0 0 10px 112px}.layui-form-item .layui-input-inline+.layui-form-mid{margin-left:110px;top:-5px;padding:0}.layui-form-item .layui-form-checkbox{margin-right:5px;margin-bottom:5px}}.layui-layedit{border-width:1px;border-style:solid;border-radius:2px}.layui-layedit-tool{padding:3px 5px;border-bottom-width:1px;border-bottom-style:solid;font-size:0}.layedit-tool-fixed{position:fixed;top:0;border-top:1px solid #e2e2e2}.layui-layedit-tool .layedit-tool-mid,.layui-layedit-tool .layui-icon{display:inline-block;vertical-align:middle;text-align:center;font-size:14px}.layui-layedit-tool .layui-icon{position:relative;width:32px;height:30px;line-height:30px;margin:3px 5px;color:#777;cursor:pointer;border-radius:2px}.layui-layedit-tool .layui-icon:hover{color:#393D49}.layui-layedit-tool .layui-icon:active{color:#000}.layui-layedit-tool .layedit-tool-active{background-color:#e2e2e2;color:#000}.layui-layedit-tool .layui-disabled,.layui-layedit-tool .layui-disabled:hover{color:#d2d2d2;cursor:not-allowed}.layui-layedit-tool .layedit-tool-mid{width:1px;height:18px;margin:0 10px;background-color:#d2d2d2}.layedit-tool-html{width:50px!important;font-size:30px!important}.layedit-tool-b,.layedit-tool-code,.layedit-tool-help{font-size:16px!important}.layedit-tool-d,.layedit-tool-face,.layedit-tool-image,.layedit-tool-unlink{font-size:18px!important}.layedit-tool-image input{position:absolute;font-size:0;left:0;top:0;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-layedit-iframe iframe{display:block;width:100%}#LAY_layedit_code{overflow:hidden}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #e2e2e2}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-flow-more a *,.layui-laypage input,.layui-table-view select[lay-ignore]{display:inline-block}.layui-laypage a:hover{color:#009688}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#009688}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input:focus,.layui-laypage select:focus{border-color:#009688!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}.layui-table,.layui-table-view{margin:10px 0}.layui-flow-more{margin:10px 0;text-align:center;color:#999;font-size:14px}.layui-flow-more a{height:32px;line-height:32px}.layui-flow-more a *{vertical-align:top}.layui-flow-more a cite{padding:0 20px;border-radius:3px;background-color:#eee;color:#333;font-style:normal}.layui-flow-more a cite:hover{opacity:.8}.layui-flow-more a i{font-size:30px;color:#737383}.layui-table{width:100%;background-color:#fff;color:#666}.layui-table tr{transition:all .3s;-webkit-transition:all .3s}.layui-table th{text-align:left;font-weight:400}.layui-table tbody tr:hover,.layui-table thead tr,.layui-table-click,.layui-table-header,.layui-table-hover,.layui-table-mend,.layui-table-patch,.layui-table-tool,.layui-table-total,.layui-table-total tr,.layui-table[lay-even] tr:nth-child(even){background-color:#f2f2f2}.layui-table td,.layui-table th,.layui-table-col-set,.layui-table-fixed-r,.layui-table-grid-down,.layui-table-header,.layui-table-page,.layui-table-tips-main,.layui-table-tool,.layui-table-total,.layui-table-view,.layui-table[lay-skin=line],.layui-table[lay-skin=row]{border-width:1px;border-style:solid;border-color:#e6e6e6}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:14px}.layui-table[lay-skin=line] td,.layui-table[lay-skin=line] th{border-width:0 0 1px}.layui-table[lay-skin=row] td,.layui-table[lay-skin=row] th{border-width:0 1px 0 0}.layui-table[lay-skin=nob] td,.layui-table[lay-skin=nob] th{border:none}.layui-table img{max-width:100px}.layui-table[lay-size=lg] td,.layui-table[lay-size=lg] th{padding:15px 30px}.layui-table-view .layui-table[lay-size=lg] .layui-table-cell{height:40px;line-height:40px}.layui-table[lay-size=sm] td,.layui-table[lay-size=sm] th{font-size:12px;padding:5px 10px}.layui-table-view .layui-table[lay-size=sm] .layui-table-cell{height:20px;line-height:20px}.layui-table[lay-data]{display:none}.layui-table-box{position:relative;overflow:hidden}.layui-table-view .layui-table{position:relative;width:auto;margin:0}.layui-table-view .layui-table[lay-skin=line]{border-width:0 1px 0 0}.layui-table-view .layui-table[lay-skin=row]{border-width:0 0 1px}.layui-table-view .layui-table td,.layui-table-view .layui-table th{padding:5px 0;border-top:none;border-left:none}.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor:pointer}.layui-table-view .layui-table td{cursor:default}.layui-table-view .layui-form-checkbox[lay-skin=primary] i{width:18px;height:18px}.layui-table-view .layui-form-radio{line-height:0;padding:0}.layui-table-view .layui-form-radio>i{margin:0;font-size:20px}.layui-table-init{position:absolute;left:0;top:0;width:100%;height:100%;text-align:center;z-index:10}.layui-table-init .layui-icon{position:absolute;left:50%;top:50%;margin:-15px 0 0 -15px;font-size:30px;color:#c2c2c2}.layui-table-header{border-width:0 0 1px;overflow:hidden}.layui-table-header .layui-table{margin-bottom:-1px}.layui-table-tool .layui-inline[lay-event]{position:relative;width:26px;height:26px;padding:5px;line-height:16px;margin-right:10px;text-align:center;color:#333;border:1px solid #ccc;cursor:pointer;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool .layui-inline[lay-event]:hover{border:1px solid #999}.layui-table-tool-temp{padding-right:120px}.layui-table-tool-self{position:absolute;right:17px;top:10px}.layui-table-tool .layui-table-tool-self .layui-inline[lay-event]{margin:0 0 0 10px}.layui-table-tool-panel{position:absolute;top:29px;left:-1px;padding:5px 0;min-width:150px;min-height:40px;border:1px solid #d2d2d2;text-align:left;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-table-tool-panel li{padding:0 10px;line-height:30px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{width:100%;padding-left:28px}.layui-table-tool-panel li:hover{background-color:#f2f2f2}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] i{position:absolute;left:0;top:0}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] span{padding:0}.layui-table-tool .layui-table-tool-self .layui-table-tool-panel{left:auto;right:-1px}.layui-table-col-set{position:absolute;right:0;top:0;width:20px;height:100%;border-width:0 0 0 1px;background-color:#fff}.layui-table-sort{width:10px;height:20px;margin-left:5px;cursor:pointer!important}.layui-table-sort .layui-edge{position:absolute;left:5px;border-width:5px}.layui-table-sort .layui-table-sort-asc{top:3px;border-top:none;border-bottom-style:solid;border-bottom-color:#b2b2b2}.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color:#666}.layui-table-sort .layui-table-sort-desc{bottom:5px;border-bottom:none;border-top-style:solid;border-top-color:#b2b2b2}.layui-table-sort .layui-table-sort-desc:hover{border-top-color:#666}.layui-table-sort[lay-sort=asc] .layui-table-sort-asc{border-bottom-color:#000}.layui-table-sort[lay-sort=desc] .layui-table-sort-desc{border-top-color:#000}.layui-table-cell{height:28px;line-height:28px;padding:0 15px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}.layui-table-cell .layui-form-checkbox[lay-skin=primary]{top:-1px;padding:0}.layui-table-cell .layui-table-link{color:#01AAED}.laytable-cell-checkbox,.laytable-cell-numbers,.laytable-cell-radio,.laytable-cell-space{padding:0;text-align:center}.layui-table-body{position:relative;overflow:auto;margin-right:-1px;margin-bottom:-1px}.layui-table-body .layui-none{line-height:26px;padding:15px;text-align:center;color:#999}.layui-table-fixed{position:absolute;left:0;top:0;z-index:101}.layui-table-fixed .layui-table-body{overflow:hidden}.layui-table-fixed-l{box-shadow:0 -1px 8px rgba(0,0,0,.08)}.layui-table-fixed-r{left:auto;right:-1px;border-width:0 0 0 1px;box-shadow:-1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r .layui-table-header{position:relative;overflow:visible}.layui-table-mend{position:absolute;right:-49px;top:0;height:100%;width:50px}.layui-table-tool{position:relative;z-index:890;width:100%;min-height:50px;line-height:30px;padding:10px 15px;border-width:0 0 1px}.layui-table-tool .layui-btn-container{margin-bottom:-10px}.layui-table-page,.layui-table-total{border-width:1px 0 0;margin-bottom:-1px;overflow:hidden}.layui-table-page{position:relative;width:100%;padding:7px 7px 0;height:41px;font-size:12px;white-space:nowrap}.layui-table-page>div{height:26px}.layui-table-page .layui-laypage{margin:0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span{height:26px;line-height:26px;margin-bottom:10px;border:none;background:0 0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span.layui-laypage-curr{padding:0 12px}.layui-table-page .layui-laypage span{margin-left:0;padding:0}.layui-table-page .layui-laypage .layui-laypage-prev{margin-left:-7px!important}.layui-table-page .layui-laypage .layui-laypage-curr .layui-laypage-em{left:0;top:0;padding:0}.layui-table-page .layui-laypage button,.layui-table-page .layui-laypage input{height:26px;line-height:26px}.layui-table-page .layui-laypage input{width:40px}.layui-table-page .layui-laypage button{padding:0 10px}.layui-table-page select{height:18px}.layui-table-patch .layui-table-cell{padding:0;width:30px}.layui-table-edit{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 14px 1px;border-radius:0;box-shadow:1px 1px 20px rgba(0,0,0,.15)}.layui-table-edit:focus{border-color:#5FB878!important}select.layui-table-edit{padding:0 0 0 10px;border-color:#C9C9C9}.layui-table-view .layui-form-checkbox,.layui-table-view .layui-form-radio,.layui-table-view .layui-form-switch{top:0;margin:0;box-sizing:content-box}.layui-table-view .layui-form-checkbox{top:-1px;height:26px;line-height:26px}.layui-table-view .layui-form-checkbox i{height:26px}.layui-table-grid .layui-table-cell{overflow:visible}.layui-table-grid-down{position:absolute;top:0;right:0;width:26px;height:100%;padding:5px 0;border-width:0 0 0 1px;text-align:center;background-color:#fff;color:#999;cursor:pointer}.layui-table-grid-down .layui-icon{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px}.layui-table-grid-down:hover{background-color:#fbfbfb}body .layui-table-tips .layui-layer-content{background:0 0;padding:0;box-shadow:0 1px 6px rgba(0,0,0,.12)}.layui-table-tips-main{margin:-44px 0 0 -1px;max-height:150px;padding:8px 15px;font-size:14px;overflow-y:scroll;background-color:#fff;color:#666}.layui-table-tips-c{position:absolute;right:-3px;top:-13px;width:20px;height:20px;padding:3px;cursor:pointer;background-color:#666;border-radius:50%;color:#fff}.layui-table-tips-c:hover{background-color:#777}.layui-table-tips-c:before{position:relative;right:-2px}.layui-upload-file{display:none!important;opacity:.01;filter:Alpha(opacity=1)}.layui-upload-drag,.layui-upload-form,.layui-upload-wrap{display:inline-block}.layui-upload-list{margin:10px 0}.layui-upload-choose{padding:0 10px;color:#999}.layui-upload-drag{position:relative;padding:30px;border:1px dashed #e2e2e2;background-color:#fff;text-align:center;cursor:pointer;color:#999}.layui-upload-drag .layui-icon{font-size:50px;color:#009688}.layui-upload-drag[lay-over]{border-color:#009688}.layui-upload-iframe{position:absolute;width:0;height:0;border:0;visibility:hidden}.layui-upload-wrap{position:relative;vertical-align:middle}.layui-upload-wrap .layui-upload-file{display:block!important;position:absolute;left:0;top:0;z-index:10;font-size:100px;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-tree{line-height:26px}.layui-tree li{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-tree li .layui-tree-spread,.layui-tree li a{display:inline-block;vertical-align:top;height:26px;*display:inline;*zoom:1;cursor:pointer}.layui-tree li a{font-size:0}.layui-tree li a i{font-size:16px}.layui-tree li a cite{padding:0 6px;font-size:14px;font-style:normal}.layui-tree li i{padding-left:6px;color:#333;-moz-user-select:none}.layui-tree li .layui-tree-check{font-size:13px}.layui-tree li .layui-tree-check:hover{color:#009E94}.layui-tree li ul{display:none;margin-left:20px}.layui-tree li .layui-tree-enter{line-height:24px;border:1px dotted #000}.layui-tree-drag{display:none;position:absolute;left:-666px;top:-666px;background-color:#f2f2f2;padding:5px 10px;border:1px dotted #000;white-space:nowrap}.layui-tree-drag i{padding-right:5px}.layui-nav{position:relative;padding:0 20px;background-color:#393D49;color:#fff;border-radius:2px;font-size:0;box-sizing:border-box}.layui-nav *{font-size:14px}.layui-nav .layui-nav-item{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle;line-height:60px}.layui-nav .layui-nav-item a{display:block;padding:0 20px;color:#fff;color:rgba(255,255,255,.7);transition:all .3s;-webkit-transition:all .3s}.layui-nav .layui-this:after,.layui-nav-bar,.layui-nav-tree .layui-nav-itemed:after{position:absolute;left:0;top:0;width:0;height:5px;background-color:#5FB878;transition:all .2s;-webkit-transition:all .2s}.layui-nav-bar{z-index:1000}.layui-nav .layui-nav-item a:hover,.layui-nav .layui-this a{color:#fff}.layui-nav .layui-this:after{content:'';top:auto;bottom:0;width:100%}.layui-nav-img{width:30px;height:30px;margin-right:10px;border-radius:50%}.layui-nav .layui-nav-more{content:'';width:0;height:0;border-style:solid dashed dashed;border-color:#fff transparent transparent;overflow:hidden;cursor:pointer;transition:all .2s;-webkit-transition:all .2s;position:absolute;top:50%;right:3px;margin-top:-3px;border-width:6px;border-top-color:rgba(255,255,255,.7)}.layui-nav .layui-nav-mored,.layui-nav-itemed>a .layui-nav-more{margin-top:-9px;border-style:dashed dashed solid;border-color:transparent transparent #fff}.layui-nav-child{display:none;position:absolute;left:0;top:65px;min-width:100%;line-height:36px;padding:5px 0;box-shadow:0 2px 4px rgba(0,0,0,.12);border:1px solid #d2d2d2;background-color:#fff;z-index:100;border-radius:2px;white-space:nowrap}.layui-nav .layui-nav-child a{color:#333}.layui-nav .layui-nav-child a:hover{background-color:#f2f2f2;color:#000}.layui-nav-child dd{position:relative}.layui-nav .layui-nav-child dd.layui-this a,.layui-nav-child dd.layui-this{background-color:#5FB878;color:#fff}.layui-nav-child dd.layui-this:after{display:none}.layui-nav-tree{width:200px;padding:0}.layui-nav-tree .layui-nav-item{display:block;width:100%;line-height:45px}.layui-nav-tree .layui-nav-item a{position:relative;height:45px;line-height:45px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item a:hover{background-color:#4E5465}.layui-nav-tree .layui-nav-bar{width:5px;height:0;background-color:#009688}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#009688;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child a{height:40px;line-height:40px;color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-tree .layui-nav-more{right:10px}.layui-nav-itemed>.layui-nav-child{display:block;padding:0;background-color:rgba(0,0,0,.3)!important}.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-bg-blue .layui-nav-bar,.layui-bg-blue .layui-nav-itemed:after,.layui-bg-blue .layui-this:after{background-color:#93D1FF}.layui-bg-blue .layui-nav-child dd.layui-this{background-color:#1E9FFF}.layui-bg-blue .layui-nav-itemed>a,.layui-nav-tree.layui-bg-blue .layui-nav-title a,.layui-nav-tree.layui-bg-blue .layui-nav-title a:hover{background-color:#007DDB!important}.layui-breadcrumb{visibility:hidden;font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999!important}.layui-breadcrumb a:hover{color:#5FB878!important}.layui-breadcrumb a cite{color:#666;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#999}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:'';width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border-width:1px;border-style:solid;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui-tab-bar .layui-icon{position:relative;display:inline-block;top:3px;transition:all .3s;-webkit-transition:all .3s}.layui-tab-item{display:none}.layui-tab-more{padding-right:30px;height:auto!important;white-space:normal!important}.layui-tab-more li.layui-this:after{border-bottom-color:#e2e2e2;border-radius:2px}.layui-tab-more .layui-tab-bar .layui-icon{top:-2px;top:3px\9;-webkit-transform:rotate(180deg);transform:rotate(180deg)}:root .layui-tab-more .layui-tab-bar .layui-icon{top:-2px\0/IE9}.layui-tab-content{padding:10px}.layui-tab-title li .layui-tab-close{position:relative;display:inline-block;width:18px;height:18px;line-height:20px;margin-left:8px;top:1px;text-align:center;font-size:14px;color:#c2c2c2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li .layui-tab-close:hover{border-radius:2px;background-color:#FF5722;color:#fff}.layui-tab-brief>.layui-tab-title .layui-this{color:#009688}.layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after{border:none;border-radius:0;border-bottom:2px solid #5FB878}.layui-tab-brief[overflow]>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-card{border-width:1px;border-style:solid;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.1)}.layui-tab-card>.layui-tab-title{background-color:#f2f2f2}.layui-tab-card>.layui-tab-title li{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-title .layui-this{background-color:#fff}.layui-tab-card>.layui-tab-title .layui-this:after{border-top:none;border-width:1px;border-bottom-color:#fff}.layui-tab-card>.layui-tab-title .layui-tab-bar{height:40px;line-height:40px;border-radius:0;border-top:none;border-right:none}.layui-tab-card>.layui-tab-more .layui-this{background:0 0;color:#5FB878}.layui-tab-card>.layui-tab-more .layui-this:after{border:none}.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:#5FB878;border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#FF5722}.layui-timeline-item:before{content:'';position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%}.layui-timeline-item:last-child:before{display:none}.layui-timeline-item:first-child:before{display:block}.layui-timeline-content{padding-left:25px}.layui-timeline-title{position:relative;margin-bottom:10px}.layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#FF5722;color:#fff;border-radius:2px}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;color:#666}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-8px 6px 0}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:'\e63d';left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:#c2c2c2;font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\9;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:0;border-radius:50%;background-color:rgba(0,0,0,.2);color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add],.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:rgba(0,0,0,.35)}.layui-carousel:hover .layui-carousel-arrow{display:block\9;opacity:1;left:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:rgba(0,0,0,.5)}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:rgba(0,0,0,.2);border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:#e2e2e2;background-color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:rgba(255,255,255,.7)}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown]>[carousel-item]>*,.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-left{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-right{top:100%}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev{opacity:0}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{opacity:1}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-right{opacity:0}.layui-fixbar{position:fixed;right:15px;bottom:15px;z-index:999999}.layui-fixbar li{width:50px;height:50px;line-height:50px;margin-bottom:1px;text-align:center;cursor:pointer;font-size:30px;background-color:#9F9F9F;color:#fff;border-radius:2px;opacity:.95}.layui-fixbar li:hover{opacity:.85}.layui-fixbar li:active{opacity:1}.layui-fixbar .layui-fixbar-top{display:none;font-size:40px}body .layui-util-face{border:none;background:0 0}body .layui-util-face .layui-layer-content{padding:0;background-color:#fff;color:#666;box-shadow:none}.layui-util-face .layui-layer-TipsG{display:none}.layui-util-face ul{position:relative;width:372px;padding:10px;border:1px solid #D9D9D9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-util-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-util-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layui-code{position:relative;margin:10px 0;padding:15px;line-height:20px;border:1px solid #ddd;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New;font-size:12px}.layui-rate,.layui-rate *{display:inline-block;vertical-align:middle}.layui-rate{padding:10px 5px 10px 0;font-size:0}.layui-rate li i.layui-icon{font-size:20px;color:#FFB800;margin-right:5px;transition:all .3s;-webkit-transition:all .3s}.layui-rate li i:hover{cursor:pointer;transform:scale(1.12);-webkit-transform:scale(1.12)}.layui-rate[readonly] li i:hover{cursor:default;transform:scale(1)}.layui-colorpicker{width:26px;height:26px;border:1px solid #e6e6e6;padding:5px;border-radius:2px;line-height:24px;display:inline-block;cursor:pointer;transition:all .3s;-webkit-transition:all .3s}.layui-colorpicker:hover{border-color:#d2d2d2}.layui-colorpicker.layui-colorpicker-lg{width:34px;height:34px;line-height:32px}.layui-colorpicker.layui-colorpicker-sm{width:24px;height:24px;line-height:22px}.layui-colorpicker.layui-colorpicker-xs{width:22px;height:22px;line-height:20px}.layui-colorpicker-trigger-bgcolor{display:block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px}.layui-colorpicker-trigger-span{display:block;height:100%;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);border-radius:2px;text-align:center}.layui-colorpicker-trigger-i{display:inline-block;color:#FFF;font-size:12px}.layui-colorpicker-trigger-i.layui-icon-close{color:#999}.layui-colorpicker-main{position:absolute;z-index:66666666;width:280px;padding:7px;background:#FFF;border:1px solid #d2d2d2;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-colorpicker-main-wrapper{height:180px;position:relative}.layui-colorpicker-basis{width:260px;height:100%;position:relative}.layui-colorpicker-basis-white{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(90deg,#FFF,hsla(0,0%,100%,0))}.layui-colorpicker-basis-black{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(0deg,#000,transparent)}.layui-colorpicker-basis-cursor{width:10px;height:10px;border:1px solid #FFF;border-radius:50%;position:absolute;top:-3px;right:-3px;cursor:pointer}.layui-colorpicker-side{position:absolute;top:0;right:0;width:12px;height:100%;background:linear-gradient(red,#FF0,#0F0,#0FF,#00F,#F0F,red)}.layui-colorpicker-side-slider{width:100%;height:5px;box-shadow:0 0 1px #888;box-sizing:border-box;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;left:0}.layui-colorpicker-main-alpha{display:none;height:12px;margin-top:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-alpha-bgcolor{height:100%;position:relative}.layui-colorpicker-alpha-slider{width:5px;height:100%;box-shadow:0 0 1px #888;box-sizing:border-box;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;top:0}.layui-colorpicker-main-pre{padding-top:7px;font-size:0}.layui-colorpicker-pre{width:20px;height:20px;border-radius:2px;display:inline-block;margin-left:6px;margin-bottom:7px;cursor:pointer}.layui-colorpicker-pre:nth-child(11n+1){margin-left:0}.layui-colorpicker-pre-isalpha{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-pre.layui-this{box-shadow:0 0 3px 2px rgba(0,0,0,.15)}.layui-colorpicker-pre>div{height:100%;border-radius:2px}.layui-colorpicker-main-input{text-align:right;padding-top:7px}.layui-colorpicker-main-input .layui-btn-container .layui-btn{margin:0 0 0 10px}.layui-colorpicker-main-input div.layui-inline{float:left;margin-right:10px;font-size:14px}.layui-colorpicker-main-input input.layui-input{width:150px;height:30px;color:#666}.layui-slider{height:4px;background:#e2e2e2;border-radius:3px;position:relative;cursor:pointer}.layui-slider-bar{border-radius:3px;position:absolute;height:100%}.layui-slider-step{position:absolute;top:0;width:4px;height:4px;border-radius:50%;background:#FFF;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layui-slider-wrap{width:36px;height:36px;position:absolute;top:-16px;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10;text-align:center}.layui-slider-wrap-btn{width:12px;height:12px;border-radius:50%;background:#FFF;display:inline-block;vertical-align:middle;cursor:pointer;transition:.3s}.layui-slider-wrap:after{content:"";height:100%;display:inline-block;vertical-align:middle}.layui-slider-wrap-btn.layui-slider-hover,.layui-slider-wrap-btn:hover{transform:scale(1.2)}.layui-slider-wrap-btn.layui-disabled:hover{transform:scale(1)!important}.layui-slider-tips{position:absolute;top:-42px;z-index:66666666;white-space:nowrap;display:none;-webkit-transform:translateX(-50%);transform:translateX(-50%);color:#FFF;background:#000;border-radius:3px;height:25px;line-height:25px;padding:0 10px}.layui-slider-tips:after{content:'';position:absolute;bottom:-12px;left:50%;margin-left:-6px;width:0;height:0;border-width:6px;border-style:solid;border-color:#000 transparent transparent}.layui-slider-input{width:70px;height:32px;border:1px solid #e6e6e6;border-radius:3px;font-size:16px;line-height:32px;position:absolute;right:0;top:-15px}.layui-slider-input-btn{display:none;position:absolute;top:0;right:0;width:20px;height:100%;border-left:1px solid #d2d2d2}.layui-slider-input-btn i{cursor:pointer;position:absolute;right:0;bottom:0;width:20px;height:50%;font-size:12px;line-height:16px;text-align:center;color:#999}.layui-slider-input-btn i:first-child{top:0;border-bottom:1px solid #d2d2d2}.layui-slider-input-txt{height:100%;font-size:14px}.layui-slider-input-txt input{height:100%;border:none}.layui-slider-input-btn i:hover{color:#009688}.layui-slider-vertical{width:4px;margin-left:34px}.layui-slider-vertical .layui-slider-bar{width:4px}.layui-slider-vertical .layui-slider-step{top:auto;left:0;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-wrap{top:auto;left:-16px;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-tips{top:auto;left:2px}@media \0screen{.layui-slider-wrap-btn{margin-left:-20px}.layui-slider-vertical .layui-slider-wrap-btn{margin-left:0;margin-bottom:-20px}.layui-slider-vertical .layui-slider-tips{margin-left:-8px}.layui-slider>span{margin-left:8px}}.layui-anim{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-anim.layui-icon{display:inline-block}.layui-anim-loop{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.layui-trans,.layui-trans a{transition:all .3s;-webkit-transition:all .3s}@-webkit-keyframes layui-rotate{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes layui-rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.layui-anim-rotate{-webkit-animation-name:layui-rotate;animation-name:layui-rotate;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes layui-up{from{-webkit-transform:translate3d(0,100%,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-up{from{transform:translate3d(0,100%,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-up{-webkit-animation-name:layui-up;animation-name:layui-up}@-webkit-keyframes layui-upbit{from{-webkit-transform:translate3d(0,30px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-upbit{from{transform:translate3d(0,30px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-upbit{-webkit-animation-name:layui-upbit;animation-name:layui-upbit}@-webkit-keyframes layui-scale{0%{opacity:.3;-webkit-transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale{0%{opacity:.3;-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-ms-transform:scale(1);transform:scale(1)}}.layui-anim-scale{-webkit-animation-name:layui-scale;animation-name:layui-scale}@-webkit-keyframes layui-scale-spring{0%{opacity:.5;-webkit-transform:scale(.5)}80%{opacity:.8;-webkit-transform:scale(1.1)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale-spring{0%{opacity:.5;transform:scale(.5)}80%{opacity:.8;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}.layui-anim-scaleSpring{-webkit-animation-name:layui-scale-spring;animation-name:layui-scale-spring}@-webkit-keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}@keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}.layui-anim-fadein{-webkit-animation-name:layui-fadein;animation-name:layui-fadein}@-webkit-keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}.layui-anim-fadeout{-webkit-animation-name:layui-fadeout;animation-name:layui-fadeout} \ No newline at end of file diff --git a/static/layui/css/layui.mobile.css b/resource/static/layui/css/layui.mobile.css old mode 100755 new mode 100644 similarity index 99% rename from static/layui/css/layui.mobile.css rename to resource/static/layui/css/layui.mobile.css index 52378f13..4a5da9cd --- a/static/layui/css/layui.mobile.css +++ b/resource/static/layui/css/layui.mobile.css @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ 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} \ No newline at end of file diff --git a/static/layui/css/modules/code.css b/resource/static/layui/css/modules/code.css old mode 100755 new mode 100644 similarity index 99% rename from static/layui/css/modules/code.css rename to resource/static/layui/css/modules/code.css index 5d767a9c..126bebe2 --- a/static/layui/css/modules/code.css +++ b/resource/static/layui/css/modules/code.css @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ 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} \ No newline at end of file diff --git a/static/layui/css/modules/laydate/default/laydate.css b/resource/static/layui/css/modules/laydate/default/laydate.css old mode 100755 new mode 100644 similarity index 99% rename from static/layui/css/modules/laydate/default/laydate.css rename to resource/static/layui/css/modules/laydate/default/laydate.css index b709ed79..78ec5395 --- a/static/layui/css/modules/laydate/default/laydate.css +++ b/resource/static/layui/css/modules/laydate/default/laydate.css @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ .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} \ No newline at end of file diff --git a/static/layui/css/modules/layer/default/icon-ext.png b/resource/static/layui/css/modules/layer/default/icon-ext.png old mode 100755 new mode 100644 similarity index 100% rename from static/layui/css/modules/layer/default/icon-ext.png rename to resource/static/layui/css/modules/layer/default/icon-ext.png diff --git a/static/layui/css/modules/layer/default/icon.png b/resource/static/layui/css/modules/layer/default/icon.png old mode 100755 new mode 100644 similarity index 100% rename from static/layui/css/modules/layer/default/icon.png rename to resource/static/layui/css/modules/layer/default/icon.png diff --git a/static/layui/css/modules/layer/default/layer.css b/resource/static/layui/css/modules/layer/default/layer.css old mode 100755 new mode 100644 similarity index 99% rename from static/layui/css/modules/layer/default/layer.css rename to resource/static/layui/css/modules/layer/default/layer.css index 15d1cb4e..dc51687f --- a/static/layui/css/modules/layer/default/layer.css +++ b/resource/static/layui/css/modules/layer/default/layer.css @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ .layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:1px -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:5px 5px 0;padding:0 15px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#1E9FFF;background-color:#1E9FFF;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#E9E7E7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:230px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;overflow:hidden;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:43px;border-left:1px solid #eee;border-right:1px solid #eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{-webkit-animation-duration:.8s;animation-duration:.8s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}} \ No newline at end of file diff --git a/static/layui/css/modules/layer/default/loading-0.gif b/resource/static/layui/css/modules/layer/default/loading-0.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/css/modules/layer/default/loading-0.gif rename to resource/static/layui/css/modules/layer/default/loading-0.gif diff --git a/static/layui/css/modules/layer/default/loading-1.gif b/resource/static/layui/css/modules/layer/default/loading-1.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/css/modules/layer/default/loading-1.gif rename to resource/static/layui/css/modules/layer/default/loading-1.gif diff --git a/static/layui/css/modules/layer/default/loading-2.gif b/resource/static/layui/css/modules/layer/default/loading-2.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/css/modules/layer/default/loading-2.gif rename to resource/static/layui/css/modules/layer/default/loading-2.gif diff --git a/static/layui/font/iconfont.eot b/resource/static/layui/font/iconfont.eot old mode 100755 new mode 100644 similarity index 100% rename from static/layui/font/iconfont.eot rename to resource/static/layui/font/iconfont.eot diff --git a/static/layui/font/iconfont.svg b/resource/static/layui/font/iconfont.svg old mode 100755 new mode 100644 similarity index 99% rename from static/layui/font/iconfont.svg rename to resource/static/layui/font/iconfont.svg index 30470647..1c7ffe97 --- a/static/layui/font/iconfont.svg +++ b/resource/static/layui/font/iconfont.svg @@ -1,473 +1,473 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/layui/font/iconfont.ttf b/resource/static/layui/font/iconfont.ttf old mode 100755 new mode 100644 similarity index 100% rename from static/layui/font/iconfont.ttf rename to resource/static/layui/font/iconfont.ttf diff --git a/static/layui/font/iconfont.woff b/resource/static/layui/font/iconfont.woff old mode 100755 new mode 100644 similarity index 100% rename from static/layui/font/iconfont.woff rename to resource/static/layui/font/iconfont.woff diff --git a/static/layui/images/face/0.gif b/resource/static/layui/images/face/0.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/0.gif rename to resource/static/layui/images/face/0.gif diff --git a/static/layui/images/face/1.gif b/resource/static/layui/images/face/1.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/1.gif rename to resource/static/layui/images/face/1.gif diff --git a/static/layui/images/face/10.gif b/resource/static/layui/images/face/10.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/10.gif rename to resource/static/layui/images/face/10.gif diff --git a/static/layui/images/face/11.gif b/resource/static/layui/images/face/11.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/11.gif rename to resource/static/layui/images/face/11.gif diff --git a/static/layui/images/face/12.gif b/resource/static/layui/images/face/12.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/12.gif rename to resource/static/layui/images/face/12.gif diff --git a/static/layui/images/face/13.gif b/resource/static/layui/images/face/13.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/13.gif rename to resource/static/layui/images/face/13.gif diff --git a/static/layui/images/face/14.gif b/resource/static/layui/images/face/14.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/14.gif rename to resource/static/layui/images/face/14.gif diff --git a/static/layui/images/face/15.gif b/resource/static/layui/images/face/15.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/15.gif rename to resource/static/layui/images/face/15.gif diff --git a/static/layui/images/face/16.gif b/resource/static/layui/images/face/16.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/16.gif rename to resource/static/layui/images/face/16.gif diff --git a/static/layui/images/face/17.gif b/resource/static/layui/images/face/17.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/17.gif rename to resource/static/layui/images/face/17.gif diff --git a/static/layui/images/face/18.gif b/resource/static/layui/images/face/18.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/18.gif rename to resource/static/layui/images/face/18.gif diff --git a/static/layui/images/face/19.gif b/resource/static/layui/images/face/19.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/19.gif rename to resource/static/layui/images/face/19.gif diff --git a/static/layui/images/face/2.gif b/resource/static/layui/images/face/2.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/2.gif rename to resource/static/layui/images/face/2.gif diff --git a/static/layui/images/face/20.gif b/resource/static/layui/images/face/20.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/20.gif rename to resource/static/layui/images/face/20.gif diff --git a/static/layui/images/face/21.gif b/resource/static/layui/images/face/21.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/21.gif rename to resource/static/layui/images/face/21.gif diff --git a/static/layui/images/face/22.gif b/resource/static/layui/images/face/22.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/22.gif rename to resource/static/layui/images/face/22.gif diff --git a/static/layui/images/face/23.gif b/resource/static/layui/images/face/23.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/23.gif rename to resource/static/layui/images/face/23.gif diff --git a/static/layui/images/face/24.gif b/resource/static/layui/images/face/24.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/24.gif rename to resource/static/layui/images/face/24.gif diff --git a/static/layui/images/face/25.gif b/resource/static/layui/images/face/25.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/25.gif rename to resource/static/layui/images/face/25.gif diff --git a/static/layui/images/face/26.gif b/resource/static/layui/images/face/26.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/26.gif rename to resource/static/layui/images/face/26.gif diff --git a/static/layui/images/face/27.gif b/resource/static/layui/images/face/27.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/27.gif rename to resource/static/layui/images/face/27.gif diff --git a/static/layui/images/face/28.gif b/resource/static/layui/images/face/28.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/28.gif rename to resource/static/layui/images/face/28.gif diff --git a/static/layui/images/face/29.gif b/resource/static/layui/images/face/29.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/29.gif rename to resource/static/layui/images/face/29.gif diff --git a/static/layui/images/face/3.gif b/resource/static/layui/images/face/3.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/3.gif rename to resource/static/layui/images/face/3.gif diff --git a/static/layui/images/face/30.gif b/resource/static/layui/images/face/30.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/30.gif rename to resource/static/layui/images/face/30.gif diff --git a/static/layui/images/face/31.gif b/resource/static/layui/images/face/31.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/31.gif rename to resource/static/layui/images/face/31.gif diff --git a/static/layui/images/face/32.gif b/resource/static/layui/images/face/32.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/32.gif rename to resource/static/layui/images/face/32.gif diff --git a/static/layui/images/face/33.gif b/resource/static/layui/images/face/33.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/33.gif rename to resource/static/layui/images/face/33.gif diff --git a/static/layui/images/face/34.gif b/resource/static/layui/images/face/34.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/34.gif rename to resource/static/layui/images/face/34.gif diff --git a/static/layui/images/face/35.gif b/resource/static/layui/images/face/35.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/35.gif rename to resource/static/layui/images/face/35.gif diff --git a/static/layui/images/face/36.gif b/resource/static/layui/images/face/36.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/36.gif rename to resource/static/layui/images/face/36.gif diff --git a/static/layui/images/face/37.gif b/resource/static/layui/images/face/37.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/37.gif rename to resource/static/layui/images/face/37.gif diff --git a/static/layui/images/face/38.gif b/resource/static/layui/images/face/38.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/38.gif rename to resource/static/layui/images/face/38.gif diff --git a/static/layui/images/face/39.gif b/resource/static/layui/images/face/39.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/39.gif rename to resource/static/layui/images/face/39.gif diff --git a/static/layui/images/face/4.gif b/resource/static/layui/images/face/4.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/4.gif rename to resource/static/layui/images/face/4.gif diff --git a/static/layui/images/face/40.gif b/resource/static/layui/images/face/40.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/40.gif rename to resource/static/layui/images/face/40.gif diff --git a/static/layui/images/face/41.gif b/resource/static/layui/images/face/41.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/41.gif rename to resource/static/layui/images/face/41.gif diff --git a/static/layui/images/face/42.gif b/resource/static/layui/images/face/42.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/42.gif rename to resource/static/layui/images/face/42.gif diff --git a/static/layui/images/face/43.gif b/resource/static/layui/images/face/43.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/43.gif rename to resource/static/layui/images/face/43.gif diff --git a/static/layui/images/face/44.gif b/resource/static/layui/images/face/44.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/44.gif rename to resource/static/layui/images/face/44.gif diff --git a/static/layui/images/face/45.gif b/resource/static/layui/images/face/45.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/45.gif rename to resource/static/layui/images/face/45.gif diff --git a/static/layui/images/face/46.gif b/resource/static/layui/images/face/46.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/46.gif rename to resource/static/layui/images/face/46.gif diff --git a/static/layui/images/face/47.gif b/resource/static/layui/images/face/47.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/47.gif rename to resource/static/layui/images/face/47.gif diff --git a/static/layui/images/face/48.gif b/resource/static/layui/images/face/48.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/48.gif rename to resource/static/layui/images/face/48.gif diff --git a/static/layui/images/face/49.gif b/resource/static/layui/images/face/49.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/49.gif rename to resource/static/layui/images/face/49.gif diff --git a/static/layui/images/face/5.gif b/resource/static/layui/images/face/5.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/5.gif rename to resource/static/layui/images/face/5.gif diff --git a/static/layui/images/face/50.gif b/resource/static/layui/images/face/50.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/50.gif rename to resource/static/layui/images/face/50.gif diff --git a/static/layui/images/face/51.gif b/resource/static/layui/images/face/51.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/51.gif rename to resource/static/layui/images/face/51.gif diff --git a/static/layui/images/face/52.gif b/resource/static/layui/images/face/52.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/52.gif rename to resource/static/layui/images/face/52.gif diff --git a/static/layui/images/face/53.gif b/resource/static/layui/images/face/53.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/53.gif rename to resource/static/layui/images/face/53.gif diff --git a/static/layui/images/face/54.gif b/resource/static/layui/images/face/54.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/54.gif rename to resource/static/layui/images/face/54.gif diff --git a/static/layui/images/face/55.gif b/resource/static/layui/images/face/55.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/55.gif rename to resource/static/layui/images/face/55.gif diff --git a/static/layui/images/face/56.gif b/resource/static/layui/images/face/56.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/56.gif rename to resource/static/layui/images/face/56.gif diff --git a/static/layui/images/face/57.gif b/resource/static/layui/images/face/57.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/57.gif rename to resource/static/layui/images/face/57.gif diff --git a/static/layui/images/face/58.gif b/resource/static/layui/images/face/58.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/58.gif rename to resource/static/layui/images/face/58.gif diff --git a/static/layui/images/face/59.gif b/resource/static/layui/images/face/59.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/59.gif rename to resource/static/layui/images/face/59.gif diff --git a/static/layui/images/face/6.gif b/resource/static/layui/images/face/6.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/6.gif rename to resource/static/layui/images/face/6.gif diff --git a/static/layui/images/face/60.gif b/resource/static/layui/images/face/60.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/60.gif rename to resource/static/layui/images/face/60.gif diff --git a/static/layui/images/face/61.gif b/resource/static/layui/images/face/61.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/61.gif rename to resource/static/layui/images/face/61.gif diff --git a/static/layui/images/face/62.gif b/resource/static/layui/images/face/62.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/62.gif rename to resource/static/layui/images/face/62.gif diff --git a/static/layui/images/face/63.gif b/resource/static/layui/images/face/63.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/63.gif rename to resource/static/layui/images/face/63.gif diff --git a/static/layui/images/face/64.gif b/resource/static/layui/images/face/64.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/64.gif rename to resource/static/layui/images/face/64.gif diff --git a/static/layui/images/face/65.gif b/resource/static/layui/images/face/65.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/65.gif rename to resource/static/layui/images/face/65.gif diff --git a/static/layui/images/face/66.gif b/resource/static/layui/images/face/66.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/66.gif rename to resource/static/layui/images/face/66.gif diff --git a/static/layui/images/face/67.gif b/resource/static/layui/images/face/67.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/67.gif rename to resource/static/layui/images/face/67.gif diff --git a/static/layui/images/face/68.gif b/resource/static/layui/images/face/68.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/68.gif rename to resource/static/layui/images/face/68.gif diff --git a/static/layui/images/face/69.gif b/resource/static/layui/images/face/69.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/69.gif rename to resource/static/layui/images/face/69.gif diff --git a/static/layui/images/face/7.gif b/resource/static/layui/images/face/7.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/7.gif rename to resource/static/layui/images/face/7.gif diff --git a/static/layui/images/face/70.gif b/resource/static/layui/images/face/70.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/70.gif rename to resource/static/layui/images/face/70.gif diff --git a/static/layui/images/face/71.gif b/resource/static/layui/images/face/71.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/71.gif rename to resource/static/layui/images/face/71.gif diff --git a/static/layui/images/face/8.gif b/resource/static/layui/images/face/8.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/8.gif rename to resource/static/layui/images/face/8.gif diff --git a/static/layui/images/face/9.gif b/resource/static/layui/images/face/9.gif old mode 100755 new mode 100644 similarity index 100% rename from static/layui/images/face/9.gif rename to resource/static/layui/images/face/9.gif diff --git a/static/layui/lay/modules/carousel.js b/resource/static/layui/lay/modules/carousel.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/carousel.js rename to resource/static/layui/lay/modules/carousel.js index 7ccf5f9d..be18bc96 --- a/static/layui/lay/modules/carousel.js +++ b/resource/static/layui/lay/modules/carousel.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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"); \ No newline at end of file diff --git a/static/layui/lay/modules/colorpicker.js b/resource/static/layui/lay/modules/colorpicker.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/colorpicker.js rename to resource/static/layui/lay/modules/colorpicker.js index 2782b42a..1ec2902c --- a/static/layui/lay/modules/colorpicker.js +++ b/resource/static/layui/lay/modules/colorpicker.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/element.js b/resource/static/layui/lay/modules/element.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/element.js rename to resource/static/layui/lay/modules/element.js index 457dec14..8b8486ea --- a/static/layui/lay/modules/element.js +++ b/resource/static/layui/lay/modules/element.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/flow.js b/resource/static/layui/lay/modules/flow.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/flow.js rename to resource/static/layui/lay/modules/flow.js index c58e6958..eca5c7b4 --- a/static/layui/lay/modules/flow.js +++ b/resource/static/layui/lay/modules/flow.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/form.js b/resource/static/layui/lay/modules/form.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/form.js rename to resource/static/layui/lay/modules/form.js index ced56074..37c6acd0 --- a/static/layui/lay/modules/form.js +++ b/resource/static/layui/lay/modules/form.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;layui.define("layer",function(e){"use strict";var i=layui.$,t=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 t=this;return i.extend(!0,t.config,e),t},u.prototype.verify=function(e){var t=this;return i.extend(!0,t.config.verify,e),t},u.prototype.on=function(e,i){return layui.onevent.call(this,l,e,i)},u.prototype.val=function(e,t){var a=i(r+'[lay-filter="'+e+'"]');a.each(function(e,a){var n=i(this);layui.each(t,function(e,i){var t,a=n.find('[name="'+e+'"]');a[0]&&(t=a[0].type,"checkbox"===t?a[0].checked=i:"radio"===t?a.each(function(){this.value===i&&(this.checked=!0)}):a.val(i))})}),f.render(null,e)},u.prototype.render=function(e,t){var n=this,u=i(r+function(){return t?'[lay-filter="'+t+'"]':""}()),d={select:function(){var e,t="请选择",a="layui-form-select",n="layui-select-title",r="layui-select-none",d="",f=u.find("select"),v=function(t,l){i(t.target).parent().hasClass(n)&&!l||(i("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},y=function(t,u,f){var y,p=i(this),m=t.find("."+n),k=m.find("input"),x=t.find("dl"),g=x.children("dd"),b=this.selectedIndex;if(!u){var C=function(){var e=t.offset().top+t.outerHeight()+5-h.scrollTop(),i=x.outerHeight();b=p[0].selectedIndex,t.addClass(a+"ed"),g.removeClass(o),y=null,g.eq(b).addClass(s).siblings().removeClass(s),e+i>h.height()&&e>=i&&t.addClass(a+"up"),$()},w=function(e){t.removeClass(a+"ed "+a+"up"),k.blur(),y=null,e||T(k.val(),function(e){e&&(d=x.find("."+s).html(),k&&k.val(d))})},$=function(){var e=x.children("dd."+s);if(e[0]){var i=e.position().top,t=x.height(),a=e.height();i>t&&x.scrollTop(i+x.scrollTop()-t+a-5),i<0&&x.scrollTop(i+x.scrollTop()-5)}};m.on("click",function(e){t.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 i=e.keyCode;9===i&&C()}).on("keydown",function(e){var i=e.keyCode;9===i&&w();var t=function(i,a){var n,l;e.preventDefault();var r=function(){var e=x.children("dd."+s);if(x.children("dd."+o)[0]&&"next"===i){var t=x.children("dd:not(."+o+",."+c+")"),n=t.eq(0).index();if(n>=0&&n无匹配项

    '):x.find("."+r).remove()},"keyup"),""===i&&x.find("."+r).remove(),void $())};f&&k.on("keyup",j).on("blur",function(t){var a=p[0].selectedIndex;e=k,d=i(p[0].options[a]).html(),setTimeout(function(){T(k.val(),function(e){d||k.val("")},"blur")},200)}),g.on("click",function(){var e=i(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:t}),w(!0),!1)}),t.find("dl>dt").on("click",function(e){return!1}),i(document).off("click",v).on("click",v)}};f.each(function(e,l){var r=i(this),o=r.next("."+a),u=this.disabled,d=l.value,f=i(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?t:v.innerHTML||t:t,m=i(['
    ','
    ','','
    ','
    ',function(e){var i=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?i.push("
    "+a.label+"
    "):i.push('
    '+a.innerHTML+"
    "):i.push('
    '+(a.innerHTML||t)+"
    ")}),0===i.length&&i.push('
    没有选项
    '),i.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"]},t=u.find("input[type=checkbox]"),a=function(e,t){var a=i(this);e.on("click",function(){var i=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(t[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(t[1]).find("em").text(n[0])),layui.event.call(a[0],l,t[2]+"("+i+")",{elem:a[0],value:a[0].value,othis:e}))})};t.each(function(t,n){var l=i(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=i(['
    ",function(){var e=n.title.replace(/\s/g,""),i={checkbox:[e?""+n.title+"":"",''].join(""),_switch:""+((n.checked?s[0]:s[1])||"")+""};return i[r]||i.checkbox}(),"
    "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",t=["",""],a=u.find("input[type=radio]"),n=function(a){var n=i(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=i(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(t[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(t[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=i(this),s=r.next("."+e),o=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();s[0]&&s.remove();var u=i(['
    ',''+t[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,i){i()}),n};var d=function(){var e=i(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=i(this),c=r.attr("lay-verify").split("|"),u=r.attr("lay-verType"),d=r.val();if(r.removeClass(o),layui.each(c,function(e,i){var c,f="",v="function"==typeof a[i];if(a[i]){var c=v?f=a[i](d,l):!a[i][0].test(d);if(f=f||a[i][1],c)return"tips"===u?t.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?t.alert(f,{title:"提示",shadeClose:!0}):t.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,i){if(i.name=(i.name||"").replace(/^\s*|\s*&/,""),i.name){if(/^.*\[\]$/.test(i.name)){var t=i.name.match(/^(.*)\[\]$/g)[0];p[t]=0|p[t],i.name=i.name.replace(/^(.*)\[\]$/,"$1["+p[t]++ +"]")}/^checkbox|radio$/.test(i.type)&&!i.checked||(c[i.name]=i.value)}}),layui.event.call(this,l,"submit("+y+")",{elem:this,form:v,field:c})},f=new u,v=i(document),h=i(window);f.render(),v.on("reset",r,function(){var e=i(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),v.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)}); \ No newline at end of file diff --git a/static/layui/lay/modules/jquery.js b/resource/static/layui/lay/modules/jquery.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/jquery.js rename to resource/static/layui/lay/modules/jquery.js index 7568330c..f8c2b582 --- a/static/layui/lay/modules/jquery.js +++ b/resource/static/layui/lay/modules/jquery.js @@ -1,5 +1,5 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ - ;!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=pe.type(e);return"function"!==n&&!pe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), -l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
    a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
    a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
    ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ +/** layui-v2.4.3 MIT License By https://www.layui.com */ + ;!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=pe.type(e);return"function"!==n&&!pe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), +l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
    a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
    a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
    ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe}); \ No newline at end of file diff --git a/static/layui/lay/modules/laydate.js b/resource/static/layui/lay/modules/laydate.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/laydate.js rename to resource/static/layui/lay/modules/laydate.js index e1dd0ab9..9f6a1db3 --- a/static/layui/lay/modules/laydate.js +++ b/resource/static/layui/lay/modules/laydate.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,n=t.length-1,a=n;a>0;a--)if("interactive"===t[a].readyState){e=t[a].src;break}return e||t[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.9",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var t=this;return t.config=w.extend({},t.config,e),t},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return e?layui.addcss(o,a,i):t.link(o,a,i),this}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
    建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,isInitValue:!0,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElemDate),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElemDate=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n.hasClass(c)||t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));t.elem&&(n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3))},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
    "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
    已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month||12,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

    "+r.time[e]+"

      "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
    ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s','
    '+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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/layer.js b/resource/static/layui/lay/modules/layer.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/layer.js rename to resource/static/layui/lay/modules/layer.js index c19c9fbd..41b5510c --- a/static/layui/lay/modules/layer.js +++ b/resource/static/layui/lay/modules/layer.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
    '+(f?r.title[0]:r.title)+"
    ":"";return r.zIndex=s,t([r.shade?'
    ':"",'
    '+(e&&2!=r.type?"":u)+'
    '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
    '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
    '+e+"
    "}():"")+(r.resize?'':"")+"
    "],u,i('
    ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
      '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
    • '+(t[0].content||"no content")+"
    • ";i'+(t[i].content||"no content")+"";return a}()+"
    ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
    '+(u.length>1?'':"")+'
    '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
    ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
    是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); \ No newline at end of file diff --git a/static/layui/lay/modules/laypage.js b/resource/static/layui/lay/modules/laypage.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/laypage.js rename to resource/static/layui/lay/modules/laypage.js index 9d08ae85..98690ac6 --- a/static/layui/lay/modules/laypage.js +++ b/resource/static/layui/lay/modules/laypage.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/laytpl.js b/resource/static/layui/lay/modules/laytpl.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/laytpl.js rename to resource/static/layui/lay/modules/laytpl.js index c0968329..6d8a36ad --- a/static/layui/lay/modules/laytpl.js +++ b/resource/static/layui/lay/modules/laytpl.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/mobile.js b/resource/static/layui/lay/modules/mobile.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/mobile.js rename to resource/static/layui/lay/modules/mobile.js index f0452a82..8756d088 --- a/static/layui/lay/modules/mobile.js +++ b/resource/static/layui/lay/modules/mobile.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;layui.define(function(i){i("layui.mobile",layui.v)});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)});layui.define(function(e){"use strict";var t=(window,document),i="querySelectorAll",n="getElementsByClassName",a=function(e){return t[i](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var i in e)t[i]=e[i];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var o=0,r=["layui-m-layer"],d=function(e){var t=this;t.config=l.extend(e),t.view()};d.prototype.view=function(){var e=this,i=e.config,s=t.createElement("div");e.id=s.id=r[0]+o,s.setAttribute("class",r[0]+" "+r[0]+(i.type||0)),s.setAttribute("index",o);var l=function(){var e="object"==typeof i.title;return i.title?'

    '+(e?i.title[0]:i.title)+"

    ":""}(),d=function(){"string"==typeof i.btn&&(i.btn=[i.btn]);var e,t=(i.btn||[]).length;return 0!==t&&i.btn?(e=''+i.btn[0]+"",2===t&&(e=''+i.btn[1]+""+e),'
    '+e+"
    "):""}();if(i.fixed||(i.top=i.hasOwnProperty("top")?i.top:100,i.style=i.style||"",i.style+=" top:"+(t.body.scrollTop+i.top)+"px"),2===i.type&&(i.content='

    '+(i.content||"")+"

    "),i.skin&&(i.anim="up"),"msg"===i.skin&&(i.shade=!1),s.innerHTML=(i.shade?"
    ':"")+'
    "+l+'
    '+i.content+"
    "+d+"
    ",!i.type||2===i.type){var y=t[n](r[0]+i.type),u=y.length;u>=1&&c.close(y[0].getAttribute("index"))}document.body.appendChild(s);var m=e.elem=a("#"+e.id)[0];i.success&&i.success(m),e.index=o++,e.action(i,m)},d.prototype.action=function(e,t){var i=this;e.time&&(l.timer[i.index]=setTimeout(function(){c.close(i.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),c.close(i.index)):e.yes?e.yes(i.index):c.close(i.index)};if(e.btn)for(var s=t[n]("layui-m-layerbtn")[0].children,o=s.length,r=0;r0&&e-1 in t)}function s(t){return A.call(t,function(t){return null!=t})}function u(t){return t.length>0?T.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in F?F[t]:F[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||k[c(t)]?e:e+"px"}function h(t){var e,n;return $[t]||(e=L.createElement(t),L.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),$[t]=n),$[t]}function p(t){return"children"in t?D.call(t.children):T.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function d(t,e){var n,r=t?t.length:0;for(n=0;n]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Z=/^(?:body|html)$/i,q=/([A-Z])/g,H=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],V=L.createElement("table"),_=L.createElement("tr"),B={tr:L.createElement("tbody"),tbody:V,thead:V,tfoot:V,td:_,th:_,"*":L.createElement("div")},U=/complete|loaded|interactive/,X=/^[\w-]*$/,J={},W=J.toString,Y={},G=L.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=G).appendChild(t),r=~Y.qsa(i,e).indexOf(t),o&&G.removeChild(t),r},C=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},N=function(t){return A.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,i,a;return R.test(t)&&(r=T(L.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(z,"<$1>")),e===E&&(e=M.test(t)&&RegExp.$1),e in B||(e="*"),a=B[e],a.innerHTML=""+t,r=T.each(D.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(i=T(r),T.each(n,function(t,e){H.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},Y.Z=function(t,e){return new d(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}else{if(e(t))return T(L).ready(t);if(Y.isZ(t))return t;if(Q(t))r=s(t);else if(i(t))r=[t],t=null;else if(M.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}}return Y.Z(r,t)},T=function(t,e){return Y.init(t,e)},T.extend=function(t){var e,n=D.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){m(t,n,e)}),t},Y.qsa=function(t,e){var n,r="#"==e[0],i=!r&&"."==e[0],o=r||i?e.slice(1):e,a=X.test(o);return t.getElementById&&a&&r?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:D.call(a&&!r&&t.getElementsByClassName?i?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=L.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},T.type=t,T.isFunction=e,T.isWindow=n,T.isArray=Q,T.isPlainObject=o,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},T.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},T.camelCase=C,T.trim=function(t){return null==t?"":String.prototype.trim.call(t)},T.uuid=0,T.support={},T.expr={},T.noop=function(){},T.map=function(t,e){var n,r,i,o=[];if(a(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):T(A.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return T(N(this.concat(T(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==E)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):a(t)&&e(t.item)?D.call(t):T(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return T(n)},has:function(t){return this.filter(function(){return i(t)?T.contains(this,t):T(this).find(t).size()})},eq:function(t){return t===-1?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:T(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:T(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?T(t).filter(function(){var t=this;return O.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):T()},closest:function(t,e){var n=[],i="object"==typeof t&&T(t);return this.each(function(o,a){for(;a&&!(i?i.indexOf(a)>=0:Y.matches(a,t));)a=a!==e&&!r(a)&&a.parentNode;a&&n.indexOf(a)<0&&n.push(a)}),T(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=T.map(n,function(t){if((t=t.parentNode)&&!r(t)&&e.indexOf(t)<0)return e.push(t),t});return v(e,t)},parent:function(t){return v(N(this.pluck("parentNode")),t)},children:function(t){return v(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||D.call(this.childNodes)})},siblings:function(t){return v(this.map(function(t,e){return A.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return T.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=T(t).get(0),i=r.parentNode||this.length>1;return this.each(function(e){T(this).wrapAll(n?t.call(this,e):i?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){T(this[0]).before(t=T(t));for(var e;(e=t.children()).length;)t=e.first();T(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=T(this),i=r.contents(),o=n?t.call(this,e):t;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){T(this).replaceWith(T(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=T(this);(t===E?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return T(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return T(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;T(this).empty().append(g(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=g(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(t))for(j in t)y(this,j,t[j]);else y(this,t,g(this,e,n,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:E},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=K[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var n="data-"+t.replace(q,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?b(r):E},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=g(this,t,e,this.value)})):this[0]&&(this[0].multiple?T(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=T(this),r=g(this,t,e,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;if(L.documentElement!==this[0]&&!T.contains(L.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r=this[0];if("string"==typeof e){if(!r)return;return r.style[C(e)]||getComputedStyle(r,"").getPropertyValue(e)}if(Q(e)){if(!r)return;var i={},o=getComputedStyle(r,"");return T.each(e,function(t,e){i[e]=r.style[C(e)]||o.getPropertyValue(e)}),i}}var a="";if("string"==t(e))n||0===n?a=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(j in e)e[j]||0===e[j]?a+=c(j)+":"+f(j,e[j])+";":this.each(function(){this.style.removeProperty(c(j))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&O.some.call(this,function(t){return this.test(x(t))},l(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){S=[];var n=x(this),r=g(this,t,e,n);r.split(/\s+/g).forEach(function(t){T(this).hasClass(t)||S.push(t)},this),S.length&&x(this,n+(n?" ":"")+S.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===E)return x(this,"");S=x(this),g(this,t,e,S).split(/\s+/g).forEach(function(t){S=S.replace(l(t)," ")}),x(this,S.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=T(this),i=g(this,t,n,x(this));i.split(/\s+/g).forEach(function(t){(e===E?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===E?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===E?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=Z.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(T(t).css("margin-top"))||0,n.left-=parseFloat(T(t).css("margin-left"))||0,r.top+=parseFloat(T(e[0]).css("border-top-width"))||0,r.left+=parseFloat(T(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||L.body;t&&!Z.test(t.nodeName)&&"static"==T(t).css("position");)t=t.offsetParent;return t})}},T.fn.detach=T.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});T.fn[t]=function(i){var o,a=this[0];return i===E?n(a)?a["inner"+e]:r(a)?a.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){a=T(this),a.css(t,g(this,i,e,a[t]()))})}}),I.forEach(function(e,n){var r=n%2;T.fn[e]=function(){var e,i,o=T.map(arguments,function(n){var r=[];return e=t(n),"array"==e?(n.forEach(function(t){return t.nodeType!==E?r.push(t):T.zepto.isZ(t)?r=r.concat(t.get()):void(r=r.concat(Y.fragment(t)))}),r):"object"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(t,e){i=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=T.contains(L.documentElement,i);o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!i)return T(t).remove();i.insertBefore(t,e),s&&w(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},T.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return T(t)[e](this),this}}),Y.Z.prototype=d.prototype=T.fn,Y.uniq=N,Y.deserializeValue=b,T.zepto=Y,T}();!function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,a){if(n=r(n),n.ns)var s=i(n.ns);return(v[e(t)]||[]).filter(function(t){return t&&(!n.e||t.e==n.e)&&(!n.ns||s.test(t.ns))&&(!o||e(t.fn)===e(o))&&(!a||t.sel==a)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function i(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in x||!!e}function a(t){return b[t]||y&&x[t]||t}function s(n,i,s,u,l,h,p){var d=e(n),m=v[d]||(v[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var i=r(e);i.fn=s,i.sel=l,i.e in b&&(s=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return i.fn.apply(this,arguments)}),i.del=h;var d=h||s;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},i.i=m.length,m.push(i),"addEventListener"in n&&n.addEventListener(a(i.e),i.proxy,o(i,p))})}function u(t,r,i,s,u){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,s).forEach(function(e){delete v[c][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,o(e,u))})})}function c(e,n){return!n&&e.isDefaultPrevented||(n||(n=e),t.each(T,function(t,r){var i=n[t];e[t]=function(){return this[r]=w,i&&i.apply(n,arguments)},e[r]=E}),e.timeStamp||(e.timeStamp=Date.now()),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function l(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,m=function(t){return"string"==typeof t},v={},g={},y="onfocusin"in window,x={focus:"focusin",blur:"focusout"},b={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",t.event={add:s,remove:u},t.proxy=function(n,r){var i=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(r,i?i.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(m(r))return i?(i.unshift(n[r],n),t.proxy.apply(null,i)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var w=function(){return!0},E=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,i,o){var a,c,h=this;return e&&!m(e)?(t.each(e,function(t,e){h.on(t,n,r,e,o)}),h):(m(n)||d(i)||i===!1||(i=r,r=n,n=f),i!==f&&r!==!1||(i=r,r=f),i===!1&&(i=E),h.each(function(f,h){o&&(a=function(t){return u(h,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,o=t(e.target).closest(n,h).get(0);if(o&&o!==h)return r=t.extend(l(e),{currentTarget:o,liveFired:h}),(a||i).apply(o,[r].concat(p.call(arguments,1)))}),s(h,e,i,r,n,c||a)}))},t.fn.off=function(e,n,r){var i=this;return e&&!m(e)?(t.each(e,function(t,e){i.off(t,n,e)}),i):(m(n)||d(r)||r===!1||(r=n,n=f),r===!1&&(r=E),i.each(function(){u(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=m(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in x&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var i,o;return this.each(function(a,s){i=l(m(e)?t.Event(e):e),i._args=r,i.target=s,t.each(n(s,e.type||e),function(t,e){if(o=e.proxy(i),i.isImmediatePropagationStopped())return!1})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){m(t)||(e=t,t=e.type);var n=document.createEvent(g[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),c(n)}}(e),function(t){function e(e,n,r){var i=t.Event(n);return t(e).trigger(i,r),!i.isDefaultPrevented()}function n(t,n,r,i){if(t.global)return e(n||x,r,i)}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function i(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function o(t,e){var r=e.context;return e.beforeSend.call(r,t,e)!==!1&&n(e,r,"ajaxBeforeSend",[t,e])!==!1&&void n(e,r,"ajaxSend",[t,e])}function a(t,e,r,i){var o=r.context,a="success";r.success.call(o,t,a,e),i&&i.resolveWith(o,[t,a,e]),n(r,o,"ajaxSuccess",[e,r,t]),u(a,e,r)}function s(t,e,r,i,o){var a=i.context;i.error.call(a,r,e,t),o&&o.rejectWith(a,[r,e,t]),n(i,a,"ajaxError",[r,i,t||e]),u(e,r,i)}function u(t,e,r){var o=r.context;r.complete.call(o,e,t),n(r,o,"ajaxComplete",[e,r]),i(r)}function c(t,e,n){if(n.dataFilter==l)return t;var r=n.context;return n.dataFilter.call(r,t,e)}function l(){}function f(t){return t&&(t=t.split(";",2)[0]),t&&(t==T?"html":t==j?"json":w.test(t)?"script":E.test(t)&&"xml")||"text"}function h(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=h(e.url,e.data),e.data=void 0)}function d(e,n,r,i){return t.isFunction(n)&&(i=r,r=n,n=void 0),t.isFunction(r)||(i=r,r=void 0),{url:e,data:n,success:r,dataType:i}}function m(e,n,r,i){var o,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),i&&(n=r?i:i+"["+(s||"object"==o||"array"==o?n:"")+"]"),!i&&a?e.add(u.name,u.value):"array"==o||!r&&"object"==o?m(e,u,r,n):e.add(n,u)})}var v,g,y=+new Date,x=window.document,b=/)<[^<]*)*<\/script>/gi,w=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,j="application/json",T="text/html",S=/^\s*$/,C=x.createElement("a");C.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,i,u=e.jsonpCallback,c=(t.isFunction(u)?u():u)||"Zepto"+y++,l=x.createElement("script"),f=window[c],h=function(e){t(l).triggerHandler("error",e||"abort")},p={abort:h};return n&&n.promise(p),t(l).on("load error",function(o,u){clearTimeout(i),t(l).off().remove(),"error"!=o.type&&r?a(r[0],p,e,n):s(null,u||"error",p,e,n),window[c]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),o(p,e)===!1?(h("abort"),p):(window[c]=function(){r=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+c),x.head.appendChild(l),e.timeout>0&&(i=setTimeout(function(){h("timeout")},e.timeout)),p)},t.ajaxSettings={type:"GET",beforeSend:l,success:l,error:l,complete:l,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:j,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:l},t.ajax=function(e){var n,i,u=t.extend({},e||{}),d=t.Deferred&&t.Deferred();for(v in t.ajaxSettings)void 0===u[v]&&(u[v]=t.ajaxSettings[v]);r(u),u.crossDomain||(n=x.createElement("a"),n.href=u.url,n.href=n.href,u.crossDomain=C.protocol+"//"+C.host!=n.protocol+"//"+n.host),u.url||(u.url=window.location.toString()),(i=u.url.indexOf("#"))>-1&&(u.url=u.url.slice(0,i)),p(u);var m=u.dataType,y=/\?.+=\?/.test(u.url);if(y&&(m="jsonp"),u.cache!==!1&&(e&&e.cache===!0||"script"!=m&&"jsonp"!=m)||(u.url=h(u.url,"_="+Date.now())),"jsonp"==m)return y||(u.url=h(u.url,u.jsonp?u.jsonp+"=?":u.jsonp===!1?"":"callback=?")),t.ajaxJSONP(u,d);var b,w=u.accepts[m],E={},j=function(t,e){E[t.toLowerCase()]=[t,e]},T=/^([\w-]+:)\/\//.test(u.url)?RegExp.$1:window.location.protocol,N=u.xhr(),O=N.setRequestHeader;if(d&&d.promise(N),u.crossDomain||j("X-Requested-With","XMLHttpRequest"),j("Accept",w||"*/*"),(w=u.mimeType||w)&&(w.indexOf(",")>-1&&(w=w.split(",",2)[0]),N.overrideMimeType&&N.overrideMimeType(w)),(u.contentType||u.contentType!==!1&&u.data&&"GET"!=u.type.toUpperCase())&&j("Content-Type",u.contentType||"application/x-www-form-urlencoded"),u.headers)for(g in u.headers)j(g,u.headers[g]);if(N.setRequestHeader=j,N.onreadystatechange=function(){if(4==N.readyState){N.onreadystatechange=l,clearTimeout(b);var e,n=!1;if(N.status>=200&&N.status<300||304==N.status||0==N.status&&"file:"==T){if(m=m||f(u.mimeType||N.getResponseHeader("content-type")),"arraybuffer"==N.responseType||"blob"==N.responseType)e=N.response;else{e=N.responseText;try{e=c(e,m,u),"script"==m?(0,eval)(e):"xml"==m?e=N.responseXML:"json"==m&&(e=S.test(e)?null:t.parseJSON(e))}catch(r){n=r}if(n)return s(n,"parsererror",N,u,d)}a(e,N,u,d)}else s(N.statusText||null,N.status?"error":"abort",N,u,d)}},o(N,u)===!1)return N.abort(),s(null,"abort",N,u,d),N;var P=!("async"in u)||u.async;if(N.open(u.type,u.url,P,u.username,u.password),u.xhrFields)for(g in u.xhrFields)N[g]=u.xhrFields[g];for(g in E)O.apply(N,E[g]);return u.timeout>0&&(b=setTimeout(function(){N.onreadystatechange=l,N.abort(),s(null,"timeout",N,u,d)},u.timeout)),N.send(u.data?u.data:null),N},t.get=function(){return t.ajax(d.apply(null,arguments))},t.post=function(){var e=d.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=d.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var i,o=this,a=e.split(/\s/),s=d(e,n,r),u=s.success;return a.length>1&&(s.url=a[0],i=a[1]),s.success=function(e){o.html(i?t("
    ").html(e.replace(b,"")).find(i):e),u&&u.apply(o,arguments)},t.ajax(s),this};var N=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(N(e)+"="+N(n))},m(r,e,n),r.join("&").replace(/%20/g,"+")}}(e),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,o){n=o.type,e=o.name,e&&"fieldset"!=o.nodeName.toLowerCase()&&!o.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&"file"!=n&&("radio"!=n&&"checkbox"!=n||o.checked)&&i(t(o).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(e),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,n){try{return e(t,n)}catch(r){return null}}}}(),t("zepto",e)});layui.define(["layer-mobile","zepto"],function(e){"use strict";var t=layui.zepto,a=layui["layer-mobile"],i=(layui.device(),"layui-upload-enter"),n="layui-upload-iframe",r={icon:2,shift:6},o={file:"文件",video:"视频",audio:"音频"};a.msg=function(e){return a.open({content:e||"",skin:"msg",time:2})};var s=function(e){this.options=e};s.prototype.init=function(){var e=this,a=e.options,r=t("body"),s=t(a.elem||".layui-upload-file"),u=t('');return t("#"+n)[0]||r.append(u),s.each(function(r,s){s=t(s);var u='
    ',l=s.attr("lay-type")||a.type;a.unwrap||(u='
    '+u+''+(s.attr("lay-title")||a.title||"上传"+(o[l]||"图片"))+"
    "),u=t(u),a.unwrap||u.on("dragover",function(e){e.preventDefault(),t(this).addClass(i)}).on("dragleave",function(){t(this).removeClass(i)}).on("drop",function(){t(this).removeClass(i)}),s.parent("form").attr("target")===n&&(a.unwrap?s.unwrap():(s.parent().next().remove(),s.unwrap().unwrap())),s.wrap(u),s.off("change").on("change",function(){e.action(this,l)})})},s.prototype.action=function(e,i){var o=this,s=o.options,u=e.value,l=t(e),p=l.attr("lay-ext")||s.ext||"";if(u){switch(i){case"file":if(p&&!RegExp("\\w\\.("+p+")$","i").test(escape(u)))return a.msg("不支持该文件格式",r),e.value="";break;case"video":if(!RegExp("\\w\\.("+(p||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(u)))return a.msg("不支持该视频格式",r),e.value="";break;case"audio":if(!RegExp("\\w\\.("+(p||"mp3|wav|mid")+")$","i").test(escape(u)))return a.msg("不支持该音频格式",r),e.value="";break;default:if(!RegExp("\\w\\.("+(p||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(u)))return a.msg("不支持该图片格式",r),e.value=""}s.before&&s.before(e),l.parent().submit();var c=t("#"+n),f=setInterval(function(){var t;try{t=c.contents().find("body").text()}catch(i){a.msg("上传接口存在跨域",r),clearInterval(f)}if(t){clearInterval(f),c.contents().find("body").html("");try{t=JSON.parse(t)}catch(i){return t={},a.msg("请对上传接口返回JSON字符",r)}"function"==typeof s.success&&s.success(t,e)}},30);e.value=""}},e("upload-mobile",function(e){var t=new s(e=e||{});t.init()})});layui.define(function(i){i("layim-mobile",layui.v)});layui["layui.mobile"]||layui.config({base:layui.cache.dir+"lay/modules/mobile/"}).extend({"layer-mobile":"layer-mobile",zepto:"zepto","upload-mobile":"upload-mobile","layim-mobile":"layim-mobile"}),layui.define(["layer-mobile","zepto","layim-mobile"],function(l){l("mobile",{layer:layui["layer-mobile"],layim:layui["layim-mobile"]})}); \ No newline at end of file diff --git a/static/layui/lay/modules/rate.js b/resource/static/layui/lay/modules/rate.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/rate.js rename to resource/static/layui/lay/modules/rate.js index eb2d7cfd..290b009c --- a/static/layui/lay/modules/rate.js +++ b/resource/static/layui/lay/modules/rate.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/slider.js b/resource/static/layui/lay/modules/slider.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/slider.js rename to resource/static/layui/lay/modules/slider.js index 6d8ac8d4..71974058 --- a/static/layui/lay/modules/slider.js +++ b/resource/static/layui/lay/modules/slider.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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",f="layui-slider-input-btn",m="layui-slider-hover",p=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};p.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"},p.prototype.render=function(){var e=this,t=e.config;if(t.min=t.min<0?0:t.min,t.range){t.value="object"==typeof t.value?t.value:[t.min,t.value];var a=Math.min(t.value[0],t.value[1]),n=Math.max(t.value[0],t.value[1]);t.value[0]=a>t.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),f=v-r+"%";r+="%",v+="%"}else{t.value="object"==typeof t.value?Math.min(t.value[0],t.value[1]):t.value,t.value=t.value>t.min?t.value:t.min;var f=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var m=t.disabled?"#c2c2c2":t.theme,p='
    '+(t.tips?'
    ':"")+'
    '+(t.range?'
    ':"")+"
    ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(p),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")})},p.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,p=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(p()-h[0].offsetTop-h.height()),a=l.range?T(p()-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/p()*100/b,t=Math.round(i)*b;return e==p()&&(t=Math.ceil(i)*b),t},w=i(['
    p()&&(r=p());var o=r/p()*100/b;x(o,e),t.addClass(m),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(m),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?p()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>p()&&(n=p());var s=n/p()*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("."+f).fadeIn("fast")},function(){var e=i(this);e.children("."+f).fadeOut("fast")}),y.children("."+f).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-bl.max?l.max:Number(g)+b;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)},p.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new p(e);return a.call(i)},e(n,t)}); \ No newline at end of file diff --git a/static/layui/lay/modules/table.js b/resource/static/layui/lay/modules/table.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/table.js rename to resource/static/layui/lay/modules/table.js index 7e1249cb..34fc4cd3 --- a/static/layui/lay/modules/table.js +++ b/resource/static/layui/lay/modules/table.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;layui.define(["laytpl","laypage","layer","form","util"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=(layui.util,layui.hint()),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,s,e,t)}},c=function(){var e=this,t=e.config,i=t.id||t.index;return i&&(c.config[i]=t),{reload:function(t){e.reload.call(e,t)},setColsWidth:function(){e.setColsWidth.call(e)},config:t}},s="table",u=".layui-table",y="layui-hide",h="layui-none",f="layui-table-view",p=".layui-table-tool",v=".layui-table-box",m=".layui-table-init",g=".layui-table-header",b=".layui-table-body",x=".layui-table-main",k=".layui-table-fixed",C=".layui-table-fixed-l",w=".layui-table-fixed-r",T=".layui-table-total",A=".layui-table-page",L=".layui-table-sort",S="layui-table-edit",N="layui-table-hover",W=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
    ','
    ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
    ","
    "].join("")},_=['',"","
    "].join(""),E=['
    ',"{{# if(d.data.toolbar){ }}",'
    ','
    ','
    ',"
    ","{{# } }}",'
    ',"{{# if(d.loading){ }}",'
    ','',"
    ","{{# } }}","{{# var left, right; }}",'
    ',W(),"
    ",'
    ',_,"
    ","{{# if(left){ }}",'
    ','
    ',W({fixed:!0}),"
    ",'
    ',_,"
    ","
    ","{{# }; }}","{{# if(right){ }}",'
    ','
    ',W({fixed:"right"}),'
    ',"
    ",'
    ',_,"
    ","
    ","{{# }; }}","
    ","{{# if(d.data.totalRow){ }}",'
    ','','',"
    ","
    ","{{# } }}","{{# if(d.data.page){ }}",'
    ','
    ',"
    ","{{# } }}","","
    "].join(""),R=t(window),H=t(document),j=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};j.prototype.config={limit:10,loading:!0,cellMinWidth:60,defaultToolbar:["filter","exports","print"],text:{none:"无数据"}},j.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id")||a.index,a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;a.height&&/^full-\d+$/.test(a.height)&&(e.fullHeightGap=a.height.split("-")[1],a.height=R.height()-e.fullHeightGap),e.setInit();var l=a.elem,n=l.next("."+f),o=e.elem=t(i(E).render({VIEW_CLASS:f,data:a,index:e.index}));if(a.index=e.index,n[0]&&n.remove(),l.after(o),e.layTool=o.find(p),e.layBox=o.find(v),e.layHeader=o.find(g),e.layMain=o.find(x),e.layBody=o.find(b),e.layFixed=o.find(k),e.layFixLeft=o.find(C),e.layFixRight=o.find(w),e.layTotal=o.find(T),e.layPage=o.find(A),e.renderToolbar(),e.fullSize(),a.cols.length>1){var r=e.layFixed.find(g).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},j.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,radio:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},j.prototype.setInit=function(e){var t=this,i=t.config;return i.clientWidth=i.width||function(){var e=function(t){var a,l;t=t||i.elem.parent(),a=t.width();try{l="none"===t.css("display")}catch(n){}return!t[0]||a&&!l?a:e(t.parent())};return e()}(),"width"===e?i.clientWidth:void layui.each(i.cols,function(e,a){layui.each(a,function(l,n){if(!n)return void a.splice(l,1);if(n.key=e+"-"+l,n.hide=n.hide||!1,n.colGroup||n.colspan>1){var o=0;layui.each(i.cols[e+1],function(t,i){i.HAS_PARENT||o>1&&o==n.colspan||(i.HAS_PARENT=!0,i.parentKey=e+"-"+l,o+=parseInt(i.colspan>1?i.colspan:1))}),n.colGroup=!0}t.initOpts(n)})})},j.prototype.renderToolbar=function(){var e=this,a=e.config,l=['
    ','
    ','
    '].join(""),n=e.layTool.find(".layui-table-tool-temp");if("default"===a.toolbar)n.html(l);else if(a.toolbar){var o=t(a.toolbar).html()||"";o&&n.html(i(o).render(a))}var r={filter:{title:"筛选列",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"导出",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"打印",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}},d=[];"object"==typeof a.defaultToolbar&&layui.each(a.defaultToolbar,function(e,t){var i=r[t];i&&d.push('
    ')}),e.layTool.find(".layui-table-tool-self").html(d.join(""))},j.prototype.setParentCol=function(e,t){var i=this,a=i.config,l=i.layHeader.find('th[data-key="'+a.index+"-"+t+'"]'),n=parseInt(l.attr("colspan"))||0;if(l[0]){var o=t.split("-"),r=a.cols[o[0]][o[1]];e?n--:n++,l.attr("colspan",n),l[n<1?"addClass":"removeClass"](y),r.colspan=n,r.hide=n<1;var d=l.data("parentkey");d&&i.setParentCol(e,d)}},j.prototype.setColsPatch=function(){var e=this,t=e.config;layui.each(t.cols,function(t,i){layui.each(i,function(t,i){i.hide&&e.setParentCol(i.hide,i.parentKey)})})},j.prototype.setColsWidth=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=e.setInit("width");e.eachCols(function(e,t){t.hide||i++}),o=o-function(){return"line"===t.skin||"nob"===t.skin?2:i+1}()-e.getScrollWidth(e.layMain[0])-1;var r=function(e){layui.each(t.cols,function(i,r){layui.each(r,function(i,d){var c=0,s=d.minWidth||t.cellMinWidth;return d?void(d.colGroup||d.hide||(e?l&&ln&&a&&(l=(o-n)/a)};r(),r(!0),e.autoColNums=a,e.eachCols(function(i,a){var n=a.minWidth||t.cellMinWidth;a.colGroup||a.hide||(0===a.width?e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(l>=n?l:n)+"px"}):/\d+%$/.test(a.width)&&e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(parseFloat(a.width)/100*o)+"px"}))});var d=e.layMain.width()-e.getScrollWidth(e.layMain[0])-e.layMain.children("table").outerWidth();if(e.autoColNums&&d>=-i&&d<=i){var c=function(t){var i;return t=t||e.layHeader.eq(0).find("thead th:last-child"),i=t.data("field"),!i&&t.prev()[0]?c(t.prev()):t},s=c(),u=s.data("key");e.getCssRule(u,function(t){var i=t.style.width||s.outerWidth();t.style.width=parseFloat(i)+d+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px")})}e.loading(!0)},j.prototype.reload=function(e){var i=this;i.config.data&&i.config.data.constructor===Array&&delete i.config.data,i.config=t.extend({},i.config,e),i.render()},j.prototype.page=1,j.prototype.pullData=function(e){var i=this,a=i.config,l=a.request,n=a.response,o=function(){"object"==typeof a.initSort&&i.sort(a.initSort.field,a.initSort.type)};if(i.startTime=(new Date).getTime(),a.url){var r={};r[l.pageName]=e,r[l.limitName]=a.limit;var d=t.extend(r,a.where);a.contentType&&0==a.contentType.indexOf("application/json")&&(d=JSON.stringify(d)),t.ajax({type:a.method||"get",url:a.url,contentType:a.contentType,data:d,dataType:"json",headers:a.headers||{},success:function(t){"function"==typeof a.parseData&&(t=a.parseData(t)||t),t[n.statusName]!=n.statusCode?(i.renderForm(),i.layMain.html('
    '+(t[n.msgName]||"返回的数据不符合规范,正确的成功状态码 ("+n.statusName+") 应为:"+n.statusCode)+"
    ")):(i.renderData(t,e,t[n.countName]),o(),a.time=(new Date).getTime()-i.startTime+" ms"),i.setColsWidth(),"function"==typeof a.done&&a.done(t,e,t[n.countName])},error:function(e,t){i.layMain.html('
    数据接口请求异常:'+t+"
    "),i.renderForm(),i.setColsWidth()}})}else if(a.data&&a.data.constructor===Array){var c={},s=e*a.limit-a.limit;c[n.dataName]=a.data.concat().splice(s,a.limit),c[n.countName]=a.data.length,i.renderData(c,e,a.data.length),o(),i.setColsWidth(),"function"==typeof a.done&&a.done(c,e,c[n.countName])}},j.prototype.eachCols=function(e){var t=this;return d.eachCols(null,e,t.config.cols),t},j.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,u=e[s.response.dataName]||[],f=[],p=[],v=[],m=function(){var e;return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(u,function(a,l){var o=[],u=[],h=[],m=a+s.limit*(n-1)+1;0!==l.length&&(r||(l[d.config.indexName]=a),c.eachCols(function(n,r){var c=r.field||n,f=s.index+"-"+r.key,p=l[c];if(void 0!==p&&null!==p||(p=""),!r.colGroup){var v=['','
    '+function(){var n=t.extend(!0,{LAY_INDEX:m},l),o=d.config.checkName;switch(r.type){case"checkbox":return'";case"radio":return n[o]&&(e=a),'';case"numbers":return m}return r.toolbar?i(t(r.toolbar).html()||"").render(n):r.templet?function(){return"function"==typeof r.templet?r.templet(n):i(t(r.templet).html()||String(p)).render(n)}():p}(),"
    "].join("");o.push(v),r.fixed&&"right"!==r.fixed&&u.push(v),"right"===r.fixed&&h.push(v)}}),f.push(''+o.join("")+""),p.push(''+u.join("")+""),v.push(''+h.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+h).remove(),c.layMain.find("tbody").html(f.join("")),c.layFixLeft.find("tbody").html(p.join("")),c.layFixRight.find("tbody").html(v.join("")),c.renderForm(),"number"==typeof e&&c.setThisRowChecked(e),c.syncCheckAll(),c.scrollPatch(),l.close(c.tipsIndex),s.HAS_SET_COLS_PATCH||c.setColsPatch(),void(s.HAS_SET_COLS_PATCH=!0))};return c.key=s.id||s.index,d.cache[c.key]=u,c.layPage[0==o||0===u.length&&1==n?"addClass":"removeClass"](y),r?m():0===u.length?(c.renderForm(),c.layFixed.remove(),c.layMain.find("tbody").html(""),c.layMain.find("."+h).remove(),c.layMain.append('
    '+s.text.none+"
    ")):(m(),c.renderTotal(u),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.loading(),c.pullData(e.curr))}},s.page),s.page.count=o,a.render(s.page))))},j.prototype.renderTotal=function(e){var t=this,i=t.config,a={};if(i.totalRow){layui.each(e,function(e,i){0!==i.length&&t.eachCols(function(e,t){var l=t.field||e,n=i[l];t.totalRow&&(a[l]=(a[l]||0)+(parseFloat(n)||0))})});var l=[];t.eachCols(function(e,t){var n=t.field||e;if(!t.hide){var o=['",'
    '+function(){var e=t.totalRowText||"";return t.totalRow?a[n]||e:e}(),"
    "].join("");l.push(o)}}),t.layTotal.find("tbody").html(""+l.join("")+"")}},j.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},j.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},j.prototype.setThisRowChecked=function(e){var t=this,i=(t.config,"layui-table-click"),a=t.layBody.find('tr[data-index="'+e+'"]');a.addClass(i).siblings("tr").removeClass(i)},j.prototype.sort=function(e,i,a,l){var n,r,c=this,u={},y=c.config,h=y.elem.attr("lay-filter"),f=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field"),p=e.data("key");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var v=c.layHeader.find("th .laytable-cell-"+p).find(L);c.layHeader.find("th").find(L).removeAttr("lay-sort"),v.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},"asc"===i?r=layui.sort(f,n):"desc"===i?r=layui.sort(f,n,!0):(r=layui.sort(f,d.config.indexName),delete c.sortKey),u[y.response.dataName]=r,c.renderData(u,c.page,c.count,!0),l&&layui.event.call(e,s,"sort("+h+")",{field:n,type:i})},j.prototype.loading=function(e){var i=this,a=i.config;a.loading&&(e?(i.layInit&&i.layInit.remove(),delete i.layInit,i.layBox.find(m).remove()):(i.layInit=t(['
    ','',"
    "].join("")),i.layBox.append(i.layInit)))},j.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},j.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},j.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(i,a){if(a.selectorText===".laytable-cell-"+e)return t(a),!0})},j.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=R.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),a&&(e=parseFloat(a)-(t.layHeader.outerHeight()||38),i.toolbar&&(e-=t.layTool.outerHeight()||50),i.totalRow&&(e-=t.layTotal.outerHeight()||40),i.page&&(e=e-(t.layPage.outerHeight()||41)-2),t.layMain.css("height",e))},j.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},j.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=(e.getScrollWidth(e.layMain[0]),i.outerWidth()-e.layMain.width()),o=function(e){if(a&&l){if(e=e.eq(0),!e.find(".layui-table-patch")[0]){var i=t('
    ');i.find("div").css({width:a}),e.find("tr").append(i)}}else e.find(".layui-table-patch").remove()};o(e.layHeader),o(e.layTotal);var r=e.layMain.height(),d=r-l;e.layFixed.find(b).css("height",i.height()>d?d:"auto"),e.layFixRight[n>0?"removeClass":"addClass"](y),e.layFixRight.css("right",a-1)},j.prototype.events=function(){var e,a=this,o=a.config,c=t("body"),u={},h=a.layHeader.find("th"),f=".layui-table-cell",p=o.elem.attr("lay-filter");a.layTool.on("click","*[lay-event]",function(e){var i=t(this),c=i.attr("lay-event"),u=function(e){var l=t(e.list),n=t('
      ');n.html(l),i.find(".layui-table-tool-panel")[0]||i.append(n),a.renderForm(),n.on("click",function(e){layui.stope(e)}),e.done&&e.done(n,l)};switch(layui.stope(e),H.trigger("table.tool.panel.remove"),l.close(a.tipsIndex),c){case"LAYTABLE_COLS":u({list:function(){var e=[];return a.eachCols(function(t,i){i.field&&"normal"==i.type&&e.push('
    • ')}),e.join("")}(),done:function(){n.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var i=t(e.elem),l=this.checked,n=i.data("key"),r=i.data("parentkey");layui.each(o.cols,function(e,t){layui.each(t,function(t,i){if(e+"-"+t===n){var d=i.hide;i.hide=!l,a.elem.find('*[data-key="'+o.index+"-"+n+'"]')[l?"removeClass":"addClass"](y),d!=i.hide&&a.setParentCol(!l,r),a.fullSize(),a.scrollPatch(),a.setColsWidth()}})})})}});break;case"LAYTABLE_EXPORT":r.ie?l.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出",this,{tips:3}):u({list:function(){return['
    • 导出到 Csv 文件
    • ','
    • 导出到 Excel 文件
    • '].join("")}(),done:function(e,i){i.on("click",function(){var e=t(this).data("type");d.exportFile(o.id,null,e)})}});break;case"LAYTABLE_PRINT":var h=window.open("打印窗口","_blank"),f=[""].join(""),v=t(a.layHeader.html());v.append(a.layMain.find("table").html()),v.find("th.layui-table-patch").remove(),v.find(".layui-table-col-special").remove(),h.document.write(f+v.prop("outerHTML")),h.document.close(),h.print(),h.close()}layui.event.call(this,s,"toolbar("+p+")",t.extend({event:c,config:o},{}))}),h.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.data("unresize")||u.resizeStart||(u.allowResize=i.width()-l<=10,c.css("cursor",u.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);u.resizeStart||c.css("cursor","")}).on("mousedown",function(e){var i=t(this);if(u.allowResize){var l=i.data("key");e.preventDefault(),u.resizeStart=!0,u.offset=[e.clientX,e.clientY],a.getCssRule(l,function(e){var t=e.style.width||i.outerWidth();u.rule=e,u.ruleWidth=parseFloat(t),u.minWidth=i.data("minwidth")||o.cellMinWidth})}}),H.on("mousemove",function(t){if(u.resizeStart){if(t.preventDefault(),u.rule){var i=u.ruleWidth+t.clientX-u.offset[0];i');return l[0].value=e.data("content")||a.text(),e.find("."+S)[0]||e.append(l),void l.focus()}}).on("mouseenter","td",function(){x.call(this)}).on("mouseleave","td",function(){x.call(this,"hide")});var g="layui-table-grid-down",x=function(e){var i=t(this),a=i.children(f);if(e)i.find(".layui-table-grid-down").remove();else if(a.prop("scrollWidth")>a.outerWidth()){if(a.find("."+g)[0])return;i.append('
      ')}};a.layBody.on("click","."+g,function(){var e=t(this),i=e.parent(),n=i.children(f);a.tipsIndex=l.tips(['
      ',n.html(),"
      ",''].join(""),n[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:a.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}})}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),i=e.parents("tr").eq(0).data("index");layui.event.call(this,s,"tool("+p+")",v.call(this,{event:e.attr("lay-event")})),a.setThisRowChecked(i)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layTotal.scrollLeft(i),a.layFixed.find(b).scrollTop(n),l.close(a.tipsIndex)}),H.on("click",function(){H.trigger("table.remove.tool.panel")}),H.on("table.remove.tool.panel",function(){t(".layui-table-tool-panel").remove()}),R.on("resize",function(){a.fullSize(),a.scrollPatch(),a.setColsWidth()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':u+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},c.config={},d.eachCols=function(e,i,a){var l=c.config[e]||{},n=[],o=0;a=t.extend(!0,[],a||l.cols),layui.each(a,function(e,t){layui.each(t,function(t,i){if(i.colGroup){var l=0;o++,i.CHILD_COLS=[],layui.each(a[e+1],function(e,t){t.PARENT_COL_INDEX||l>1&&l==i.colspan||(t.PARENT_COL_INDEX=o,i.CHILD_COLS.push(t),l+=parseInt(t.colspan>1?t.colspan:1))})}i.PARENT_COL_INDEX||n.push(i)})});var r=function(e){layui.each(e||n,function(e,t){return t.CHILD_COLS?r(t.CHILD_COLS):void("function"==typeof i&&i(e,t))})};r()},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},d.exportFile=function(e,t,i){t=t||d.clearCacheKey(d.cache[e]),i=i||"csv";var a=c.config[e]||{},l={csv:"text/csv",xls:"application/vnd.ms-excel"}[i],n=document.createElement("a");return r.ie?o.error("IE_NOT_SUPPORT_EXPORTS"):(n.href="data:"+l+";charset=utf-8,\ufeff"+encodeURIComponent(function(){var i=[],a=[];return layui.each(t,function(t,l){var n=[];"object"==typeof e?(layui.each(e,function(e,a){0==t&&i.push(a||"")}),layui.each(d.clearCacheKey(l),function(e,t){n.push(t)})):d.eachCols(e,function(e,a){a.field&&"normal"==a.type&&!a.hide&&(0==t&&i.push(a.title||""),n.push(l[a.field]))}),a.push(n.join(","))}),i.join(",")+"\r\n"+a.join("\r\n")}()),n.download=(a.title||"table_"+(a.index||""))+"."+i,document.body.appendChild(n),n.click(),void document.body.removeChild(n))},d.reload=function(e,i){var a=c.config[e];return i=i||{},a?(i.data&&i.data.constructor===Array&&delete a.data,d.render(t.extend(!0,{},a,i))):o.error("The ID option was not found in the table instance")},d.render=function(e){var t=new j(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(s,d)}); \ No newline at end of file diff --git a/static/layui/lay/modules/tree.js b/resource/static/layui/lay/modules/tree.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/tree.js rename to resource/static/layui/lay/modules/tree.js index 68ef68db..af9ca315 --- a/static/layui/lay/modules/tree.js +++ b/resource/static/layui/lay/modules/tree.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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+"元素")})}); \ No newline at end of file diff --git a/static/layui/lay/modules/upload.js b/resource/static/layui/lay/modules/upload.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/upload.js rename to resource/static/layui/lay/modules/upload.js index b1b2d60e..1ede8d63 --- a/static/layui/lay/modules/upload.js +++ b/resource/static/layui/lay/modules/upload.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/lay/modules/util.js b/resource/static/layui/lay/modules/util.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/lay/modules/util.js rename to resource/static/layui/lay/modules/util.js index 1c59f553..f0bf4d2c --- a/static/layui/lay/modules/util.js +++ b/resource/static/layui/lay/modules/util.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;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)}); \ No newline at end of file diff --git a/static/layui/layui.all.js b/resource/static/layui/layui.all.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/layui.all.js rename to resource/static/layui/layui.all.js index 304b4050..b73f96e8 --- a/static/layui/layui.all.js +++ b/resource/static/layui/layui.all.js @@ -1,5 +1,5 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ - ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.4.3"},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/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)});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)});!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,n=t.length-1,a=n;a>0;a--)if("interactive"===t[a].readyState){e=t[a].src;break}return e||t[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.9",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var t=this;return t.config=w.extend({},t.config,e),t},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return e?layui.addcss(o,a,i):t.link(o,a,i),this}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
        建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,isInitValue:!0,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElemDate),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElemDate=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n.hasClass(c)||t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));t.elem&&(n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3))},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
        "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
        已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month||12,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

        "+r.time[e]+"

          "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
        ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), -l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
        a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
        ","
        "],area:[1,"",""],param:[1,"",""],thead:[1,"","
        "],tr:[2,"","
        "],col:[2,"","
        "],td:[3,"","
        "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
        ","
        "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
        a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
        ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ +/** layui-v2.4.3 MIT License By https://www.layui.com */ + ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.4.3"},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/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)});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)});!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,n=t.length-1,a=n;a>0;a--)if("interactive"===t[a].readyState){e=t[a].src;break}return e||t[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.9",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var t=this;return t.config=w.extend({},t.config,e),t},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return e?layui.addcss(o,a,i):t.link(o,a,i),this}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
        建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,isInitValue:!0,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElemDate),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElemDate=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n.hasClass(c)||t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));t.elem&&(n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3))},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
        "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
        已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month||12,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

        "+r.time[e]+"

          "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
        ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), +l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
        a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
        ","
        "],area:[1,"",""],param:[1,"",""],thead:[1,"","
        "],tr:[2,"","
        "],col:[2,"","
        "],td:[3,"","
        "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
        ","
        "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
        a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
        ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe});!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
        '+(f?r.title[0]:r.title)+"
        ":"";return r.zIndex=s,t([r.shade?'
        ':"",'
        '+(e&&2!=r.type?"":u)+'
        '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
        '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
        '+e+"
        "}():"")+(r.resize?'':"")+"
        "],u,i('
        ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
          '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
        • '+(t[0].content||"no content")+"
        • ";i'+(t[i].content||"no content")+"";return a}()+"
        ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
        '+(u.length>1?'':"")+'
        '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
        ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
        是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);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)});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)});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",f="layui-slider-input-btn",m="layui-slider-hover",p=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};p.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"},p.prototype.render=function(){var e=this,t=e.config;if(t.min=t.min<0?0:t.min,t.range){t.value="object"==typeof t.value?t.value:[t.min,t.value];var a=Math.min(t.value[0],t.value[1]),n=Math.max(t.value[0],t.value[1]);t.value[0]=a>t.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),f=v-r+"%";r+="%",v+="%"}else{t.value="object"==typeof t.value?Math.min(t.value[0],t.value[1]):t.value,t.value=t.value>t.min?t.value:t.min;var f=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var m=t.disabled?"#c2c2c2":t.theme,p='
        '+(t.tips?'
        ':"")+'
        '+(t.range?'
        ':"")+"
        ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(p),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")})},p.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,p=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(p()-h[0].offsetTop-h.height()),a=l.range?T(p()-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/p()*100/b,t=Math.round(i)*b;return e==p()&&(t=Math.ceil(i)*b),t},w=i(['
        p()&&(r=p());var o=r/p()*100/b;x(o,e),t.addClass(m),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(m),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?p()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>p()&&(n=p());var s=n/p()*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("."+f).fadeIn("fast")},function(){var e=i(this);e.children("."+f).fadeOut("fast")}),y.children("."+f).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-bl.max?l.max:Number(g)+b;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)},p.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new p(e);return a.call(i)},e(n,t)});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)});layui.define("layer",function(e){"use strict";var i=layui.$,t=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 t=this;return i.extend(!0,t.config,e),t},u.prototype.verify=function(e){var t=this;return i.extend(!0,t.config.verify,e),t},u.prototype.on=function(e,i){return layui.onevent.call(this,l,e,i)},u.prototype.val=function(e,t){var a=i(r+'[lay-filter="'+e+'"]');a.each(function(e,a){var n=i(this);layui.each(t,function(e,i){var t,a=n.find('[name="'+e+'"]');a[0]&&(t=a[0].type,"checkbox"===t?a[0].checked=i:"radio"===t?a.each(function(){this.value===i&&(this.checked=!0)}):a.val(i))})}),f.render(null,e)},u.prototype.render=function(e,t){var n=this,u=i(r+function(){return t?'[lay-filter="'+t+'"]':""}()),d={select:function(){var e,t="请选择",a="layui-form-select",n="layui-select-title",r="layui-select-none",d="",f=u.find("select"),v=function(t,l){i(t.target).parent().hasClass(n)&&!l||(i("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},y=function(t,u,f){var y,p=i(this),m=t.find("."+n),k=m.find("input"),x=t.find("dl"),g=x.children("dd"),b=this.selectedIndex;if(!u){var C=function(){var e=t.offset().top+t.outerHeight()+5-h.scrollTop(),i=x.outerHeight();b=p[0].selectedIndex,t.addClass(a+"ed"),g.removeClass(o),y=null,g.eq(b).addClass(s).siblings().removeClass(s),e+i>h.height()&&e>=i&&t.addClass(a+"up"),$()},w=function(e){t.removeClass(a+"ed "+a+"up"),k.blur(),y=null,e||T(k.val(),function(e){e&&(d=x.find("."+s).html(),k&&k.val(d))})},$=function(){var e=x.children("dd."+s);if(e[0]){var i=e.position().top,t=x.height(),a=e.height();i>t&&x.scrollTop(i+x.scrollTop()-t+a-5),i<0&&x.scrollTop(i+x.scrollTop()-5)}};m.on("click",function(e){t.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 i=e.keyCode;9===i&&C()}).on("keydown",function(e){var i=e.keyCode;9===i&&w();var t=function(i,a){var n,l;e.preventDefault();var r=function(){var e=x.children("dd."+s);if(x.children("dd."+o)[0]&&"next"===i){var t=x.children("dd:not(."+o+",."+c+")"),n=t.eq(0).index();if(n>=0&&n无匹配项

        '):x.find("."+r).remove()},"keyup"),""===i&&x.find("."+r).remove(),void $())};f&&k.on("keyup",j).on("blur",function(t){var a=p[0].selectedIndex;e=k,d=i(p[0].options[a]).html(),setTimeout(function(){T(k.val(),function(e){d||k.val("")},"blur")},200)}),g.on("click",function(){var e=i(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:t}),w(!0),!1)}),t.find("dl>dt").on("click",function(e){return!1}),i(document).off("click",v).on("click",v)}};f.each(function(e,l){var r=i(this),o=r.next("."+a),u=this.disabled,d=l.value,f=i(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?t:v.innerHTML||t:t,m=i(['
        ','
        ','','
        ','
        ',function(e){var i=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?i.push("
        "+a.label+"
        "):i.push('
        '+a.innerHTML+"
        "):i.push('
        '+(a.innerHTML||t)+"
        ")}),0===i.length&&i.push('
        没有选项
        '),i.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"]},t=u.find("input[type=checkbox]"),a=function(e,t){var a=i(this);e.on("click",function(){var i=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(t[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(t[1]).find("em").text(n[0])),layui.event.call(a[0],l,t[2]+"("+i+")",{elem:a[0],value:a[0].value,othis:e}))})};t.each(function(t,n){var l=i(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=i(['
        ",function(){var e=n.title.replace(/\s/g,""),i={checkbox:[e?""+n.title+"":"",''].join(""),_switch:""+((n.checked?s[0]:s[1])||"")+""};return i[r]||i.checkbox}(),"
        "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",t=["",""],a=u.find("input[type=radio]"),n=function(a){var n=i(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=i(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(t[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(t[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=i(this),s=r.next("."+e),o=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();s[0]&&s.remove();var u=i(['
        ',''+t[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,i){i()}),n};var d=function(){var e=i(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=i(this),c=r.attr("lay-verify").split("|"),u=r.attr("lay-verType"),d=r.val();if(r.removeClass(o),layui.each(c,function(e,i){var c,f="",v="function"==typeof a[i];if(a[i]){var c=v?f=a[i](d,l):!a[i][0].test(d);if(f=f||a[i][1],c)return"tips"===u?t.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?t.alert(f,{title:"提示",shadeClose:!0}):t.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,i){if(i.name=(i.name||"").replace(/^\s*|\s*&/,""),i.name){if(/^.*\[\]$/.test(i.name)){var t=i.name.match(/^(.*)\[\]$/g)[0];p[t]=0|p[t],i.name=i.name.replace(/^(.*)\[\]$/,"$1["+p[t]++ +"]")}/^checkbox|radio$/.test(i.type)&&!i.checked||(c[i.name]=i.value)}}),layui.event.call(this,l,"submit("+y+")",{elem:this,form:v,field:c})},f=new u,v=i(document),h=i(window);f.render(),v.on("reset",r,function(){var e=i(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),v.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)});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+"元素")})});layui.define(["laytpl","laypage","layer","form","util"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=(layui.util,layui.hint()),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,s,e,t)}},c=function(){var e=this,t=e.config,i=t.id||t.index;return i&&(c.config[i]=t),{reload:function(t){e.reload.call(e,t)},setColsWidth:function(){e.setColsWidth.call(e)},config:t}},s="table",u=".layui-table",y="layui-hide",h="layui-none",f="layui-table-view",p=".layui-table-tool",v=".layui-table-box",m=".layui-table-init",g=".layui-table-header",b=".layui-table-body",x=".layui-table-main",k=".layui-table-fixed",C=".layui-table-fixed-l",w=".layui-table-fixed-r",T=".layui-table-total",A=".layui-table-page",L=".layui-table-sort",S="layui-table-edit",N="layui-table-hover",W=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
          ','
          ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
          ","
          "].join("")},_=['',"","
          "].join(""),E=['
          ',"{{# if(d.data.toolbar){ }}",'
          ','
          ','
          ',"
          ","{{# } }}",'
          ',"{{# if(d.loading){ }}",'
          ','',"
          ","{{# } }}","{{# var left, right; }}",'
          ',W(),"
          ",'
          ',_,"
          ","{{# if(left){ }}",'
          ','
          ',W({fixed:!0}),"
          ",'
          ',_,"
          ","
          ","{{# }; }}","{{# if(right){ }}",'
          ','
          ',W({fixed:"right"}),'
          ',"
          ",'
          ',_,"
          ","
          ","{{# }; }}","
          ","{{# if(d.data.totalRow){ }}",'
          ','','',"
          ","
          ","{{# } }}","{{# if(d.data.page){ }}",'
          ','
          ',"
          ","{{# } }}","","
          "].join(""),R=t(window),H=t(document),j=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};j.prototype.config={limit:10,loading:!0,cellMinWidth:60,defaultToolbar:["filter","exports","print"],text:{none:"无数据"}},j.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id")||a.index,a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;a.height&&/^full-\d+$/.test(a.height)&&(e.fullHeightGap=a.height.split("-")[1],a.height=R.height()-e.fullHeightGap),e.setInit();var l=a.elem,n=l.next("."+f),o=e.elem=t(i(E).render({VIEW_CLASS:f,data:a,index:e.index}));if(a.index=e.index,n[0]&&n.remove(),l.after(o),e.layTool=o.find(p),e.layBox=o.find(v),e.layHeader=o.find(g),e.layMain=o.find(x),e.layBody=o.find(b),e.layFixed=o.find(k),e.layFixLeft=o.find(C),e.layFixRight=o.find(w),e.layTotal=o.find(T),e.layPage=o.find(A),e.renderToolbar(),e.fullSize(),a.cols.length>1){var r=e.layFixed.find(g).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},j.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,radio:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},j.prototype.setInit=function(e){var t=this,i=t.config;return i.clientWidth=i.width||function(){var e=function(t){var a,l;t=t||i.elem.parent(),a=t.width();try{l="none"===t.css("display")}catch(n){}return!t[0]||a&&!l?a:e(t.parent())};return e()}(),"width"===e?i.clientWidth:void layui.each(i.cols,function(e,a){layui.each(a,function(l,n){if(!n)return void a.splice(l,1);if(n.key=e+"-"+l,n.hide=n.hide||!1,n.colGroup||n.colspan>1){var o=0;layui.each(i.cols[e+1],function(t,i){i.HAS_PARENT||o>1&&o==n.colspan||(i.HAS_PARENT=!0,i.parentKey=e+"-"+l,o+=parseInt(i.colspan>1?i.colspan:1))}),n.colGroup=!0}t.initOpts(n)})})},j.prototype.renderToolbar=function(){var e=this,a=e.config,l=['
          ','
          ','
          '].join(""),n=e.layTool.find(".layui-table-tool-temp");if("default"===a.toolbar)n.html(l);else if(a.toolbar){var o=t(a.toolbar).html()||"";o&&n.html(i(o).render(a))}var r={filter:{title:"筛选列",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"导出",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"打印",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}},d=[];"object"==typeof a.defaultToolbar&&layui.each(a.defaultToolbar,function(e,t){var i=r[t];i&&d.push('
          ')}),e.layTool.find(".layui-table-tool-self").html(d.join(""))},j.prototype.setParentCol=function(e,t){var i=this,a=i.config,l=i.layHeader.find('th[data-key="'+a.index+"-"+t+'"]'),n=parseInt(l.attr("colspan"))||0;if(l[0]){var o=t.split("-"),r=a.cols[o[0]][o[1]];e?n--:n++,l.attr("colspan",n),l[n<1?"addClass":"removeClass"](y),r.colspan=n,r.hide=n<1;var d=l.data("parentkey");d&&i.setParentCol(e,d)}},j.prototype.setColsPatch=function(){var e=this,t=e.config;layui.each(t.cols,function(t,i){layui.each(i,function(t,i){i.hide&&e.setParentCol(i.hide,i.parentKey)})})},j.prototype.setColsWidth=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=e.setInit("width");e.eachCols(function(e,t){t.hide||i++}),o=o-function(){return"line"===t.skin||"nob"===t.skin?2:i+1}()-e.getScrollWidth(e.layMain[0])-1;var r=function(e){layui.each(t.cols,function(i,r){layui.each(r,function(i,d){var c=0,s=d.minWidth||t.cellMinWidth;return d?void(d.colGroup||d.hide||(e?l&&ln&&a&&(l=(o-n)/a)};r(),r(!0),e.autoColNums=a,e.eachCols(function(i,a){var n=a.minWidth||t.cellMinWidth;a.colGroup||a.hide||(0===a.width?e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(l>=n?l:n)+"px"}):/\d+%$/.test(a.width)&&e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(parseFloat(a.width)/100*o)+"px"}))});var d=e.layMain.width()-e.getScrollWidth(e.layMain[0])-e.layMain.children("table").outerWidth();if(e.autoColNums&&d>=-i&&d<=i){var c=function(t){var i;return t=t||e.layHeader.eq(0).find("thead th:last-child"),i=t.data("field"),!i&&t.prev()[0]?c(t.prev()):t},s=c(),u=s.data("key");e.getCssRule(u,function(t){var i=t.style.width||s.outerWidth();t.style.width=parseFloat(i)+d+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px")})}e.loading(!0)},j.prototype.reload=function(e){var i=this;i.config.data&&i.config.data.constructor===Array&&delete i.config.data,i.config=t.extend({},i.config,e),i.render()},j.prototype.page=1,j.prototype.pullData=function(e){var i=this,a=i.config,l=a.request,n=a.response,o=function(){"object"==typeof a.initSort&&i.sort(a.initSort.field,a.initSort.type)};if(i.startTime=(new Date).getTime(),a.url){var r={};r[l.pageName]=e,r[l.limitName]=a.limit;var d=t.extend(r,a.where);a.contentType&&0==a.contentType.indexOf("application/json")&&(d=JSON.stringify(d)),t.ajax({type:a.method||"get",url:a.url,contentType:a.contentType,data:d,dataType:"json",headers:a.headers||{},success:function(t){"function"==typeof a.parseData&&(t=a.parseData(t)||t),t[n.statusName]!=n.statusCode?(i.renderForm(),i.layMain.html('
          '+(t[n.msgName]||"返回的数据不符合规范,正确的成功状态码 ("+n.statusName+") 应为:"+n.statusCode)+"
          ")):(i.renderData(t,e,t[n.countName]),o(),a.time=(new Date).getTime()-i.startTime+" ms"),i.setColsWidth(),"function"==typeof a.done&&a.done(t,e,t[n.countName])},error:function(e,t){i.layMain.html('
          数据接口请求异常:'+t+"
          "),i.renderForm(),i.setColsWidth()}})}else if(a.data&&a.data.constructor===Array){var c={},s=e*a.limit-a.limit;c[n.dataName]=a.data.concat().splice(s,a.limit),c[n.countName]=a.data.length,i.renderData(c,e,a.data.length),o(),i.setColsWidth(),"function"==typeof a.done&&a.done(c,e,c[n.countName])}},j.prototype.eachCols=function(e){var t=this;return d.eachCols(null,e,t.config.cols),t},j.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,u=e[s.response.dataName]||[],f=[],p=[],v=[],m=function(){var e;return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(u,function(a,l){var o=[],u=[],h=[],m=a+s.limit*(n-1)+1;0!==l.length&&(r||(l[d.config.indexName]=a),c.eachCols(function(n,r){var c=r.field||n,f=s.index+"-"+r.key,p=l[c];if(void 0!==p&&null!==p||(p=""),!r.colGroup){var v=['','
          '+function(){var n=t.extend(!0,{LAY_INDEX:m},l),o=d.config.checkName;switch(r.type){case"checkbox":return'";case"radio":return n[o]&&(e=a),'';case"numbers":return m}return r.toolbar?i(t(r.toolbar).html()||"").render(n):r.templet?function(){return"function"==typeof r.templet?r.templet(n):i(t(r.templet).html()||String(p)).render(n)}():p}(),"
          "].join("");o.push(v),r.fixed&&"right"!==r.fixed&&u.push(v),"right"===r.fixed&&h.push(v)}}),f.push(''+o.join("")+""),p.push(''+u.join("")+""),v.push(''+h.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+h).remove(),c.layMain.find("tbody").html(f.join("")),c.layFixLeft.find("tbody").html(p.join("")),c.layFixRight.find("tbody").html(v.join("")),c.renderForm(),"number"==typeof e&&c.setThisRowChecked(e),c.syncCheckAll(),c.scrollPatch(),l.close(c.tipsIndex),s.HAS_SET_COLS_PATCH||c.setColsPatch(),void(s.HAS_SET_COLS_PATCH=!0))};return c.key=s.id||s.index,d.cache[c.key]=u,c.layPage[0==o||0===u.length&&1==n?"addClass":"removeClass"](y),r?m():0===u.length?(c.renderForm(),c.layFixed.remove(),c.layMain.find("tbody").html(""),c.layMain.find("."+h).remove(),c.layMain.append('
          '+s.text.none+"
          ")):(m(),c.renderTotal(u),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.loading(),c.pullData(e.curr))}},s.page),s.page.count=o,a.render(s.page))))},j.prototype.renderTotal=function(e){var t=this,i=t.config,a={};if(i.totalRow){layui.each(e,function(e,i){0!==i.length&&t.eachCols(function(e,t){var l=t.field||e,n=i[l];t.totalRow&&(a[l]=(a[l]||0)+(parseFloat(n)||0))})});var l=[];t.eachCols(function(e,t){var n=t.field||e;if(!t.hide){var o=['",'
          '+function(){var e=t.totalRowText||"";return t.totalRow?a[n]||e:e}(),"
          "].join("");l.push(o)}}),t.layTotal.find("tbody").html(""+l.join("")+"")}},j.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},j.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},j.prototype.setThisRowChecked=function(e){var t=this,i=(t.config,"layui-table-click"),a=t.layBody.find('tr[data-index="'+e+'"]');a.addClass(i).siblings("tr").removeClass(i)},j.prototype.sort=function(e,i,a,l){var n,r,c=this,u={},y=c.config,h=y.elem.attr("lay-filter"),f=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field"),p=e.data("key");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var v=c.layHeader.find("th .laytable-cell-"+p).find(L);c.layHeader.find("th").find(L).removeAttr("lay-sort"),v.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},"asc"===i?r=layui.sort(f,n):"desc"===i?r=layui.sort(f,n,!0):(r=layui.sort(f,d.config.indexName),delete c.sortKey),u[y.response.dataName]=r,c.renderData(u,c.page,c.count,!0),l&&layui.event.call(e,s,"sort("+h+")",{field:n,type:i})},j.prototype.loading=function(e){var i=this,a=i.config;a.loading&&(e?(i.layInit&&i.layInit.remove(),delete i.layInit,i.layBox.find(m).remove()):(i.layInit=t(['
          ','',"
          "].join("")),i.layBox.append(i.layInit)))},j.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},j.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},j.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(i,a){if(a.selectorText===".laytable-cell-"+e)return t(a),!0})},j.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=R.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),a&&(e=parseFloat(a)-(t.layHeader.outerHeight()||38),i.toolbar&&(e-=t.layTool.outerHeight()||50),i.totalRow&&(e-=t.layTotal.outerHeight()||40),i.page&&(e=e-(t.layPage.outerHeight()||41)-2),t.layMain.css("height",e))},j.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},j.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=(e.getScrollWidth(e.layMain[0]),i.outerWidth()-e.layMain.width()),o=function(e){if(a&&l){if(e=e.eq(0),!e.find(".layui-table-patch")[0]){var i=t('
          ');i.find("div").css({width:a}),e.find("tr").append(i)}}else e.find(".layui-table-patch").remove()};o(e.layHeader),o(e.layTotal);var r=e.layMain.height(),d=r-l;e.layFixed.find(b).css("height",i.height()>d?d:"auto"),e.layFixRight[n>0?"removeClass":"addClass"](y),e.layFixRight.css("right",a-1)},j.prototype.events=function(){var e,a=this,o=a.config,c=t("body"),u={},h=a.layHeader.find("th"),f=".layui-table-cell",p=o.elem.attr("lay-filter");a.layTool.on("click","*[lay-event]",function(e){var i=t(this),c=i.attr("lay-event"),u=function(e){var l=t(e.list),n=t('
            ');n.html(l),i.find(".layui-table-tool-panel")[0]||i.append(n),a.renderForm(),n.on("click",function(e){layui.stope(e)}),e.done&&e.done(n,l)};switch(layui.stope(e),H.trigger("table.tool.panel.remove"),l.close(a.tipsIndex),c){case"LAYTABLE_COLS":u({list:function(){var e=[];return a.eachCols(function(t,i){i.field&&"normal"==i.type&&e.push('
          • ')}),e.join("")}(),done:function(){n.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var i=t(e.elem),l=this.checked,n=i.data("key"),r=i.data("parentkey");layui.each(o.cols,function(e,t){layui.each(t,function(t,i){if(e+"-"+t===n){var d=i.hide;i.hide=!l,a.elem.find('*[data-key="'+o.index+"-"+n+'"]')[l?"removeClass":"addClass"](y),d!=i.hide&&a.setParentCol(!l,r),a.fullSize(),a.scrollPatch(),a.setColsWidth()}})})})}});break;case"LAYTABLE_EXPORT":r.ie?l.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出",this,{tips:3}):u({list:function(){return['
          • 导出到 Csv 文件
          • ','
          • 导出到 Excel 文件
          • '].join("")}(),done:function(e,i){i.on("click",function(){var e=t(this).data("type");d.exportFile(o.id,null,e)})}});break;case"LAYTABLE_PRINT":var h=window.open("打印窗口","_blank"),f=[""].join(""),v=t(a.layHeader.html());v.append(a.layMain.find("table").html()),v.find("th.layui-table-patch").remove(),v.find(".layui-table-col-special").remove(),h.document.write(f+v.prop("outerHTML")),h.document.close(),h.print(),h.close()}layui.event.call(this,s,"toolbar("+p+")",t.extend({event:c,config:o},{}))}),h.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.data("unresize")||u.resizeStart||(u.allowResize=i.width()-l<=10,c.css("cursor",u.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);u.resizeStart||c.css("cursor","")}).on("mousedown",function(e){var i=t(this);if(u.allowResize){var l=i.data("key");e.preventDefault(),u.resizeStart=!0,u.offset=[e.clientX,e.clientY],a.getCssRule(l,function(e){var t=e.style.width||i.outerWidth();u.rule=e,u.ruleWidth=parseFloat(t),u.minWidth=i.data("minwidth")||o.cellMinWidth})}}),H.on("mousemove",function(t){if(u.resizeStart){if(t.preventDefault(),u.rule){var i=u.ruleWidth+t.clientX-u.offset[0];i');return l[0].value=e.data("content")||a.text(),e.find("."+S)[0]||e.append(l),void l.focus()}}).on("mouseenter","td",function(){x.call(this)}).on("mouseleave","td",function(){x.call(this,"hide")});var g="layui-table-grid-down",x=function(e){var i=t(this),a=i.children(f);if(e)i.find(".layui-table-grid-down").remove();else if(a.prop("scrollWidth")>a.outerWidth()){if(a.find("."+g)[0])return;i.append('
            ')}};a.layBody.on("click","."+g,function(){var e=t(this),i=e.parent(),n=i.children(f);a.tipsIndex=l.tips(['
            ',n.html(),"
            ",''].join(""),n[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:a.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}})}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),i=e.parents("tr").eq(0).data("index");layui.event.call(this,s,"tool("+p+")",v.call(this,{event:e.attr("lay-event")})),a.setThisRowChecked(i)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layTotal.scrollLeft(i),a.layFixed.find(b).scrollTop(n),l.close(a.tipsIndex)}),H.on("click",function(){H.trigger("table.remove.tool.panel")}),H.on("table.remove.tool.panel",function(){t(".layui-table-tool-panel").remove()}),R.on("resize",function(){a.fullSize(),a.scrollPatch(),a.setColsWidth()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':u+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},c.config={},d.eachCols=function(e,i,a){var l=c.config[e]||{},n=[],o=0;a=t.extend(!0,[],a||l.cols),layui.each(a,function(e,t){layui.each(t,function(t,i){if(i.colGroup){var l=0;o++,i.CHILD_COLS=[],layui.each(a[e+1],function(e,t){t.PARENT_COL_INDEX||l>1&&l==i.colspan||(t.PARENT_COL_INDEX=o,i.CHILD_COLS.push(t),l+=parseInt(t.colspan>1?t.colspan:1))})}i.PARENT_COL_INDEX||n.push(i)})});var r=function(e){layui.each(e||n,function(e,t){return t.CHILD_COLS?r(t.CHILD_COLS):void("function"==typeof i&&i(e,t))})};r()},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},d.exportFile=function(e,t,i){t=t||d.clearCacheKey(d.cache[e]),i=i||"csv";var a=c.config[e]||{},l={csv:"text/csv",xls:"application/vnd.ms-excel"}[i],n=document.createElement("a");return r.ie?o.error("IE_NOT_SUPPORT_EXPORTS"):(n.href="data:"+l+";charset=utf-8,\ufeff"+encodeURIComponent(function(){var i=[],a=[];return layui.each(t,function(t,l){var n=[];"object"==typeof e?(layui.each(e,function(e,a){0==t&&i.push(a||"")}),layui.each(d.clearCacheKey(l),function(e,t){n.push(t)})):d.eachCols(e,function(e,a){a.field&&"normal"==a.type&&!a.hide&&(0==t&&i.push(a.title||""),n.push(l[a.field]))}),a.push(n.join(","))}),i.join(",")+"\r\n"+a.join("\r\n")}()),n.download=(a.title||"table_"+(a.index||""))+"."+i,document.body.appendChild(n),n.click(),void document.body.removeChild(n))},d.reload=function(e,i){var a=c.config[e];return i=i||{},a?(i.data&&i.data.constructor===Array&&delete a.data,d.render(t.extend(!0,{},a,i))):o.error("The ID option was not found in the table instance")},d.render=function(e){var t=new j(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(s,d)});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",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)});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)});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)});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)});layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//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"); \ No newline at end of file diff --git a/static/layui/layui.js b/resource/static/layui/layui.js old mode 100755 new mode 100644 similarity index 99% rename from static/layui/layui.js rename to resource/static/layui/layui.js index a0ed5f32..3897c9d7 --- a/static/layui/layui.js +++ b/resource/static/layui/layui.js @@ -1,2 +1,2 @@ -/** layui-v2.4.3 MIT License By https://www.layui.com */ +/** layui-v2.4.3 MIT License By https://www.layui.com */ ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.4.3"},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
            - {{range $k, $v := .role}} - + {{range $k, $v := .roleList}} + {{end}}
            *
            diff --git a/views/admin/edit.html b/resource/template/admin/edit.html similarity index 97% rename from views/admin/edit.html rename to resource/template/admin/edit.html index 4d59b100..2bb29f97 100644 --- a/views/admin/edit.html +++ b/resource/template/admin/edit.html @@ -58,8 +58,8 @@
            - {{range $k, $v := .role}} - + {{range $k, $v := .roleList}} + {{end}}
            *
            diff --git a/views/admin/list.html b/resource/template/admin/list.html similarity index 100% rename from views/admin/list.html rename to resource/template/admin/list.html diff --git a/views/auth/list.html b/resource/template/auth/list.html similarity index 100% rename from views/auth/list.html rename to resource/template/auth/list.html diff --git a/views/ban/add.html b/resource/template/ban/add.html similarity index 100% rename from views/ban/add.html rename to resource/template/ban/add.html diff --git a/views/ban/edit.html b/resource/template/ban/edit.html similarity index 100% rename from views/ban/edit.html rename to resource/template/ban/edit.html diff --git a/views/ban/list.html b/resource/template/ban/list.html similarity index 100% rename from views/ban/list.html rename to resource/template/ban/list.html diff --git a/views/group/add.html b/resource/template/group/add.html similarity index 100% rename from views/group/add.html rename to resource/template/group/add.html diff --git a/views/group/edit.html b/resource/template/group/edit.html similarity index 100% rename from views/group/edit.html rename to resource/template/group/edit.html diff --git a/views/group/list.html b/resource/template/group/list.html similarity index 100% rename from views/group/list.html rename to resource/template/group/list.html diff --git a/views/home/start.html b/resource/template/home/start.html similarity index 98% rename from views/home/start.html rename to resource/template/home/start.html index deb78aab..bfcd5d8e 100644 --- a/views/home/start.html +++ b/resource/template/home/start.html @@ -246,7 +246,7 @@ {{range $k, $v := .jobs}} - {{$v.task_name}}-{{$v.task_group}} # {{$v.task_id}} + {{$v.task_name}}-{{$v.task_group}} # {{$v.task_id}} {{$v.next_time}} {{else}} @@ -336,7 +336,7 @@ }); function logDetail(id){ - window.parent.openTab("/tasklog/detail?id="+id,id+' 日志详情',"admin_log_detail-"+id,''); + window.parent.openTab("/task_log/detail?id="+id,id+' 日志详情',"admin_log_detail-"+id,''); } diff --git a/views/login/login.html b/resource/template/login/login.html similarity index 100% rename from views/login/login.html rename to resource/template/login/login.html diff --git a/views/notifytpl/add.html b/resource/template/notifytpl/add.html similarity index 100% rename from views/notifytpl/add.html rename to resource/template/notifytpl/add.html diff --git a/views/notifytpl/edit.html b/resource/template/notifytpl/edit.html similarity index 100% rename from views/notifytpl/edit.html rename to resource/template/notifytpl/edit.html diff --git a/views/notifytpl/list.html b/resource/template/notifytpl/list.html similarity index 93% rename from views/notifytpl/list.html rename to resource/template/notifytpl/list.html index 73183f75..02b066b2 100644 --- a/views/notifytpl/list.html +++ b/resource/template/notifytpl/list.html @@ -40,7 +40,7 @@ //方法级渲染 table.render({ elem: '#table_list' - , url: '/notifytpl/table' + , url: '/notify_tpl/table' ,size: 'sm' //小尺寸的表格 , cols: [[ {checkbox: true, fixed: true}, @@ -70,7 +70,7 @@ }; $("#add").on("click", function () { - window.parent.openTab("/notifytpl/add", '新增模板', "notify_tpl_add-0", 'fa-plus'); + window.parent.openTab("/notify_tpl/add", '新增模板', "notify_tpl_add-0", 'fa-plus'); }) //监听工具条 @@ -78,7 +78,7 @@ var data = obj.data; var tplName = data.tpl_name if (obj.event === 'edit') { - window.parent.openTab("/notifytpl/edit?id=" + data.id, tplName + '编辑', "notify_tpl_edit-" + data.id, 'fa-edit'); + window.parent.openTab("/notify_tpl/edit?id=" + data.id, tplName + '编辑', "notify_tpl_edit-" + data.id, 'fa-edit'); } else if (obj.event === 'del') { layer.confirm('真的删除【' + data.tpl_name + '】模板么', function (index) { var jsData = {'id': data.id} diff --git a/views/public/help.html b/resource/template/public/help.html similarity index 100% rename from views/public/help.html rename to resource/template/public/help.html diff --git a/views/public/layout.html b/resource/template/public/layout.html similarity index 98% rename from views/public/layout.html rename to resource/template/public/layout.html index b4a3570a..9db5e99d 100644 --- a/views/public/layout.html +++ b/resource/template/public/layout.html @@ -43,7 +43,7 @@
            -{{.LayoutContent}} +{{include .MainContent .}} {{/*
            \ No newline at end of file + diff --git a/views/task/copy.html b/resource/template/task/copy.html similarity index 98% rename from views/task/copy.html rename to resource/template/task/copy.html index 6fe7d234..77e05ef9 100644 --- a/views/task/copy.html +++ b/resource/template/task/copy.html @@ -120,7 +120,7 @@
            @@ -160,13 +160,13 @@ var formSelects = layui.formSelects; - var server_id = {{$.service_ids}}; + var server_id = [{{$.task.ServerIds}}]; formSelects.render({ init : server_id, name : 'select_server', }); - var select_notify = {{$.notify_user_ids}}; + var select_notify = [{{$.task.NotifyUserIds}}]; console.log(select_notify); formSelects.render({ diff --git a/views/task/detail.html b/resource/template/task/detail.html similarity index 85% rename from views/task/detail.html rename to resource/template/task/detail.html index 358f751f..3201b11f 100644 --- a/views/task/detail.html +++ b/resource/template/task/detail.html @@ -14,18 +14,18 @@ {{end}} - {{if eq $.task.Status 1}} - - {{end}} - {{if eq $.task.Status 0}} - - {{end}} + + + + + + - - - - - + + + + +
            @@ -183,7 +183,7 @@ } window.parent.openTab("/task/edit?id="+id,task_name+' 编辑',"admin_task_edit-"+id,'fa-edit'); }else if(event==='log'){ - window.parent.openTab("/tasklog/list?task_id="+id,task_name+'日志',"admin_log-"+id,''); + window.parent.openTab("/task_log/list?task_id="+id,task_name+'日志',"admin_log-"+id,''); }else if(event==='copy'){ window.parent.openTab("/task/copy?id="+id,task_name+' 复制',"admin_task_copy-"+id,'fa-copy'); }else if(event==="del"){ @@ -195,7 +195,7 @@ layer.confirm("确认要删除这条任务吗?", {icon: 3, title:'提示'}, function(index){ layer.load(); - $.post('/task/ajaxdel', {id:id}, function (out) { + $.post('/task/ajax_del', {id:id}, function (out) { if (out.status == 0) { layer.msg("操作成功",{icon: 1,shade:0.3,time:1000},function () { @@ -217,10 +217,10 @@ }else if (event==='run'){ layer.confirm("测试执行任务,注意不要超时,请确认执行", {icon: 3, title:'提示'}, function(index){ layer.load(); - $.post('/task/ajaxrun', {id:id}, function (out) { + $.post('/task/ajax_run', {id:id}, function (out) { if (out.status == 0) { layer.msg("操作成功",{icon: 1,shade:0.3,time:1000},function () { - window.parent.openTab("/tasklog/list?task_id="+id,task_name+' 日志',"admin_task_log-"+id,''); + window.parent.openTab("/task_log/list?task_id="+id,task_name+' 日志',"admin_task_log-"+id,''); }) } else { @@ -234,7 +234,7 @@ layer.close(index); }); }else if (event==='audit' || event==='start' || event==='pause' || event==="nopass"){ - $.post('/task/ajax'+event, {id:id}, function (out) { + $.post('/task/ajax_'+event, {id:id}, function (out) { if (out.status == 0) { layer.msg("操作成功",{icon: 1,shade:0.3,time:1000},function () { window.location.reload() diff --git a/views/task/edit.html b/resource/template/task/edit.html similarity index 98% rename from views/task/edit.html rename to resource/template/task/edit.html index c9a89084..e342235f 100644 --- a/views/task/edit.html +++ b/resource/template/task/edit.html @@ -120,7 +120,7 @@
            @@ -162,13 +162,13 @@ var formSelects = layui.formSelects; - var server_id = {{$.service_ids}}; + var server_id = [{{$.task.ServerIds}}]; formSelects.render({ init : server_id, name : 'select_server', }); - var select_notify = {{$.notify_user_ids}}; + var select_notify = [{{$.task.NotifyUserIds}}]; console.log(select_notify); formSelects.render({ diff --git a/views/task/list.html b/resource/template/task/list.html similarity index 66% rename from views/task/list.html rename to resource/template/task/list.html index c2626730..3981b622 100644 --- a/views/task/list.html +++ b/resource/template/task/list.html @@ -4,8 +4,8 @@
            - - cron + +
            @@ -33,11 +33,14 @@