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
Observer plugins #1954
Observer plugins #1954
Conversation
Very nice! Will be great to have a simple example for this. |
Well, working on one. First step was to allow plugin. |
Any one can look my question? Thanks. |
Please send your questions on erlang mailing list, slack or bugs.erlang.org. Not the right place. |
dbc4b0d
to
f360b3b
Compare
@codeadict I just pushed an example in commit 590eda0 |
6713841
to
590eda0
Compare
lib/observer/doc/src/observer_ug.xml
Outdated
|
||
terminate(_Reason, _State = #state{frame=Frame}) -> | ||
wxMiniFrame:destroy(Frame), | ||
%wx:destroy() % DO NOT or observer will be closed too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should go outside in Bold or as a warning. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like:
<warning>
<p>To prevent the observer from being closed, please do not call
<c>wx:destroy()</c> from your plugins.</p>
</warning>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will consider this
Hey, it looks very clear to me, will try compiling and adding this sample plugin tomorrow. |
Why the limitation on 10 plugins? If a limitation is needed, maybe it should be 10 active plugins, with some UI to enable/disable plugins. If there is already this and I missed it, please disregard. Otherwise I like this idea very much, being able to add Cowboy/Ranch-specific info to Observer has been on the back of my mind for a while. |
Please fix travis errors above: (dialyzer, doc) |
@essen menu entries in wx are handled as integers and event match needs to checks that this ID integer is a plugin menu (and not another ID for another menu), so needs to limit the number between a lower and upper bound (declared as defines in beginning of code). 10 is not a limit, it was arbitrary chosen. I can increase this, but maybe need @dgud opinion. As plugins are declared in observer config, I'm not sure how I can add an UI to tell that this plugin is active or not. Simply add only useful plugin in config for your node ? |
@dgud thanks for the feedback. Indeed my editor has a diff tool that do not care of trailing whitespace... need to fix this config. |
95454f8
to
451e13c
Compare
@dgud fixes are squashed. CI seems OK. |
I don't like (nor understand) the usage of runtime_tools env, why can't you use observers environment. |
Maybe I miss something but observer is not an application but comes with runtime_tools? Tell me if I m wrong |
The observer gui is part of the observer application, observer uses runtime_tools but it also uses stdlib and kernel and wx. |
Hum. I missed that observer is an application indeed. OK I will change that like it would have been since the beginning |
I was confused with the fact that runtime_tools need to be part of a release for node to be observed by observer. Sorry |
0e77e13
to
750d961
Compare
efad55f
to
9619d43
Compare
Add documentation Add simple example of plugin
9619d43
to
7fb057b
Compare
Fixed and squashed |
I have thought some on this PR and reached the conclusion that I want something better where I'm not against a plugin-api but want something better. I'm closing this for now. |
Agree, need tabs! Let's make this happen. |
This PR allow to add third party wx user interface plugins in Observer.
Plugins have to be declared in observer configuration.
Plugin can receive current observed node as start argument if needed.