From ae6f798d0f0f23b0240b83f93b249b76227e3a42 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Sun, 21 Feb 2016 20:53:35 +0100 Subject: [PATCH] created sync for server --- web/Gemfile | 1 + web/Gemfile.lock | 2 ++ web/README.md | 2 +- web/app/assets/javascripts/application.js | 14 +++++++++++ .../views/configuration_files/update.html.erb | 4 ++-- web/app/views/layouts/application.html.erb | 7 ++++++ web/app/views/servers/show.html.erb | 24 +++++++++++++++++++ 7 files changed, 51 insertions(+), 3 deletions(-) diff --git a/web/Gemfile b/web/Gemfile index 86fb28c..6c01f86 100644 --- a/web/Gemfile +++ b/web/Gemfile @@ -26,6 +26,7 @@ gem 'active_scaffold' gem 'bootstrap', '~> 4.0.0.alpha3' gem 'ace-rails-ap' gem 'puma' +gem 'breadcrumbs_on_rails' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' diff --git a/web/Gemfile.lock b/web/Gemfile.lock index da41155..f227892 100644 --- a/web/Gemfile.lock +++ b/web/Gemfile.lock @@ -50,6 +50,7 @@ GEM bootstrap (4.0.0.alpha3) autoprefixer-rails (>= 6.0.3) sass (>= 3.4.19) + breadcrumbs_on_rails (2.3.1) builder (3.2.2) byebug (8.2.2) coffee-rails (4.1.1) @@ -170,6 +171,7 @@ DEPENDENCIES ace-rails-ap active_scaffold bootstrap (~> 4.0.0.alpha3) + breadcrumbs_on_rails byebug coffee-rails (~> 4.1.0) jbuilder (~> 2.0) diff --git a/web/README.md b/web/README.md index b00be6b..d18ba6e 100644 --- a/web/README.md +++ b/web/README.md @@ -1,4 +1,4 @@ -=== README === +=== README This README would normally document whatever steps are necessary to get the application up and running. diff --git a/web/app/assets/javascripts/application.js b/web/app/assets/javascripts/application.js index dcfd7c9..820f82d 100644 --- a/web/app/assets/javascripts/application.js +++ b/web/app/assets/javascripts/application.js @@ -20,3 +20,17 @@ //= require ace/mode-apache_conf //= require ace/mode-ini //= require ace/mode-dockerfile + +// $(".click-to-select-all").click(function() { +// var $this = $(this); +// $this.select(); +// +// // Work around Chrome's little problem +// $this.mouseup(function() { +// // Prevent further mouseup intervention +// $this.unbind("mouseup"); +// return false; +// }); +// }); + +$(".click-to-select-all").click(function() { $(this).select(); }); diff --git a/web/app/views/configuration_files/update.html.erb b/web/app/views/configuration_files/update.html.erb index 02bd0ef..6d9e9da 100644 --- a/web/app/views/configuration_files/update.html.erb +++ b/web/app/views/configuration_files/update.html.erb @@ -42,12 +42,12 @@
<% command = pull_command(@record) %> CHUB -> Your Server
- <%= text_field_tag 'command_pull', command, readonly: true, class: 'form-control-sm', size: command.length %> + <%= text_field_tag 'command_pull', command, readonly: true, class: 'form-control-sm click-to-select-all', size: command.length %>
<% command = push_command(@record) %> Your Server -> CHUB
- <%= text_field_tag 'command_push', command, readonly: true, class: 'form-control-sm', size: command.length %> + <%= text_field_tag 'command_push', command, readonly: true, class: 'form-control-sm click-to-select-all', size: command.length %>
diff --git a/web/app/views/layouts/application.html.erb b/web/app/views/layouts/application.html.erb index 910626b..fa9b2c0 100644 --- a/web/app/views/layouts/application.html.erb +++ b/web/app/views/layouts/application.html.erb @@ -14,5 +14,12 @@ CHUB
<%= yield %>
+ + diff --git a/web/app/views/servers/show.html.erb b/web/app/views/servers/show.html.erb index b122cbe..73a0aa7 100644 --- a/web/app/views/servers/show.html.erb +++ b/web/app/views/servers/show.html.erb @@ -60,6 +60,30 @@ + <% + pull_commands = @record.configuration_files.map do |file| + pull_command(file) + end.join("\n") + + push_commands = @record.configuration_files.map do |file| + push_command(file) + end.join("\n") + + %> +

Sync Server:

+
+
+ + CHUB -> Your Server
+ <%= text_area_tag 'command_pull', pull_commands, readonly: true, class: 'form-control-sm click-to-select-all', size: "80x10" %> +
+
+ Your Server -> CHUB
+ <%= text_area_tag 'command_push', push_commands, readonly: true, class: 'form-control-sm click-to-select-all', size: "80x10" %> +
+
+ + <% end %>