Browse Source

update template

pull/205/head
xiaoz 6 days ago
parent
commit
1dea8e2e07
  1. 3
      templates/admin/add_category.php
  2. 2
      templates/admin/add_link.php
  3. 2
      templates/admin/index.php
  4. 38
      templates/admin/init.php
  5. 104
      templates/admin/link_list.php
  6. 8
      templates/admin/setting/subscribe.php
  7. 4
      templates/admin/setting/transition_page.php
  8. 66
      templates/admin/static/embed.js
  9. 3
      templates/admin/static/style.css

3
templates/admin/add_category.php

@ -7,8 +7,7 @@ @@ -7,8 +7,7 @@
<!-- 说明提示框 -->
<div class="layui-col-lg12">
<div class="setting-msg">
<p>1. 关于字体图标的说明请参考帮助文档:<a href="https://dwz.ovh/7nr1f" target = "_blank" title = "字体图标使用说明">https://dwz.ovh/7nr1f</a></p>
<p>2. 权重越大,排序越靠前</p>
<p>注意:权重越大,分类排序越靠前</p>
</div>
</div>
<!-- 说明提示框END -->

2
templates/admin/add_link.php

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
<div class="setting-msg">
<p>1. 权重越大,排序越靠前</p>
<p>2. 识别功能可以自动获取链接标题和描述信息,但不确保一定成功</p>
<p>3. 仅 5iux/heimdall/tushan2/webstack 支持自定义图标,其余主题均自动获取链接图标。</p>
<p>3. 仅 default2/5iux/heimdall/tushan2/webstack 支持自定义图标,其余主题均自动获取链接图标。</p>
</div>
</div>
<!-- 说明提示框END -->

2
templates/admin/index.php

@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
<div class="layui-col-lg3">
<div class = "admin-msg">
<h2>Chrome浏览器扩展</h2>
<h2>浏览器扩展</h2>
<p class="text">
<a href="https://dwz.ovh/4kxn2" title = "适用于Chromium内核的浏览器扩展" rel = "nofollow" target="_blank">https://dwz.ovh/4kxn2</a>
</p>

38
templates/admin/init.php

