diff --git a/class/core/common.py b/class/core/common.py new file mode 100755 index 000000000..26131327b --- /dev/null +++ b/class/core/common.py @@ -0,0 +1,17 @@ +# coding: utf-8 + +import os +import sys +import time +import string +import json +import hashlib +import shlex +import datetime +import subprocess +import re +import hashlib + +import db + +from random import Random diff --git a/class/core/system_api.py b/class/core/system_api.py index cf245d160..6267787df 100755 --- a/class/core/system_api.py +++ b/class/core/system_api.py @@ -69,6 +69,14 @@ class system_api: end = request.args.get('end', '') data = self.getNetWorkIoData(start, end) return public.getJson(data) + + # 重启面板 + def restartApi(self): + + cmd = public.getRunDir() + '/scripts/init.d/mw restart &' + print public.execShell(cmd) + + return public.returnJson(True, '面板已重启!') ##### ----- end ----- ### # 名取PID diff --git a/route/static/app/index.js b/route/static/app/index.js index aa3d56650..9d9296ad1 100755 --- a/route/static/app/index.js +++ b/route/static/app/index.js @@ -606,34 +606,119 @@ function updateInstall(){ } //重启服务器 -function ReBoot() { +function reBoot() { layer.open({ type: 1, - title: lan.index.reboot_title, - area: ['500px', '280px'], + title: '重启服务器或者面板', + area: '330px', closeBtn: 2, shadeClose: false, - content: "
" + lan.index.reboot_warning + "
\ -" + lan.index.reboot_ps + "
\ -" + lan.index.reboot_ps_1 + "
\ -" + lan.index.reboot_ps_2 + "
\ -" + lan.index.reboot_ps_3 + "
\ -" + lan.index.reboot_ps_4 + "
\ -"+ lan.index.reboot_warning + "
\ +"+ lan.index.reboot_ps + "
\ +"+ lan.index.reboot_ps_1 + "
\ +"+ lan.index.reboot_ps_2 + "
\ +"+ lan.index.reboot_ps_3 + "
\ +"+ lan.index.reboot_ps_4 + "
\ +" + lan.index.reboot_msg_1 + "
"); + bt.pub.set_server_status_by("name={{session['webserver']}}&type=stop", function (r1) { + $(".SafeRestartCode p").addClass('c9'); + $(".SafeRestartCode").append("" + lan.index.reboot_msg_2 + "...
"); + bt.pub.set_server_status_by("name=mysqld&type=stop", function (r2) { + $(".SafeRestartCode p").addClass('c9'); + $(".SafeRestartCode").append("" + lan.index.reboot_msg_3 + "...
"); + bt.system.root_reload(function (rdata) { + $(".SafeRestartCode p").addClass('c9'); + $(".SafeRestartCode").append("" + lan.index.reboot_msg_4 + "...
"); + var sEver = setInterval(function () { + bt.system.get_total(function () { + clearInterval(sEver); + $(".SafeRestartCode p").addClass('c9'); + $(".SafeRestartCode").append("" + lan.index.reboot_msg_5 + "...
"); + setTimeout(function () { + layer.closeAll(); + }, 3000); + }) + }, 3000); + }) + }) + }) + }) + }, 100); + break; + } + }); + + + + // layer.open({ + // type: 1, + // title: lan.index.reboot_title, + // area: ['500px', '280px'], + // closeBtn: 2, + // shadeClose: false, + // content: "" + lan.index.reboot_warning + "
\ + //" + lan.index.reboot_ps + "
\ + //" + lan.index.reboot_ps_1 + "
\ + //" + lan.index.reboot_ps_2 + "
\ + //" + lan.index.reboot_ps_3 + "
\ + //" + lan.index.reboot_ps_4 + "
\ + //