From d3f7924ddd0ff8ef3b873d836718cd69790867a3 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 3 Dec 2018 13:39:06 +0800 Subject: [PATCH] u --- class/core/system_api.py | 10 ++++++++++ route/system.py | 5 +++-- scripts/lib.sh | 2 +- static/js/index.js | 20 ++++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/class/core/system_api.py b/class/core/system_api.py index 157021c74..1b149edcd 100755 --- a/class/core/system_api.py +++ b/class/core/system_api.py @@ -5,6 +5,7 @@ import time import os import re import math +import json from flask import Flask, session @@ -514,6 +515,15 @@ class system_api: return public.returnJson(True, "设置成功!") + # 更新服务 + def updateServer(self, type): + try: + if not public.isRestart(): + return public.returnMsg(False, '请等待所有安装任务完成再执行!') + + except Exception as ex: + return public.returnJson(False, "连接服务器失败!") + # 重启面板 def reWeb(self, get): # if not public.IsRestart(): return diff --git a/route/system.py b/route/system.py index 7db456706..87bb56d63 100644 --- a/route/system.py +++ b/route/system.py @@ -24,8 +24,9 @@ def network(): @system.route("/update_server") -def updatePanel(): - return public.returnJson(False, "12") +def updateServer(): + data = system_api.system_api().updateServer('update') + return data @system.route("/system_total") diff --git a/scripts/lib.sh b/scripts/lib.sh index eaa021f43..ec7c0396d 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -172,7 +172,7 @@ Install_OpenSSL() { if [ ! -d ${libPath}/openssl ];then cd ${sourcePath} - if [ ! -f ${sourcePath}openssl-1.0.2q.tar.gz ];then + if [ ! -f ${sourcePath}/openssl-1.0.2q.tar.gz ];then wget https://github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 fi tar -zxf openssl-1.0.2q.tar.gz diff --git a/static/js/index.js b/static/js/index.js index 1a13febfc..1abc5cab0 100755 --- a/static/js/index.js +++ b/static/js/index.js @@ -498,6 +498,26 @@ function checkUpdate() { },'json'); } +function updateMsg(){ + window.open("http://www.bt.cn/bbs/thread-1186-1-1.html"); + $.get('/ajax?action=UpdatePanel',function(rdata){ + layer.open({ + type:1, + title:lan.index.update_to+'['+rdata.version+']', + area: '400px', + shadeClose:false, + closeBtn:2, + content:'
' + +'

'+rdata.updateMsg+'

' + +'
' + +'' + +'' + +'
' + +'
' + }); + }); +} + //开始升级 function updateVersion(version) {