-
Notifications
You must be signed in to change notification settings - Fork 4
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
OCS Web control panel system for Agents #163
Conversation
Now ocsbow.js:OCSConnection handles all the reconnection stuff, and monitor.js just registers callbacks to populate the UI.
Each panel is rendered in its own "tab". No panels right now but see next commit...
Includes some fake_data_agent improvements to make control more interesting.
That way we the OCSConnection can manage reconnection and the AgentClients do not need to be recreated.
Use AgentList to monitor heartbeat feeds and callback to anyone who has subscribed to monitor a particular Agent. Turn stuff red when agent connection is lost.
…ribute The two new API calls are 'get_agent_class' and 'get_api', the latter of which returns a single blob with all tasks, processes, feeds, and the agent_class. These simplify the www control system (especially in that agent_class allows the right control panel to be associated with an agent instance). In current use, OCSAgent is constructed in ocs_agent.init_site_agent. The Agent codes typically only mention their class name when they call site_config.parse_args. So it convenient, though perhaps not the best design, to have parse_args simply add the agent_class to the args returned by parse_args, and have init_site_agent extract it from there.
This makes use of the new api calls (get_api and get_class_name), but will be operable even if not all Agents support them. Also a couple of bug fixes to tab activation; tab creationg + activation for debugging. Also some code cleanup.
- OcsUiHelper takes a client for setting up default start/stop actions - OcsUiHelper.dropdown (demonstrated in FakeData) - Rename OcsUiHelper.panel to .set_context - Rename OcsUiHelper.ind to .get - Rename OcsUiHelper.progress_bar to .progressbar
0da893b
to
9551d56
Compare
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.
This is great! Couple of small comments inline below. Other misc. thing I came across/questions I had:
- In testing I found I can start a delay task, but can't abort mid-delay.
- Is the name
delay_box
special in any way, or are we just trying to avoid a collision with the namedelay
. If I can make a UI suggestion, can we have the "Suggestions" drop down populate the "Delay (s)" field with the selected value? That way the "Delay" field is the definitive place for the delay parameter, and there is no potential confusion between selecting a suggestion and entering a value. set_boxes()
seems to be missing from the OcsUiHelper Method Reference
I should note that I've looked at the Python changes here, and the FakeDataAgent.js, but not most of the other .js or .html/.css.
I don't want to hold up moving forward on this, so maybe if the UI suggestion is good we should open an issue for it. Similarly for the abort functionality, I assume that should be working?
Thanks -- pushed fixes and will merge soon if there are no further objections.
|
Significant advancements to the OCS Web system. monitor.html now has a tabbed interface where panels can be opened for controlling and monitoring each Agent. A "generic" control panel can be opened, or a panel matched to the specific Agent Class can be used in order to provide operation-specific parameters.
This has significant documentation describing how to develop a new custom panel.
Description
This includes simple "specialized" panels for the Aggregator and FakeData agents, as well as the Generic panel. Simple panels for other agents can be made by copying the (fairly compact) examples these provide.
There are some changes to ocs/ocs_agent.py and site_config.py, in order to store and expose the Agent's class name (e.g. 'FakeDataAgent') to the world.
Motivation and Context
I don't believe there's an issue for this, but it's been the plan for a long time and has been re-re-re-requested recently.
How Has This Been Tested?
This has been tested with a combined docker+host OCS setup, using recent versions of Firefox and Chrome.
Types of changes
Checklist:
develop
branch.