batch_manager 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/stylesheets/batch_manager/application.css +4 -0
- data/app/assets/stylesheets/batch_manager/batches.css +53 -0
- data/app/controllers/batch_manager/application_controller.rb +4 -0
- data/app/controllers/batch_manager/batches_controller.rb +17 -0
- data/app/views/batch_manager/batches/index.html.erb +42 -0
- data/app/views/layouts/batch_manager/application.html.erb +14 -0
- data/config/routes.rb +12 -0
- data/lib/batch_manager/version.rb +1 -1
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmNhYjY3YmRiN2ZlN2FlMDg5NmU1YmJiZmJkNTNjZTk4ZmM3ZDY2ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWZhY2Q5MWMyMzljZjkxNzYxYzc1YzM2NmNhNWY3ZDhjMDg5OTU4ZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTFkZGVmYzg5MjViY2RiYTdjZGMwZmNhOTBhOTNiMjYwN2EzNzBlNDUwMGJm
|
10
|
+
MzEyMmYzM2U5MDU0MmM1NGNjMzIwYjNkMTYzMWQzMWY1ZGJlZDlhMGQwNDEy
|
11
|
+
ZmM5Yzg5Zjc0ODY1Yzg5YjkwZDA0ZDAwZmYxOGQ0ZjY5ZjRmNWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWVmNjg1YTNlZDcxZDU3Yjg4NGMwZWE4NDZiNjMyMDM1NmMwYTViOGY4YTYz
|
14
|
+
OTIzNDY4M2QyYWJjMmQzNDcwMjIzNGI2NmNhN2JlZmZlODc5NDI0YTZjNWY2
|
15
|
+
MDBmNmYzZjNhOTMxMThiZTMzY2U5NjQ1ZTFlNzk2NjUxMzhkOGY=
|
@@ -0,0 +1,53 @@
|
|
1
|
+
body {
|
2
|
+
width: 1200px;
|
3
|
+
margin: 0 auto;
|
4
|
+
}
|
5
|
+
|
6
|
+
table {
|
7
|
+
width: 100%;
|
8
|
+
border-collapse:collapse;
|
9
|
+
border-spacing:0;
|
10
|
+
background-color:#ffffff;
|
11
|
+
empty-cells:show;
|
12
|
+
}
|
13
|
+
|
14
|
+
td, th {
|
15
|
+
border:1px solid #663300;
|
16
|
+
}
|
17
|
+
|
18
|
+
th {
|
19
|
+
color:#FFF;
|
20
|
+
background-color:#996633;
|
21
|
+
background-position:left top;
|
22
|
+
padding:0.1em 0.5em;
|
23
|
+
text-align:center;
|
24
|
+
}
|
25
|
+
|
26
|
+
th a {
|
27
|
+
color: #FFF;
|
28
|
+
text-decoration: underline;;
|
29
|
+
}
|
30
|
+
|
31
|
+
td {
|
32
|
+
padding:0.1em 0.5em;
|
33
|
+
}
|
34
|
+
|
35
|
+
tr.odd {
|
36
|
+
background-color:#ffffcc;
|
37
|
+
}
|
38
|
+
|
39
|
+
tr.attention {
|
40
|
+
background-color:#ffaaaa;
|
41
|
+
}
|
42
|
+
|
43
|
+
tr.disable {
|
44
|
+
background-color:#aaaaaa;
|
45
|
+
}
|
46
|
+
|
47
|
+
tr.even.disable {
|
48
|
+
background-color:#bbbbbb;
|
49
|
+
}
|
50
|
+
|
51
|
+
tr.odd.disable {
|
52
|
+
background-color:#bbbbaa;
|
53
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module BatchManager
|
2
|
+
class BatchesController < ApplicationController
|
3
|
+
def index
|
4
|
+
@details = BatchManager::Monitor.details
|
5
|
+
end
|
6
|
+
|
7
|
+
def exec
|
8
|
+
BatchManager::Executor.exec(params[:batch_name], :wet => params[:wet])
|
9
|
+
redirect_to(batch_manager_batches_url)
|
10
|
+
end
|
11
|
+
|
12
|
+
def log
|
13
|
+
log_file = BatchManager::Logger.log_file_path(params[:batch_name], params[:wet])
|
14
|
+
render :text => File.read(log_file).gsub("\n", "<br/>")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<h2>Batches</h2>
|
2
|
+
<table>
|
3
|
+
<tr>
|
4
|
+
<th>Managed?</th>
|
5
|
+
<th>Name</th>
|
6
|
+
<th>Ran/Limit</th>
|
7
|
+
<th>Last run at</th>
|
8
|
+
<th>Created at</th>
|
9
|
+
<th>Log</th>
|
10
|
+
<th></th>
|
11
|
+
</tr>
|
12
|
+
<% @details.each do |status| %>
|
13
|
+
<% schema_batch = status.schema_batch %>
|
14
|
+
<tr>
|
15
|
+
<td><%= status.managed?? "Yes" : "" %></td>
|
16
|
+
<td><%= status.name %></td>
|
17
|
+
<td style="text-align:right;"><%= schema_batch.try(:ran_times).to_i %>/<%= status.times_limit || 0 %></td>
|
18
|
+
<td style="text-align:center;">
|
19
|
+
<% if last_ran_at = schema_batch.try(:last_ran_at) %>
|
20
|
+
<%= last_ran_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
21
|
+
<% end %>
|
22
|
+
</td>
|
23
|
+
<td style="text-align:center;"><%= status.created_at.strftime('%Y-%m-%d %H:%M:%S') if status.created_at %></td>
|
24
|
+
<td style="text-align:center;">
|
25
|
+
<% if File.exist?(BatchManager::Logger.log_file_path(status.name)) %>
|
26
|
+
<%= link_to "dry", log_batches_url(:batch_name => status.name) %>
|
27
|
+
<% end %>
|
28
|
+
<% if File.exist?(BatchManager::Logger.log_file_path(status.name, true)) %>
|
29
|
+
<%= link_to "wet", log_batches_url(:batch_name => status.name, :wet => true) %>
|
30
|
+
<% end %>
|
31
|
+
</td>
|
32
|
+
<td style="text-align:center;">
|
33
|
+
<% if status.managed? %>
|
34
|
+
<%= link_to "dry run", exec_batches_url(:batch_name => status.name) %>
|
35
|
+
<% if status.can_run? %>
|
36
|
+
<%= link_to "wet run", exec_batches_url(:batch_name => status.name, :wet => true), :class => "danger", :onclick => "return confirm('Are you sure?')" %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
</td>
|
40
|
+
</tr>
|
41
|
+
<% end %>
|
42
|
+
</table>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>TestEngine</title>
|
5
|
+
<%= stylesheet_link_tag "batch_manager/application", :media => "all" %>
|
6
|
+
<%= javascript_include_tag "batch_manager/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: batch_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Weihu Chen
|
@@ -102,6 +102,13 @@ executables:
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
+
- app/assets/stylesheets/batch_manager/application.css
|
106
|
+
- app/assets/stylesheets/batch_manager/batches.css
|
107
|
+
- app/controllers/batch_manager/application_controller.rb
|
108
|
+
- app/controllers/batch_manager/batches_controller.rb
|
109
|
+
- app/views/batch_manager/batches/index.html.erb
|
110
|
+
- app/views/layouts/batch_manager/application.html.erb
|
111
|
+
- config/routes.rb
|
105
112
|
- bin/bm_exec
|
106
113
|
- lib/batch_manager/batch_status.rb
|
107
114
|
- lib/batch_manager/engine.rb
|