From 3f33f2d6c859efa7406b19e57462ef96e1bbebd5 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 10 Dec 2018 17:27:09 +0800 Subject: [PATCH] update --- class/core/plugin_api.py | 20 +++++++++++++------- class/core/public.py | 2 +- route/plugins.py | 5 +++-- static/app/soft.js | 10 +++++----- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/class/core/plugin_api.py b/class/core/plugin_api.py index bb5288646..817b72857 100755 --- a/class/core/plugin_api.py +++ b/class/core/plugin_api.py @@ -285,8 +285,12 @@ class plugin_api: except Exception, e: print e - plugins_info = self.checkStatusMProcess(plugins_info) - return plugins_info + start = (page - 1) * pageSize + 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'): plugins_info = [] @@ -409,19 +413,21 @@ class plugin_api: return plugins_info - def getPluginList(self, sType, sPage=1, sPageSize=15): + def getPluginList(self, sType, sPage=1, sPageSize=10): ret = {} ret['type'] = json.loads(public.readFile(self.__type)) # plugins_info = self.getAllListThread(sType) # plugins_info = self.getAllListProcess(sType) - plugins_info = self.getAllListPage(sType) + data = self.getAllListPage(sType, sPage, sPageSize) + ret['data'] = data[0] args = {} - args['count'] = len(plugins_info) - args['p1'] = sPage + args['count'] = data[1] + args['p'] = sPage + args['tojs'] = 'getSList' + args['row'] = sPageSize - ret['data'] = plugins_info ret['list'] = public.getPage(args) return ret diff --git a/class/core/public.py b/class/core/public.py index 825cff733..8082cdb02 100755 --- a/class/core/public.py +++ b/class/core/public.py @@ -77,7 +77,7 @@ def getPage(args, result='1,2,3,4,5,8'): info['row'] = 10 if args.has_key('row'): - info['row'] = args['row'] + info['row'] = int(args['row']) info['p'] = 1 if args.has_key('p'): diff --git a/route/plugins.py b/route/plugins.py index 6c9e1279b..3b596ff97 100644 --- a/route/plugins.py +++ b/route/plugins.py @@ -40,8 +40,9 @@ def file(): @plugins.route('/list', methods=['GET']) def list(): - typeVal = request.args.get('type', '0') - data = plugin_api.plugin_api().getPluginList(typeVal, 1) + sType = request.args.get('type', '0') + sPage = request.args.get('p', '1') + data = plugin_api.plugin_api().getPluginList(sType, int(sPage)) return public.getJson(data) diff --git a/static/app/soft.js b/static/app/soft.js index c66db491a..68aacb398 100755 --- a/static/app/soft.js +++ b/static/app/soft.js @@ -396,8 +396,8 @@ function indexSoft() { }; } -$(function() { - if (window.document.location.pathname == '/soft/') { - setInterval(function() { getSList(); }, 10000); - } -}); \ No newline at end of file +// $(function() { +// if (window.document.location.pathname == '/soft/') { +// setInterval(function() { getSList(); }, 10000); +// } +// }); \ No newline at end of file