Class: ForemanProbing::ScansController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ForemanProbing::ScansController
- Defined in:
- app/controllers/foreman_probing/scans_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/foreman_probing/scans_controller.rb', line 15 def create @composer = ScanComposer.new_from_params(params[:foreman_probing_scan]) @scan = @composer.compose! @scan.save! task = ForemanTasks.async_task(::Actions::ForemanProbing::PerformScan, @scan, @scan.ports) @scan.task = task @scan.save! set_auto_refresh redirect_to @scan end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/foreman_probing/scans_controller.rb', line 4 def index @scans = resource_base.order(:id => 'desc').paginate(:page => params[:page]) end |
#new ⇒ Object
8 9 10 11 12 13 |
# File 'app/controllers/foreman_probing/scans_controller.rb', line 8 def new @scan = ForemanProbing::Scan.new @scan.target_kind = params.fetch(:target_kind, 'direct') @scan.search_query = params[:search_query] @scan.targeting = ::ForemanProbing::Targeting.new end |
#rerun ⇒ Object
28 29 30 31 32 33 |
# File 'app/controllers/foreman_probing/scans_controller.rb', line 28 def rerun composer = ScanComposer.new_from_scan(ForemanProbing::Scan.find(params['id'])) @scan = composer.compose! render :action => 'new' end |
#show ⇒ Object
35 36 37 38 |
# File 'app/controllers/foreman_probing/scans_controller.rb', line 35 def show @scan = ::ForemanProbing::Scan.find(params['id']) set_auto_refresh end |