forked from mirror/MrDoc
优化版本更新检测功能,移除默认更新提醒弹出框
This commit is contained in:
parent
a0477486a0
commit
ec7f982f8e
@ -23,6 +23,17 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<!-- 系统版本更新提示 -->
|
||||
<div class="layui-card" style="display: none;" id="is_update_tips">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-card-header">
|
||||
<span style="color:red;font-weight:700;"><i class="layui-icon layui-icon-tips"></i> {% trans "MrDoc 已发布新版本,点击查看" %}
|
||||
<a href="https://gitee.com/zmister/MrDoc/blob/master/CHANGES.md" target="_blank" style="text-decoration:underline;">《更新内容》</a>,
|
||||
点击查看 <a href="https://doc.mrdoc.pro/doc/1395/" target="_blank" style="text-decoration:underline;">《更新指南》</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
<script src="{% static 'PearAdminLayui/component/layui/layui.js' %}?version={{mrdoc_version}}"></script>
|
||||
@ -42,9 +53,17 @@
|
||||
console.log(new_version,current_version)
|
||||
if(new_version > current_version){
|
||||
console.log("发现新版本")
|
||||
if(silence){
|
||||
$("#is_update_tips").css("display","block");
|
||||
return false;
|
||||
}
|
||||
layer.open({
|
||||
title:"{% trans '版本更新' %}",
|
||||
content:"{% trans '觅思文档已发布新版本,请及时更新' %}",
|
||||
btn:['知道了','了解如何更新'],
|
||||
btn2:function(){
|
||||
window.open("https://doc.mrdoc.pro/doc/1395/");
|
||||
},
|
||||
})
|
||||
}else{
|
||||
if(silence == false){
|
||||
|
Loading…
x
Reference in New Issue
Block a user