merge origin master
commit
2be745c070
@ -0,0 +1,9 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
require '/lib/simple_html_dom.php';
|
||||
|
||||
|
||||
class Simple_html_dom_lib extends CI_Controller{
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<!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>
|
@ -0,0 +1,44 @@
|
||||
<?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-5">页面</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>
|
@ -0,0 +1,80 @@
|
||||
<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="start_score" name="start_score" placeholder="开始分数">
|
||||
<input type="number" class="form-control" id="end_score" name="end_score" placeholder="结束分数">
|
||||
<select class="form-control" name="device">
|
||||
<option value="moblie">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>
|
@ -0,0 +1,97 @@
|
||||
<script language="javascript">
|
||||
$(function() {
|
||||
var idList = [];
|
||||
var index = 0;
|
||||
$("td[data-id]").each(function(index, element) {
|
||||
idList[index] = $(element).data("id");
|
||||
});
|
||||
$("#startButton").click(function() {
|
||||
batch_update_cache(idList[index]);
|
||||
});
|
||||
batch_get_backup(idList[index]);
|
||||
|
||||
function batch_update_cache(infoId) {
|
||||
var $statusLabel = $("#status" + infoId);
|
||||
$statusLabel.html("\u7a0d\u7b49...");
|
||||
console.info("infoId: " + infoId + "; length: " + idList.length + "; index: " + index);
|
||||
$.get("/info.php/welcome/change_static_url/" + infoId,
|
||||
function(result) {
|
||||
console.info(result);
|
||||
$statusLabel.html(result.message);
|
||||
index++;
|
||||
if (index < idList.length) {
|
||||
batch_update_cache(idList[index]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function batch_get_backup(infoId) {
|
||||
var $backupLabel = $("#backup" + infoId);
|
||||
$backupLabel.html("\u7a0d\u7b49...");
|
||||
$.get("/info.php/welcome/get_info_backup_id/" + infoId,
|
||||
function(result) {
|
||||
console.info(result);
|
||||
if (result.status == 'success') {
|
||||
$backupLabel.html(result.username + ', ' + result.datetime + ', ' + result.logId);
|
||||
$backupLabel.attr('href', '/info.php/information/backup_content/' + result.logId);
|
||||
} else {
|
||||
$backupLabel.html('无');
|
||||
}
|
||||
index++;
|
||||
if (index < idList.length) {
|
||||
batch_get_backup(idList[index]);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function update_content(infoId) {
|
||||
var $statusLabel = $("#status" + infoId);
|
||||
$statusLabel.html("\u7a0d\u7b49...");
|
||||
console.info("infoId: " + infoId);
|
||||
$.get("/info.php/welcome/change_static_url/" + infoId,
|
||||
function(result) {
|
||||
console.info(result);
|
||||
$statusLabel.html(result.message);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span1">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="span10">
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1">#ID</th>
|
||||
<th class="span9">URL</th>
|
||||
<th class="span5">备份</th>
|
||||
<th class="span2">操作</th>
|
||||
<th class="span2"><button id="startButton">开始批量</button></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($all_information as $key => $info) {
|
||||
if ($info->ic_status == 1 && !empty($info->ic_url)) {
|
||||
?>
|
||||
<tr>
|
||||
<td data-id='<?php echo $info->is_id; ?>'><?php echo $info->is_id; ?></td>
|
||||
<td class="cache_url"><?php echo $info->ic_url; ?></td>
|
||||
<td><a target="_blank" id="backup<?php echo $info->is_id; ?>" href="javascript:;">查看</a></td>
|
||||
<td>
|
||||
<a href="javascript:update_content(<?php echo $info->is_id; ?>);">更换</a> |
|
||||
<a target="_blank" href="/info.php/information/edit/<?php echo $info->is_id; ?>">看看</a>
|
||||
</td>
|
||||
<td id="status<?php echo $info->is_id; ?>"><i class="icon-refresh"></i></td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue