diff --git a/app/controllers/kpm/nodes_info_controller.rb b/app/controllers/kpm/nodes_info_controller.rb index 40a4798..ea00fdc 100644 --- a/app/controllers/kpm/nodes_info_controller.rb +++ b/app/controllers/kpm/nodes_info_controller.rb @@ -8,6 +8,8 @@ class NodesInfoController < EngineController include ActionController::Live def index + @installing = !params[:i].blank? + @nodes_info = ::KillBillClient::Model::NodesInfo.nodes_info(options_for_klient) # For convenience, put pure OSGI bundles at the bottom @@ -76,7 +78,7 @@ def refresh def install_plugin trigger_node_plugin_command('INSTALL_PLUGIN') - redirect_to :action => :index + redirect_to nodes_info_index_path(:i => 1) end def uninstall_plugin diff --git a/app/views/kpm/nodes_info/index.html.erb b/app/views/kpm/nodes_info/index.html.erb index 9d8fa9e..a16de23 100644 --- a/app/views/kpm/nodes_info/index.html.erb +++ b/app/views/kpm/nodes_info/index.html.erb @@ -3,6 +3,7 @@

Configured instances + <%= link_to(' Operation complete, reload page'.html_safe, url_for, :id => "reload-page", :class => 'btn btn-xs text-success', :style => "display: none;") %> <% if kpm_plugin_installed?(@nodes_info) %>
@@ -46,7 +47,22 @@ setTimeout(fakeOperationComplete, 6000); }); + <%- if @installing %> + // Prevent other clicks + $('.plugin-link').removeAttr('data-remote') + .removeAttr('data-method') + .removeAttr('href') + $('#nodes-table-wrapper').css({ opacity: 0.5 }); + + $('#install-in-progress').show(); + $('#install-in-progress').children().addClass('fa-spin'); + + setTimeout(fakeOperationComplete, 6000); + <% end %> + function fakeOperationComplete() { + $('#install-in-progress').hide(); + $('.plugin-link').children().removeClass('fa-spin'); $('#nodes-table-wrapper').fadeTo("slow", 0.5); $('#reload-page').fadeIn("slow"); diff --git a/app/views/kpm/plugins/_form.html.erb b/app/views/kpm/plugins/_form.html.erb index 2463947..8a599f1 100644 --- a/app/views/kpm/plugins/_form.html.erb +++ b/app/views/kpm/plugins/_form.html.erb @@ -2,7 +2,7 @@
<%= label_tag :plugin_key, 'Plugin key', :class => 'col-sm-2 control-label' %>
- <%= text_field_tag :plugin_key, '', :class => 'form-control', :placeholder => 'Plugin key', :required => true %> + <%= text_field_tag :plugin_key, '', :class => 'form-control', :placeholder => 'Unique identifier for this plugin, e.g. myCompany:myPluginName', :required => true %>
@@ -14,7 +14,7 @@
<%= label_tag :plugin_uri, 'URI', :class => 'col-sm-2 control-label' %>
- <%= text_field_tag :plugin_uri, '', :class => 'form-control', :placeholder => 'Plugin URI', :required => true %> + <%= text_field_tag :plugin_uri, '', :class => 'form-control', :placeholder => 'HTTP(S) url accessible from all Kill Bill nodes', :required => true %>