创建站点检查web服务

pull/118/head
midoks 3 years ago
parent d51ffca697
commit 64f7b9b50a
  1. 2
      class/core/plugins_api.py
  2. 21
      class/core/site_api.py
  3. 15
      route/static/app/site.js
  4. 11
      route/static/app/soft.js
  5. BIN
      route/static/img/apache.png
  6. BIN
      route/static/img/mysql.png
  7. BIN
      route/static/img/nginx.png
  8. BIN
      route/static/img/php.png

@ -794,7 +794,7 @@ class plugins_api:
return mw.returnJson(True, '删除成功!')
# shell 调用
def run(self, name, func, version, args='', script='index'):
def run(self, name, func, version='', args='', script='index'):
path = mw.getRunDir() + '/' + self.__plugin_dir + \
'/' + name + '/' + script + '.py'
py = 'python3 ' + path

@ -823,6 +823,25 @@ class site_api:
port = request.form.get('port', '')
return self.add(webname, port, ps, path, version)
def checkWebStatusApi(self):
'''
创建站点检查web服务
'''
if not mw.isInstalledWeb():
return mw.returnJson(False, '请安装并启动OpenResty服务!')
path = mw.getServerDir() + '/openresty/init.d/openresty'
data = mw.execShell(path + " status")
if data[0].strip().find('stopped') != -1:
return mw.returnJson(False, '请启动OpenResty服务!')
# import plugins_api
# data = plugins_api.plugins_api().run('openresty', 'status')
# if data[0].strip() == 'stop':
# return mw.returnJson(False, '请启动OpenResty服务!')
return mw.returnJson(True, 'OK')
def addDomainApi(self):
isError = mw.checkWebConfig()
if isError != True:
@ -1075,7 +1094,7 @@ class site_api:
# self.closeHasPwd(get)
filename = self.passPath + '/' + siteName + '.pass'
print(filename)
# print(filename)
passconf = username + ':' + mw.hasPwd(password)
if siteName == 'phpmyadmin':

@ -163,8 +163,23 @@ function setWebPs(b, e, a) {
},'json');
}
function checkWebStatus(){
data = syncPost('/site/check_web_status')
if (data.status){
return true
}
layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, "#000"]})
return false
}
//添加站点
function webAdd(type) {
checkPass = checkWebStatus()
//未开启openresty,不能继续
if (!checkPass){
return
}
if (type == 1) {
var array;
var str="";

@ -146,17 +146,6 @@ function getSList(isdisplay) {
'<td>' + indexshow + '</td>' +
'<td style="text-align: right;">' + handle + '</td>' +
'</tr>';
// sBody += '<tr>' +
// '<td><span ' + titleClick +
// '><img onclick="asyncLoadImage(this,\'/plugins/file?name='+plugin.name+'&f=ico.png\')"src="/plugins/file?name=' + plugin.name +
// '&f=ico.png' + '">' + plugin_title + '</span></td>' +
// '<td>' + plugin.ps + '</td>' +
// '<td>' + softPath + '</td>' +
// '<td>' + state + '</td>' +
// '<td>' + indexshow + '</td>' +
// '<td style="text-align: right;">' + handle + '</td>' +
// '</tr>';
}
sBody += pBody;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 801 B

Loading…
Cancel
Save