mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
1. 去除首页版本标识
2. 去除更新页面无用链接
This commit is contained in:
@@ -12,6 +12,6 @@ urlpatterns = [
|
||||
path(r'do_restart', views.do_restart, name='do_restart'),
|
||||
path(r'do_restart', views.do_restart, name='do_restart'),
|
||||
path(r'do_update', views.do_update, name='do_update'),
|
||||
path(r'get_update', views.do_get_update, name='do_get_update'),
|
||||
# path(r'get_update', views.do_get_update, name='do_get_update'),
|
||||
path(r'do_sql', views.do_sql, name='do_sql'),
|
||||
]
|
||||
|
||||
@@ -157,38 +157,38 @@ def restart_container(request):
|
||||
'update_tips': update_tips,
|
||||
})
|
||||
|
||||
|
||||
def do_get_update(request):
|
||||
update = 'false'
|
||||
# 拉取更新元数据
|
||||
update_log = subprocess.Popen('git remote update', shell=True)
|
||||
update_log.wait()
|
||||
# 获取本地更新日志第一条
|
||||
p_local = subprocess.Popen('git log --oneline -1', shell=True, stdout=subprocess.PIPE, )
|
||||
commit_local = p_local.stdout.readline().decode('utf8').strip()
|
||||
# 获取远端仓库更新日志第一条
|
||||
p_remote = subprocess.Popen('git log origin/master --oneline -1', shell=True, stdout=subprocess.PIPE, )
|
||||
commit_remote = p_remote.stdout.readline().decode('utf8').strip()
|
||||
print(commit_local, commit_remote)
|
||||
# if 'HEAD' in commit and 'origin' in commit:
|
||||
print(commit_remote == commit_local)
|
||||
# 如果日志相同则更新到最新,否则显示远端更新日志
|
||||
if commit_remote == commit_local:
|
||||
return JsonResponse(data=CommonResponse.success(
|
||||
msg='已经更新到最新!',
|
||||
data={
|
||||
'update_notes': get_git_logs(master='origin/master'),
|
||||
}
|
||||
).to_dict(), safe=False)
|
||||
else:
|
||||
update = 'true'
|
||||
return JsonResponse(data=CommonResponse.success(
|
||||
msg='拉取更新日志成功!!',
|
||||
data={
|
||||
'update': update,
|
||||
'update_notes': get_git_logs(master='origin/master'),
|
||||
}
|
||||
).to_dict(), safe=False)
|
||||
#
|
||||
# def do_get_update(request):
|
||||
# update = 'false'
|
||||
# # 拉取更新元数据
|
||||
# update_log = subprocess.Popen('git remote update', shell=True)
|
||||
# update_log.wait()
|
||||
# # 获取本地更新日志第一条
|
||||
# p_local = subprocess.Popen('git log --oneline -1', shell=True, stdout=subprocess.PIPE, )
|
||||
# commit_local = p_local.stdout.readline().decode('utf8').strip()
|
||||
# # 获取远端仓库更新日志第一条
|
||||
# p_remote = subprocess.Popen('git log origin/master --oneline -1', shell=True, stdout=subprocess.PIPE, )
|
||||
# commit_remote = p_remote.stdout.readline().decode('utf8').strip()
|
||||
# print(commit_local, commit_remote)
|
||||
# # if 'HEAD' in commit and 'origin' in commit:
|
||||
# print(commit_remote == commit_local)
|
||||
# # 如果日志相同则更新到最新,否则显示远端更新日志
|
||||
# if commit_remote == commit_local:
|
||||
# return JsonResponse(data=CommonResponse.success(
|
||||
# msg='已经更新到最新!',
|
||||
# data={
|
||||
# 'update_notes': get_git_logs(master='origin/master'),
|
||||
# }
|
||||
# ).to_dict(), safe=False)
|
||||
# else:
|
||||
# update = 'true'
|
||||
# return JsonResponse(data=CommonResponse.success(
|
||||
# msg='拉取更新日志成功!!',
|
||||
# data={
|
||||
# 'update': update,
|
||||
# 'update_notes': get_git_logs(master='origin/master'),
|
||||
# }
|
||||
# ).to_dict(), safe=False)
|
||||
|
||||
|
||||
def do_update(request):
|
||||
|
||||
@@ -4,41 +4,26 @@
|
||||
|
||||
<el-row class="info-card">
|
||||
|
||||
{% if "SIMPLEUI_HOME_QUICK"|get_config != False %}
|
||||
|
||||
<el-col :span="15" :lg="15" :md="15" :sm="24" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<i class="fas fa-link"></i>
|
||||
<span v-text="getLanuage('Quick navigation')"></span>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
{% if "SIMPLEUI_HOME_QUICK"|get_config != False %}
|
||||
<div v-for="(c,j) in models" :key="c.name" class="quick-wrap">
|
||||
<a href="javascript:;" @click="openTab(c,(j+1)+'')">
|
||||
<span class="icon" :class="c.icon"></span>
|
||||
<span class="card-name" v-text="c.name"></span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
{% endif %}
|
||||
<el-col :span="9" :lg="9" :md="9" :sm="24" :xs="24">
|
||||
<el-col :span="24" :lg="24" :md="24" :sm="24" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span><i class="fab fa-stripe-s"></i>PTools <span
|
||||
v-text="getLanuage('Home page')"></span></span>
|
||||
<i class="fas fa-link"></i>
|
||||
<span v-text="getLanuage('Quick navigation')"></span>
|
||||
</div>
|
||||
<div class="float-wrap clearfix">
|
||||
<div style="text-align: center">
|
||||
<img src="/static/logo3.png" alt="" style="height: 210px">
|
||||
<div>v2022.08.13</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
{% if "SIMPLEUI_HOME_QUICK"|get_config != False %}
|
||||
<div v-for="(c,j) in models" :key="c.name" class="quick-wrap">
|
||||
<a href="javascript:;" @click="openTab(c,(j+1)+'')">
|
||||
<span class="icon" :class="c.icon"></span>
|
||||
<span class="card-name" v-text="c.name"></span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
@@ -153,34 +153,34 @@
|
||||
});
|
||||
});
|
||||
},
|
||||
get_update() {
|
||||
axios.get(
|
||||
"{% url "do_get_update" %}"
|
||||
).then(res => {
|
||||
if (res.data.code === 0) {
|
||||
console.log(res.data)
|
||||
this.update_notes = res.data.data.update_notes
|
||||
{#this.update_log = true#}
|
||||
this.local_log_width = 12
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.data.msg
|
||||
});
|
||||
} else {
|
||||
console.log(res)
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: res.data.msg
|
||||
});
|
||||
}
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '获取更新失败!'
|
||||
});
|
||||
});
|
||||
},
|
||||
{#get_update() {#}
|
||||
{# axios.get(#}
|
||||
{# "{% url "do_get_update" %}"#}
|
||||
{# ).then(res => {#}
|
||||
{# if (res.data.code === 0) {#}
|
||||
{# console.log(res.data)#}
|
||||
{# this.update_notes = res.data.data.update_notes#}
|
||||
{#this.update_log = true#}
|
||||
{# this.local_log_width = 12#}
|
||||
{# this.$message({#}
|
||||
{# type: 'success',#}
|
||||
{# message: res.data.msg#}
|
||||
{# });#}
|
||||
{# } else {#}
|
||||
{# console.log(res)#}
|
||||
{# this.$message({#}
|
||||
{# type: 'warning',#}
|
||||
{# message: res.data.msg#}
|
||||
{# });#}
|
||||
{# }#}
|
||||
{# }).catch(res => {#}
|
||||
{# console.log(res)#}
|
||||
{# this.$message({#}
|
||||
{# type: 'info',#}
|
||||
{# message: '获取更新失败!'#}
|
||||
{# });#}
|
||||
{# });#}
|
||||
{#{},#}
|
||||
do_update() {
|
||||
this.$confirm('此操作会拉取软件更新软件,新版本不一定稳定,是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
|
||||
Reference in New Issue
Block a user