Compare commits

..

No commits in common. 'd5003b44e171ce99047505ccfa33b0d5d4f10837' and '2410d879f2113377a078d2a4cf1631ebed7d5dc2' have entirely different histories.

  1. 4
      README.md
  2. 52
      class/Api.php
  3. 6
      controller/api.php
  4. 9
      data/update.log
  5. 1
      templates/admin/header.php
  6. 90
      templates/admin/index.php
  7. 2
      templates/admin/login.php
  8. 58
      templates/admin/setting/backup.php
  9. 57
      templates/admin/setting/theme.php
  10. 58
      templates/admin/static/embed.js
  11. 67
      templates/admin/static/style.css
  12. 0
      templates/index.html
  13. 2
      version.txt

4
README.md

@ -53,11 +53,11 @@ OneNav是一款开源免费的书签(导航)管理程序,使用使用PHP +
```bash ```bash
docker run -itd --name="onenav" -p 80:80 \ docker run -itd --name="onenav" -p 80:80 \
-v /data/onenav:/data/wwwroot/default/data \ -v /data/onenav:/data/wwwroot/default/data \
helloz/onenav:0.9.33 helloz/onenav:0.9.32
``` ```
* 第一个`80`是自定义访问端口,可以自行修改,第二个`80`是容器端口,请勿修改 * 第一个`80`是自定义访问端口,可以自行修改,第二个`80`是容器端口,请勿修改
* `/data/onenav`:本机挂载目录,用于持久存储Onenav数据 * `/data/onenav`:本机挂载目录,用于持久存储Onenav数据
* `0.9.33`:改成OneNav最新版本号,可以通过[releases](https://github.com/helloxz/onenav/releases)查看最新版本号 * `0.9.32`:改成OneNav最新版本号,可以通过[releases](https://github.com/helloxz/onenav/releases)查看最新版本号
> 更多说明,请参考帮助文档:https://dwz.ovh/onenav > 更多说明,请参考帮助文档:https://dwz.ovh/onenav

52
class/Api.php

@ -566,58 +566,6 @@ class Api {
} }
} }
} }
/**
* name:通用上传接口
* @param1:指定上传路径
* @param2:指定允许的后缀名称,是一个数组
*/
public function general_upload($path,$suffixs){
// 验证权限
$this->auth($token);
// 存在错误,上传失败
if ($_FILES["file"]["error"] > 0)
{
$this->err_msg(-1015,'File upload failed!');
}
else
{
$filename = $_FILES["file"]["name"];
//获取文件后缀
$suffix = explode('.',$filename);
$suffix = strtolower(end($suffix));
//临时文件位置
$temp = $_FILES["file"]["tmp_name"];
// 遍历$suffixs后缀文件,判断是否允许
foreach ($suffixs as $key => $value) {
if( $suffix == $value ) {
$allow = true;
break;
}
}
// 如果是不允许的文件,则删除
if( $allow !== TRUE ) {
//删除临时文件
unlink($filename);
$this->err_msg(-1014,'Unsupported file suffix name!');
}
// 如果是允许的文件,则移动到指定目录,path格式为data/
if( copy($temp,$path.$filename) ) {
$data = [
'code' => 0,
'file_name' => $path.$filename
];
exit(json_encode($data));
}
else{
// 复制文件失败了
$this->err_msg(-2000,'上传失败,请检查' + $path + '目录权限!');
}
}
}
/** /**
* 图标上传 * 图标上传

6
controller/api.php

@ -662,9 +662,3 @@ function global_search() {
global $api; global $api;
$api->global_search(); $api->global_search();
} }
// 上传数据备份文件
function upload_backup(){
global $api;
$api->general_upload('data/backup/',['db3']);
}

9
data/update.log

@ -249,12 +249,3 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
3. 修改Medoo默认获取模式为关联数组,避免过多冗余数据 3. 修改Medoo默认获取模式为关联数组,避免过多冗余数据
4. 重构OneNav Chrome扩展 4. 重构OneNav Chrome扩展
5. 后台获取API页面,新增API域名显示 5. 后台获取API页面,新增API域名显示
20231114
1. 优化后台首页信息显示
2. 优化主题商城主题展示效果
3. 修改登录页面静态资源参数被宝塔拦截问题
20231207
1. 新增技术支持按钮
2. 数据备份页面新增上传备份功能

1
templates/admin/header.php

@ -27,7 +27,6 @@
<li class="layui-nav-item"><a href="/index.php?c=admin&page=link_list"><i class="layui-icon layui-icon-link"></i> 我的链接</a></li> <li class="layui-nav-item"><a href="/index.php?c=admin&page=link_list"><i class="layui-icon layui-icon-link"></i> 我的链接</a></li>
<li class="layui-nav-item"><a href="/index.php?c=admin&page=add_link"><i class="layui-icon layui-icon-add-circle-fine"></i> 添加链接</a></li> --> <li class="layui-nav-item"><a href="/index.php?c=admin&page=add_link"><i class="layui-icon layui-icon-add-circle-fine"></i> 添加链接</a></li> -->
<li class="layui-nav-item"><a title = "加入OneNav交流群" target = "_blank" href="https://dwz.ovh/qxsul"><i class="layui-icon layui-icon-group"></i> 交流群</a></li> <li class="layui-nav-item"><a title = "加入OneNav交流群" target = "_blank" href="https://dwz.ovh/qxsul"><i class="layui-icon layui-icon-group"></i> 交流群</a></li>
<li class="layui-nav-item"><a onclick = "support()" title = "请求OneNav技术支持" href="javascript:;"><i class="layui-icon layui-icon-help"></i> 技术支持</a></li>
</ul> </ul>
<ul class="layui-nav layui-layout-right"> <ul class="layui-nav layui-layout-right">

90
templates/admin/index.php

@ -7,93 +7,43 @@
<div style="padding: 15px;"> <div style="padding: 15px;">
<div class="layui-container" style = "margin-top:2em;"> <div class="layui-container" style = "margin-top:2em;">
<div class="layui-row layui-col-space18"> <div class="layui-row layui-col-space18">
<div class="layui-col-lg4">
<div class="layui-col-lg3"> <div class = "admin-msg">当前版本:<span id = "current_version"><?php echo file_get_contents('version.txt'); ?></span>
<div class = "admin-msg">
<h2>当前版本</h2>
<p class="text">
<span id = "current_version">
<?php echo file_get_contents('version.txt'); ?></span>
<span id = "update_msg" style = "display:none;"><a style = "color: #FF5722;" href = "https://github.com/helloxz/onenav/releases" title = "下载最新版OneNav" target = "_blank" id="current_version">有可用更新</a></span> <span id = "update_msg" style = "display:none;"><a style = "color: #FF5722;" href = "https://github.com/helloxz/onenav/releases" title = "下载最新版OneNav" target = "_blank" id="current_version">有可用更新</a></span>
</p>
</div> </div>
</div> </div>
<div class="layui-col-lg4">
<div class="layui-col-lg3">
<div class = "admin-msg"> <div class = "admin-msg">
<h2>最新版本</h2> 最新版本:<span><span id = "getting">获取中...</span><a href = "https://github.com/helloxz/onenav/releases" title = "下载最新版OneNav" target = "_blank" id="latest_version"></a></span>
<p class="text" id = "new_version"> (<a href="/index.php?c=admin&page=setting/subscribe" title = "订阅后可一键更新">一键更新</a>)
<i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop"></i>
</p>
</div> </div>
</div> </div>
<div class="layui-col-lg4">
<div class="layui-col-lg3"> <div class = "admin-msg">交流群:<a target = "_blank" rel = "nofollow" href="https://dwz.ovh/qxsul" title = "点此加入OneNav交流群">https://dwz.ovh/qxsul</a></div>
<div class = "admin-msg">
<h2>交流群</h2>
<p class="text">
<a target = "_blank" rel = "nofollow" href="https://dwz.ovh/qxsul" title = "点此加入OneNav交流群">https://dwz.ovh/qxsul</a>
</p>
</div> </div>
<div class="layui-col-lg4">
<div class = "admin-msg">社区支持:<a href="https://dwz.ovh/vd0bw" rel = "nofollow" target="_blank" title="访问下问社区">https://dwz.ovh/vd0bw</a></div>
</div> </div>
<div class="layui-col-lg4">
<div class="layui-col-lg3"> <div class = "admin-msg">项目地址:<a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank">https://github.com/helloxz/onenav</a></div>
<div class = "admin-msg">
<h2>社区支持</h2>
<p class="text">
<a href="https://dwz.ovh/vd0bw" rel = "nofollow" target="_blank" title="访问下问社区">https://dwz.ovh/vd0bw</a>
</p>
</div> </div>
<div class="layui-col-lg4">
<div class = "admin-msg">帮助文档:<a href="https://dwz.ovh/onenav" rel = "nofollow" target="_blank">https://dwz.ovh/onenav</a></div>
</div> </div>
<div class="layui-col-lg4">
<div class="layui-col-lg3"> <div class = "admin-msg">作者博客: <a href="https://www.xiaoz.me/" rel = "nofollow" target="_blank">https://www.xiaoz.me/</a></div>
<div class = "admin-msg">
<h2>项目地址</h2>
<p class="text"><a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank">https://github.com/helloxz/onenav</a></p>
</div>
</div> </div>
<div class="layui-col-lg4">
<div class="layui-col-lg3"> <div class = "admin-msg">捐赠地址: <a href="https://dwz.ovh/donation" rel = "nofollow" target="_blank">https://dwz.ovh/donation</a></div>
<div class = "admin-msg">
<h2>帮助文档</h2>
<p class="text"><a href="https://dwz.ovh/onenav" rel = "nofollow" target="_blank">https://dwz.ovh/onenav</a></p>
</div>
</div>
<div class="layui-col-lg3">
<div class = "admin-msg">
<h2>作者博客</h2>
<p class="text">
<a href="https://blog.xiaoz.org/" rel = "nofollow" target="_blank">https://blog.xiaoz.org/</a>
</p>
</div>
</div>
<div class="layui-col-lg3">
<div class = "admin-msg">
<h2>购买订阅</h2>
<p class="text">
<a href="https://dwz.ovh/69h9q" rel = "nofollow" target="_blank">https://dwz.ovh/69h9q</a>
</p>
</div>
</div>
<div class="layui-col-lg3">
<div class = "admin-msg">
<h2>Chrome浏览器扩展</h2>
<p class="text">
<a href="https://dwz.ovh/4kxn2" title = "适用于Chromium内核的浏览器扩展" rel = "nofollow" target="_blank">https://dwz.ovh/4kxn2</a>
</p>
</div> </div>
<div class="layui-col-lg4">
<div class = "admin-msg">Chrome浏览器扩展: <a href="https://dwz.ovh/4kxn2" title = "适用于Chromium内核的浏览器扩展" rel = "nofollow" target="_blank">https://dwz.ovh/4kxn2</a></div>
</div> </div>
<!-- 日志输出窗口 --> <!-- 日志输出窗口 -->
<div class="layui-col-lg12"> <div class="layui-col-lg12">
<p><h3 style = "padding-bottom:1em;">日志输出:</h3></p> <p><h3 style = "padding-bottom:1em;">日志输出:</h3></p>
<blockquote class="layui-elem-quote" id = "console_log"> <textarea id = "console_log" name="desc" rows="20" placeholder="日志输出控制台" class="layui-textarea" readonly="readonly"></textarea>
</blockquote>
<!-- <textarea id = "console_log" name="desc" rows="20" placeholder="日志输出控制台" class="layui-textarea" readonly="readonly"></textarea> -->
</div> </div>
<!-- 日志输出窗口END --> <!-- 日志输出窗口END -->

2
templates/admin/login.php

@ -100,5 +100,5 @@
</script> </script>
<script src = 'static/js/jquery.min.js'></script> <script src = 'static/js/jquery.min.js'></script>
<script src = 'static/layui/layui.js'></script> <script src = 'static/layui/layui.js'></script>
<script src="templates/admin/static/embed.js?v=<?php echo $version; ?>"></script> <script src="templates/admin/static/embed.js?v=<?php echo $version; ?>'"></script>
</html> </html>

58
templates/admin/setting/backup.php

@ -12,7 +12,6 @@
<li>订阅用户可以对数据库进行本地备份和回滚</li> <li>订阅用户可以对数据库进行本地备份和回滚</li>
<li>备份数据库仅保存最近10份数据</li> <li>备份数据库仅保存最近10份数据</li>
<li>该功能仅辅助备份使用,无法确保100%数据安全,因此定期对整个站点打包备份仍然是必要的</li> <li>该功能仅辅助备份使用,无法确保100%数据安全,因此定期对整个站点打包备份仍然是必要的</li>
<li>如果您需要迁移数据,步骤为:立即备份 > 下载备份到本地 > 新安装OneNav > 上传备份 > 回滚</li>
</ol> </ol>
</div> </div>
</div> </div>
@ -28,28 +27,14 @@
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script> </script>
<!-- 操作选项END --> <!-- 操作选项END -->
<!-- 头部工具栏 --> <!-- 头部工具栏 -->
<script type="text/html" id="toolbarheader"> <script type="text/html" id="toolbarheader">
<div class="layui-btn-container"> <div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="backup">立即备份</button> <button class="layui-btn layui-btn-sm" lay-event="backup">立即备份</button>
</div> </div>
</script> </script>
<!-- 头部工具栏END --> <!-- 头部工具栏END -->
<!-- 上传按钮 -->
<div class="upload-backup">
<button type="button" class="layui-btn layui-btn-sm upload-bakcup" lay-options="{accept: 'file'}">
<i class="layui-icon layui-icon-upload"></i>
上传备份
</button>
</div>
<!-- 上传按钮END -->
</div> </div>
</div> </div>
</div> </div>
@ -57,49 +42,8 @@
<?php include_once(dirname(__DIR__).'/footer.php'); ?> <?php include_once(dirname(__DIR__).'/footer.php'); ?>
<script> <script>
layui.use(['table','upload'],function(){ layui.use(['table'],function(){
var table = layui.table; var table = layui.table;
var upload = layui.upload;
// 渲染上传
// 渲染
upload.render({
elem: '.upload-bakcup', // 绑定多个元素
url: '/index.php?c=api&method=upload_backup', // 设置上传接口
accept: 'file', // 普通文件
exts:'db3', // 允许的后缀
before: function(obj){ // 选择文件后
layer.load();
var files = obj.pushFile();
let file = Object.values(files)[0];
// 得到文件名
let name = file.name;
// 正则判断文件名是否符合规范,文件名格式如:onenav_202312071528_0.9.32.db3
let reg = /^onenav_[0-9]{12}_[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\.db3$/;
if( !reg.test(name) ) {
layer.msg('文件格式不正确!',{icon:5});
// 关闭loading
layer.closeAll('loading');
return false;
}
},
done: function(res){
layer.msg('上传成功!',{icon:1});
table.reload('tableid', {
where: { //设定异步数据接口的额外参数,任意设
aaaaaa: 'xxx'
}
});
layer.closeAll('loading');
},
error: function(index, upload){
layer.msg('上传出错!',{icon:5});
layer.closeAll('loading');
}
});
// 渲染表格 // 渲染表格
table.render({ table.render({
elem: '#mytable' elem: '#mytable'

57
templates/admin/setting/theme.php

@ -16,26 +16,22 @@
<!-- 说明提示框END --> <!-- 说明提示框END -->
<div class="layui-col-lg12"> <div class="layui-col-lg12">
<div class="layui-row layui-col-space24"> <div class="layui-row layui-col-space24">
<!-- 主题列表new -->
<?php foreach ($themes as $key => $theme) { <?php foreach ($themes as $key => $theme) {
//var_dump($theme['info']->name); //var_dump($theme['info']->name);
?> ?>
<div class="layui-col-md3"> <!-- 主题列表 -->
<div class="layui-card custom-card"> <div class="layui-col-lg3 layui-col-md6 layui-col-sm12">
<div class="layui-card-header"> <fieldset style = "padding:1em;border:0px;height:280px;border:1px dashed #1E9FFF;box-shadow: 2px 2px 3px #888888;color:#666666">
<legend style = "font-size:24px;" id="<?php echo $key; ?>">
<?php echo $key; ?> - <?php echo $theme['info']->version ?> <?php echo $key; ?> - <?php echo $theme['info']->version ?>
<?php if( $current_them == $key ) { ?> <span class="renewable" style="color:#FF5722;font-size:14px;"></span>
<span style = "color:#ff5722;">(使用中)</span> </legend>
<?php } ?>
</div>
<div class="layui-card-body">
<!-- 主题图片 --> <!-- 主题图片 -->
<div class = "screenshot"><p><img layer-src="<?php echo $theme['info']->screenshot; ?>" src="<?php echo $theme['info']->screenshot; ?>" alt=""></p></div> <div class = "screenshot"><p><img layer-src="<?php echo $theme['info']->screenshot; ?>" src="<?php echo $theme['info']->screenshot; ?>" alt=""></p></div>
<!-- 主题图片END --> <!-- 主题图片END -->
<hr>
<div class = "thme-btns"> <p>
<div class="layui-btn-group"> <div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" onclick = "set_theme('<?php echo $key; ?>')">使用</button> <button type="button" class="layui-btn layui-btn-sm" onclick = "set_theme('<?php echo $key; ?>')">使用</button>
<button type="button" class="layui-btn layui-btn-sm" onclick = "theme_detail('<?php echo $key; ?>')">详情</button> <button type="button" class="layui-btn layui-btn-sm" onclick = "theme_detail('<?php echo $key; ?>')">详情</button>
@ -43,15 +39,16 @@
<button type="button" class="layui-btn layui-btn-sm" onclick = "update_theme('<?php echo $key; ?>','<?php echo $theme['info']->version; ?>')">更新</button> <button type="button" class="layui-btn layui-btn-sm" onclick = "update_theme('<?php echo $key; ?>','<?php echo $theme['info']->version; ?>')">更新</button>
<a class="layui-btn layui-btn-sm" target = "_blank" href="/index.php?theme=<?php echo $key; ?>">预览</a> <a class="layui-btn layui-btn-sm" target = "_blank" href="/index.php?theme=<?php echo $key; ?>">预览</a>
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick = "delete_theme('<?php echo $key; ?>')">删除</button> <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick = "delete_theme('<?php echo $key; ?>')">删除</button>
</div> <?php if( $current_them == $key ) { ?>
</div> <button type="button" class="layui-btn layui-btn-sm layui-btn-danger">当前</button>
<?php } ?>
</div> </div>
</p>
</fieldset>
</div> </div>
</div> <!-- 主题列表END -->
<?php } ?> <?php } ?>
<!-- 主题列表new END -->
</div> </div>
</div> </div>
<hr> <hr>
@ -63,28 +60,22 @@
//var_dump($theme['info']->name); //var_dump($theme['info']->name);
?> ?>
<!-- 在线主题列表 --> <!-- 在线主题列表 -->
<div class="layui-col-lg3 layui-col-md6 layui-col-sm12">
<fieldset style = "padding:1em;border:0px;height:280px;border:1px dashed #1E9FFF;box-shadow: 2px 2px 3px #888888;color:#666666">
<legend style = "font-size:24px;"><?php echo $key; ?> - <?php echo $theme->version ?></legend>
<div class="layui-col-md3">
<div class="layui-card custom-card">
<div class="layui-card-header">
<?php echo $key; ?> - <?php echo $theme->version ?>
</div>
<div class="layui-card-body">
<!-- 主题图片 --> <!-- 主题图片 -->
<div class = "screenshot"> <div class = "screenshot"><p><img layer-src="<?php echo $theme->screenshot; ?>" src="<?php echo $theme->screenshot; ?>" alt=""></p></div>
<p><img layer-src="<?php echo $theme->screenshot; ?>" src="<?php echo $theme->screenshot; ?>" alt=""></p>
</div>
<!-- 主题图片END --> <!-- 主题图片END -->
<hr>
<div class = "thme-btns"> <p>
<div class="layui-btn-group"> <div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" onclick = "down_theme('<?php echo $key; ?>','download')">下载</button> <button type="button" class="layui-btn layui-btn-sm" onclick = "down_theme('<?php echo $key; ?>','download')">下载</button>
<a class="layui-btn layui-btn-sm" title = "查看<?php echo $key; ?>演示" target = "_blank" href="https://nav.rss.ink/index.php?theme=<?php echo $key; ?>">查看演示</a> <a class="layui-btn layui-btn-sm" title = "查看<?php echo $key; ?>演示" target = "_blank" href="https://nav.rss.ink/index.php?theme=<?php echo $key; ?>">查看演示</a>
<!-- <button type="button" class="layui-btn layui-btn-sm" onclick = "theme_detail_online('<?php echo $key; ?>')">详情</button> -->
</div> </div>
</div> </p>
</fieldset>
</div>
</div>
</div> </div>
<!-- 主题列表END --> <!-- 主题列表END -->
<?php } ?> <?php } ?>

58
templates/admin/static/embed.js

@ -976,17 +976,17 @@ function check_weak_password(){
} }
//检测数据库是否可能被下载 //检测数据库是否可能被下载
function check_db_down(){ function check_db_down(){
$("#console_log").append("检查数据库是否可被下载...<br />"); $("#console_log").append("检查数据库是否可被下载...\n");
$.ajax({ $.ajax({
type:"HEAD", type:"HEAD",
async:false, async:false,
url:"/data/onenav.db3", url:"/data/onenav.db3",
statusCode: { statusCode: {
200: function() { 200: function() {
$("#console_log").append("危险!!!危险!!!危险!!!数据库可被下载,请尽快参考帮助文档:https://dwz.ovh/jvr2t 加固安全设置!<br /><br />"); $("#console_log").append("危险!!!危险!!!危险!!!数据库可被下载,请尽快参考帮助文档:https://dwz.ovh/jvr2t 加固安全设置!\n\n");
}, },
403:function() { 403:function() {
$("#console_log").append("您的数据库看起来是安全的!<br />"); $("#console_log").append("您的数据库看起来是安全的!\n\n");
} }
} }
}); });
@ -995,19 +995,18 @@ function check_db_down(){
//获取待更新数据库列表,http://onenav.com/index.php?c=api&method=exe_sql&name=on_db_logs.sql //获取待更新数据库列表,http://onenav.com/index.php?c=api&method=exe_sql&name=on_db_logs.sql
function get_sql_update_list() { function get_sql_update_list() {
$("#console_log").append("----------------------------------------------------------------------<br />"); $("#console_log").append("正在检查数据库更新...\n");
$("#console_log").append("正在检查数据库更新...<br />");
$.get("index.php?c=api&method=get_sql_update_list",function(data,status){ $.get("index.php?c=api&method=get_sql_update_list",function(data,status){
if ( data.code == 0 ) { if ( data.code == 0 ) {
//如果没有可用更新,直接结束 //如果没有可用更新,直接结束
if ( data.data.length == 0 ) { if ( data.data.length == 0 ) {
$("#console_log").append("当前无可用更新!<br />"); $("#console_log").append("当前无可用更新!\n");
return false; return false;
} }
else{ else{
$("#console_log").append("检查到可更新SQL列表:<br />"); $("#console_log").append("检查到可更新SQL列表:\n");
$("#console_log").append("正在准备更新...<br />"); $("#console_log").append("正在准备更新...\n");
for(i in data.data) { for(i in data.data) {
sqlname = data.data[i]; sqlname = data.data[i];
//$("#console_log").append(data.data[i] + "\n"); //$("#console_log").append(data.data[i] + "\n");
@ -1046,20 +1045,12 @@ function getQueryVariable(variable)
function get_latest_version(){ function get_latest_version(){
$.post("/index.php?c=api&method=get_latest_version",function(data,status){ $.post("/index.php?c=api&method=get_latest_version",function(data,status){
//console.log(data.data); //console.log(data.data);
$("#getting").hide();
//获取最新版本 //获取最新版本
let latest_version = data.data; let latest_version = data.data;
$("#latest_version").text(latest_version); $("#latest_version").text(latest_version);
// 改变显示内容
let new_version = `
<a href="https://github.com/helloxz/onenav/releases" title="下载最新版OneNav" target="_blank" id="latest_version">${latest_version}</a>
[<a href="/index.php?c=admin&page=setting/subscribe" title="订阅后可一键更新">一键更新</a>]
`;
$("#new_version").html(new_version);
$("#new_version").show();
//获取当前版本 //获取当前版本
let current_version = $("#current_version").text(); let current_version = $("#current_version").text();
@ -1212,36 +1203,3 @@ $(document).ready(function() {
} }
}); });
}); });
// 获取当前域名
function getCurrentDomain() {
// 获取协议(包括末尾的冒号和斜杠)
var protocol = window.location.protocol;
// 获取域名
var hostname = window.location.hostname;
// 获取端口号
var port = window.location.port;
// 检查端口号是否为80或443,并相应地调整URL
if (port === "80" || port === "443" || port === "") {
return protocol + "//" + hostname;
} else {
return protocol + "//" + hostname + ":" + port;
}
}
// 技术支持函数
function support() {
let domain = getCurrentDomain();
let description = "域名:" + domain;
let support_url = "https://support.xiuping.net/service/index?lang=zh_CN&product_id=1&description=" + description;
layer.open({
type: 2,
title: false,
shadeClose: true,
shade: 0.8,
area: ['700px', '780px'],
content: support_url // iframe 的 url
});
}

67
templates/admin/static/style.css

@ -62,28 +62,15 @@
display: none; display: none;
} }
.admin-msg{ .admin-msg{
padding: 16px; background-color: #f2f2f2;
background-color: #F8F8F8; line-height: 14px;
padding:1em;
border-radius: 5px; border-radius: 5px;
color: #999; color:#888888;
height:56px;
}
.admin-msg:hover{
background-color: #eeeeee;
/*榧犳爣鍙樻垚灏忔墜*/
cursor: pointer;
} }
.admin-msg a{ .admin-msg a{
color:#01AAED; color:#01AAED;
} }
.admin-msg h2{
font-size:18px;
color:#16b777;
}
.admin-msg .text{
padding:14px 0 2px 0;
}
/* 上传按钮 */ /* 上传按钮 */
#up_html{ #up_html{
margin-left:auto; margin-left:auto;
@ -148,17 +135,13 @@
.place-holder{ .place-holder{
padding-bottom: 3em; padding-bottom: 3em;
} }
/* .screenshot { .screenshot {
height:220px; height:220px;
} */ }
.screenshot img{ .screenshot img{
width: 100%; max-width: auto;
height:240px; max-height: 200px;
/*自动裁剪图片*/ max-width:96%;
object-fit: cover;
border-radius: 3px;
/*鼠标移动到上面变成小手*/
cursor: pointer;
} }
#progress{ #progress{
@ -176,35 +159,3 @@
height: 38px; height: 38px;
width: 38px; width: 38px;
} }
.custom-card {
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.06); /* 更细微的阴影 */
transition: 0.3s;
border-radius: 10px; /* 圆角边框 */
background-color: #f9f9f9; /* 非常淡的灰色背景 */
}
.custom-card:hover {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1);
transform: scale(1.03); /* 稍微缩放的悬停效果 */
}
.layui-card-header {
font-weight: bold; /* 自定义标题样式 */
color: #333; /* 字体颜色 */
font-size: 16px;
}
.layui-card-body {
color: #333; /* 内容字体颜色 */
font-size: 14px; /* 字体大小 */
}
.thme-btns {
text-align: center;
padding:6px 0 6px 0;
}
.upload-backup{
margin-top: 16px;
}

0
templates/index.html

2
version.txt

@ -1 +1 @@
v0.9.33-20231207 v0.9.32-20230714
Loading…
Cancel
Save