This commit is contained in:
flaskfarm
2022-10-27 06:14:29 +09:00
parent 24db9ff5c1
commit cb422de218
6 changed files with 20 additions and 13 deletions

View File

@@ -76,8 +76,8 @@ class PluginManager:
if _ in plugin_loading_list: if _ in plugin_loading_list:
new_plugins.append(_) new_plugins.append(_)
else: else:
cls.all_package_list[t]['loading'] = False cls.all_package_list[_]['loading'] = False
cls.all_package_list[t]['status'] = 'not_include_loading_list' cls.all_package_list[_]['status'] = 'not_include_loading_list'
plugins = new_plugins plugins = new_plugins
except Exception as exception: except Exception as exception:
F.logger.error('Exception:%s', exception) F.logger.error('Exception:%s', exception)
@@ -92,8 +92,8 @@ class PluginManager:
if _ not in plugin_except_list: if _ not in plugin_except_list:
new_plugins.append(_) new_plugins.append(_)
else: else:
cls.all_package_list[t]['loading'] = False cls.all_package_list[_]['loading'] = False
cls.all_package_list[t]['status'] = 'include_except_list' cls.all_package_list[_]['status'] = 'include_except_list'
plugins = new_plugins plugins = new_plugins
except Exception as exception: except Exception as exception:
F.logger.error('Exception:%s', exception) F.logger.error('Exception:%s', exception)

View File

@@ -1 +1 @@
VERSION="4.0.41" VERSION="4.0.42"

View File

@@ -13,6 +13,7 @@ class PluginModuleBase(object):
self.name = name self.name = name
self.socketio_list = None self.socketio_list = None
self.page_list = None self.page_list = None
self.web_list_model = None
def get_module(self, module_name): def get_module(self, module_name):
try: try:
@@ -143,6 +144,7 @@ class PluginPageBase(object):
self.name = name self.name = name
self.scheduler_desc = scheduler_desc self.scheduler_desc = scheduler_desc
self.socketio_list = None self.socketio_list = None
self.web_list_model = None
def process_menu(self, req): def process_menu(self, req):
try: try:

View File

@@ -102,12 +102,7 @@ def default_route(P):
def second_ajax(module_name, cmd): def second_ajax(module_name, cmd):
try: try:
for module in P.module_list: for module in P.module_list:
if module_name == module.name: if cmd == 'scheduler':
if cmd == 'command':
return module.process_command(request.form['command'], request.form.get('arg1'), request.form.get('arg2'), request.form.get('arg3'), request)
else:
return module.process_ajax(cmd, request)
elif cmd == 'scheduler':
go = request.form['scheduler'] go = request.form['scheduler']
if go == 'true': if go == 'true':
P.logic.scheduler_start(module_name) P.logic.scheduler_start(module_name)
@@ -123,6 +118,16 @@ def default_route(P):
elif cmd == 'immediately_execute': elif cmd == 'immediately_execute':
ret = P.logic.immediately_execute(module_name) ret = P.logic.immediately_execute(module_name)
return jsonify(ret) return jsonify(ret)
elif cmd == 'web_list':
model = P.logic.get_module(module_name).web_list_model
if model != None:
return jsonify(model.web_list(request))
if module_name == module.name:
if cmd == 'command':
return module.process_command(request.form['command'], request.form.get('arg1'), request.form.get('arg2'), request.form.get('arg3'), request)
else:
return module.process_ajax(cmd, request)
except Exception as exception: except Exception as exception:
P.logger.error('Exception:%s', exception) P.logger.error('Exception:%s', exception)
P.logger.error(traceback.format_exc()) P.logger.error(traceback.format_exc())

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long