Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-On Engine for MHN #138

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Add-On Engine for MHN #138

wants to merge 20 commits into from

Conversation

mercolino
Copy link

I have been working on an add-on Engine for MHN, that will allow the integration of third party code into MHN to expand its features and capabilities while maintaining the main code intact, It is nearly finished except for possible bugs, documentation update and comments of the code (work in progress), but basically the things to consider are:

  • On the installation script there is a question that ask you to enable the add-on engine that saves a variable in config.py
    • If Add-On Engine is enabled then it shows a menu called Add-Ons, initially is empty because there are no add-ons
  • In config.py there is also another variable called DISABLED_ADDONS, to disable outside the web interface problematic add-ons
  • The menu settings changed, now there is a “User Settings” and an “Add-On” Settings
  • In the Add-On Settings you could load new add-ons
    • There is a folder in mhn called addon_examples, here you will find an example of the addon called hello_addon, and a .tar.gz file that is the compressed version of the directory and is used to load the add-ons through the web interface
    • You could load the .tar.gz file through the web interface, you can activate it at load or you could activate it later, when a new add-on is loaded you should restart the server so the mhn app could load the respective add-on
    • Once the plugin is loaded, you could activate or deactivate through the webpage, if there is a problem with the plugin that does not allow you to start mhn you could add it to config.py in DISABLED_ADDONS

I tried the follow the best I can the program logic, but there were a few things that I could not do, and these are:

  • The add-ons are basically blueprints loaded by the flask app at start through the init.py file, I could not find a way to refresh the blueprints without the need to restart the application
  • Normally the Posts of the forms are intercepted by main.js and posted using jquery using am JSON request, jquery and ajax does not support very well the multipart/form-data, but it is possible with FormData Objects the problem is that it generates an XMLHTTPRequest that it is not understand by flask. Now the form is handled by a regular post request.

But I am no expert, so, if you find a way to do this please let me know.

Attached are a few screenshots.....

screen shot 2015-03-11 at 18 16 49
screen shot 2015-03-11 at 18 17 10
screen shot 2015-03-11 at 18 17 21
screen shot 2015-03-11 at 18 16 35

I think that I didn't forgot anything, but if you have some questions please don't hesitate to ask....

@d1str0
Copy link
Collaborator

d1str0 commented Mar 14, 2019

@mercolino still interested in MHN? I haven't taken a look at this yet. Have you tried using this with the latest code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants