Commit 2ba78530 by kevin

push code

parents
<?php
define("HOST","127.0.0.1");
define("USER","root");
define("PASS","1q2w3e4_");
define("DBNAME","leakcanary");
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>日志详情页</title>
</head>
<style type="text/css">
.wrapper {width: 1000px;margin: 20px auto;}
h2 {text-align: center;}
.add {margin-bottom: 20px;}
.add a {text-decoration: none;color: #fff;background-color: green;padding: 6px;border-radius: 5px;}
td {text-align: center;}
</style>
<body>
<div class="wrapper">
<h2>日志详情页</h2>
<table width="960">
<?php
// 处理增加操作的页面
require "dbconfig.php";
// 连接mysql
$link = @mysqli_connect(HOST,USER,PASS, DBNAME) or die("提示:数据库连接失败!");
// 选择数据库
mysqli_select_db($link, DBNAME);
// 编码设置
mysqli_set_charset($link,'utf8');
$id = $_GET['id'];
// 3. 从DBNAME中查询到news数据库,返回数据库结果集,并按照addtime降序排列
$sql = "select * from leakCanary where id={$id} order by id asc;";
// 结果集
$result = mysqli_query($link, $sql) or die('添加数据出错:'.mysqli_error());
// var_dump($result);
// 解析结果集,$row为新闻所有数据,$newsNum为新闻数目
$count= mysqli_num_rows($result);
// for($i=0; $i<$count; $i++){
$row = mysqli_fetch_assoc($result);
// echo $row;
$contentJson = $row["contentJson"];
$json=json_decode($contentJson,true);
$leakTrace = $json["leakTrace"];
$elements = $leakTrace["elements"];
$className = $json["className"];
echo "<div class=title>
{$className}
</div>";
foreach ($elements as $key => $value) {
$classChildName = $value["className"];
$referenceName = $value["referenceName"];
$classHierarchy = $value["classHierarchy"];
echo "<hr class=line />";
echo "<div class=title-0>
{$classChildName}
</div>
<div class=title-1>
{$referenceName}
</div>";
foreach ($classHierarchy as $key => $value) {
echo "<div class=title-2>
{$value}
</div>";
}
}
echo "<div class=line></div>";
/*echo "</tr>";*/
// }
// 5. 释放结果集
mysqli_free_result($result);
mysqli_close($link);
?>
</table>
<script type="text/javascript">
function changestatus (id) {
if (confirm("确定要修改该日志吗?")){
window.location = "action-del.php?id="+id;
}
}
function enterpage (id) {
window.location = "detail.php?id="+id;
}
</script>
<style type="text/css">
.time{
margin-top: 30px;
font-size: 16px;
margin-left: 20px;
text-decoration:none;
}
.title{
margin-top: 40px;
font-size: 32px;
font-weight: bold;
color: #000000;
}
.title-0{
margin-top: 20px;
font-size: 16px;
font-weight: bold;
color: #000;
}
.title-1{
margin-top: 10px;
font-size: 16px;
color: #000;
text-decoration:underline;
}
.title-2{
margin-top: 10px;
margin-left:50px;
font-size: 16px;
text-decoration:none;
color: #ff0000;
}
.line{
margin-top: 20px;
margin-bottom: 50px;
}
.bottom{
display: flex;
align-items: flex-end;
}
</style>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>LeakCanary内存泄露日志输出</title>
</head>
<style type="text/css">
.wrapper {width: 1000px;margin: 20px auto;}
h2 {text-align: center;}
.add {margin-bottom: 20px;}
.add a {text-decoration: none;color: #fff;background-color: green;padding: 6px;border-radius: 5px;}
td {text-align: center;}
</style>
<body>
<div class="wrapper">
<h2>LeakCanary内存泄露日志输出</h2>
<!-- <div class="add">
<a href="addnews.html">增加新闻</a>
</div> -->
<table width="960">
<?php
// 处理增加操作的页面
require "dbconfig.php";
// 连接mysql
$link = @mysqli_connect(HOST,USER,PASS,DBNAME) or die("提示:数据库连接失败!111111");
// 选择数据库
mysqli_select_db($link, DBNAME);
// 编码设置
mysqli_set_charset($link,'utf8');
// 3. 从DBNAME中查询到news数据库,返回数据库结果集,并按照addtime降序排列
$sql = 'select * from leakCanary order by id desc;';
// 结果集
$result = mysqli_query($link, $sql) or die('添加数据出错:'.mysqli_error());
// var_dump($result);
// 解析结果集,$row为新闻所有数据,$newsNum为新闻数目
$newsNum=mysqli_num_rows($result);
for($i=0; $i<$newsNum; $i++){
$row = mysqli_fetch_assoc($result);
/* echo "<tr>";*/
/*echo "<div>编号:{$row['id']}</div>";*/
echo "<div class=bottom>
<div class=title>
<a href='javascript:enterpage({$row['id']})' class=href>
{$row['className']}
</a>
</div>
<div class=show-detail>
<a href='javascript:enterpage({$row['id']})' class=href>
阅读详情 >
</a>
</div>
</div>";
echo "<div class=commitHash>
git 最后一次提交记录 [ {$row['gitCommitHash']} ]
</div>
<div class=currentBranch>
git 提交当前分支 [ {$row['gitCurrentBranch']} ]
</div>";
echo "<div class=bottom>
<div class=status>
<a href='javascript:changestatus({$row['id']})' class=href>
修改状态
</a>
</div>
<div class=time>
上报时间 {$row['addtime']}
</div>
</div>";
echo "<hr class=line />";
/*echo "</tr>";*/
}
// 5. 释放结果集
mysqli_free_result($result);
mysqli_close($link);
?>
</table>
<script type="text/javascript">
function changestatus (id) {
if (confirm("确定要修改该日志吗?")){
//window.location = "action-del.php?id="+id;
}
}
function enterpage (id) {
window.location = "details.php?id="+id;
}
</script>
<style type="text/css">
.time{
margin-top: 30px;
font-size: 16px;
margin-left: 20px;
text-decoration:none;
}
.title{
margin-top: 40px;
font-size: 24px;
font-weight: bold;
color: #000;
}
.show-detail{
margin-top: 30px;
margin-left:20px;
font-size: 16px;
text-decoration:none;
}
.title .href{
text-decoration:none;
color: #000;
}
.commitHash{
margin-top: 10px;
margin-left: 30px;
text-decoration:none;
color: #ff0000;
}
.currentBranch{
margin-left: 30px;
text-decoration:none;
color: #000;
}
.show-detail .href{
text-decoration:none;
color: #a59393;
}
.status{
margin-top: 10px;
font-size: 16px;
margin-left:20px;
text-decoration:none;
}
.status .href{
text-decoration:none;
color: #cccccc;
}
.line{
margin-top: 20px;
margin-bottom: 20px;
}
.bottom{
display: flex;
align-items: flex-end;
}
</style>
</body>
</html>
<?php
// 处理增加操作的页面
require "dbconfig.php";
// 连接mysql
$link = @mysqli_connect(HOST,USER,PASS,DBNAME) or die("提示:数据库连接失败!");
// 选择数据库
mysqli_select_db($link, DBNAME);
// 编码设置
mysqli_set_charset($link,'utf8');
// 获取增加的新闻
$className = $_GET['className'];
$contentJson = $_GET['contentJson'];
$modulePackage = $_GET['modulePackage'];
$isHandle = $_GET['isHandle'];
$gitCommitHash = $_GET['gitCommitHash'];
$gitCurrentBranch = $_GET['gitCurrentBranch'];
$addtime = $_GET['addtime'];
// 插入数据
mysqli_query($link,"INSERT INTO leakCanary (className,contentJson,modulePackage,isHandle,gitCommitHash,gitCurrentBranch,addtime) VALUES ('$className','$contentJson','$modulePackage','$isHandle','$gitCommitHash','$gitCurrentBranch','$addtime')") or die('添加数据出错:'.mysqli_error());
$result=array(
'code'=>0,
'message'=>数据更新成功,
'data'=>null
);
exit(json_encode($result)); //返回0表示注册成功
-- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2018 年 01 月 14 日 08:03
-- 服务器版本: 5.0.51
-- PHP 版本: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- 数据库: `news20180111`
--
-- --------------------------------------------------------
--
-- 表的结构 `news`
--
CREATE TABLE `leakCanary` (
`id` int(10) unsigned NOT NULL auto_increment,
`className` text NOT NULL,
`contentJson` text NOT NULL,
`modulePackage` text NOT NULL,
`isHandle` varchar(64) NOT NULL,
`gitCommitHash` text NOT NULL,
`gitCurrentBranch` text NOT NULL,
`addtime` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- 导出表中的数据 `news`
--
INSERT INTO `leakCanary` VALUES (2, 'LauncherActivity', '{
"className": "com.secoo.app.mvp.ui.activity.LauncherActivity",
"leakTrace": {
"elements": [
{
"className": "dalvik.system.PathClassLoader",
"classHierarchy": [
"dalvik.system.PathClassLoader",
"delvik.system.BasePathClassLoader",
"java.lang.ClassLoader"
],
"referenceName": "runtimeInternalObjects"
},
{
"className": "com.secoo.app.mvp.ui.activity.LauncherActivity",
"classHierarchy": [
"com.secoo.app.mvp.ui.activity.LauncherActivity",
"com.secoo.commonsdk.arms.base.BaseActivity",
"com.secoo.commonsdk.components.TrackableActivity",
"android.support.v7.app.AppCompatActivity"
],
"referenceName": "mFragments"
},
{
"className": "dalvik.system.PathClassLoader",
"classHierarchy": [
"dalvik.system.PathClassLoader",
"delvik.system.BasePathClassLoader",
"java.lang.ClassLoader"
],
"referenceName": "runtimeInternalObjects"
},
{
"className": "dalvik.system.PathClassLoader",
"classHierarchy": [
"dalvik.system.PathClassLoader",
"delvik.system.BasePathClassLoader",
"java.lang.ClassLoader"
],
"referenceName": "runtimeInternalObjects"
}
]
}
}', 'com.secoo',"false",'2018-01-13');
-- INSERT INTO `leakCanary` VALUES (3, '新闻3', '科技', '王五', '2018-01-12', '英特尔再曝新漏洞,黑客可控制笔记本');
-- INSERT INTO `leakCanary` VALUES (5, '新闻5', '历史', '赵七', '2018-01-06', '毛泽东生前警卫:不孤独因有毛主席相伴');
-- INSERT INTO `leakCanary` VALUES (4, '新闻4', '电影', '马六', '2018-01-09', '2018内地好莱坞引进片前瞻');
-- INSERT INTO `leakCanary` VALUES (1, '新闻1', '社会', '张三', '2018-01-14', '2018春运售票进入高峰期');
-- INSERT INTO `leakCanary` VALUES (6, '新闻6', '财经', '周八', '2018-01-01', '新年楼市松绑真相');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment