Version 2.2.2

增加注销按钮
完善注释
This commit is contained in:
firesun
2015-10-30 22:46:04 +08:00
parent 13630da377
commit 51513e2f05
20 changed files with 180 additions and 70 deletions

View File

@@ -58,22 +58,29 @@ require("auth.php");
<ul id="Tab" class="nav"> <ul id="Tab" class="nav">
<li class="active"> <li class="active">
<a href="#panel" data-toggle="tab"> <a href="#panel" data-toggle="tab">
<span class="icon icon-chart-column"></span>接收面板</a> <span class="icon icon-panel"></span>接收面板</a>
</li> </li>
<li> <li>
<a href="#js" data-toggle="tab"> <a href="#js" data-toggle="tab">
<span class="icon icon-star-empty"></span>我的JS</a> <span class="icon icon-my-js"></span>我的JS</a>
</li> </li>
<li> <li>
<a href="#template" data-toggle="tab"> <a href="#template" data-toggle="tab">
<span class="icon icon-faves"></span>公共模板</a> <span class="icon icon-template"></span>公共模板</a>
</li> </li>
<li> <li>
<a href="#aboutus" data-toggle="tab"> <a href="#aboutus" data-toggle="tab">
<span class="icon icon-info"></span>关于</a> <span class="icon icon-info"></span>关于</a>
</li> </li>
<li id="logout">
<a href="#logout" >
<span class="icon icon-logout"></span>注销</a>
</li>
</ul> </ul>
<span id="rights">Copyright © 2015-2016 Powered by Firesun</span> <span id="rights">Copyright © 2015-2016<br>Powered by <a href="https://github.com/firesunCN" target="_blank">Firesun</a></span>
</div> </div>
</div> </div>
@@ -107,18 +114,19 @@ require("auth.php");
<h2 class="eam-efficiency col-xs-3">关于</h2> <h2 class="eam-efficiency col-xs-3">关于</h2>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
<div id="about_detail"></div> <div id="about_detail">
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div id="notifications-bottom-right"></div> <div id="notifications-bottom-right"></div>
<div style="display: none;"> <div style="display: none;">
<div id="searchWindow" class="windows"> <div id="searchWindow" class="windows">
<div> <div>
查找记录</div> 查找记录</div>
@@ -157,6 +165,24 @@ require("auth.php");
</div> </div>
</div> </div>
</div> </div>
<div id="logoutConfirmWindow" class="windows">
<div>
<img width="14" height="14" src="static/images/help.png" alt="" />
确认</div>
<div>
<div style="margin: 5px;">
您确认注销吗?
</div>
<div>
<div style="float: right; margin-top: 15px;">
<input type="button" id="logoutConfirm_ok" value="确认" style="margin-right: 10px" />
<input type="button" id="logoutConfirm_cancel" value="取消" />
</div>
</div>
</div>
</div>
<div id="clearConfirmWindow" class="windows"> <div id="clearConfirmWindow" class="windows">
<div> <div>
<img width="14" height="14" src="static/images/help.png" alt="" /> <img width="14" height="14" src="static/images/help.png" alt="" />

18
api.php
View File

