389 lines
13 KiB
HTML
389 lines
13 KiB
HTML
{extend name="public/base" /}
|
|
|
|
{block name="body"}
|
|
<div class="layui-fluid" id="component-tabs">
|
|
<div class="layui-row">
|
|
<div class="layui-col-md12">
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div class="layui-tab layui-tab-card" lay-filter="seo-tabs-brief">
|
|
<ul class="layui-tab-title">
|
|
<li lay-id="config"><span style="color:red">* </span>接口配置</li>
|
|
<li class="layui-this" lay-id="push">百度推送</li>
|
|
<li lay-id="map">站点地图</li>
|
|
<li lay-id="robots">robots</li>
|
|
<li lay-id="push_js">自动提交</li>
|
|
<li lay-id="search_show">蜘蛛分析</li>
|
|
</ul>
|
|
<div class="layui-tab-content">
|
|
<div class="layui-tab-item">
|
|
<div class="layui-form" wid100 lay-filter="config">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">key</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="client_id" value="{:config('taoler.baidu.client_id')}" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">百度分词API Key</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">secret</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="client_secret" value="{:config('taoler.baidu.client_secret')}" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">百度分词Secret Key</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">推送接口</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="push_api" value="{:config('taoler.baidu.push_api')}" placeholder="http://完整的接口地址" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">接口调用地址:http://data.zz.baidu.com/urls?site=https://www.youurl.com&token=yuotoken</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn" lay-submit lay-filter="baidu_config">确认保存</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-tab-item layui-show">
|
|
<div class="layui-form" wid100 lay-filter="push">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">推送范围</label>
|
|
<div class="layui-input-inline" style="width: 100px;">
|
|
<input type="text" name="start_id" value="" placeholder="开始ID" class="layui-input" >
|
|
</div>
|
|
<div class="layui-form-mid">-</div>
|
|
<div class="layui-input-inline" style="width: 100px;">
|
|
<input type="text" name="end_id" placeholder="结束ID" autocomplete="off" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">帖子ID范围,如果不填,默认全站提交</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">选择时间</label>
|
|
<div class="layui-input-inline">
|
|
<select name="time" lay-verify="required">
|
|
<option value="today">今天</option>
|
|
<option value="yesterday">昨天</option>
|
|
<option value="week">本周</option>
|
|
<option value="month">本月</option>
|
|
<option value="''">全部</option>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">推送至API</label>
|
|
<div class="layui-input-block">
|
|
{if condition="checkRuleButton('Seo/push')"}
|
|
<button class="layui-btn" lay-submit lay-filter="search_push">提交推送</button>
|
|
{else /}
|
|
<button class="layui-btn layui-btn-disabled">提交推送</button>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-tab-item">
|
|
<div class="layui-form" wid100 lay-filter="map">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">限定数量</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="map_num" value="{:config('taoler.sitemap.map_num')}" placeholder="推荐5000" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">单个map文件xml数量</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">更新频率</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="map_time" value="" placeholder="daily" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">每天或定时</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">优先级</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="map_level" value="" placeholder="默认0.5" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">0.0-1.0之间</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn" lay-submit lay-filter="map_xml">生成</button>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<textarea type="text" class="layui-textarea" style="height: 300px;">{$xml}</textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="layui-tab-item">
|
|
<div class="layui-form" wid100 lay-filter="robots">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">内容</label>
|
|
<div class="layui-input-block">
|
|
<textarea type="text" name="robots" placeholder="请正确填写robots内容" class="layui-textarea" style="height: 400px;">{$robots}</textarea>
|
|
<div class="layui-form-mid layui-word-aux">会自动写入sitemap的链接</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn" lay-submit lay-filter="robots_submit">生成</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-tab-item">
|
|
<div class="layui-form" wid100 lay-filter="push_js">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">名称</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="name" required placeholder="请正确填写js平台名称" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">js自动收录平台</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">JS代码</label>
|
|
<div class="layui-input-block">
|
|
<textarea type="text" name="jscode" required placeholder="请正确填写robots内容" class="layui-textarea" style="height: 200px;"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn layui-btn-danger" lay-submit lay-filter="push_jscode_submit">新增</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{volist name="jscode" id="vo"}
|
|
<hr>
|
|
<div class="layui-form" wid100>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">{$vo.name}</label>
|
|
<div class="layui-input-block">
|
|
<textarea type="text" name="jscode" placeholder="请正确填写robots内容" class="layui-textarea" style="height: 200px;">{$vo.jscode}</textarea>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<input type="text" name="id" class="layui-hide" value="{$vo.id}">
|
|
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="push_jscode_del">删除</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/volist}
|
|
|
|
</div>
|
|
<div class="layui-tab-item">
|
|
<div class="layui-form" wid100 lay-filter="search_show">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">选择时间</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="search_time" id="search_time" required lay-verify="required" autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">选择蜘蛛</label>
|
|
<div class="layui-input-inline">
|
|
<select type="text" name="spider_name" required lay-verify="required" autocomplete="off" class="layui-input">
|
|
<option value="Baiduspider" selected>百度</option>
|
|
<option value="Bytespider" >头条</option>
|
|
<option value="Googlebot" >谷歌</option>
|
|
<option value="bingbot" >bing</option>
|
|
<option value="" >全部</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn layui-btn-danger" lay-submit lay-filter="search_show_submit">开始分析</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">分析结果</label>
|
|
|
|
<div class="layui-input-block">
|
|
<table id="spider" lay-filter="spider"></table>
|
|
<!--textarea type="text" name="search_list" placeholder="搜索引擎抓取结果" class="layui-textarea" style="height: 600px;"></textarea-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
|
|
{block name="js"}
|
|
<script>
|
|
var setWebSite ="{:url('Set/website')}";
|
|
var setEmail ="{:url('Set/email')}";
|
|
layui.config({
|
|
base: '/static/admin/' //静态资源所在路径
|
|
}).extend({
|
|
index: 'lib/index' //主入口模块
|
|
}).use(['index', 'laydate', 'table'], function(){
|
|
var $ = layui.$
|
|
,form = layui.form
|
|
var element =layui.element ;
|
|
var laydate = layui.laydate;
|
|
var table = layui.table;
|
|
|
|
//执行一个laydate实例
|
|
laydate.render({
|
|
elem: '#search_time' //指定元素
|
|
,type: 'date'
|
|
,format: 'yyyyMM/dd'
|
|
,value: new Date()
|
|
});
|
|
|
|
//第一个实例
|
|
table.render({
|
|
elem: '#spider'
|
|
,url: "{:url('seo/searchLog')}" //数据接口
|
|
,page: true //开启分页
|
|
,cols: [[ //表头
|
|
{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
|
|
,{field: 'time', title: '时间', width:160}
|
|
,{field: 'name', title: '名称', width:120, sort: true}
|
|
,{field: 'ip', title: 'IP', width:200}
|
|
,{field: 'url', title: 'URL', minWidth: 200}
|
|
]]
|
|
,text: '对不起,加载出现异常!'
|
|
});
|
|
|
|
// baidu push
|
|
form.on('submit(search_push)', function(data){
|
|
var field = data.field;
|
|
$.post("{:url('seo/push')}",field,function(res){
|
|
if(res.code == 0){
|
|
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.open({title:"推送失败",content:res.msg,icon:5,anim:6});
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
//网站配置
|
|
form.on('submit(baidu_config)', function(data){
|
|
var field = data.field;
|
|
$.post("{:url('seo/config')}",field,function(res){
|
|
if(res.code == 0){
|
|
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.open({title:"配置失败",content:res.msg,icon:5,anim:6});
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
// map
|
|
form.on('submit(map_xml)', function(data){
|
|
var field = data.field;
|
|
$.post("{:url('seo/map')}",field,function(res){
|
|
if(res.code == 0){
|
|
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.open({title:"生成失败",content:res.msg,icon:5,anim:6});
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
// robots
|
|
form.on('submit(robots_submit)', function(data){
|
|
var field = data.field;
|
|
$.post("{:url('seo/robots')}",field,function(res){
|
|
if(res.code == 0){
|
|
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.open({title:"设置失败",content:res.msg,icon:5,anim:6});
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
// 添加自动提交JS代码
|
|
form.on('submit(push_jscode_submit)', function(data){
|
|
var field = data.field;
|
|
$.post("{:url('seo/savePushJs')}",field,function(res){
|
|
if(res.code == 0){
|
|
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.open({title:"添加失败",content:res.msg,icon:5,anim:6});
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
// 删除自动提交JS代码
|
|
form.on('submit(push_jscode_del)', function(data){
|
|
var field = data.field;
|
|
$.post("{:url('seo/delPushJs')}",field,function(res){
|
|
if(res.code == 0){
|
|
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.open({title:"删除失败",content:res.msg,icon:5,anim:6});
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
// 搜索引擎分析
|
|
form.on('submit(search_show_submit)', function(data){
|
|
var field = data.field;
|
|
$.post("{:url('seo/searchLog')}",field,function(res){
|
|
if(res.code == 0){
|
|
layer.msg(res.msg,{icon:6,tiye:2000},function(){
|
|
//$("textarea[name='search_list']").html(res.data);
|
|
});
|
|
} else {
|
|
layer.open({title:"添加失败",content:res.msg,icon:5,anim:6});
|
|
}
|
|
//执行重载
|
|
table.reload('spider', {
|
|
where: field
|
|
});
|
|
});
|
|
return false;
|
|
});
|
|
|
|
// 显示当前tab
|
|
if(location.hash){
|
|
element.tabChange('seo-tabs-brief', location.hash.replace(/^#/, ''));
|
|
}
|
|
element.on('tab(seo-tabs-brief)', function(){
|
|
var othis = $(this), layid = othis.attr('lay-id');
|
|
if(layid){
|
|
location.hash = layid;
|
|
}
|
|
});
|
|
|
|
|
|
});
|
|
</script>
|
|
{/block}
|