extface 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6818f18177daecafed4aae5cea77a7ff17f3ee83
4
- data.tar.gz: 761e1a4219e3c10875547338b0b5ddcb1875bc28
3
+ metadata.gz: f087805cac85a3a24f51cb71fd0a5b97d787f1ca
4
+ data.tar.gz: 80bcf72379c305197d1281f6b958e5e744b81009
5
5
  SHA512:
6
- metadata.gz: f76b369e71612f014876ed47136b20e3c61e66e93ea289b67dbd974aa9ffa7e467f1e5c9f3ffffd251b951a77e27a4a9e31166ab0d11eaa8300372b5e96da1b3
7
- data.tar.gz: e331e5dd136113e221d50fe83fc34efee58e0349d94a1fc2d05360a4fce8c23a33be9800b4a7a4964e0d8b41b8c2a7f8a15201cb9a7e32d32274ee9f486a1f43
6
+ metadata.gz: 03a6973e0839a3c9bbc13605ff74369b36170fc249815828d0a5f6b0f4b21a5a6937c35491c771a0dce5891a37381ab65f8e4021c72ecd18578d125d2156f5d7
7
+ data.tar.gz: 1a09107b86362f4b101f859f0c5f6e628eb09fd4a1c72e8788eed22c5761e7f2d2ecb09743cf817a987c403c9ee41ffc83fde37771e77874d2979323a23541b9
@@ -51,8 +51,8 @@ module Extface
51
51
 
52
52
  def test_page
53
53
  set_device
54
- job = @device.driveable.print_test_page
55
- render text: job_path(job)
54
+ @job = @device.driveable.print_test_page if params[:test_page]
55
+ render action: :show
56
56
  end
57
57
 
58
58
  private
@@ -54,6 +54,10 @@ module Extface
54
54
  response.stream.close
55
55
  end
56
56
 
57
+ def settings
58
+ render text: 'settings'
59
+ end
60
+
57
61
  private
58
62
  def device
59
63
  @device ||= extfaceable.extface_devices.find_by(uuid: params[:device_uuid])
@@ -39,6 +39,8 @@ module Extface
39
39
  p line
40
40
  end
41
41
  job.failed! e.message
42
+ ensure
43
+ ActiveRecord::Base.connection.close
42
44
  end
43
45
  end
44
46
  job
@@ -13,7 +13,7 @@
13
13
  <%= t( @device.new_record? ? '.new' : '.edit') %>
14
14
  </h3>
15
15
  </div>
16
-
16
+ <br />
17
17
  <%= render 'object_errors', object: f.object %>
18
18
 
19
19
  <%= form_group f, :name, :text_field %>
@@ -10,7 +10,7 @@
10
10
  <%= t('.devices') %>
11
11
  </h3>
12
12
  </div>
13
-
13
+ <br />
14
14
  <table class="table table-condensed table-stripped">
15
15
  <thead>
16
16
  <tr class='active'>
@@ -1,34 +1,69 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <strong>Uuid:</strong>
5
- <%= @device.uuid %>
6
- </p>
7
-
8
- <p>
9
- <strong>Name:</strong>
10
- <%= @device.name %>
11
- </p>
12
-
13
- <p>
14
- <strong>Extfaceable:</strong>
15
- <%= @device.extfaceable %>
16
- </p>
1
+ <div class="page-header nav">
2
+ <%= link_to 'Edit', edit_device_path(@device), class: 'btn btn-primary navbar-btn pull-right' %>
3
+ <h3 class='navbar-text'>
4
+ <%= link_to extface.root_path do %>
5
+ Extface<sup>&hearts;</sup>
6
+ <% end %>
7
+ &raquo;
8
+ <%= link_to t('.devices'), devices_path %>
9
+ &raquo;
10
+ <%= @device.name %>
11
+ </h3>
12
+ </div>
13
+ <br />
14
+ <% if @job.present? %>
15
+ <div class='alert alert-info job-monitor'>
16
+ See job #<%= @job.id %> execution progress at: <%= link_to job_url(@job), job_path(@job), target: :_blank %>
17
+ <div>
18
+ <div class='text-danger'>You need multi-threaded server to do that!</div>
19
+ <small>(Easiest workaraund: Include <%= link_to 'unicorn-rails', 'https://github.com/samuelkadolph/unicorn-rails', target: :_blank %> in your application)</small>
20
+ </div>
21
+ </div>
22
+ <% end %>
23
+ <div class='row'>
24
+ <div class='col-sm-6'>
25
+ <dl class="dl-horizontal">
26
+ <dt><%= t('.name') %></dt>
27
+ <dd><%= @device.name %></dd>
28
+
29
+ <dt><%= t('.parent') %></dt>
30
+ <dd><%= @device.extfaceable.composite_id %></dd>
31
+
32
+ <dt><%= t('.driver') %></dt>
33
+ <dd><%= @device.driver_name %></dd>
34
+ </dl>
35
+ </div>
36
+ <div class='col-sm-6'>
37
+ <dl class="dl-horizontal">
38
+ <dt><%= t('.created') %></dt>
39
+ <dd><%= distance_of_time_in_words_to_now @device.created_at %> ago</dd>
40
+
41
+ <dt><%= t('.successful_jobs') %></dt>
42
+ <dd>
43
+ <%= @device.jobs.count %>
44
+ (<%= t('.last') %>: <%= distance_of_time_in_words_to_now @device.jobs.maximum(:completed_at) %> ago)
45
+ </dd>
46
+
47
+ <dt><%= t('.failures') %></dt>
48
+ <dd>
49
+ <%= @device.jobs.count %>
50
+ (<%= t('.last') %>: <%= distance_of_time_in_words_to_now @device.jobs.maximum(:failed_at) %> ago)
51
+ </dd>
52
+
17
53
 
