|
|
@ -24,11 +24,20 @@ |
|
|
|
?> |
|
|
|
?> |
|
|
|
<div class="layui-col-md3"> |
|
|
|
<div class="layui-col-md3"> |
|
|
|
<div class="layui-card custom-card"> |
|
|
|
<div class="layui-card custom-card"> |
|
|
|
<div class="layui-card-header"> |
|
|
|
<div class="layui-card-header" id="<?php echo $key; ?>"> |
|
|
|
<?php echo $key; ?> - <?php echo $theme['info']->version ?> |
|
|
|
<div class="them-header"> |
|
|
|
<?php if( $current_them == $key ) { ?> |
|
|
|
<div class="left"> |
|
|
|
<span style = "color:#ff5722;">(使用中)</span> |
|
|
|
<span class = "name"><?php echo $key; ?> - <?php echo $theme['info']->version ?></span> |
|
|
|
<?php } ?> |
|
|
|
<?php if( $current_them == $key ) { ?> |
|
|
|
|
|
|
|
<span style = "color:#ff5722;">(使用中)</span> |
|
|
|
|
|
|
|
<?php } ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
|
|
|
|
<span class="renewable" style="color:#FF5722;font-size:14px;"></span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-card-body"> |
|
|
|
<div class="layui-card-body"> |
|
|
|
<!-- 主题图片 --> |
|
|
|
<!-- 主题图片 --> |
|
|
@ -214,25 +223,29 @@ function update_theme(name,version){ |
|
|
|
|
|
|
|
|
|
|
|
//遍历所有主题,检查是否有更新 |
|
|
|
//遍历所有主题,检查是否有更新 |
|
|
|
function check_update(){ |
|
|
|
function check_update(){ |
|
|
|
|
|
|
|
console.log('fdsfsdf'); |
|
|
|
//请求远程主题列表 |
|
|
|
//请求远程主题列表 |
|
|
|
$.get("https://onenav.xiaoz.top/v1/theme_list.php",function(data,status){ |
|
|
|
$.get("https://onenav.xiaoz.top/v1/theme_list.php",function(data,status){ |
|
|
|
let result = data.data; |
|
|
|
let result = data.data; |
|
|
|
|
|
|
|
console.log(result); |
|
|
|
//console.log(result.5iux); |
|
|
|
//console.log(result.5iux); |
|
|
|
for (const obj in result) { |
|
|
|
for (const obj in result) { |
|
|
|
//获取主题名称 |
|
|
|
//获取主题名称 |
|
|
|
let value = $("#" + obj).text(); |
|
|
|
let select = `#${obj} .name`; |
|
|
|
|
|
|
|
let value = $(select).text(); |
|
|
|
|
|
|
|
|
|
|
|
//如果获取到的数据为空 |
|
|
|
//如果获取到的数据为空 |
|
|
|
if( value == '' ) { |
|
|
|
if( value == '' ) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
//console.log(obj); |
|
|
|
|
|
|
|
//获取最新版本 |
|
|
|
//获取最新版本 |
|
|
|
let latest_version = result[obj].version; |
|
|
|
let latest_version = result[obj].version; |
|
|
|
//获取当前版本 |
|
|
|
//获取当前版本 |
|
|
|
let current_version = value.split(' - ')[1]; |
|
|
|
let current_version = value.split(' - ')[1]; |
|
|
|
//如果存在最新版本 |
|
|
|
//如果存在最新版本 |
|
|
|
if( latest_version > current_version ) { |
|
|
|
if( latest_version > current_version ) { |
|
|
|
console.log("#" + obj + ".renewable"); |
|
|
|
console.log("#" + obj + " .renewable"); |
|
|
|
$("#" + obj + " .renewable").append(`(可更新至${latest_version})`); |
|
|
|
$("#" + obj + " .renewable").append(`(可更新至${latest_version})`); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|