pull/109/head
Mr Chen 7 years ago
parent 8c5149c1e1
commit 3f33f2d6c8
  1. 20
      class/core/plugin_api.py
  2. 2
      class/core/public.py
  3. 5
      route/plugins.py
  4. 10
      static/app/soft.js

@ -285,8 +285,12 @@ class plugin_api:
except Exception, e: except Exception, e:
print e print e
plugins_info = self.checkStatusMProcess(plugins_info) start = (page - 1) * pageSize
return plugins_info end = start + pageSize
_plugins_info = plugins_info[start:end]
_plugins_info = self.checkStatusMProcess(_plugins_info)
return (_plugins_info, len(plugins_info))
def makeListThread(self, data, sType='0'): def makeListThread(self, data, sType='0'):
plugins_info = [] plugins_info = []
@ -409,19 +413,21 @@ class plugin_api:
return plugins_info return plugins_info
def getPluginList(self, sType, sPage=1, sPageSize=15): def getPluginList(self, sType, sPage=1, sPageSize=10):
ret = {} ret = {}
ret['type'] = json.loads(public.readFile(self.__type)) ret['type'] = json.loads(public.readFile(self.__type))
# plugins_info = self.getAllListThread(sType) # plugins_info = self.getAllListThread(sType)
# plugins_info = self.getAllListProcess(sType) # plugins_info = self.getAllListProcess(sType)
plugins_info = self.getAllListPage(sType) data = self.getAllListPage(sType, sPage, sPageSize)
ret['data'] = data[0]
args = {} args = {}
args['count'] = len(plugins_info) args['count'] = data[1]
args['p1'] = sPage args['p'] = sPage
args['tojs'] = 'getSList'
args['row'] = sPageSize
ret['data'] = plugins_info
ret['list'] = public.getPage(args) ret['list'] = public.getPage(args)
return ret return ret

@ -77,7 +77,7 @@ def getPage(args, result='1,2,3,4,5,8'):
info['row'] = 10 info['row'] = 10
if args.has_key('row'): if args.has_key('row'):
info['row'] = args['row'] info['row'] = int(args['row'])
info['p'] = 1 info['p'] = 1
if args.has_key('p'): if args.has_key('p'):

@ -40,8 +40,9 @@ def file():
@plugins.route('/list', methods=['GET']) @plugins.route('/list', methods=['GET'])
def list(): def list():
typeVal = request.args.get('type', '0') sType = request.args.get('type', '0')
data = plugin_api.plugin_api().getPluginList(typeVal, 1) sPage = request.args.get('p', '1')
data = plugin_api.plugin_api().getPluginList(sType, int(sPage))
return public.getJson(data) return public.getJson(data)

@ -396,8 +396,8 @@ function indexSoft() {
}; };
} }
$(function() { // $(function() {
if (window.document.location.pathname == '/soft/') { // if (window.document.location.pathname == '/soft/') {
setInterval(function() { getSList(); }, 10000); // setInterval(function() { getSList(); }, 10000);
} // }
}); // });
Loading…
Cancel
Save