Sha256: b6edece66185e37acff3ec3a5555c2fb1d21a1bee580313e1e467c3ceb58bafe

Contents?: true

Size: 960 Bytes

Versions: 6

Compression:

Stored size: 960 Bytes

Contents

class PluginsController < ApplicationController
  def index
    redirect_to installed_plugins_path
  end

  def installed
    @plugins = Plugin.installed
  end

  def recommended
    @plugins = Plugin.recommended
  end

  def updated
    @plugins = Plugin.installed.reject{|plugin| plugin.latest_version? }
  end

  def install
    params[:plugins].each do |gem_name|
      GemInstaller.new.async.perform(gem_name)
    end
    redirect_to plugins_path
  end

  def uninstall
    params[:plugins].each do |gem_name|
      GemUninstaller.new.async.perform(gem_name)
    end
    redirect_to plugins_path
  end

  def upgrade
    GemInstaller.new.async.perform(params[:plugins][:name], params[:plugins][:version])
    redirect_to plugins_path
  end

  def bulk_upgrade
    params[:plugins].each do |gem_name|
      pl = Plugin.new(gem_name: gem_name)
      GemInstaller.new.async.perform(gem_name, pl.latest_version)
    end
    redirect_to plugins_path
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fluentd-ui-0.2.0 app/controllers/plugins_controller.rb
fluentd-ui-0.1.4 app/controllers/plugins_controller.rb
fluentd-ui-0.1.3 app/controllers/plugins_controller.rb
fluentd-ui-0.1.2 app/controllers/plugins_controller.rb
fluentd-ui-0.1.1 app/controllers/plugins_controller.rb
fluentd-ui-0.1.0 app/controllers/plugins_controller.rb