pagespeed分数统计和搜索
parent
a90c87a32d
commit
db4fac8199
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
foreach ($score_data_list as $key => $item) {
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1">#</th>
|
||||
<th class="col-sm-3">页面</th>
|
||||
<th class="col-sm-1">移动端</th>
|
||||
<th class="col-sm-1">桌面端</th>
|
||||
<th class="col-sm-2">更新时间</th>
|
||||
<th class="col-sm-2">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$site_url = rtrim($this->config->item('site_url'), '/');
|
||||
if (!empty($score_data_list)) {
|
||||
foreach ($score_data_list as $key => $item) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ++$key; ?></td>
|
||||
<td><?php echo $item->psd_URL; ?></td>
|
||||
<td><?php echo $item->psd_MobileScore; ?></td>
|
||||
<td><?php echo $item->psd_DesktopScore; ?></td>
|
||||
<td><?php echo date('Y-m-d', strtotime($item->psd_Datetime)); ?></td>
|
||||
<td>
|
||||
<a href="<?php echo $site_url . $item->psd_URL ?>" target="_blank">查看页面</a> | <a href="https://developers.google.com/speed/pagespeed/insights/?url=<?php echo urlencode($site_url . $item->psd_URL); ?>" target="_blank">Google insights</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -1,22 +1,80 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="Expires" CONTENT="0"/>
|
||||
<meta http-equiv="Cache-Control" CONTENT="no-cache"/>
|
||||
<meta http-equiv="Pragma" CONTENT="no-cache"/>
|
||||
<title>HTML-Compressor</title>
|
||||
</head>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<h1>页面样式精简</h1>
|
||||
<form name="form_htmlsource" id="form_htmlsource" action="<?php echo site_url('apps/htmlcompressor/index/optimize'); ?>" method="post">
|
||||
<input type="text" name="websitehost" id="websitehost" style="width:200px;" placeholder="域名" /><br/><br/>
|
||||
<textarea name="htmlsource" id="htmlsource" rows="22" style="width:800px;" placeholder="网页代码" ></textarea>
|
||||
<input type="submit"/>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript" src="/js/highcharts/highcharts.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#score_chart').highcharts({
|
||||
chart: {type: 'column'},
|
||||
title: {text: '网页性能分数分布图'},
|
||||
subtitle: {
|
||||
text: '移动端平均分:<?php echo $score_data->m_avg; ?> | 桌面端平均分:<?php echo $score_data->d_avg; ?> 总页面数:<?php echo $score_data->page_count; ?>'
|
||||
},
|
||||
xAxis: {
|
||||
categories: [
|
||||
'60分以下',
|
||||
'60-69分',
|
||||
'70-79分',
|
||||
'80-85分',
|
||||
'86-89分',
|
||||
'90-95分',
|
||||
'96-100分'
|
||||
],
|
||||
crosshair: true
|
||||
},
|
||||
yAxis: {
|
||||
min: 0,
|
||||
title: {
|
||||
text: '网页数量'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
},
|
||||
enableMouseTracking: true
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{name: '移动', data: [<?php echo $score_data->m60_0 . ',' . $score_data->m60_69 . ',' . $score_data->m70_79 . ',' . $score_data->m80_85 . ',' . $score_data->m86_89 . ',' . $score_data->m90_95 . ',' . $score_data->m96_100; ?>]}
|
||||
, {name: '桌面', data: [<?php echo $score_data->d60_0 . ',' . $score_data->d60_69 . ',' . $score_data->d70_79 . ',' . $score_data->d80_85 . ',' . $score_data->d86_89 . ',' . $score_data->d90_95 . ',' . $score_data->d96_100; ?>]}
|
||||
]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div id="score_chart" ></div>
|
||||
|
||||
<legend>根据分数搜索页面</legend>
|
||||
<form class="form-inline" method="post" name="form_score_search" id="form_score_search" action="<?php echo site_url('apps/pagespeed/index/search_score'); ?>">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1"></label>
|
||||
<input type="number" class="form-control" id="exampleInputEmail1" name="start_score" placeholder="开始分数">
|
||||
<input type="number" class="form-control" id="exampleInputPassword1" name="end_score" placeholder="结束分数">
|
||||
<select class="form-control" name="device">
|
||||
<option value="mobile">Mobile</option>
|
||||
<option value="desktop">Desktop</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="button" class="btn btn-default" onclick="submit_search();">搜索</button>
|
||||
</form>
|
||||
|
||||
<div id="search_result_box"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function submit_search() {
|
||||
$('#form_score_search').ajaxSubmit({
|
||||
success: function(data, textStatus) {
|
||||
$('#search_result_box').html(data);
|
||||
},
|
||||
error: function(msg) {
|
||||
alert('\u53d1\u751f\u9519\u8bef\uff0c\u8bf7\u8054\u7cfbYCC...');
|
||||
},
|
||||
dataType: 'json',
|
||||
timeout: 30000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue