Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for 261 #11

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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