delayed_job_ui 0.0.0 → 0.0.1

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: d5748551e76adba7e11cb2fd9193f22a9fd1e44e
4
- data.tar.gz: adb43b66e8d8d1ce4f9ff129646ded83dfffdac3
3
+ metadata.gz: 94d772c78046c542ea23ec40383b3e22e577922a
4
+ data.tar.gz: 0c4b9e3bc7123e60b8f0189f55af705923bf0102
5
5
  SHA512:
6
- metadata.gz: 36dadf322d87b7c7a207071891dcdc0f507eb8f01217244ffc37ac637fcebd4b16bad2aac9b722ccd5d64ab2a7df074e166f7d388208d7d026e155e518f41d41
7
- data.tar.gz: b23ef4af1416fb35675e4556e4c983149c0e7a665d2079c60b2084e780af65cdad816d6af82c8e506cfdda6b19e105a1408593259e24dce4a0c70c6d8e4eea09
6
+ metadata.gz: ce1da16824a0cf9bf9c69a7a49eec34b9aea947a0ca01fdc36b11e1342eaf998c939ce6b47d56fb6e4efff0abc18bb56fc6fa83ed0892a7375b10cc6f25f44d6
7
+ data.tar.gz: e7f744ed6aacea23f3cf7bc03451a29c8d7e34ae3174b6bccb561e60147e9fd8cf8ab0128484edfc8c714e925c72a82aa78136121c8a21bfbab806c732636b66
@@ -10,6 +10,7 @@ window.delayed_job_ui = (function($){
10
10
  dj_obj.$parent = $(namespace);
11
11
  instantiate_datatable();
12
12
  tab_handlers();
13
+ resize_handlers();
13
14
  hide_tab_content();
14
15
  show_active_tab();
15
16
  }
@@ -18,12 +19,24 @@ window.delayed_job_ui = (function($){
18
19
  dj_obj.$parent.find('.job_table').DataTable();
19
20
  }
20
21
 
22
+ var resize_handlers = function() {
23
+ dj_obj.$parent.on('click', '.open', function(e){
24
+ e.preventDefault();
25
+ dj_obj.$parent.removeClass('closed');;
26
+ });
27
+
28
+ dj_obj.$parent.on('click', '.close', function(e){
29
+ e.preventDefault();
30
+ dj_obj.$parent.addClass('closed');;
31
+ });
32
+ }
33
+
21
34
  var tab_handlers = function() {
22
35
  dj_obj.$parent.on('click', '.link_to_tab', function(e){
23
36
  e.preventDefault();
24
37
  $tab_link = $(e.target);
25
38
  set_active_tab($tab_link)
26
- })
39
+ });
27
40
  }
28
41
 