@@ -9,15 +9,17 @@ if(isset($_GET['cmd']))
{ {
switch($_GET['cmd']) switch($_GET['cmd'])
{ {
//所有记录包括详细信息
case 'list': case 'list':
echo json_encode(dirList()); echo json_encode(dirList());
break; break;
//只列出时间戳索引id
case 'simplelist': case 'simplelist':
echo json_encode(dirSimpleList()); echo json_encode(dirSimpleList());
break; break;
//根据时间戳索引id获得单条信息
case 'get': case 'get':
if(isset($_GET['id'])&&preg_match('/^[0-9]{10}$/',$_GET['id'])) if(isset($_GET['id'])&&preg_match('/^[0-9]{10}$/',$_GET['id']))
echo json_encode(loadInfo($_GET['id'])); echo json_encode(loadInfo($_GET['id']));
@@ -25,6 +27,7 @@ if(isset($_GET['cmd']))
echo json_encode(false); echo json_encode(false);
break; break;
//根据时间戳索引id删除单条信息
case 'del': case 'del':
if(isset($_GET['id'])&&preg_match('/^[0-9]{10}$/',$_GET['id'])) if(isset($_GET['id'])&&preg_match('/^[0-9]{10}$/',$_GET['id']))
echo json_encode(delInfo($_GET['id'])); echo json_encode(delInfo($_GET['id']));
@@ -32,11 +35,18 @@ if(isset($_GET['cmd']))
echo json_encode(false); echo json_encode(false);
break; break;
//清空记录
case 'clear': case 'clear':
echo json_encode(clearInfo()); echo json_encode(clearInfo());
break; break;
default:
echo json_encode(false);
} }
} }
else
echo json_encode(false);
function dirSimpleList() { function dirSimpleList() {
$files = glob(DATA_PATH . '/*.php'); $files = glob(DATA_PATH . '/*.php');
foreach ($files as &$file){ foreach ($files as &$file){
@@ -44,17 +54,17 @@ function dirSimpleList() {
} }
return $files; return $files;
} }
function dirList() {
function dirList() {
$list=array(); $list=array();
$files = glob(DATA_PATH . '/*.php'); $files = glob(DATA_PATH . '/*.php');
arsort($files); arsort($files);
foreach ($files as $file) { foreach ($files as $file) {
$listinfo=array();
$filename=basename($file,".php"); $filename=basename($file,".php");
$info=loadInfo($filename); $info=loadInfo($filename);
$isChange=false; $isChange=false;
//如果没有设置location就查询qqwry.dat判断location
if(!isset($info['location'])) if(!isset($info['location']))
{ {
$info['location']=convertip($info['user_IP'],IPDATA_PATH); $info['location']=convertip($info['user_IP'],IPDATA_PATH);
@@ -63,10 +73,8 @@ function dirList() {
if($isChange) if($isChange)
saveInfo(json_encode($info),$filename); saveInfo(json_encode($info),$filename);
$list[]= $info; $list[]= $info;
} }
return $list; return $list;
} }
?> ?>

View File

@@ -2,9 +2,12 @@
if(!defined('IN_XSS_PLATFORM')) { if(!defined('IN_XSS_PLATFORM')) {
exit('Access Denied'); exit('Access Denied');
} }
//设置httponly
ini_set("session.cookie_httponly", 1); ini_set("session.cookie_httponly", 1);
session_start(); session_start();
//判断登陆情况ip和useragent是否改变改变则强制退出
if(!(isset($_SESSION['isLogin']) && $_SESSION['isLogin']===true && isset($_SESSION['user_IP']) &&$_SESSION['user_IP']!="" &&$_SESSION['user_IP']=== $_SERVER['REMOTE_ADDR'] &&isset($_SESSION['user_agent']) &&$_SESSION['user_agent']!="" &&$_SESSION['user_agent']=== $_SERVER['HTTP_USER_AGENT'] )) if(!(isset($_SESSION['isLogin']) && $_SESSION['isLogin']===true && isset($_SESSION['user_IP']) &&$_SESSION['user_IP']!="" &&$_SESSION['user_IP']=== $_SERVER['REMOTE_ADDR'] &&isset($_SESSION['user_agent']) &&$_SESSION['user_agent']!="" &&$_SESSION['user_agent']=== $_SERVER['HTTP_USER_AGENT'] ))
{ {
$_SESSION['isLogin']=false; $_SESSION['isLogin']=false;
@@ -16,9 +19,8 @@ if(!(isset($_SESSION['isLogin']) && $_SESSION['isLogin']===true && isset($_SESSI
exit(); exit();
} }
//开启CSP
header("Content-Security-Policy: default-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; frame-src 'none'"); header("Content-Security-Policy: default-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; frame-src 'none'");
header("X-Content-Security-Policy: default-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; frame-src 'none'"); header("X-Content-Security-Policy: default-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; frame-src 'none'");
header("X-WebKit-CSP: default-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; frame-src 'none'"); header("X-WebKit-CSP: default-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; frame-src 'none'");
?> ?>

View File

@@ -2,11 +2,16 @@
if(!defined('IN_XSS_PLATFORM')) { if(!defined('IN_XSS_PLATFORM')) {
exit('Access Denied'); exit('Access Denied');
} }
//默认密码bluelotus
define('PASS', '2a05218c7aa0a6dbd370985d984627b8');//bluelotus define('PASS', '2a05218c7aa0a6dbd370985d984627b8');
//记录封禁ip列表存放位置
define('DATA_PATH', 'data'); define('DATA_PATH', 'data');
//开启对记录封禁ip列表的AES加密
define('ENABLE_ENCRYPT', true); define('ENABLE_ENCRYPT', true);
//加密密码
define('ENCRYPT_PASS', "bluelotus"); define('ENCRYPT_PASS', "bluelotus");
//是否启用KEEP_SESSION功能需要外部定时访问keepsession.php
define('KEEP_SESSION', true); define('KEEP_SESSION', true);
//ip数据库地址
define('IPDATA_PATH', "qqwry.dat"); define('IPDATA_PATH', "qqwry.dat");
?> ?>

View File

@@ -5,6 +5,7 @@ if(!defined('IN_XSS_PLATFORM')) {
require_once("config.php"); require_once("config.php");
require_once("functions.php"); require_once("functions.php");
//对记录的读写操作无数据库采用读写文件的方式文件名即请求时的时间戳同时也是记录的id
function saveInfo($info,$filename) function saveInfo($info,$filename)
{ {
$logFile = dirname( __FILE__ ).'/'.DATA_PATH.'/'.$filename.'.php'; $logFile = dirname( __FILE__ ).'/'.DATA_PATH.'/'.$filename.'.php';

View File

@@ -4,6 +4,7 @@ if(!defined('IN_XSS_PLATFORM')) {
} }
require_once("aes.php"); require_once("aes.php");
//nginx无getallheaders函数
if (!function_exists('getallheaders')) { if (!function_exists('getallheaders')) {
function getallheaders() { function getallheaders() {
foreach ($_SERVER as $name => $value) { foreach ($_SERVER as $name => $value) {
@@ -15,7 +16,7 @@ if (!function_exists('getallheaders')) {
} }
} }
//判断该记录是否
function isKeepSession($info){ function isKeepSession($info){
$keepsession=false; $keepsession=false;
foreach($info['cookie_data'] as $k => $v) { foreach($info['cookie_data'] as $k => $v) {
@@ -33,8 +34,7 @@ function isKeepSession($info){
return $keepsession; return $keepsession;
} }
//xss过滤
function stripStr($str){ function stripStr($str){
if(get_magic_quotes_gpc()) if(get_magic_quotes_gpc())
$str=stripslashes($str); $str=stripslashes($str);
@@ -49,6 +49,7 @@ function stripArr($arr){
return $new_arr; return $new_arr;
} }
//尝试base64解码
function tryBase64Decode($arr) function tryBase64Decode($arr)
{ {
if(isset($arr)&&count($arr)>0) if(isset($arr)&&count($arr)>0)
@@ -74,6 +75,7 @@ function tryBase64Decode($arr)
return false; return false;
} }
//判断string是否为base64编码判断方法解码后为可见字符串
function isBase64Formatted($str) function isBase64Formatted($str)
{ {
if(preg_match('/^[A-Za-z0-9+\/=]+$/',$str)) if(preg_match('/^[A-Za-z0-9+\/=]+$/',$str))
@@ -93,6 +95,7 @@ function decrypt($info,$encryptPass)
return AESDecryptCtr($info,$encryptPass); return AESDecryptCtr($info,$encryptPass);
} }
//基于Discuz X3.1 function_misc.php
function convertip($ip, $ipdatafile) { function convertip($ip, $ipdatafile) {
$ipaddr = '未知'; $ipaddr = '未知';
if(preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $ip)) { if(preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $ip)) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

@@ -19,6 +19,7 @@ $request_time = isset($_SERVER['REQUEST_TIME'])?$_SERVER['REQUEST_TIME']:time();
$headers_data =getallheaders(); $headers_data =getallheaders();
//如果提交的数据有base64编码的就解码
$get_data=$_GET; $get_data=$_GET;
$decoded_get_data=tryBase64Decode($_GET); $decoded_get_data=tryBase64Decode($_GET);
$post_data=$_POST; $post_data=$_POST;
@@ -26,6 +27,7 @@ $decoded_post_data=tryBase64Decode($_POST);
$cookie_data=$_COOKIE; $cookie_data=$_COOKIE;
$decoded_cookie_data=tryBase64Decode($_COOKIE); $decoded_cookie_data=tryBase64Decode($_COOKIE);
//防xss过滤对array要同时处理key与value
$info['user_IP'] = stripStr($user_IP); $info['user_IP'] = stripStr($user_IP);
$info['user_port'] = stripStr($user_port); $info['user_port'] = stripStr($user_port);
$info['protocol'] = stripStr($protocol); $info['protocol'] = stripStr($protocol);
@@ -46,6 +48,7 @@ $info['cookie_data'] = stripArr($cookie_data);
if($decoded_cookie_data) if($decoded_cookie_data)
$info['decoded_cookie_data'] = stripArr($decoded_cookie_data); $info['decoded_cookie_data'] = stripArr($decoded_cookie_data);
//判断是否keepsession判断标准get或者post或者cookie包含keepsession=1
$info['keepsession']=isKeepSession($info)?true:false; $info['keepsession']=isKeepSession($info)?true:false;
saveInfo(json_encode($info),$request_time); saveInfo(json_encode($info),$request_time);

View File

@@ -5,18 +5,20 @@ header("Content-Security-Policy: default-src 'self'; object-src 'none'; frame-sr
header("X-Content-Security-Policy: default-src 'self'; object-src 'none'; frame-src 'none'"); header("X-Content-Security-Policy: default-src 'self'; object-src 'none'; frame-src 'none'");
header("X-WebKit-CSP: default-src 'self'; object-src 'none'; frame-src 'none'"); header("X-WebKit-CSP: default-src 'self'; object-src 'none'; frame-src 'none'");
//设置httponly
ini_set("session.cookie_httponly", 1); ini_set("session.cookie_httponly", 1);
session_start(); session_start();
require_once("config.php"); require_once("config.php");
require_once("functions.php"); require_once("functions.php");
//判断是否登陆
if(isset($_SESSION['isLogin']) && $_SESSION['isLogin']===true) if(isset($_SESSION['isLogin']) && $_SESSION['isLogin']===true)
{ {
header("Location: admin.php"); header("Location: admin.php");
exit(); exit();
} }
//判断ip是否在封禁列表中
$forbiddenIPList=loadForbiddenIPList(); $forbiddenIPList=loadForbiddenIPList();
$ip=$_SERVER['REMOTE_ADDR']; $ip=$_SERVER['REMOTE_ADDR'];
if(!isset($forbiddenIPList[$ip]) || $forbiddenIPList[$ip]<3) if(!isset($forbiddenIPList[$ip]) || $forbiddenIPList[$ip]<3)
@@ -53,7 +55,8 @@ function loadForbiddenIPList()
$logfile = DATA_PATH . '/forbiddenIPList.dat'; $logfile = DATA_PATH . '/forbiddenIPList.dat';
!file_exists( $logfile ) && @touch( $logfile ); !file_exists( $logfile ) && @touch( $logfile );
$str = file_get_contents( $logfile ); $str = file_get_contents( $logfile );
$str =decrypt($str,ENCRYPT_PASS); if(ENABLE_ENCRYPT)
$str =decrypt($str,ENCRYPT_PASS);
if($str!='') if($str!='')
{ {
$result=json_decode($str,true); $result=json_decode($str,true);
@@ -70,7 +73,10 @@ function saveForbiddenIPList($forbiddenIPList)
{ {
$logfile = DATA_PATH . '/forbiddenIPList.dat'; $logfile = DATA_PATH . '/forbiddenIPList.dat';
!file_exists( $logfile ) && @touch( $logfile ); !file_exists( $logfile ) && @touch( $logfile );
@file_put_contents($logfile, encrypt(json_encode($forbiddenIPList),ENCRYPT_PASS)); $str=json_encode($forbiddenIPList);
if(ENABLE_ENCRYPT)
$str = encrypt($str,ENCRYPT_PASS);
@file_put_contents($logfile, $str);
} }
/* /*
@@ -81,6 +87,7 @@ function checkPassword($p)
{ {
if(isset($_SESSION['firesunCheck'])&&isset($_POST['firesunCheck'])&&$_SESSION['firesunCheck']!=""&&$_POST['firesunCheck']===$_SESSION['firesunCheck']) if(isset($_SESSION['firesunCheck'])&&isset($_POST['firesunCheck'])&&$_SESSION['firesunCheck']!=""&&$_POST['firesunCheck']===$_SESSION['firesunCheck'])
{ {
//改了这个盐记得改login.js里的两个要一致
$salt="!KTMdg#^^I6Z!deIVR#SgpAI6qTN7oVl"; $salt="!KTMdg#^^I6Z!deIVR#SgpAI6qTN7oVl";
$key=PASS; $key=PASS;
$key=md5($salt.$key.$_SESSION['firesunCheck'].$salt); $key=md5($salt.$key.$_SESSION['firesunCheck'].$salt);
@@ -92,6 +99,7 @@ function checkPassword($p)
return false; return false;
} }
//生成挑战应答的随机值
function generate_password( $length = 32 ) { function generate_password( $length = 32 ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$password = ""; $password = "";

10
logout.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
session_start();
$_SESSION['isLogin']=false;
$_SESSION['user_IP']="";
$_SESSION['user_agent']="";
session_unset();
session_destroy();
header("Location: login.php");
exit();
?>

Binary file not shown.

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="512">
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
<glyph unicode="&#xe600;" d="M312 72c0-30.797-25.203-56-56-56v0c-30.801 0-56 25.203-56 56v160c0 30.801 25.199 56 56 56v0c30.797 0 56-25.199 56-56v-160zM312 376c0-30.801-25.203-56-56-56v0c-30.801 0-56 25.199-56 56v0c0 30.801 25.199 56 56 56v0c30.797 0 56-25.199 56-56v0z" />
<glyph unicode="&#xe601;" d="M124.063 272.297c0 26.398 20.801 53.824 46.219 60.941l136.719 38.281c25.422 7.121 46.219 26.207 46.219 42.426 0 16.215-20.797 23.664-46.219 16.543l-185.328-51.887c-25.426-7.121-46.215-34.547-46.215-60.945v-215.094c0-26.406 10.933-44.938 24.305-41.203 13.367 3.75 24.301 28.406 24.301 54.813v156.125zM205 309.168c-25.426-7.121-46.222-34.543-46.222-60.946v-195.66c0-26.406 20.797-42.18 46.222-35.063l185.328 51.883c25.422 7.133 46.219 34.547 46.219 60.945v195.664c0 26.399-20.805 42.176-46.219 35.054l-185.328-51.879zM351.594 156.515c6.797-18.508-2.203-28.242-20-21.64-17.797 6.594-46.922-3.75-64.719-23-17.793-19.258-26.793-15.922-19.996 7.414 6.801 23.336-2.199 47.836-20 54.445-17.801 6.601-14.359 18.406 7.641 26.219 22 7.828 45.551 33.313 52.356 56.649 6.797 23.336 17.922 27.285 24.719 8.781 6.805-18.504 30.367-27.246 52.359-19.422 21.992 7.816 25.43-1.535 7.64-20.801-17.797-19.254-26.797-50.145-20-68.645z" />
<glyph unicode="&#xe602;" d="M374.182 185.598l32.291-168.709-150.473 82.844-150.474-82.844 32.289 168.709-125.288 117.507 170.432 21.427 73.041 155.47 73.041-155.469 170.427-21.427-125.286-117.508zM300.527 288.752l-44.528 94.781-44.531-94.781-103.901-13.063 76.383-71.641-19.688-102.85 91.738 50.505 91.735-50.506-19.685 102.85 76.383 71.641-103.904 13.063z" />
<glyph unicode="&#xe603;" d="M127.999 64.002c-17.672 0-32.001 14.325-32.001 31.998v128.004c0 17.672 14.329 31.997 32.001 31.997 17.672 0 32.001-14.325 32.001-31.997v-128.004c0-17.672-14.329-31.998-32.001-31.998v0zM223.999 64.002c-17.672 0-32.001 14.325-32.001 31.998v64.004c0 17.67 14.329 31.998 32.001 31.998 17.672 0 32.001-14.328 32.001-31.998v-64.004c0-17.672-14.329-31.998-32.001-31.998v0zM319.998 64.002c-17.672 0-32 14.325-32 31.998v160.001c0 17.672 14.328 32.001 32 32.001 17.673 0 32.002-14.329 32.002-32.001v-160.001c0-17.672-14.33-31.998-32.002-31.998v0zM415.998 64.002c-17.672 0-32 14.325-32 31.998v256.001c0 17.675 14.328 32.001 32 32.001 17.676 0 32.002-14.326 32.002-32.001v-256.001c0-17.672-14.326-31.998-32.002-31.998v0z" />
<glyph unicode="&#xe604;" d="M368 480h-224c-26.4 0-48-21.6-48-48v-416c0-26.4 21.6-48 48-48h224c26.4 0 48 21.6 48 48v416c0 26.4-21.6 48-48 48zM192 456h128v-16h-128v16zM256 0c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zM384 96h-256v320h256v-320z" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -37,11 +37,11 @@ body,
/* font */ /* font */
@font-face { @font-face {
font-family: 'icomoon'; font-family: 'icomoon';
src:url('Fonts/icomoon.eot?c8m22a'); src:url('../fonts/icomoon.eot?c8m22a');
src:url('Fonts/icomoon.eot?#iefixc8m22a') format('embedded-opentype'), src:url('../fonts/icomoon.eot?#iefixc8m22a') format('embedded-opentype'),
url('Fonts/icomoon.woff?c8m22a') format('woff'), url('../fonts/icomoon.woff?c8m22a') format('woff'),
url('Fonts/icomoon.ttf?c8m22a') format('truetype'), url('../fonts/icomoon.ttf?c8m22a') format('truetype'),
url('Fonts/icomoon.svg?c8m22a#icomoon') format('svg'); url('../fonts/icomoon.svg?c8m22a#icomoon') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@@ -60,20 +60,20 @@ body,
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-logout:before {
content: "\e900";
}
.icon-info:before { .icon-info:before {
content: "\e600"; content: "\e904";
} }
.icon-faves:before { .icon-template:before {
content: "\e601"; content: "\e901";
} }
.icon-star-empty:before { .icon-my-js:before {
content: "\e602"; content: "\e903";
} }
.icon-chart-column:before { .icon-panel:before {
content: "\e603"; content: "\e902";
}
.icon-mobile:before {
content: "\e604";
} }
.icon { .icon {
@@ -146,12 +146,16 @@ body,
} }
#rights { #rights {
width:100%;
color: #848690; color: #848690;
font-size: 10px; font-size: 12px;
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
text-align: center;
line-height: 120%;
} }
/* Toggle button */ /* Toggle button */
#toggle-button { #toggle-button {
margin-top: 27px; margin-top: 27px;
@@ -198,3 +202,4 @@ body,
box-shadow: 1px 0 4px #ededee; box-shadow: 1px 0 4px #ededee;
background-color: #fff; background-color: #fff;
} }

BIN
static/fonts/icomoon.eot Normal file

Binary file not shown.

15
static/fonts/icomoon.svg Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="enter" d="M384 448h-320v128h320v128l192-192-192-192zM1024 960v-832l-384-192v192h-384v256h64v-192h320v576l256 128h-576v-256h-64v320z" />
<glyph unicode="&#xe901;" glyph-name="file-text2" d="M917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624zM736 128h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 256h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 384h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32z" />
<glyph unicode="&#xe902;" glyph-name="download2" d="M896 448h-160l-224-224-224 224h-160l-128-256v-64h1024v64l-128 256zM0 64h1024v-64h-1024v64zM576 640v256h-128v-256h-224l288-288 288 288h-224z" />
<glyph unicode="&#xe903;" glyph-name="attachment" d="M665.832 632.952l-64.952 64.922-324.81-324.742c-53.814-53.792-53.814-141.048 0-194.844 53.804-53.792 141.060-53.792 194.874 0l389.772 389.708c89.714 89.662 89.714 235.062 0 324.726-89.666 89.704-235.112 89.704-324.782 0l-409.23-409.178c-0.29-0.304-0.612-0.576-0.876-0.846-125.102-125.096-125.102-327.856 0-452.906 125.054-125.056 327.868-125.056 452.988 0 0.274 0.274 0.516 0.568 0.82 0.876l0.032-0.034 279.332 279.292-64.986 64.92-279.33-279.262c-0.296-0.268-0.564-0.57-0.846-0.844-89.074-89.058-233.98-89.058-323.076 0-89.062 89.042-89.062 233.922 0 322.978 0.304 0.304 0.604 0.582 0.888 0.846l-0.046 0.060 409.28 409.166c53.712 53.738 141.144 53.738 194.886 0 53.712-53.734 53.712-141.148 0-194.84l-389.772-389.7c-17.936-17.922-47.054-17.922-64.972 0-17.894 17.886-17.894 47.032 0 64.92l324.806 324.782z" />
<glyph unicode="&#xe904;" glyph-name="heart" d="M755.188 896c-107.63 0-200.258-87.554-243.164-179-42.938 91.444-135.578 179-243.216 179-148.382 0-268.808-120.44-268.808-268.832 0-301.846 304.5-380.994 512.022-679.418 196.154 296.576 511.978 387.206 511.978 679.418 0 148.392-120.43 268.832-268.812 268.832z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/fonts/icomoon.ttf Normal file

Binary file not shown.

BIN
static/fonts/icomoon.woff Normal file

Binary file not shown.

View File

@@ -7,6 +7,7 @@ var interval = 1000; //向服务器获取记录的时间间隔同时也是aja
$(document).ready(function() { $(document).ready(function() {
var self = this; var self = this;
//数据源与datafields
var source = { var source = {
datatype: "json", datatype: "json",
datafields: [{ datafields: [{
@@ -76,6 +77,7 @@ $(document).ready(function() {
root: 'data', root: 'data',
}; };
//从接口获得数据后的处理格式化时间与根据useragent判断客户端
var dataAdapter = new $.jqx.dataAdapter(source, { var dataAdapter = new $.jqx.dataAdapter(source, {
downloadComplete: function(data, status, xhr) { downloadComplete: function(data, status, xhr) {
if (status == "success") { if (status == "success") {
@@ -104,6 +106,7 @@ $(document).ready(function() {
}, },
}); });
//每行detail信息初始化
var initrowdetails = function(index, parentElement, gridElement, datarecord) { var initrowdetails = function(index, parentElement, gridElement, datarecord) {
var tabsdiv = null; var tabsdiv = null;
var information = null; var information = null;
@@ -119,7 +122,8 @@ $(document).ready(function() {
post_grid = tabsdiv.find('.post_grid'); post_grid = tabsdiv.find('.post_grid');
cookie_grid = tabsdiv.find('.cookie_grid'); cookie_grid = tabsdiv.find('.cookie_grid');
headers_grid = tabsdiv.find('.headers_grid'); headers_grid = tabsdiv.find('.headers_grid');
//datarecord.client=datarecord.headers_data["User-Agent"]?get_client_info(datarecord.headers_data["User-Agent"]):"未知";
//GET表
var get_data = new Array(); var get_data = new Array();
for (key in datarecord.get_data) { for (key in datarecord.get_data) {
var get_data_item = new Array(); var get_data_item = new Array();
@@ -193,6 +197,7 @@ $(document).ready(function() {
] ]
}); });
//POST表
var post_data = new Array(); var post_data = new Array();
for (key in datarecord.post_data) { for (key in datarecord.post_data) {
var post_data_item = new Array(); var post_data_item = new Array();
@@ -269,6 +274,7 @@ $(document).ready(function() {
] ]
}); });
//COOKIE表
var cookie_data = new Array(); var cookie_data = new Array();
for (key in datarecord.cookie_data) { for (key in datarecord.cookie_data) {
var cookie_data_item = new Array(); var cookie_data_item = new Array();
@@ -341,6 +347,7 @@ $(document).ready(function() {
] ]
}); });
//HTTP Headers表
var headers_data = new Array(); var headers_data = new Array();
for (key in datarecord.headers_data) { for (key in datarecord.headers_data) {
var headers_data_item = new Array(); var headers_data_item = new Array();
@@ -392,6 +399,8 @@ $(document).ready(function() {
}, },
] ]
}); });
//其他信息
var container = $('<div style="margin: 25px;"></div>'); var container = $('<div style="margin: 25px;"></div>');
container.appendTo($(information)); container.appendTo($(information));
var leftcolumn = $('<div style="float: left; width: 45%;"></div>'); var leftcolumn = $('<div style="float: left; width: 45%;"></div>');
@@ -419,6 +428,7 @@ $(document).ready(function() {
$(rightcolumn).append(uri_item); $(rightcolumn).append(uri_item);
$(rightcolumn).append(client_item); $(rightcolumn).append(client_item);
//tab大小调整
$(tabsdiv).jqxTabs({ $(tabsdiv).jqxTabs({
width: '95%', width: '95%',
height: '100%' height: '100%'
@@ -426,16 +436,18 @@ $(document).ready(function() {
} }
} }
//主面板初始化
$("#panelGrid").jqxGrid({ $("#panelGrid").jqxGrid({
pageable: true, pageable: true,
//如果需要autoresizecolumn可以在这开启
ready: function() { ready: function() {
//$('#panelGrid').jqxGrid('autoresizecolumn', 'request_date_and_time_string'); //$('#panelGrid').jqxGrid('autoresizecolumn', 'request_date_and_time_string');
//$('#panelGrid').jqxGrid('autoresizecolumn', 'data_type'); //$('#panelGrid').jqxGrid('autoresizecolumn', 'data_type');
//$('#panelGrid').jqxGrid('autoresizecolumn', 'user_IP'); //$('#panelGrid').jqxGrid('autoresizecolumn', 'user_IP');
}, },
//最底下的状态栏初始化
pagerrenderer: function() { pagerrenderer: function() {
var container = $("<div style='overflow: hidden; position: relative; '></div>"); var container = $("<div style='overflow: hidden; position: relative; '></div>");
var deleteButton = $("<div style='float: left; margin-left: 5px;'><img style='position: relative; margin-top: 2px;' src='static/images/delete.png'/><span style='margin-left: 4px; position: relative; top: 3px;'>删除</span></div>"); var deleteButton = $("<div style='float: left; margin-left: 5px;'><img style='position: relative; margin-top: 2px;' src='static/images/delete.png'/><span style='margin-left: 4px; position: relative; top: 3px;'>删除</span></div>");
var clearButton = $("<div style='float: left; margin-left: 5px;'><img style='position: relative; margin-top: 2px;' src='static/images/clear.png'/><span style='margin-left: 4px; position: relative; top: 3px;'>清空</span></div>"); var clearButton = $("<div style='float: left; margin-left: 5px;'><img style='position: relative; margin-top: 2px;' src='static/images/clear.png'/><span style='margin-left: 4px; position: relative; top: 3px;'>清空</span></div>");
@@ -468,20 +480,15 @@ $(document).ready(function() {
}); });
// reload grid data.
clearButton.click(function(event) { clearButton.click(function(event) {
$('#clearConfirmWindow').jqxWindow('open'); $('#clearConfirmWindow').jqxWindow('open');
$("#clearConfirmWindow").addClass('animated'); $("#clearConfirmWindow").addClass('animated');
//$("#panelGrid").jqxGrid({
// source: getAdapter()
//});
}); });
// search for a record. // search for a record.
searchButton.click(function(event) { searchButton.click(function(event) {
//var offset = $("#panelGrid").offset();
$("#searchWindow").jqxWindow('open'); $("#searchWindow").jqxWindow('open');
$("#searchWindow").addClass('animated'); $("#searchWindow").addClass('animated');
//$("#jqxwindow").jqxWindow('move', offset.left + 30, offset.top + 30);
}); });
var pageElementsContainer = $("<div style='overflow: hidden;float: right;position: relative;margin: 5.5px; '></div>"); var pageElementsContainer = $("<div style='overflow: hidden;float: right;position: relative;margin: 5.5px; '></div>");
@@ -524,8 +531,6 @@ $(document).ready(function() {
}); });
return container; return container;
}, },
//selectionmode: 'multiplerowsextended',
scrollmode: 'logical', scrollmode: 'logical',
sortable: true, sortable: true,
pagesize: 25, pagesize: 25,
@@ -677,6 +682,32 @@ $(document).ready(function() {
} }
}); });
//注销确认窗口
$('#logoutConfirmWindow').jqxWindow({
height: 100,
width: 270,
resizable: false,
okButton: $('#logoutConfirm_ok'),
cancelButton: $('#logoutConfirm_cancel'),
autoOpen: false,
});
$('#logoutConfirm_ok').jqxButton({
width: '65px'
});
$('#logoutConfirm_cancel').jqxButton({
width: '65px'
});
$('#logoutConfirmWindow').on('close',
function(event) {
if (event.args.dialogResult.OK) {
window.location.href = "logout.php";
}
});
$('#failedWindow').jqxWindow({ $('#failedWindow').jqxWindow({
height: 100, height: 100,
width: 270, width: 270,
@@ -697,6 +728,7 @@ $(document).ready(function() {
width: 210, width: 210,
height: 180 height: 180
}); });
// create find and clear buttons. // create find and clear buttons.
$("#findButton").jqxButton({ $("#findButton").jqxButton({
width: 70 width: 70
@@ -704,6 +736,7 @@ $(document).ready(function() {
$("#clearButton").jqxButton({ $("#clearButton").jqxButton({
width: 70 width: 70
}); });
// find records that match a criteria. // find records that match a criteria.
$("#dropdownlist").jqxDropDownList({ $("#dropdownlist").jqxDropDownList({
autoDropDownHeight: true, autoDropDownHeight: true,
@@ -768,6 +801,12 @@ $(document).ready(function() {
//$('#panelGrid').jqxGrid('autoresizecolumn', 'user_IP'); //$('#panelGrid').jqxGrid('autoresizecolumn', 'user_IP');
}); });
$("#logout").click(function() {
$('#logoutConfirmWindow').jqxWindow('open');
$("#logoutConfirmWindow").addClass('animated');
});
//定时判断是否有新的记录 //定时判断是否有新的记录
checkNewMessages(); checkNewMessages();
setIntervalID = setInterval(checkNewMessages, interval); setIntervalID = setInterval(checkNewMessages, interval);