Update index.py
This commit is contained in:
parent
3301c68b27
commit
2f2ab82a7d
|
|
@ -521,15 +521,16 @@ def setFpmConfig(version):
|
|||
|
||||
|
||||
def checkFpmStatusFile(version):
|
||||
if mw.isInstalledWeb():
|
||||
sdir = mw.getServerDir()
|
||||
dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
||||
if not os.path.exists(dfile):
|
||||
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
||||
content = mw.readFile(tpl)
|
||||
content = contentReplace(content, version)
|
||||
mw.writeFile(dfile, content)
|
||||
mw.restartWeb()
|
||||
if not mw.isInstalledWeb():
|
||||
return False
|
||||
|
||||
dfile = getServerDir() + '/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
||||
if not os.path.exists(dfile):
|
||||
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
||||
content = mw.readFile(tpl)
|
||||
content = contentReplace(content, version)
|
||||
mw.writeFile(dfile, content)
|
||||
mw.restartWeb()
|
||||
|
||||
|
||||
def getFpmStatus(version):
|
||||
|
|
@ -538,19 +539,19 @@ def getFpmStatus(version):
|
|||
try:
|
||||
url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json'
|
||||
result = mw.httpGet(url)
|
||||
tmp = json.loads(result)
|
||||
fTime = time.localtime(int(tmp['start time']))
|
||||
tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
||||
data = json.loads(result)
|
||||
fTime = time.localtime(int(data['start time']))
|
||||
data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
||||
except Exception as e:
|
||||
url = 'http://127.0.0.1/phpfpm_status_' + version + '?json'
|
||||
result = mw.httpGet(url)
|
||||
tmp = json.loads(result)
|
||||
fTime = time.localtime(int(tmp['start time']))
|
||||
tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
||||
data = json.loads(result)
|
||||
fTime = time.localtime(int(data['start time']))
|
||||
data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
||||
else:
|
||||
tmp = {}
|
||||
data = {}
|
||||
|
||||
return mw.getJson(tmp)
|
||||
return mw.getJson(data)
|
||||
|
||||
|
||||
def getDisableFunc(version):
|
||||
|
|
|
|||
Loading…
Reference in New Issue