18
- <p>
19
- <strong>Driveable:</strong>
20
- <%= @device.driveable %>
21
- </p>
54
+ </dl>
55
+ </div>
56
+ </div>
22
57
 
23
- <%= link_to 'Edit', edit_device_path(@device) %> |
24
- <%= link_to 'Back', devices_path %>
25
- <br />
26
- Client Pull URL:
27
- <br />
28
- <%= extface.pull_url(@device.uuid) %>
29
- <br />
30
- <%= link_to 'Print Test Page', test_page_device_path(@device), remote:true %>
58
+ <dl class="dl-horizontal">
59
+ <dt><%= t('.client_pull_url') %></dt>
60
+ <dd><pre><%= extface.pull_url(@device.uuid) %></pre></dd>
61
+ </dl>
31
62
 
63
+ <hr />
64
+ <% if @device.print? %>
65
+ <%= button_to 'Print Test Page', test_page_device_path(@device), remote: true, name: :test_page, value: true, class: 'btn btn-warning' %>
66
+ <% end %>
32
67
 
33
68
  <h1>Jobs</h1>
34
69
  <table class='table'>
@@ -43,7 +78,7 @@ Client Pull URL:
43
78
  <th>Connected</th>
44
79
  </tr>
45
80
  </thead>
46
- <% @device.jobs.last(10).each do |job|%>
81
+ <% @device.jobs.last(10).reverse.each do |job|%>
47
82
  <tr>
48
83
  <td><%= job.id %></td>
49
84
  <td><%= job.created_at %></td>
@@ -0,0 +1 @@
1
+ <%= __FILE__.gsub(Rails.root.to_s, "") %>
@@ -1,14 +1,15 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Extface</title>
4
+ <title>Extface&hearts;</title>
5
5
  <%= stylesheet_link_tag "extface/application", media: "all" %>
6
+ <%= stylesheet_link_tag "http://getbootstrap.com/dist/css/bootstrap.min.css", medis: :all %>
6
7
  <%= javascript_include_tag "extface/application" %>
7
8
  <%= csrf_meta_tags %>
8
9
  </head>
9
10
  <body>
10
-
11
- <%= yield %>
12
-
11
+ <div class="container">
12
+ <%= yield %>
13
+ </div>
13
14
  </body>
14
15
  </html>
data/config/routes.rb CHANGED
@@ -3,10 +3,11 @@ Extface::Engine.routes.draw do
3
3
 
4
4
  resources :devices do
5
5
  resources :jobs, only: [:show]
6
- get :test_page, on: :member
6
+ post :test_page, on: :member
7
7
  end
8
8
 
9
9
  get ':device_uuid' => 'handler#pull', as: :pull
10
+ get ':device_uuid/settings' => 'handler#settings', as: :settings
10
11
  post ':device_uuid' => 'handler#push', as: :push
11
12
  root 'devices#index'
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module Extface
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.2
19
+ version: 4.0.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.2
26
+ version: 4.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +128,7 @@ files:
128
128
  - app/views/extface/devices/index.html.erb
129
129
  - app/views/extface/devices/show.html.erb
130
130
  - app/views/extface/driver/fixed_width_serial_cdr/_settings.html.erb
131
+ - app/views/extface/driver/generic_pos/_settings.html.erb
131
132
  - app/views/extface/driver/star_scp700/_settings.html.erb
132
133
  - app/views/extface/jobs/_form.html.erb
133
134
  - app/views/extface/jobs/edit.html.erb