sinatra-hexacta 0.8.0 → 0.8.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 +4 -4
- data/lib/sinatra/extensions/processmanager.rb +2 -2
- data/lib/sinatra/handlers/processes.rb +5 -4
- data/lib/sinatra/helpers/alerts.rb +4 -0
- data/lib/sinatra/public/css/app.min.1.css +36 -0
- data/lib/sinatra/public/img/noimage.jpg +0 -0
- data/lib/sinatra/public/js/process.js +87 -0
- data/lib/sinatra/views/alerts/process.slim +11 -0
- data/lib/sinatra/views/libraries/include_css.slim +1 -1
- data/lib/sinatra/views/libraries/include_js_before.slim +1 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94878352931180fed716175089275de8178feddbfd3d967864ff1781e6d6ef69
|
4
|
+
data.tar.gz: 8b51e6e2a13b4f90c56af20b7d35f4928556ad98e29b062ef0e5a78bd67f947b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81abe6f03be0934d7b718e1d952c9bbdfa44f1a35306b8c7fad085d1173e390830f3931de9f143d9a7b2569c224e54818392cc4878cf613e27c5c48109ae5d7d
|
7
|
+
data.tar.gz: 806507f14e95da83d1e69fa514966c83e92c5cc8d217a1965c44136a923d823070e2901e70ed2c57dca1daefa33f9fd58bb20331f56309cdb6515b813a4be0d0
|
@@ -93,14 +93,14 @@ class ProcessManager
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def clean(clazz)
|
96
|
-
@handlers.select { |handler|
|
96
|
+
@handlers.select { |handler| handler.clazz == clazz }.each do |handler|
|
97
97
|
handler.interrupt
|
98
98
|
self.finish(handler)
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
102
|
def running?(clazz)
|
103
|
-
!@handlers.select { |handler| handler.clazz == clazz }.empty
|
103
|
+
!@handlers.select { |handler| handler.clazz == clazz }.empty?
|
104
104
|
end
|
105
105
|
|
106
106
|
end
|
@@ -9,16 +9,17 @@ module Sinatra
|
|
9
9
|
get '/processes' do
|
10
10
|
return "" if ProcessManager.instance.find(params[:class]).nil?
|
11
11
|
content_type :json
|
12
|
-
return {
|
12
|
+
return { 'name' => ProcessManager.instance.find(params[:class]).name, 'progress' => ProcessManager.instance.find(params[:class]).progress }.to_json
|
13
13
|
end
|
14
14
|
|
15
|
-
post '/processes/:
|
16
|
-
ProcessManager.instance.
|
15
|
+
post '/processes/:clazz' do |clazz|
|
16
|
+
ProcessManager.instance.clean(clazz)
|
17
|
+
200
|
17
18
|
end
|
18
19
|
|
19
20
|
post '/process' do
|
20
21
|
klass = Object.const_get("#{params[:class]}")
|
21
|
-
a_handler = ProcessManager.instance.run(klass)
|
22
|
+
a_handler = ProcessManager.instance.run(klass,params)
|
22
23
|
a_handler.to_json
|
23
24
|
end
|
24
25
|
end
|
@@ -23,6 +23,10 @@ module Sinatra
|
|
23
23
|
slim "#{Hexacta::GEM_FILE_DIR}/alerts/error".to_sym, locals: option_hash
|
24
24
|
end
|
25
25
|
|
26
|
+
def process_alert(option_hash)
|
27
|
+
slim "#{Hexacta::GEM_FILE_DIR}/alerts/process".to_sym, locals: option_hash
|
28
|
+
end
|
29
|
+
|
26
30
|
setup_dir("/app/views/#{Hexacta::GEM_FILE_DIR}/alerts")
|
27
31
|
copy_all_files("/lib/sinatra/views/alerts","/app/views/#{Hexacta::GEM_FILE_DIR}/alerts")
|
28
32
|
end
|
@@ -16387,3 +16387,39 @@ svg.ct-chart-bar, svg.ct-chart-line{
|
|
16387
16387
|
0% { width: 0; }
|
16388
16388
|
100% { width: 100%; }
|
16389
16389
|
}
|
16390
|
+
|
16391
|
+
@-webkit-keyframes rotating /* Safari and Chrome */ {
|
16392
|
+
from {
|
16393
|
+
-webkit-transform: rotate(0deg);
|
16394
|
+
-o-transform: rotate(0deg);
|
16395
|
+
transform: rotate(0deg);
|
16396
|
+
}
|
16397
|
+
to {
|
16398
|
+
-webkit-transform: rotate(360deg);
|
16399
|
+
-o-transform: rotate(360deg);
|
16400
|
+
transform: rotate(360deg);
|
16401
|
+
}
|
16402
|
+
}
|
16403
|
+
@keyframes rotating {
|
16404
|
+
from {
|
16405
|
+
-ms-transform: rotate(0deg);
|
16406
|
+
-moz-transform: rotate(0deg);
|
16407
|
+
-webkit-transform: rotate(0deg);
|
16408
|
+
-o-transform: rotate(0deg);
|
16409
|
+
transform: rotate(0deg);
|
16410
|
+
}
|
16411
|
+
to {
|
16412
|
+
-ms-transform: rotate(360deg);
|
16413
|
+
-moz-transform: rotate(360deg);
|
16414
|
+
-webkit-transform: rotate(360deg);
|
16415
|
+
-o-transform: rotate(360deg);
|
16416
|
+
transform: rotate(360deg);
|
16417
|
+
}
|
16418
|
+
}
|
16419
|
+
.rotating {
|
16420
|
+
-webkit-animation: rotating 2s linear infinite;
|
16421
|
+
-moz-animation: rotating 2s linear infinite;
|
16422
|
+
-ms-animation: rotating 2s linear infinite;
|
16423
|
+
-o-animation: rotating 2s linear infinite;
|
16424
|
+
animation: rotating 2s linear infinite;
|
16425
|
+
}
|
Binary file
|
@@ -0,0 +1,87 @@
|
|
1
|
+
class ProcessManager {
|
2
|
+
|
3
|
+
static show(clazz) {
|
4
|
+
$("#processes").css("height","80px");
|
5
|
+
$("#processes .title").html(clazz);
|
6
|
+
}
|
7
|
+
|
8
|
+
static hide() {
|
9
|
+
$("#processes").css("height","0px");
|
10
|
+
}
|
11
|
+
|
12
|
+
static update(progress) {
|
13
|
+
$("#processes .progress-bar").css("width",progress + "%");
|
14
|
+
}
|
15
|
+
|
16
|
+
static complete() {
|
17
|
+
$("#processes .progress-bar").css("width","100%");
|
18
|
+
$("#processes .rotating").removeClass("rotating");
|
19
|
+
$("#processes .zmdi").removeClass("zmdi-settings").addClass("zmdi-check-circle");
|
20
|
+
$("#processes .progress").removeClass("active");
|
21
|
+
$("#processes .progress-bar").addClass("progress-bar-success");
|
22
|
+
$("#processes .detail").html("Completado. Refresca la pantalla para actualizar la información.");
|
23
|
+
}
|
24
|
+
|
25
|
+
static start(clazz) {
|
26
|
+
$.ajax({
|
27
|
+
url: "/process",
|
28
|
+
type: 'POST',
|
29
|
+
data: { class : clazz },
|
30
|
+
success: function(result) {
|
31
|
+
ProcessManager.show('Cargando...');
|
32
|
+
ProcessManager.update(0);
|
33
|
+
},
|
34
|
+
error: function(error) {
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
|
39
|
+
static start_with_map(clazz,map) {
|
40
|
+
map['class'] = clazz;
|
41
|
+
$.ajax({
|
42
|
+
url: "/process",
|
43
|
+
type: 'POST',
|
44
|
+
data: map,
|
45
|
+
success: function(result) {
|
46
|
+
ProcessManager.show('Cargando...');
|
47
|
+
ProcessManager.update(0);
|
48
|
+
},
|
49
|
+
error: function(error) {
|
50
|
+
}
|
51
|
+
});
|
52
|
+
}
|
53
|
+
|
54
|
+
static getProcesses(clazz) {
|
55
|
+
$.ajax({
|
56
|
+
url: "/processes",
|
57
|
+
type: 'GET',
|
58
|
+
data: { class : clazz },
|
59
|
+
success: function(result) {
|
60
|
+
if (result != "") {
|
61
|
+
if (result.progress >= 100.0) {
|
62
|
+
//ProcessManager.hide();
|
63
|
+
ProcessManager.complete()
|
64
|
+
ProcessManager.cleanProcess(clazz);
|
65
|
+
} else {
|
66
|
+
ProcessManager.show(result.name);
|
67
|
+
}
|
68
|
+
ProcessManager.update(result.progress);
|
69
|
+
|
70
|
+
}
|
71
|
+
},
|
72
|
+
error: function(error) {
|
73
|
+
}
|
74
|
+
});
|
75
|
+
}
|
76
|
+
|
77
|
+
static cleanProcess(clazz) {
|
78
|
+
$.ajax({
|
79
|
+
url: "/processes/" + clazz,
|
80
|
+
type: 'POST',
|
81
|
+
success: function(result) {
|
82
|
+
},
|
83
|
+
error: function(error) {
|
84
|
+
}
|
85
|
+
});
|
86
|
+
}
|
87
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.row#processes style="height:0px;overflow: hidden;-webkit-transition: all 0.5s ease-in-out;-o-transition: all 0.5s ease-in-out;transition: all 0.5s ease-in-out;"
|
2
|
+
.col-xs-12
|
3
|
+
.progress.progress-striped.active style="height:80px;"
|
4
|
+
.progress-bar aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" style="width: 0%;text-align:left;"
|
5
|
+
.lv-item.p-20.p-fixed
|
6
|
+
.media
|
7
|
+
.pull-left
|
8
|
+
i.zmdi.zmdi-hc-3x.zmdi-settings.c-white.rotating
|
9
|
+
.media-body
|
10
|
+
.lv-title.c-white.title
|
11
|
+
small.lv-small.c-white.detail Espera por favor...
|
@@ -29,7 +29,7 @@ link href="/sinatra-hexacta/vendors/daterangepicker/daterangepicker.css" rel="st
|
|
29
29
|
link href="/sinatra-hexacta/vendors/fullcalendar/main.min.css" rel="stylesheet"
|
30
30
|
|
31
31
|
/year calendar
|
32
|
-
link href="/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.css" rel="stylesheet"
|
32
|
+
link href="/sinatra-hexacta/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.css" rel="stylesheet"
|
33
33
|
|
34
34
|
/general app
|
35
35
|
link href="/sinatra-hexacta/css/app.min.1.css?version=#{settings.version}" rel="stylesheet"
|
@@ -8,3 +8,4 @@ script src="/sinatra-hexacta/vendors/chartist/chartist-plugin-legend.js"
|
|
8
8
|
|
9
9
|
script src="/sinatra-hexacta/js/app.js?ver=#{settings.version}" type='text/javascript'
|
10
10
|
script src="/sinatra-hexacta/js/finder.js?ver=#{settings.version}" type='text/javascript'
|
11
|
+
script src="/sinatra-hexacta/js/process.js?ver=#{settings.version}" type='text/javascript'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-hexacta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Zanger
|
@@ -125,10 +125,12 @@ files:
|
|
125
125
|
- lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.ttf
|
126
126
|
- lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.woff
|
127
127
|
- lib/sinatra/public/img/finder.jpg
|
128
|
+
- lib/sinatra/public/img/noimage.jpg
|
128
129
|
- lib/sinatra/public/img/select.png
|
129
130
|
- lib/sinatra/public/img/select@2x.png
|
130
131
|
- lib/sinatra/public/js/app.js
|
131
132
|
- lib/sinatra/public/js/finder.js
|
133
|
+
- lib/sinatra/public/js/process.js
|
132
134
|
- lib/sinatra/public/vendors/animate.css/animate.min.css
|
133
135
|
- lib/sinatra/public/vendors/bootstrap-validator/validator.js
|
134
136
|
- lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.es.js
|
@@ -174,6 +176,7 @@ files:
|
|
174
176
|
- lib/sinatra/views/alerts/empty.slim
|
175
177
|
- lib/sinatra/views/alerts/error.slim
|
176
178
|
- lib/sinatra/views/alerts/info.slim
|
179
|
+
- lib/sinatra/views/alerts/process.slim
|
177
180
|
- lib/sinatra/views/alerts/success.slim
|
178
181
|
- lib/sinatra/views/alerts/warning.slim
|
179
182
|
- lib/sinatra/views/charts/bar.slim
|