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:
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

@ -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'):

@ -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)

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