Skip to content

Commit

Permalink
Merge pull request #11 from killbill/fix-for-261
Browse files Browse the repository at this point in the history
Fixes for 261
  • Loading branch information
pierre authored Feb 4, 2020
2 parents 3224055 + f6b7fe3 commit 2ec0cc0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/controllers/kpm/nodes_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions app/views/kpm/nodes_info/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="column-block">

<h1>Configured instances
<div id="install-in-progress" class="btn btn-xs text-success" style="display: none;"><i class="fa fa-refresh"></i>&nbsp;Operation in progress</div>
<%= link_to('<i class="fa fa-refresh"></i>&nbsp;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) %>
<div class="pull-right">
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions app/views/kpm/plugins/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="form-group">
<%= label_tag :plugin_key, 'Plugin key', :class => 'col-sm-2 control-label' %>
<div class="col-sm-9">
<%= 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 %>
</div>
</div>
<div class="form-group">
Expand All @@ -14,7 +14,7 @@
<div class="form-group">
<%= label_tag :plugin_uri, 'URI', :class => 'col-sm-2 control-label' %>
<div class="col-sm-9">
<%= 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 %>
</div>
</div>
<div class='form-group'>
Expand Down

0 comments on commit 2ec0cc0

Please sign in to comment.