29
42
  var set_active_tab = function($tab_link) {
@@ -1,4 +1,8 @@
1
1
  #delayed-job-ui {
2
+ position: fixed;
3
+ bottom: 0;
4
+ width: 100%;
5
+ z-index: 100;
2
6
  * {
3
7
  box-sizing: border-box;
4
8
  &:before, &:after {
@@ -6,10 +10,54 @@
6
10
  }
7
11
  }
8
12
 
13
+ .minimized {
14
+ display: none;
15
+ }
16
+
17
+ .maximized {
18
+ position: relative;
19
+ .close {
20
+ position: absolute;
21
+ right: 12px;
22
+ top: 12px;
23
+ background: white;
24
+ padding: 1px 6px;
25
+ color: black;
26
+ border: 1px solid #C7C7C7;
27
+ &:hover {
28
+ text-decoration: none;
29
+ background: #ccc;
30
+ }
31
+ }
32
+ }
33
+
34
+ &.closed {
35
+ width: inherit;
36
+ .maximized {
37
+ display: none;
38
+ }
39
+ .minimized {
40
+ display: block;
41
+ .open {
42
+ display: block;
43
+ padding: 10px;
44
+ top: 1px;
45
+ color: black;
46
+ border-top: 5px solid #D65F75;
47
+ background: white;
48
+ border-bottom: none;
49
+ border-right: none;
50
+ box-shadow: 1px -2px 1px rgba(0,0,0,0.2);
51
+ z-index: 999;
52
+ }
53
+ }
54
+ }
55
+
9
56
  .panel {
10
57
  border-radius: 0;
11
58
  background: white;
12
59
  box-shadow: 0px 0px 1px rgba(0,0,0,0.2);
60
+ margin-bottom: 0;
13
61
 
14
62
  .content {
15
63
  margin-top: 20px;
@@ -1,42 +1,46 @@
1
1
  = stylesheet_link_tag "delayed_job_ui"
2
2
  = javascript_include_tag 'delayed_job_ui'
3
3
 
4
- #delayed-job-ui
5
- %ul.tabs.cf
6
- %li
7
- = link_to 'Overview', '#overview', :class => 'tab-title link_to_tab active'
8
- %li
9
- = link_to 'Enqueued', '#enqueued', :class => 'tab-title link_to_tab'
10
- %li
11
- = link_to 'Working', '#working', :class => 'tab-title link_to_tab'
12
- %li
13
- = link_to 'Pending', '#pending', :class => 'tab-title link_to_tab'
14
- %li
15
- = link_to 'Failed', '#failed', :class => 'tab-title link_to_tab'
16
- .panel
17
- .content
18
- #overview.tab-content
19
- %h2 Overview
20
- %table
21
- %thead
22
- %tr
23
- %th Type
24
- %th Count
25
- %tbody
26
- - DelayedJobUi::Jobs.job_count.each do |type, count|
4
+ #delayed-job-ui.closed
5
+ .minimized
6
+ =link_to 'Delayed Job UI', '#', :class => 'open'
7
+ .maximized
8
+ =link_to 'X', '#', :class => 'close'
9
+ %ul.tabs.cf
10
+ %li
11
+ = link_to 'Overview', '#overview', :class => 'tab-title link_to_tab active'
12
+ %li
13
+ = link_to 'Enqueued', '#enqueued', :class => 'tab-title link_to_tab'
14
+ %li
15
+ = link_to 'Working', '#working', :class => 'tab-title link_to_tab'
16
+ %li
17
+ = link_to 'Pending', '#pending', :class => 'tab-title link_to_tab'
18
+ %li
19
+ = link_to 'Failed', '#failed', :class => 'tab-title link_to_tab'
20
+ .panel
21
+ .content
22
+ #overview.tab-content
23
+ %h2 Overview
24
+ %table
25
+ %thead
27
26
  %tr
28
- %td= link_to type.to_s.capitalize, "##{type}", :class => 'link_to_tab'
29
- %td= count
27
+ %th Type
28
+ %th Count
29
+ %tbody
30
+ - DelayedJobUi::Jobs.job_count.each do |type, count|
31
+ %tr
32
+ %td= link_to type.to_s.capitalize, "##{type}", :class => 'link_to_tab'
33
+ %td= count
30
34
 
31
- #enqueued.tab-content
32
- %h2 Enqueued
33
- = render 'delayed_job_ui/job_table', :type => :enqueued
34
- #working.tab-content
35
- %h2 Working
36
- = render 'delayed_job_ui/job_table', :type => :working
37
- #pending.tab-content
38
- %h2 Pending
39
- = render 'delayed_job_ui/job_table', :type => :pending
40
- #failed.tab-content
41
- %h2 Failed
42
- = render 'delayed_job_ui/job_table', :type => :failed
35
+ #enqueued.tab-content
36
+ %h2 Enqueued
37
+ = render 'delayed_job_ui/job_table', :type => :enqueued
38
+ #working.tab-content
39
+ %h2 Working
40
+ = render 'delayed_job_ui/job_table', :type => :working
41
+ #pending.tab-content
42
+ %h2 Pending
43
+ = render 'delayed_job_ui/job_table', :type => :pending
44
+ #failed.tab-content
45
+ %h2 Failed
46
+ = render 'delayed_job_ui/job_table', :type => :failed
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'delayed_job_ui'
3
- s.version = '0.0.0'
3
+ s.version = '0.0.1'
4
4
  s.date = '2014-09-18'
5
5
  s.summary = 'A UI wrapper for DelayedJob'
6
6
  s.description = s.summary
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Woojin Kim