安装提示更新

pull/109/head
Mr Chen 6 years ago
parent 7711972adb
commit ce6061bbf3
  1. 2
      class/core/config_api.py
  2. 41
      class/core/plugins_api.py
  3. 3
      route/static/app/soft.js

@ -15,7 +15,7 @@ from flask import request
class config_api:
__version = '0.4.0'
__version = '0.4.1'
def __init__(self):
pass

@ -314,17 +314,10 @@ class plugins_api:
return True
# 检查是否正在安装
def checkSetupTask(self, sName):
sName = ''
version = ''
def checkSetupTask(self, sName, sVer, sCoexist):
if not self.__tasks:
self.__tasks = public.M('tasks').where(
"status!=?", ('1',)).field('status,name').select()
if sName.find('php-') != -1:
tmp = sName.split('-')
sName = tmp[0]
version = tmp[1]
isTask = '1'
for task in self.__tasks:
tmpt = public.getStrBetween('[', ']', task['name'])
@ -332,12 +325,9 @@ class plugins_api:
continue
tmp1 = tmpt.split('-')
name1 = tmp1[0].lower()
if sName == 'php':
if name1 == sName and tmp1[1] == version:
if name1 == sName and tmp1[1] == sVer:
isTask = task['status']
else:
if name1 == 'pure':
name1 = 'pure-ftpd'
if name1 == sName:
isTask = task['status']
return isTask
@ -453,7 +443,7 @@ class plugins_api:
if info.has_key('coexist') and info['coexist']:
coexist = True
pluginInfo = {
pInfo = {
"id": 10000,
"pid": info['pid'],
"type": 1000,
@ -474,29 +464,28 @@ class plugins_api:
"status": False,
}
pluginInfo['task'] = self.checkSetupTask(pluginInfo['name'])
if checks.find('VERSION') > -1:
pluginInfo['install_checks'] = checks.replace(
pInfo['install_checks'] = checks.replace(
'VERSION', info['versions'])
if path.find('VERSION') > -1:
pluginInfo['path'] = path.replace(
pInfo['path'] = path.replace(
'VERSION', info['versions'])
pluginInfo['display'] = self.checkDisplayIndex(
info['name'], pluginInfo['versions'])
pInfo['task'] = self.checkSetupTask(
pInfo['name'], info['versions'], coexist)
pInfo['display'] = self.checkDisplayIndex(
info['name'], pInfo['versions'])
pluginInfo['setup'] = os.path.exists(pluginInfo['install_checks'])
pInfo['setup'] = os.path.exists(pInfo['install_checks'])
if coexist and pluginInfo['setup']:
pluginInfo['setup_version'] = info['versions']
if coexist and pInfo['setup']:
pInfo['setup_version'] = info['versions']
else:
pluginInfo['setup_version'] = self.getVersion(
pluginInfo['install_checks'])
pInfo['setup_version'] = self.getVersion(pInfo['install_checks'])
# pluginInfo['status'] = self.checkStatus(pluginInfo)
pluginInfo['status'] = False
return pluginInfo
pInfo['status'] = False
return pInfo
def makeCoexist(self, data):
plugins_info = []

@ -122,12 +122,11 @@ function getSList(isdisplay) {
}
}
var isTask = plugin.task;
if (plugin.task == '-2') {
handle = '<a style="color:green;" href="javascript:task();">正在卸载...</a>';
} else if (plugin.task == '-1') {
handle = '<a style="color:green;" href="javascript:task();">正在安装...</a>';
} else if (isTask == '0') {
} else if (plugin.task == '0') {
handle = '<a style="color:#C0C0C0;" href="javascript:task();">等待中...</a>';
}

Loading…
Cancel
Save