mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
创建站点检查web服务
This commit is contained in:
@@ -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
|
||||
|
||||
+20
-1
@@ -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 |
Reference in New Issue
Block a user