sidekiq-cron 1.2.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,71 +0,0 @@
1
- header.row
2
- .span.col-sm-5.pull-left
3
- h3 = t('CronJobs')
4
-
5
- .span.col-sm-7.pull-right style="margin-top: 20px; margin-bottom: 10px;"
6
- - if @cron_jobs.size > 0
7
- form.pull-right action="#{root_path}cron/__all__/delete" method="post"
8
- = csrf_tag if respond_to?(:csrf_tag)
9
- input.btn.btn-small.pull-left.btn-danger type="submit" name="enque" value="#{t('DeleteAll')}" data-confirm="#{t('AreYouSureDeleteCronJobs')}"
10
- form.pull-right action="#{root_path}cron/__all__/disable" method="post"
11
- = csrf_tag if respond_to?(:csrf_tag)
12
- input.btn.btn-small.pull-left type="submit" name="enque" value="#{t('DisableAll')}"
13
- form.pull-right action="#{root_path}cron/__all__/enable" method="post"
14
- = csrf_tag if respond_to?(:csrf_tag)
15
- input.btn.btn-small.pull-left type="submit" name="enque" value="#{t('EnableAll')}"
16
- form.pull-right action="#{root_path}cron/__all__/enque" method="post"
17
- = csrf_tag if respond_to?(:csrf_tag)
18
- input.btn.btn-small.pull-left type="submit" name="enque" value="#{t('EnqueueAll')}"
19
-
20
- - if @cron_jobs.size > 0
21
-
22
- table class="table table-hover table-bordered table-striped"
23
- thead
24
- th = t('Status')
25
- th = t('Name')
26
- th = t('Cron')
27
- th = t('Last enqueued')
28
- th width="180px"
29
- = t('Actions')
30
-
31
-
32
- - @cron_jobs.sort{|a,b| a.sort_name <=> b.sort_name }.each_with_index do |job, index|
33
- - style = "#{job.status == 'disabled' ? "background: #ecc": ""}"
34
- tr
35
- td[style="#{style}"]= job.status
36
- td[style="#{style}"]
37
- a href="#{root_path}cron/#{CGI.escape(job.name).gsub('+', '%20')}"
38
- b = job.name
39
- hr style="margin:3px;border:0;"
40
- small
41
- - if job.message and job.message.to_s.size > 100
42
- button data-toggle="collapse" data-target=".worker_#{index}" class="btn btn-mini" = t('ShowAll')
43
- .toggle[class="worker_#{index}" style="display: inline;"]= job.message[0..100] + "... "
44
- .toggle[class="worker_#{index}" style="display: none;"]= job.message
45
- - else
46
- = job.message
47
-
48
- td[style="#{style}"]
49
- b == job.cron.gsub(" ", "&nbsp;")
50
- td[style="#{style}"]== job.last_enqueue_time ? relative_time(job.last_enqueue_time) : "-"
51
- td[style="#{style}"]
52
- -if job.status == 'enabled'
53
- form action="#{root_path}cron/#{CGI.escape(job.name).gsub('+', '%20')}/enque" method="post"
54
- = csrf_tag if respond_to?(:csrf_tag)
55
- input.btn.btn-small.pull-left type="submit" name="enque" value="#{t('EnqueueNow')}"
56
- form action="#{root_path}cron/#{CGI.escape(job.name).gsub('+', '%20')}/disable" method="post"
57
- = csrf_tag if respond_to?(:csrf_tag)
58
- input.btn.btn-small.pull-left type="submit" name="disable" value="#{t('Disable')}"
59
- -else
60
- form action="#{root_path}cron/#{CGI.escape(job.name).gsub('+', '%20')}/enque" method="post"
61
- = csrf_tag if respond_to?(:csrf_tag)
62
- input.btn.btn-small.pull-left type="submit" name="enque" value="#{t('EnqueueNow')}"
63
- form action="#{root_path}cron/#{CGI.escape(job.name).gsub('+', '%20')}/enable" method="post"
64
- = csrf_tag if respond_to?(:csrf_tag)
65
- input.btn.btn-small.pull-left type="submit" name="enable" value="#{t('Enable')}"
66
- form action="#{root_path}cron/#{CGI.escape(job.name).gsub('+', '%20')}/delete" method="post"
67
- = csrf_tag if respond_to?(:csrf_tag)
68
- input.btn.btn-danger.btn-small type="submit" name="delete" value="#{t('Delete')}" data-confirm="#{t('AreYouSureDeleteCronJob', :job => job.name)}"
69
-
70
- - else
71
- .alert.alert-success = t('NoCronJobsWereFound')
@@ -1,61 +0,0 @@
1
- header.row
2
- .span.col-sm-5.pull-left
3
- h3
4
- = "#{t('Cron')} #{t('Job')}"
5
- small= @job.name
6
- .span.col-sm-7.pull-right style=("margin-top: 20px; margin-bottom: 10px;")
7
- - cron_job_path = "#{root_path}cron/#{CGI.escape(@job.name).gsub('+', '%20')}"
8
- form.pull-right action="#{cron_job_path}/enque?redirect=#{cron_job_path}" method="post"
9
- = csrf_tag if respond_to?(:csrf_tag)
10
- input.btn.btn-small.pull-left name="enque" type="submit" value="#{t('EnqueueNow')}"
11
- - if @job.status == 'enabled'
12
- form.pull-right action="#{cron_job_path}/disable?redirect=#{cron_job_path}" method="post"
13
- = csrf_tag if respond_to?(:csrf_tag)
14
- input.btn.btn-small.pull-left name="disable" type="submit" value="#{t('Disable')}"
15
- - else
16
- form.pull-right action="#{cron_job_path}/enable?redirect=#{cron_job_path}" method="post"
17
- = csrf_tag if respond_to?(:csrf_tag)
18
- input.btn.btn-small.pull-left name="enable" type="submit" value="#{t('Enable')}"
19
- form.pull-right action="#{cron_job_path}/delete" method="post"
20
- = csrf_tag if respond_to?(:csrf_tag)
21
- input.btn.btn-danger.btn-small data-confirm="#{t('AreYouSureDeleteCronJob' job =@job.name)}" name="delete" type="submit" value="#{t('Delete')}" /
22
-
23
- table.table.table-bordered.table-striped
24
- tbody
25
- tr
26
- th= t 'Status'
27
- td= @job.status
28
- tr
29
- th= t 'Name'
30
- td= @job.name
31
- tr
32
- th= t 'Description'
33
- td= @job.description
34
- tr
35
- th= t 'Message'
36
- td
37
- pre= @job.pretty_message
38
- tr
39
- th= t 'Cron'
40
- td= @job.cron.gsub(" ", "&nbsp;")
41
- tr
42
- th= t 'Last enqueued'
43
- td= @job.last_enqueue_time ? relative_time(@job.last_enqueue_time) : "-"
44
-
45
- header.row
46
- .col-sm-12
47
- h4= t 'History'
48
-
49
- - if @job.jid_history_from_redis.size > 0
50
- table.table.table-hover.table-bordered.table-striped
51
- thead
52
- tr
53
- th= t 'Enqueued'
54
- th= t 'JID'
55
- tbody
56
- - @job.jid_history_from_redis.each do |jid_history|
57
- tr
58
- td= jid_history['enqueued']
59
- td= jid_history['jid']
60
- - else
61
- .alert.alert-success= t 'NoHistoryWereFound'