This commit is contained in:
Mr Chen 2018-11-29 19:16:12 +08:00
parent 092494a216
commit 3d44b3014f
2 changed files with 14 additions and 1 deletions

View File

@ -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, '[]')

View File

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