linkkf 로직수정중
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import shutil
|
||||
|
||||
from support import SupportFile
|
||||
from support import SupportFile, SupportYaml
|
||||
|
||||
from .setup import *
|
||||
|
||||
name = 'plugin'
|
||||
|
||||
class ModulePlugin(PluginModuleBase):
|
||||
|
||||
def __init__(self, P):
|
||||
super(ModulePlugin, self).__init__(P, name=name, first_menu='list')
|
||||
self.all_plugin_list = None
|
||||
|
||||
|
||||
def process_menu(self, page, req):
|
||||
@@ -36,14 +38,16 @@ class ModulePlugin(PluginModuleBase):
|
||||
"""
|
||||
for name, entity in F.PluginManager.all_package_list.items():
|
||||
try:
|
||||
if entity.get('version') == '3':
|
||||
#data.append(entity)
|
||||
data.append({'package_name':name})
|
||||
else:
|
||||
if 'P' in entity:
|
||||
data.append(entity['P'].plugin_info)
|
||||
data[-1]['loading'] = entity.get('loading')
|
||||
data[-1]['status'] = entity.get('status')
|
||||
data[-1]['log'] = entity.get('log')
|
||||
else:
|
||||
data.append({'package_name':name})
|
||||
data[-1]['loading'] = entity.get('loading')
|
||||
data[-1]['status'] = entity.get('status')
|
||||
data[-1]['log'] = entity.get('log')
|
||||
except Exception as e:
|
||||
data.append({'package_name':name})
|
||||
P.logger.error(f'Exception:{str(e)}')
|
||||
@@ -64,6 +68,36 @@ class ModulePlugin(PluginModuleBase):
|
||||
else:
|
||||
ret['msg'] = info['path'] + "<br>폴더가 없습니다."
|
||||
ret['ret'] = 'danger'
|
||||
elif command == 'get_plugin_list_all':
|
||||
if self.all_plugin_list == None:
|
||||
filepath = os.path.join(os.path.dirname(__file__), 'files', 'all_plugin.yaml')
|
||||
self.all_plugin_list = SupportYaml.read_yaml(filepath)
|
||||
|
||||
def get_plugin(_name):
|
||||
for _cate in self.all_plugin_list:
|
||||
for _plugin in _cate['list']:
|
||||
if _plugin['package_name'] == _name:
|
||||
P.logger.info(_name)
|
||||
if _name == 'ff_reystream':
|
||||
P.logger.info(_name)
|
||||
return _plugin
|
||||
|
||||
|
||||
for name, entity in F.PluginManager.all_package_list.items():
|
||||
try:
|
||||
_plugin = get_plugin(name)
|
||||
if _plugin != None:
|
||||
_plugin['loading'] = entity.get('loading')
|
||||
_plugin['status'] = entity.get('status')
|
||||
_plugin['log'] = entity.get('log')
|
||||
|
||||
_plugin['version'] = entity['P'].plugin_info['version']
|
||||
|
||||
except Exception as e:
|
||||
data.append({'package_name':name})
|
||||
P.logger.error(f'Exception:{str(e)}')
|
||||
P.logger.error(traceback.format_exc())
|
||||
ret['data'] = self.all_plugin_list
|
||||
return jsonify(ret)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user