From 0d057a59d3b8a4a5881dd0d01e3044fdec831bf0 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Fri, 22 Apr 2022 16:47:43 +0800 Subject: [PATCH] 20220422 --- templates/admin/add_category.php | 20 +++++-- templates/admin/add_link.php | 7 +-- templates/admin/add_quick_tpl.php | 9 ++- templates/admin/edit_category.php | 34 ++++++++--- templates/admin/footer.php | 2 +- templates/admin/index.php | 6 ++ templates/admin/left.php | 2 +- templates/admin/setting/api.php | 52 +++++++++++++++++ templates/admin/setting/site.php | 9 ++- templates/admin/static/add_quick_tpl.css | 4 +- templates/admin/static/embed.js | 73 +++++++++++++++++++++++- templates/baisuTwo/css/style.css | 1 + templates/baisuTwo/index.php | 24 ++++++-- templates/baisuTwo/info.json | 4 +- templates/default/index.php | 59 +++++++++++++------ templates/default/info.json | 4 +- templates/default/static/embed.js | 7 ++- templates/default/static/style.css | 15 ++++- 18 files changed, 277 insertions(+), 55 deletions(-) create mode 100644 templates/admin/setting/api.php diff --git a/templates/admin/add_category.php b/templates/admin/add_category.php index 107682d..0700449 100755 --- a/templates/admin/add_category.php +++ b/templates/admin/add_category.php @@ -11,8 +11,8 @@ -
-
+
+
@@ -27,6 +27,20 @@
+
+ +
+ +
+
+
@@ -49,10 +63,8 @@
-
-
diff --git a/templates/admin/add_link.php b/templates/admin/add_link.php index 7f9bcaf..a87d338 100755 --- a/templates/admin/add_link.php +++ b/templates/admin/add_link.php @@ -5,16 +5,15 @@
-
+
- +
-
@@ -64,12 +63,10 @@
-
识别 -
diff --git a/templates/admin/add_quick_tpl.php b/templates/admin/add_quick_tpl.php index e1e4f96..888cbe5 100755 --- a/templates/admin/add_quick_tpl.php +++ b/templates/admin/add_quick_tpl.php @@ -11,13 +11,12 @@ 快速添加 - + -
- 快速添加当前连接 + 快速添加链接到OneNav
@@ -44,11 +43,11 @@
是否私有 - +
- +
diff --git a/templates/admin/edit_category.php b/templates/admin/edit_category.php index 86935b0..71ef8e3 100755 --- a/templates/admin/edit_category.php +++ b/templates/admin/edit_category.php @@ -11,8 +11,8 @@
-
- +
+ + - \ No newline at end of file diff --git a/templates/admin/index.php b/templates/admin/index.php index f7e731a..f59e49b 100755 --- a/templates/admin/index.php +++ b/templates/admin/index.php @@ -10,6 +10,9 @@
当前版本:
+
+
最新版本:获取中...
+
QQ群1:147687134
@@ -34,6 +37,9 @@
+
+
Chrome浏览器扩展: https://dwz.ovh/4kxn2
+
diff --git a/templates/admin/left.php b/templates/admin/left.php index c489975..1e5ebc8 100755 --- a/templates/admin/left.php +++ b/templates/admin/left.php @@ -23,7 +23,6 @@ - diff --git a/templates/admin/setting/api.php b/templates/admin/setting/api.php new file mode 100644 index 0000000..a72e24c --- /dev/null +++ b/templates/admin/setting/api.php @@ -0,0 +1,52 @@ + + + + +
+ +
+ +
+
+ API使用说明,请参考:https://dwz.ovh/viot5 +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
+
+ + \ No newline at end of file diff --git a/templates/admin/setting/site.php b/templates/admin/setting/site.php index 0910e13..c99b3c7 100644 --- a/templates/admin/setting/site.php +++ b/templates/admin/setting/site.php @@ -4,7 +4,7 @@
-
+
@@ -58,6 +58,13 @@
+
+ +
+ +
+
+
diff --git a/templates/admin/static/add_quick_tpl.css b/templates/admin/static/add_quick_tpl.css index a231f60..f280c1c 100755 --- a/templates/admin/static/add_quick_tpl.css +++ b/templates/admin/static/add_quick_tpl.css @@ -59,8 +59,8 @@ box-sizing: content-box; } .quick-main{ - width: 400px; - height: 460px; + width: 360px; + height: 420px; margin: auto; padding: 20px; background-color: white; diff --git a/templates/admin/static/embed.js b/templates/admin/static/embed.js index 9ed9bd4..0d9f0bf 100755 --- a/templates/admin/static/embed.js +++ b/templates/admin/static/embed.js @@ -15,6 +15,7 @@ layui.use(['element','table','layer','form','upload'], function(){ ,cols: [[ //表头 {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'} ,{field: 'name', title: '分类名称', width:160} + ,{field: 'fname', title: '父级分类', width:160} ,{field: 'add_time', title: '添加时间', width:160, sort: true,templet:function(d){ var add_time = timestampToTime(d.add_time); return add_time; @@ -291,6 +292,67 @@ layui.use(['element','table','layer','form','upload'], function(){ return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 }); + //生成token + form.on('submit(create_sk)', function(data){ + if( data.field.SecretKey == '' ) { + $.post('/index.php?c=api&method=create_sk',data.field,function(data,status){ + //如果添加成功 + if(data.code == 0) { + $("#SecretKey").val(data.data); + layer.msg('SecretKey生成完毕!', {icon: 1}); + } + else{ + layer.msg(data.err_msg, {icon: 5}); + } + }); + } + else{ + layer.msg('SecretKey已经存在!', {icon: 5}); + } + + //console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value} + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 + }); + + //更换token + form.on('submit(change_sk)', function(data){ + if( data.field.SecretKey != '' ) { + $.post('/index.php?c=api&method=create_sk',data.field,function(data,status){ + //如果添加成功 + if(data.code == 0) { + $("#SecretKey").val(data.data); + layer.msg('SecretKey已更换!', {icon: 1}); + } + else{ + layer.msg(data.err_msg, {icon: 5}); + } + }); + } + else{ + layer.msg('请先生成SecretKey!', {icon: 5}); + } + + //console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value} + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 + }); + + //计算token + form.on('submit(cal_token)', function(data){ + if( (data.field.SecretKey != '') && (data.field.username != '' ) ) { + let username = data.field.username; + let sk = data.field.SecretKey; + let token = md5(username + sk); + $("#token").val(token); + layer.msg('token计算成功!', {icon: 1}); + } + else{ + layer.msg('SecretKey为空,请先生成!', {icon: 5}); + } + + //console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value} + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 + }); + //添加链接 form.on('submit(add_link)', function(data){ $.post('/index.php?c=api&method=add_link',data.field,function(data,status){ @@ -525,4 +587,13 @@ function getQueryVariable(variable) if(pair[0] == variable){return pair[1];} } return(false); -} \ No newline at end of file +} + +//获取最新版本 +function get_latest_version(){ + $.get("https://git.xiaoz.me/xiaoz/onenav/raw/branch/main/version.txt",function(data,status){ + $("#getting").hide(); + $("#latest_version").text(data); + }); +} +get_latest_version(); \ No newline at end of file diff --git a/templates/baisuTwo/css/style.css b/templates/baisuTwo/css/style.css index b942f60..8905d4b 100644 --- a/templates/baisuTwo/css/style.css +++ b/templates/baisuTwo/css/style.css @@ -1050,6 +1050,7 @@ footer a:hover { display: flex; justify-content: flex-start; align-items: center; + overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis; } .m-navlist a.list i { display: block; diff --git a/templates/baisuTwo/index.php b/templates/baisuTwo/index.php index 899df8b..e2312a6 100644 --- a/templates/baisuTwo/index.php +++ b/templates/baisuTwo/index.php @@ -15,7 +15,7 @@ - + @@ -54,16 +54,29 @@
"; ?> + + +
+ + + + + +
+ +
@@ -216,11 +229,14 @@
+ © 2022 BaiSu,Powered by OneNav
The theme author is BaiSu - +
diff --git a/templates/baisuTwo/info.json b/templates/baisuTwo/info.json index 3b3b055..5621258 100644 --- a/templates/baisuTwo/info.json +++ b/templates/baisuTwo/info.json @@ -2,8 +2,8 @@ "name":"百素主题2", "description":"适用于OneNav的百素主题2", "homepage":"https://gitee.com/baisucode/baisu-two", - "version":"1.0.0", - "update":"2022/04/15", + "version":"1.0.1", + "update":"2022/04/22", "author":"baisu", "screenshot":"https://img.rss.ink/imgs/2022/03/cba9f1946776a8f0.png" } \ No newline at end of file diff --git a/templates/default/index.php b/templates/default/index.php index c165cd5..55c9f7c 100755 --- a/templates/default/index.php +++ b/templates/default/index.php @@ -8,11 +8,11 @@ - - - + + + - + @@ -84,17 +84,43 @@
+ @@ -198,14 +221,18 @@ - - - - + + + +