Commit graph

42 commits

Author SHA1 Message Date
Dominik Sander
26e878c61a Fix the rest of the deprecation warnings 2016-10-05 22:47:38 +02:00
Dominik Sander
42b132017f Rescue from AR:SubclassNotFound and allow to delete agents
Especially when using Agent gems it happens that an Agent was deleted from the gem or the user removed a gem from the
configuration. Instead of failing with an Internal Server Error the user now is offered to delete all undefined agents.

`type.constantize` is needed to invoke the Rails auto_loader in development since not all Agent classes are loaded when
the application boots.
2016-09-21 20:10:49 +02:00
Dominik Sander
b2f031003f Use strong_parameters and drop protected_attributes
* Ensure admin attribute can not be set at sign up and the agents user_id is not changeable
* Remove ACCESSIBLE_ATTRIBUTES from the User model
* Remove side effect on agent_params from AgentsController#build_agent
2016-09-12 15:54:26 +02:00
Dominik Sander
d573b98a68 Show recently received events in dry run modal 2016-05-18 09:58:49 +02:00
George Opritescu
ad4a15d6da Added button to toggle visibility of disabled agents (#1464)
Added button to toggle visibility of disabled agents

* Moved index code to separate file

* Added cookie to allow toggling visibility of disabled agents

* Filter disabled agents based on cookie

* Removed js and use correct cookie name

* CR changes
2016-05-10 22:52:30 +02:00
Dominik Sander
73bcd927e3 Do not run/enqueue event propagation when a AgentPropagateJob is already enqueued
Fixes the creation of duplicated events caused by Agent.receive! running multiple times concurrently.
2016-04-17 17:15:50 +02:00
Andrew Cantino
7476d7dcf1 Add column with default sort to prioritize new Agents in the index view 2016-03-13 13:27:49 -07:00
Andrew Cantino
41f4d6e339 handle return paths mroe gracefully from "Back" in Agent show 2015-09-01 19:57:16 -07:00
Andrew Cantino
8713dce4d8 integrate @knu's suggestions 2015-08-16 16:05:22 -07:00
Andrew Cantino
ce84f159e0 There is a button to add a new Agent directly in a Scenario; deleting an Agent from its show page no longer 404s; there is a button to destroy all delayed_jobs 2015-08-14 21:51:13 -07:00
Akinori MUSHA
fe857bc6f0 Make the dry_run action accept an event payload 2015-07-29 22:38:52 +09:00
Akinori MUSHA
8eaaff410a Always use POST for dry_run 2015-07-29 22:32:03 +09:00
Akinori MUSHA
e3f090ade8 Properly redirect to /agents after creating a new agent 2015-07-04 04:04:00 +09:00
Akinori MUSHA
9ec2f17506 Fix PUT /agents/:id redirecting to the edit page by default 2015-06-30 10:18:39 +09:00
Akinori MUSHA
5854566c64 AgentsController#redirect_back: Use the referrer when appropriate 2015-06-30 09:54:45 +09:00
Akinori MUSHA
15378aa006 Add "Dry Run" to the action menu 2015-05-19 22:14:52 +09:00
Akinori MUSHA
a080a78eeb Allow user to clear memory of an agent
This closes #802.
2015-04-24 23:16:52 +09:00
Akinori MUSHA
05f98cac61 Show error messages when trying to dry-run an invalid agent. 2015-03-14 04:54:34 +09:00
Akinori MUSHA
979f803759 Add a "Dry Run" feature to the Agent form.
User can test if an agent being saved will work as expected simply by
clicking the "Dry Run" button, which opens up a modal window that shows
dry-run results including log, events and memory.  Resolves #593.

The current implementation only allows dry-run of Agents that do not
require an incoming event to be run.

Also, each Agent class must opt in for this feature by declaring
themselves as `can_dry_run!`.  To begin with, only WebsiteAgent is
marked as dry-runnable for now.
2015-03-14 04:52:44 +09:00
KimJungHun
bfcec46e45 Update agents_controller.rb
I don't consider if the @agent variable is not present.
So I changed it again.
2015-02-24 19:29:13 +09:00
KimJungHun
b939a27526 Update agents_controller.rb
"@agent.destroyed?" is more simple and obvious than "message.include?("deleted")"
2015-02-24 17:59:00 +09:00
KimJungHun
073b80a5cc Update agents_controller.rb
When user stay agent details page, user can use action.

But user use "Delete agent" action, then exception error is occurred.

When action of "Delete agent" run, destory is called, it call "redirect_back".

Although @agent is destroyed, redirect_back used "path = agent_path(@agent)" .

So I add for this case.

if message include "deleted", redirect_back is called by destroy.

then redirect_back use "path = agents_path".
2015-02-24 15:49:47 +09:00
Dominik Sander
60956c49b9 Added a concern to configure Agents via HTML forms
Validate input forms based on a callback
Offer valid options for parameters
2014-11-02 01:23:42 +01:00
Andrew Cantino
4bb833fd89 Minor refector to avoid global @agent 2014-09-17 21:39:27 -07:00
Andrew Cantino
77723a91d5 tables can be sorted; optimized Agents load slightly 2014-09-10 00:23:14 -07:00
Akinori MUSHA
69d2273221 Add can_control_other_agents to the response hash of type_details. 2014-09-03 13:10:59 +09:00
Dominik Sander
0c020d922c Moved the service dropdown into a partial 2014-08-10 13:29:20 +02:00
Alex Coomans
15e3f0a33d Break Diagram into it's own controller, nest resources
Conflicts:
	app/views/scenarios/show.html.erb
2014-07-31 16:42:58 -07:00
Andrew Cantino
8c18160e15 fix missing default schedule usage when making an agent 2014-06-28 00:27:42 +02:00
Andrew Cantino
cd5c7060fb integrate dsander's suggestions 2014-06-09 19:32:00 -07:00
Andrew Cantino
b91faf62a0 easier removal of agents from scenarios via the menu 2014-06-01 00:24:35 -07:00
Andrew Cantino
b25c38c45e better handling of return paths, and more specs 2014-05-31 15:47:22 -07:00
Glenn 'devalias' Grant
9b86bce9c1 Changes based on @cantino's comments
* Changed line-through to opacity: 0.5
* Removed 'def disable' in favour of put
* Remove disabled checkbox from form
2014-04-28 20:23:49 +10:00
Glenn 'devalias' Grant
03ceab8da5 Merge branch 'master' into 196-disable-agents
Conflicts:
	app/views/agents/diagram.html.erb
	app/views/agents/show.html.erb

Manually Edited:
	app/helpers/dot_helper.rb
2014-04-28 19:25:04 +10:00
Akinori MUSHA
47fb2894a1 Add a "Clone" button in agents#show.
- Make agents#new take an optional :id for creating a clone of an
  existing agent of the user.

- Delay the call for $(".select2").select2() so filled-in values of
  sources can take effect.
2014-04-25 21:44:48 +09:00
Akinori MUSHA
71f7921fb9 Move DOT stuff into a new helper named DotHelper, adding some specs. 2014-04-24 23:16:47 +09:00
Glenn 'devalias' Grant
9e935ce74e [196-Disable] Update agent index, controller, css, etc to show disabled state 2014-04-09 20:39:29 +10:00
Andrew Cantino
229e24ea80 add keep_events_for as an optional field for agents to decide how long to store events 2013-12-22 14:30:02 -08:00
Andrew Cantino
8d7dde6fb5 Add a POST endpoint called handle_details_post that Agents' details views can use to send data to the Agent from the UI. Add a new ManualEventAgent that uses the handle_details_post functionality to create simple events on demand for testing / debugging. 2013-09-06 23:46:31 -07:00
Andrew Cantino
00727fbd4d add Agent Logs; add logging to WebsiteAgent; refactor flash notices and add event notices 2013-08-24 22:46:57 -06:00
Andrew Cantino
eead335705 switch to class methods and ids to shorten the payload size of serialized delayed_jobs 2013-03-23 15:12:39 -07:00
Andrew Cantino
620acffa5a initial commit 2013-03-09 22:36:12 -08:00