@ -13,8 +13,21 @@ @@ -13,8 +13,21 @@
<style>
body{
/* background:url(templates/admin/static/bg.jpg); */
background-color:rgba(0, 0, 51, 0.8);
background: linear-gradient(to right, #a8c0ff, #3f2b96);
color: #333333;
}
.box{
padding:18px;
background-color:#fff;
border-radius:12px;
color: #333333;
/** 阴影特效 */
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.box-title{
text-align:center;
color: #2f363c;
padding:18px 0 30px 0;
}
</style>
@ -23,10 +36,13 @@ @@ -23,10 +36,13 @@
<div class="layui-container">
<div class="layui-row">
<div class="login-logo">
<h1>初始化OneNav用户名/密码</h1>
</div>
<div class="layui-col-lg4 layui-col-md-offset4" style ="margin-top:4em;">
<!-- star box -->
<div class="box">
<div class="box-title">
<h2>初始化OneNav</h2>
</div>
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<label class="layui-form-label">用户名</label>
@ -34,6 +50,7 @@ @@ -34,6 +50,7 @@
<input type="text" name="username" required lay-verify="required" placeholder="3-32位的字母或数字" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-block">
@ -49,11 +66,20 @@ @@ -49,11 +66,20 @@
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit lay-filter="init_onenav" style = "width:100%;">设置</button>
<label class="layui-form-label">邮箱</label>
<div class="layui-input-block">
<input type="text" name="email" required lay-verify="required|email" placeholder="请输入您的常用邮箱" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit lay-filter="init_onenav" style = "width:100%;">完成初始化</button>
</div>
</form>
</div>
<!-- end box -->
</div>
</div>
</div>

104
templates/admin/link_list.php

@ -9,9 +9,9 @@ @@ -9,9 +9,9 @@
<div class="layui-col-lg12">
<div class="page-msg">
<ol>
<li>仅 5iux/heimdall/tushan2/webstack 支持自定义图标,其余主题均自动获取链接图标。</li>
<li>default2/5iux/heimdall/tushan2/webstack 支持自定义图标,其余主题均自动获取链接图标。</li>
<li>分类的私有属性优先级高于链接的私有属性</li>
<li>权重数字越大,排序越靠前</li>
<li>权重数字越大,链接排序越靠前</li>
</ol>
</div>
</div>
@ -39,16 +39,24 @@ @@ -39,16 +39,24 @@
<div style="width:50px;display: inline-block;"></div>
<!-- 顶部搜索 -->
<div class="layui-inline">
<div class="layui-inline" style="border-right:1px solid #ccc;">
<div class="layui-input-inline">
<input type="text" name="keyword" id="keyword" placeholder="请输入关键词" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 100px;">
<div class="layui-input-inline" style="width: 70px;">
<button class="layui-btn" lay-submit lay-filter="search_keyword">搜索</button>
</div>
</div>
<!-- 顶部搜索END -->
<!-- 批量检测 -->
<div class="layui-inline">
<div class="layui-input-inline">
<button class="layui-btn" lay-submit lay-filter="batch_check">批量检测</button>
</div>
</div>
<!-- 批量检测END -->
</div>
</form>
</div>
@ -128,6 +136,59 @@ layui.use(['table','form'], function(){ @@ -128,6 +136,59 @@ layui.use(['table','form'], function(){
});
});
// 提交批量检测
form.on('submit(batch_check)', function(data){
let content = `
<ul>
<li>1. 此功能仅订阅用户可用!</li>
<li>2. 检测较为耗时,检测期间请勿关闭和刷新此页面!</li>
<li>3. 检测结果仅供参考,无法确保100%准确,具体以实际访问为准!</li>
</ul>
`;
// 弹出确认提示
layer.confirm(content, {
btn: ['开始检测','取消'],
title: '即将对链接进行批量检测!',
area: ['400px', 'auto']
}, function(){
// 关闭确认提示
layer.closeAll('dialog');
// 显示全局加载
var index = layer.load(1);
$.ajax({
url: '/index.php?c=api&method=batch_check_links',
type: 'GET',
success: function(response) {
// 请求成功后执行的代码
if( response.code == 200 ) {
// 关闭全局加载
layer.close(index);
layer.msg("批量检测成功!",{icon:1});
// 2s后重新载入页面
setTimeout(function(){
location.reload();
},2000);
}
else{
layer.msg(response.msg,{icon:5});
// 关闭全局加载
layer.close(index);
}
},
error: function(xhr, status, error) {
layer.close(index);
// 请求出错时执行的代码
console.log(error);
layer.msg("批量检测失败!",{icon:5});
}
});
}, function(){
// 取消后执行的代码
});
return false;
});
// 提交搜索
form.on('submit(search_keyword)', function(data){
console.log(data.field);
@ -181,7 +242,21 @@ layui.use(['table','form'], function(){ @@ -181,7 +242,21 @@ layui.use(['table','form'], function(){
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'check_status', title: '状态', width: 80,sort:true,templet:function(d){
let title = `检测时间:${d.last_checked_time}`;
if(d.check_status == 1) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-green">正常</span>`;
}
else if(d.check_status == 2) {
return `<span title="${title}" class="link-status-text layui-badge">异常</span>`;
}
else if(d.check_status == 3) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-cyan">未知</span>`;
}
else {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-gray">未检测</span>`;
}
}}
,{field: 'property', title: '私有', width: 80, sort: true,templet: function(d){
if(d.property == 1) {
return '<button type="button" class="layui-btn layui-btn-xs"></button>';
@ -190,6 +265,7 @@ layui.use(['table','form'], function(){ @@ -190,6 +265,7 @@ layui.use(['table','form'], function(){
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger"></button>';
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'click', title: '点击数',width:90,sort:true}
,{fixed: 'right', title:'操作', toolbar: '#link_operate'}
]]
@ -252,7 +328,21 @@ function reset_query(){ @@ -252,7 +328,21 @@ function reset_query(){
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'check_status', title: '状态', width: 80,sort:true,templet:function(d){
let title = `检测时间:${d.last_checked_time}`;
if(d.check_status == 1) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-green">正常</span>`;
}
else if(d.check_status == 2) {
return `<span title="${title}" class="link-status-text layui-badge">异常</span>`;
}
else if(d.check_status == 3) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-cyan">未知</span>`;
}
else {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-gray">未检测</span>`;
}
}}
,{field: 'property', title: '私有', width: 80, sort: true,templet: function(d){
if(d.property == 1) {
return '<button type="button" class="layui-btn layui-btn-xs"></button>';
@ -261,6 +351,7 @@ function reset_query(){ @@ -261,6 +351,7 @@ function reset_query(){
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger"></button>';
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'click', title: '点击数',width:90,sort:true}
,{fixed: 'right', title:'操作', toolbar: '#link_operate'}
]]
@ -270,5 +361,6 @@ function reset_query(){ @@ -270,5 +361,6 @@ function reset_query(){
}
</script>
<?php include_once('footer.php'); ?>

8
templates/admin/setting/subscribe.php

@ -61,7 +61,7 @@ @@ -61,7 +61,7 @@
<div class="layui-form-item">
<button class="layui-btn" lay-submit="" lay-filter="set_subscribe">保存设置</button>
<button class="layui-btn" lay-submit="" lay-filter="reset_subscribe">删除订阅</button>
<a class="layui-btn layui-btn-danger" rel = "nofollow" target = "_blank" title = "点此购买订阅" href="https://dwz.ovh/69h9q"><i class="fa fa-shopping-cart"></i> 购买订阅</a>
<a class="layui-btn layui-btn-danger" onclick="buySubscribe('<?php echo get_host(); ?>')" rel = "nofollow" title = "点此购买订阅" href="javascript:;"><i class="fa fa-shopping-cart"></i> 购买订阅</a>
</div>
</form>
@ -121,6 +121,12 @@ @@ -121,6 +121,12 @@
<script>
// 购买订阅
function buySubscribe(url) {
// 新窗口打开购买订阅页面
window.open("https://shop.xiuping.net/onenav/index?domain=" + url);
}
//获取可更新版本
function available_version() {
var current_version = $("#current_version").val();

4
templates/admin/setting/transition_page.php

@ -39,12 +39,12 @@ @@ -39,12 +39,12 @@
<div class="layui-form-mid layui-word-aux">管理员停留时间,单位秒</div>
</div>
<div class="layui-form-item layui-form-text">
<!-- <div class="layui-form-item layui-form-text">
<label class="layui-form-label">过渡页菜单(订阅可用)</label>
<div class="layui-input-block">
<textarea name = "menu" placeholder="请参考帮助文档进行设置!" rows = "4" class="layui-textarea"><?php echo $transition_page['menu']; ?></textarea>
</div>
</div>
</div> -->
<!-- <div class="layui-form-item layui-form-text">
<label class="layui-form-label">自定义footer,支持HTML(订阅可用)</label>

66
templates/admin/static/embed.js

@ -42,31 +42,8 @@ function set_icon_name(){ @@ -42,31 +42,8 @@ function set_icon_name(){
//获取icon名称
function get_icon_name(){
let icon_name;
//从表单获取
let tmp_name = $("#font_icon").val();
if( tmp_name == undefined ) {
return false;
}
tmp_name = tmp_name.split("/");
tmp_name = tmp_name.pop();
tmp_name = tmp_name.split(".");
tmp_name = tmp_name[0];
icon_name = tmp_name;
//如果不存在,则从session获取
if( icon_name == "" || icon_name == undefined ) {
icon_name = sessionStorage.icon_name;
}
//如果session也不存在,则重新设置一个
if( icon_name == "" || icon_name == undefined ) {
set_icon_name();
icon_name = sessionStorage.icon_name;
}
//最后返回
return icon_name;
// console.log('this?');
return getRandomString(6);
}
//获取老图标的完整路径
@ -210,7 +187,21 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -210,7 +187,21 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'check_status', title: '状态', width: 80,sort:true,templet:function(d){
let title = `检测时间:${d.last_checked_time}`;
if(d.check_status == 1) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-green">正常</span>`;
}
else if(d.check_status == 2) {
return `<span title="${title}" class="link-status-text layui-badge">异常</span>`;
}
else if(d.check_status == 3) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-cyan">未知</span>`;
}
else {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-gray">未检测</span>`;
}
}}
,{field: 'property', title: '私有', width: 80, sort: true,templet: function(d){
if(d.property == 1) {
return '<button type="button" class="layui-btn layui-btn-xs">是</button>';
@ -219,6 +210,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -219,6 +210,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger">否</button>';
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'click', title: '点击数',width:90,sort:true}
,{fixed: 'right', title:'操作', toolbar: '#link_operate'}
]]
@ -547,7 +539,21 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -547,7 +539,21 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'check_status', title: '状态', width: 80,sort:true,templet:function(d){
let title = `检测时间:${d.last_checked_time}`;
if(d.check_status == 1) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-green">正常</span>`;
}
else if(d.check_status == 2) {
return `<span title="${title}" class="link-status-text layui-badge">异常</span>`;
}
else if(d.check_status == 3) {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-cyan">未知</span>`;
}
else {
return `<span title="${title}" class="link-status-text layui-badge layui-bg-gray">未检测</span>`;
}
}}
,{field: 'property', title: '私有', width: 80, sort: true,templet: function(d){
if(d.property == 1) {
return '<button type="button" class="layui-btn layui-btn-xs">是</button>';
@ -556,6 +562,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -556,6 +562,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger">否</button>';
}
}}
,{field: 'weight', title: '权重', width: 75,sort:true,edit: 'text'}
,{field: 'click', title: '点击数',width:90,sort:true}
,{fixed: 'right', title:'操作', toolbar: '#link_operate'}
]]
@ -829,7 +836,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -829,7 +836,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
layer.msg(data.err_msg, {icon: 5});
}
});
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
// console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//识别链接信息
@ -1009,7 +1016,8 @@ function check_db_down(){ @@ -1009,7 +1016,8 @@ function check_db_down(){
url:"/data/onenav.db3",
statusCode: {
200: function() {
$("#console_log").append("危险!!!危险!!!危险!!!数据库可被下载,请尽快参考帮助文档:https://dwz.ovh/jvr2t 加固安全设置!<br /><br />");
let msg = `危险!!!危险!!!危险!!!数据库可被下载,请尽快参考帮助文档:<a target = "_blank" href = "https://dwz.ovh/jvr2t">https://dwz.ovh/jvr2t</a> 加固安全设置!<br /><br />`;
$("#console_log").append(msg);
},
403:function() {
$("#console_log").append("您的数据库看起来是安全的!<br />");

3
templates/admin/static/style.css

@ -240,3 +240,6 @@ @@ -240,3 +240,6 @@
text-align: right;
float:right;
}
.link-status-text{
cursor: pointer;
}
Loading…
Cancel
Save