created sync for server

This commit is contained in:
Senad Uka
2016-02-21 20:53:35 +01:00
parent 6fd266d7ea
commit ae6f798d0f
7 changed files with 51 additions and 3 deletions

View File

@@ -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'

View File

@@ -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)

View File

@@ -1,4 +1,4 @@
=== README ===
=== README
This README would normally document whatever steps are necessary to get the
application up and running.

View File

@@ -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(); });

View File

@@ -42,12 +42,12 @@
<div class="col-md-6">
<% command = pull_command(@record) %>
CHUB -> Your Server<br />
<%= 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 %>
</div>
<div class="col-md-6">
<% command = push_command(@record) %>
Your Server -> CHUB<br />
<%= 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 %>
</div>
</div>

View File

@@ -14,5 +14,12 @@ CHUB
<div class="container-fluid">
<%= yield %>
</div>
<footer>
<br /> <br />
<p>
Saburly Configuration Hub (c) 2016
</p>
</footer>
</body>
</html>

View File

@@ -60,6 +60,30 @@
</tbody>
</table>
<%
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")
%>
<h3>Sync Server: </h3>
<div class="row">
<div class="col-md-6">
CHUB -> Your Server<br />
<%= text_area_tag 'command_pull', pull_commands, readonly: true, class: 'form-control-sm click-to-select-all', size: "80x10" %>
</div>
<div class="col-md-6">
Your Server -> CHUB<br />
<%= text_area_tag 'command_push', push_commands, readonly: true, class: 'form-control-sm click-to-select-all', size: "80x10" %>
</div>
</div>
<% end %>
</div>