marty 5.1.2 → 5.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10af0b3690a8b11f6aee67bad8c10178d4e6b73c
4
- data.tar.gz: 3714e7d0a7d3d9130ee82c61dc27f533835627ab
3
+ metadata.gz: 721393c215b2dbf1013c0ed60c8bee3fbc801f3a
4
+ data.tar.gz: 71bedcb01d1fb87f391df4699662e27d7589b5ce
5
5
  SHA512:
6
- metadata.gz: 8bd3c6021736228693d13b86f308fd7effc429ea9ea10a98c25bf79c8ecb5893972ee8728ab2505553d822a830cd9ccd7762eb57ceb3180fcc23a7a941f9376c
7
- data.tar.gz: 425d1ee9841e00d0708151f04560e892a0752def916abe4f765b696b24cb90217d69fd075dcfd61a826fd36222667d5bfd5fa54145ecf0adc2ca244cd3d3eb3d
6
+ metadata.gz: 4aa0408d877bc3f5d5f7a196880030abcf89b4c32d002c913e053368e455542e38ca8db6f1c6c7d2e1b317cac7113606cc2c1b7a375b1594b5e4ede492375173
7
+ data.tar.gz: e454bc45988cc864988c81a293fef71fa3158076ef7c714aca66be7519dc37f116b6cd1de194fab75f55fe9fe33bf202f2fd69cb81ab50d3fd1ca1dc0b3f3b30
@@ -7,6 +7,7 @@ class Marty::ScheduleJobsDashboard < Marty::Grid
7
7
  update: ACCESSIBLE_BY,
8
8
  delete: ACCESSIBLE_BY,
9
9
  destroy: ACCESSIBLE_BY,
10
+ job_run: ACCESSIBLE_BY,
10
11
  edit_window__edit_form__submit: ACCESSIBLE_BY,
11
12
  add_window__add_form__submit: ACCESSIBLE_BY
12
13
  )
@@ -31,6 +32,10 @@ class Marty::ScheduleJobsDashboard < Marty::Grid
31
32
  []
32
33
  end
33
34
 
35
+ def default_bbar
36
+ super + [:do_job_run]
37
+ end
38
+
34
39
  attribute :job_class do |c|
35
40
  c.width = 400
36
41
  end
@@ -52,6 +57,13 @@ class Marty::ScheduleJobsDashboard < Marty::Grid
52
57
  c.field_config = editor_config
53
58
  end
54
59
 
60
+ action :do_job_run do |a|
61
+ a.text = 'Run'
62
+ a.tooltip = 'Run'
63
+ a.icon_cls = 'fa fa-play glyph'
64
+ a.disabled = true
65
+ end
66
+
55
67
  endpoint :edit_window__edit_form__submit do |params|
56
68
  result = super(params)
57
69
  next result if result.empty?
@@ -90,6 +102,17 @@ class Marty::ScheduleJobsDashboard < Marty::Grid
90
102
 
91
103
  res
92
104
  end
105
+
106
+ endpoint :job_run do
107
+ begin
108
+ s = Marty::BackgroundJob::Schedule.find(client_config['selected'])
109
+ klass = s.job_class
110
+ klass.constantize.new.perform
111
+ rescue StandardError => e
112
+ next client.netzke_notify(e.message)
113
+ end
114
+ client.netzke_notify("#{klass.demodulize} ran successfully.")
115
+ end
93
116
  end
94
117
 
95
118
  ScheduleJobsDashboard = Marty::ScheduleJobsDashboard
@@ -0,0 +1,13 @@
1
+ {
2
+ netzkeOnDoJobRun: function(params) {
3
+ Ext.Msg.confirm(
4
+ 'Run Job',
5
+ Ext.String.format('Are you sure?'),
6
+ (btn, value, cfg) => {
7
+ if (btn == "yes") {
8
+ this.mask('Performing job...');
9
+ this.server.jobRun(() => { this.unmask()});
10
+ }
11
+ });
12
+ }
13
+ }
@@ -1,17 +1,21 @@
1
1
  class Marty::RpcCall
2
2
  # POST to a remote marty
3
- def self.marty_post(host, port, path, script, node, attrs, params, options = {},
4
- ssl = false)
3
+ def self.marty_post(host, port, path, script, node, attrs, params,
4
+ options = {}, ssl = false)
5
5
  http = Net::HTTP.new(host, port)
6
+
7
+ # FIXME: in 5.2.0 put ssl in options hash
6
8
  http.use_ssl = ssl
9
+ http.read_timeout = options[:read_timeout] if options[:read_timeout]
10
+
7
11
  request = Net::HTTP::Post.new(path)
8
12
  request.add_field('Content-Type', 'application/json')
9
- request.body = (options + {
10
- 'script' => script,
11
- 'node' => node,
12
- 'attrs' => attrs.to_json,
13
- 'params' => params.to_json,
14
- }).to_json
13
+ request.body = { 'script' => script,
14
+ 'node' => node,
15
+ 'attrs' => attrs.to_json,
16
+ 'params' => params.to_json,
17
+ }.to_json
18
+
15
19
  begin
16
20
  response = http.request(request)
17
21
  rescue StandardError => e
@@ -25,7 +29,8 @@ class Marty::RpcCall
25
29
  end
26
30
 
27
31
  def self.marty_download(
28
- host, port, path, job_id, ssl = false, read_timeout = 60)
32
+ host, port, path, job_id, ssl = false, read_timeout = 60
33
+ )
29
34
 
30
35
  params = { job_id: job_id }
31
36
  url = path + '?' + URI.encode(URI.encode_www_form(params))
@@ -43,10 +48,12 @@ class Marty::RpcCall
43
48
  end
44
49
  end
45
50
 
46
- def self.xml_call(host, port, path, body, use_ssl)
51
+ # FIXME: in Marty 5.2.0 put ssl in options hash
52
+ def self.xml_call(host, port, path, body, use_ssl, options = {})
47
53
  http = Net::HTTP.new(host, port)
48
54
  request = Net::HTTP::Post.new(path)
49
55
  http.use_ssl = use_ssl
56
+ http.read_timeout = options[:read_timeout] if options[:read_timeout]
50
57
  request.add_field('Content-Type', 'xml')
51
58
  request.add_field('Accept', 'xml')
52
59
  request.body = body
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = '5.1.2'
2
+ VERSION = '5.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marty
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2019-08-12 00:00:00.000000000 Z
17
+ date: 2019-08-13 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: aws-sigv4
@@ -292,6 +292,7 @@ files:
292
292
  - app/components/marty/reporting.rb
293
293
  - app/components/marty/reporting/client/reporting.js
294
294
  - app/components/marty/schedule_jobs_dashboard.rb
295
+ - app/components/marty/schedule_jobs_dashboard/client/schedule_jobs_dashboard.js
295
296
  - app/components/marty/script_form.rb
296
297
  - app/components/marty/script_form/client/script_form.js
297
298
  - app/components/marty/script_grid.rb