pull/109/head
Mr Chen 7 years ago
parent aa36b4bd36
commit 591b1fd551
  1. 7
      class/core/plugin_api.py
  2. 8
      route/plugins.py

@ -217,6 +217,13 @@ class plugin_api:
ret['list'] = public.getPage(args)
return ret
def getIndexList(self):
if not os.path.exists(self.__index):
public.writeFile(self.__index, '[]')
indexList = json.loads(public.readFile(self.__index))
return indexList
def addIndex(self, name, version):
if not os.path.exists(self.__index):
public.writeFile(self.__index, '[]')

@ -38,13 +38,19 @@ def file():
return c
@plugins.route('/list', methods=['GET', 'POST'])
@plugins.route('/list', methods=['GET'])
def list():
typeVal = request.args.get('type', '0')
data = plugin_api.plugin_api().getPluginList(typeVal, 1)
return public.getJson(data)
@plugins.route('/index_list', methods=['GET'])
def indexList():
data = plugin_api.plugin_api().getIndexList()
return public.getJson(data)
@plugins.route('/install', methods=['POST'])
def install():

Loading…
Cancel
Save