This commit is contained in:
parent
092494a216
commit
3d44b3014f
|
|
@ -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…
Reference in New Issue