minicron 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +674 -0
  3. data/README.md +187 -0
  4. data/Rakefile +17 -0
  5. data/bin/minicron +26 -0
  6. data/lib/minicron.rb +179 -0
  7. data/lib/minicron/alert.rb +115 -0
  8. data/lib/minicron/alert/email.rb +50 -0
  9. data/lib/minicron/alert/pagerduty.rb +39 -0
  10. data/lib/minicron/alert/sms.rb +47 -0
  11. data/lib/minicron/cli.rb +367 -0
  12. data/lib/minicron/constants.rb +7 -0
  13. data/lib/minicron/cron.rb +192 -0
  14. data/lib/minicron/hub/app.rb +132 -0
  15. data/lib/minicron/hub/assets/app/application.js +151 -0
  16. data/lib/minicron/hub/assets/app/components/schedules.js +280 -0
  17. data/lib/minicron/hub/assets/app/controllers/executions.js +35 -0
  18. data/lib/minicron/hub/assets/app/controllers/hosts.js +129 -0
  19. data/lib/minicron/hub/assets/app/controllers/jobs.js +109 -0
  20. data/lib/minicron/hub/assets/app/controllers/schedules.js +80 -0
  21. data/lib/minicron/hub/assets/app/helpers.js +22 -0
  22. data/lib/minicron/hub/assets/app/models/execution.js +13 -0
  23. data/lib/minicron/hub/assets/app/models/host.js +15 -0
  24. data/lib/minicron/hub/assets/app/models/job.js +15 -0
  25. data/lib/minicron/hub/assets/app/models/job_execution_output.js +11 -0
  26. data/lib/minicron/hub/assets/app/models/schedule.js +32 -0
  27. data/lib/minicron/hub/assets/app/router.js +31 -0
  28. data/lib/minicron/hub/assets/app/routes/executions.js +36 -0
  29. data/lib/minicron/hub/assets/app/routes/hosts.js +42 -0
  30. data/lib/minicron/hub/assets/app/routes/index.js +9 -0
  31. data/lib/minicron/hub/assets/app/routes/jobs.js +52 -0
  32. data/lib/minicron/hub/assets/app/routes/schedules.js +37 -0
  33. data/lib/minicron/hub/assets/css/bootswatch.min.css +9 -0
  34. data/lib/minicron/hub/assets/css/main.scss +323 -0
  35. data/lib/minicron/hub/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  36. data/lib/minicron/hub/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  37. data/lib/minicron/hub/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  38. data/lib/minicron/hub/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  39. data/lib/minicron/hub/assets/fonts/lato-bold-700.woff +0 -0
  40. data/lib/minicron/hub/assets/fonts/lato-italic-400.woff +0 -0
  41. data/lib/minicron/hub/assets/fonts/lato-regular-400.woff +0 -0
  42. data/lib/minicron/hub/assets/js/ansi_up-1.1.1.min.js +6 -0
  43. data/lib/minicron/hub/assets/js/auth/ember-auth-9.0.7.min.js +2 -0
  44. data/lib/minicron/hub/assets/js/auth/ember-auth-request-jquery-1.0.3.min.js +1 -0
  45. data/lib/minicron/hub/assets/js/bootstrap-3.1.1.min.js +6 -0
  46. data/lib/minicron/hub/assets/js/ember-1.4.1.min.js +18 -0
  47. data/lib/minicron/hub/assets/js/ember-data-1.0.0-beta.7.f87cba88.min.js +10 -0
  48. data/lib/minicron/hub/assets/js/faye-browser-1.0.1.min.js +2 -0
  49. data/lib/minicron/hub/assets/js/handlebars-1.3.0.min.js +29 -0
  50. data/lib/minicron/hub/assets/js/jquery-2.1.0.min.js +4 -0
  51. data/lib/minicron/hub/assets/js/moment-2.5.1.min.js +7 -0
  52. data/lib/minicron/hub/controllers/api/executions.rb +34 -0
  53. data/lib/minicron/hub/controllers/api/hosts.rb +150 -0
  54. data/lib/minicron/hub/controllers/api/job_execution_outputs.rb +30 -0
  55. data/lib/minicron/hub/controllers/api/jobs.rb +118 -0
  56. data/lib/minicron/hub/controllers/api/schedule.rb +184 -0
  57. data/lib/minicron/hub/controllers/index.rb +5 -0
  58. data/lib/minicron/hub/db/schema.rb +98 -0
  59. data/lib/minicron/hub/db/schema.sql +158 -0
  60. data/lib/minicron/hub/models/alert.rb +7 -0
  61. data/lib/minicron/hub/models/execution.rb +8 -0
  62. data/lib/minicron/hub/models/host.rb +7 -0
  63. data/lib/minicron/hub/models/job.rb +18 -0
  64. data/lib/minicron/hub/models/job_execution_output.rb +7 -0
  65. data/lib/minicron/hub/models/schedule.rb +25 -0
  66. data/lib/minicron/hub/serializers/execution.rb +75 -0
  67. data/lib/minicron/hub/serializers/host.rb +57 -0
  68. data/lib/minicron/hub/serializers/job.rb +104 -0
  69. data/lib/minicron/hub/serializers/job_execution_output.rb +48 -0
  70. data/lib/minicron/hub/serializers/schedule.rb +68 -0
  71. data/lib/minicron/hub/views/handlebars/application.erb +51 -0
  72. data/lib/minicron/hub/views/handlebars/errors.erb +29 -0
  73. data/lib/minicron/hub/views/handlebars/executions.erb +79 -0
  74. data/lib/minicron/hub/views/handlebars/hosts.erb +205 -0
  75. data/lib/minicron/hub/views/handlebars/jobs.erb +203 -0
  76. data/lib/minicron/hub/views/handlebars/loading.erb +3 -0
  77. data/lib/minicron/hub/views/handlebars/schedules.erb +354 -0
  78. data/lib/minicron/hub/views/index.erb +7 -0
  79. data/lib/minicron/hub/views/layouts/app.erb +15 -0
  80. data/lib/minicron/monitor.rb +116 -0
  81. data/lib/minicron/transport.rb +15 -0
  82. data/lib/minicron/transport/client.rb +80 -0
  83. data/lib/minicron/transport/faye/client.rb +103 -0
  84. data/lib/minicron/transport/faye/extensions/job_handler.rb +184 -0
  85. data/lib/minicron/transport/faye/server.rb +58 -0
  86. data/lib/minicron/transport/server.rb +62 -0
  87. data/lib/minicron/transport/ssh.rb +51 -0
  88. data/spec/invalid_config.toml +2 -0
  89. data/spec/minicron/cli_spec.rb +154 -0
  90. data/spec/minicron/transport/client_spec.rb +8 -0
  91. data/spec/minicron/transport/faye/client_spec.rb +53 -0
  92. data/spec/minicron/transport/server_spec.rb +70 -0
  93. data/spec/minicron/transport_spec.rb +13 -0
  94. data/spec/minicron_spec.rb +133 -0
  95. data/spec/spec_helper.rb +33 -0
  96. data/spec/valid_config.toml +48 -0
  97. metadata +577 -0
@@ -0,0 +1,29 @@
1
+ <script type="text/x-handlebars" id="error">
2
+ <div class="alert alert-danger">
3
+ <h4>{{name}} {{number}}</h4>
4
+ <p>{{message}}</p>
5
+ </div>
6
+ </script>
7
+
8
+ <script type="text/x-handlebars" id="fatal-error">
9
+ <div class="navbar navbar-default navbar-fixed-top" role="navigation">
10
+ <div class="main-container">
11
+ <div class="navbar-header">
12
+ <a href="" class="navbar-brand">minicron</a>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="main-container clearfix">
18
+ <div class="sidebar"></div>
19
+
20
+ <div class="main-panel">
21
+ <div class="inner">
22
+ <div class="alert alert-danger">
23
+ <h4>{{name}} {{number}}</h4>
24
+ <p>{{message}}</p>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </script>
@@ -0,0 +1,79 @@
1
+ <script type="text/x-handlebars" id="executions/index">
2
+ Nothing to see here, why not set up a {{#link-to 'jobs'}}job{{/link-to}}?
3
+ </script>
4
+
5
+ <script type="text/x-handlebars" id="execution/index">
6
+ <section>
7
+ <header class="clearfix">
8
+ <h2 class="pull-left">Execution #{{id}}</h2>
9
+ <a {{action 'delete' this}} class="pull-right btn btn-danger btn-sm">Delete</a>
10
+ </header>
11
+ <hr/>
12
+
13
+ <form class="form-horizontal" role="form">
14
+ <div class="form-group">
15
+ <label class="col-sm-2 control-label">Created At</label>
16
+ <div class="col-sm-10">
17
+ <div class="form-control form-control-view">{{created_at}}</div>
18
+ </div>
19
+ </div>
20
+ <div class="form-group">
21
+ <label class="col-sm-2 control-label">Started At</label>
22
+ <div class="col-sm-10">
23
+ <div class="form-control form-control-view">{{started_at}}</div>
24
+ </div>
25
+ </div>
26
+ <div class="form-group">
27
+ <label class="col-sm-2 control-label">Finished At</label>
28
+ <div class="col-sm-10">
29
+ <div class="form-control form-control-view">{{finished_at}}</div>
30
+ </div>
31
+ </div>
32
+ <div class="form-group">
33
+ <label class="col-sm-2 control-label">Exit Status</label>
34
+ <div class="col-sm-10">
35
+ <div class="form-control form-control-view">{{exit_status}}</div>
36
+ </div>
37
+ </div>
38
+ </form>
39
+ </section>
40
+
41
+ <section>
42
+ <header class="clearfix">
43
+ <h2 class="pull-left">Job</h2>
44
+ {{#link-to 'job.edit' job.id class="pull-right btn btn-warning btn-sm"}}Edit{{/link-to}}
45
+ {{#link-to 'job' job.id class="pull-right btn btn-info btn-sm"}}View{{/link-to}}
46
+ </header>
47
+ <hr/>
48
+
49
+ <form class="form-horizontal" role="form">
50
+ <div class="form-group">
51
+ <label class="col-sm-2 control-label">Name</label>
52
+ <div class="col-sm-10">
53
+ <div class="form-control form-control-view">{{job.name}}</div>
54
+ </div>
55
+ </div>
56
+ <div class="form-group">
57
+ <label class="col-sm-2 control-label">Command</label>
58
+ <div class="col-sm-10">
59
+ <div class="form-control form-control-view">{{job.command}}</div>
60
+ </div>
61
+ </div>
62
+ <div class="form-group">
63
+ <label class="col-sm-2 control-label">Host</label>
64
+ <div class="col-sm-10">
65
+ <div class="form-control form-control-view">{{job.host.name}}</div>
66
+ </div>
67
+ </div>
68
+ </form>
69
+ </section>
70
+
71
+ <section>
72
+ <header>
73
+ <h2>Output</h2>
74
+ </header>
75
+ <hr/>
76
+
77
+ <div class="output tomorrow-night-eighties-ansi-theme">{{#each controller.sortedOutput}}{{ansi_to_html output}}{{/each}}</div>
78
+ </section>
79
+ </script>
@@ -0,0 +1,205 @@
1
+ <script type="text/x-handlebars" id="hosts/index">
2
+ <header class="clearfix">
3
+ <h2 class="pull-left">Hosts</h2>
4
+ {{#link-to 'hosts.new' class="pull-right btn btn-success btn-sm"}}Add New Host{{/link-to}}
5
+ </header>
6
+ <hr/>
7
+
8
+ <table class="table table-striped table-hover">
9
+ <thead>
10
+ <tr>
11
+ <th>ID</th>
12
+ <th>Name</th>
13
+ <th>FQDN</th>
14
+ <th>Actions</th>
15
+ </tr>
16
+ </thead>
17
+
18
+ <tbody>
19
+ {{#each model}}
20
+ <tr>
21
+ <td>{{#link-to 'host' id}}{{id}}{{/link-to}}</td>
22
+ <td>{{name}}</td>
23
+ <td>{{fqdn}}</td>
24
+ <td>
25
+ {{#link-to 'host' id class="btn btn-info btn-xs"}}View{{/link-to}}
26
+ {{#link-to 'host.edit' id class="btn btn-warning btn-xs"}}Edit{{/link-to}}
27
+ <a {{action 'delete' this}} class="btn btn-danger btn-xs">Delete</a>
28
+ </th>
29
+ </tr>
30
+ {{/each}}
31
+ </body>
32
+ </table>
33
+ </script>
34
+
35
+ <script type="text/x-handlebars" id="host/index">
36
+ <section>
37
+ <header class="clearfix">
38
+ <h2 class="pull-left">Host '{{name}}'</h2>
39
+ <a {{action 'delete' this}} class="pull-right btn btn-danger btn-sm">Delete</a>
40
+ {{#link-to 'host.edit' id class="pull-right btn btn-warning btn-sm"}}Edit{{/link-to}}
41
+ <a {{action 'test' this}} class="pull-right btn btn-info btn-sm">{{test_connection}}</a>
42
+ </header>
43
+ <hr/>
44
+
45
+ <form class="form-horizontal" role="form">
46
+ <div class="form-group">
47
+ <label class="col-sm-2 control-label">Name</label>
48
+ <div class="col-sm-10">
49
+ <div class="form-control form-control-view">{{name}}</div>
50
+ </div>
51
+ </div>
52
+ <div class="form-group">
53
+ <label class="col-sm-2 control-label">FQDN</label>
54
+ <div class="col-sm-10">
55
+ <div class="form-control form-control-view">{{fqdn}}</div>
56
+ </div>
57
+ </div>
58
+ <div class="form-group">
59
+ <label class="col-sm-2 control-label">Host</label>
60
+ <div class="col-sm-10">
61
+ <div class="form-control form-control-view">{{host}}</div>
62
+ </div>
63
+ </div>
64
+ <div class="form-group">
65
+ <label class="col-sm-2 control-label">Port</label>
66
+ <div class="col-sm-10">
67
+ <div class="form-control form-control-view">{{port}}</div>
68
+ </div>
69
+ </div>
70
+ <div class="form-group">
71
+ <label class="col-sm-2 control-label">Public Key</label>
72
+ <div class="col-sm-10">
73
+ <pre class="form-control form-control-view">{{public_key}}</pre>
74
+ </div>
75
+ </div>
76
+ <div class="form-group">
77
+ <label class="col-sm-2 control-label">Created At</label>
78
+ <div class="col-sm-10">
79
+ <div class="form-control form-control-view">{{created_at}}</div>
80
+ </div>
81
+ </div>
82
+ <div class="form-group">
83
+ <label class="col-sm-2 control-label">Updated At</label>
84
+ <div class="col-sm-10">
85
+ <div class="form-control form-control-view">{{updated_at}}</div>
86
+ </div>
87
+ </div>
88
+ </form>
89
+ </section>
90
+
91
+ <section>
92
+ <header class="clearfix">
93
+ <h2 class="pull-left">Jobs</h2>
94
+ {{#link-to 'jobs.new' class="pull-right btn btn-success btn-sm"}}Add New Job{{/link-to}}
95
+ </header>
96
+ <hr/>
97
+
98
+ <table class="table table-striped table-hover">
99
+ <thead>
100
+ <tr>
101
+ <th>ID</th>
102
+ <th>Name</th>
103
+ <th>Host</th>
104
+ <th>Actions</th>
105
+ </tr>
106
+ </thead>
107
+
108
+ <tbody>
109
+ {{#each job in jobs}}
110
+ <tr>
111
+ <td>{{#link-to 'job' job.id}}{{job.id}}{{/link-to}}</td>
112
+ <td>{{job.name}}</td>
113
+ <td>{{#link-to 'host' job.host.id}}{{job.host.name}}{{/link-to}}</td>
114
+ <td>
115
+ {{#link-to 'job' job.id class="btn btn-info btn-xs"}}View{{/link-to}}
116
+ {{#link-to 'job.edit' job.id class="btn btn-warning btn-xs"}}Edit{{/link-to}}
117
+ </th>
118
+ </tr>
119
+ {{/each}}
120
+ </body>
121
+ </table>
122
+ </section>
123
+ </script>
124
+
125
+ <script type="text/x-handlebars" id="hosts/new">
126
+ <header>
127
+ <h2>Add New Host</h2>
128
+ </header>
129
+ <hr/>
130
+
131
+ <form class="form-horizontal" role="form" {{action 'save' on='submit'}}>
132
+ <div class="form-group">
133
+ <label class="col-sm-2 control-label">Name</label>
134
+ <div class="col-sm-10">
135
+ {{input value=name type="text" class="form-control" placeholder="A nickname for the host e.g 'fred' - OPTIONAL"}}
136
+ </div>
137
+ </div>
138
+ <div class="form-group">
139
+ <label class="col-sm-2 control-label">FQDN</label>
140
+ <div class="col-sm-10">
141
+ {{input value=fqdn type="text" class="form-control" placeholder="The machine fully qualified domain name e.g 'server1.host.com'"}}
142
+ </div>
143
+ </div>
144
+ <div class="form-group">
145
+ <label class="col-sm-2 control-label">Host</label>
146
+ <div class="col-sm-10">
147
+ {{input value=host type="text" class="form-control" placeholder="The machine host, this could be an IP address or FQDN"}}
148
+ </div>
149
+ </div>
150
+ <div class="form-group">
151
+ <label class="col-sm-2 control-label">Port</label>
152
+ <div class="col-sm-10">
153
+ {{input value=port type="text" class="form-control" placeholder="The port to connect on, if empty this is assumed to be 22"}}
154
+ </div>
155
+ </div>
156
+ <div class="form-group">
157
+ <div class="col-sm-offset-2 col-sm-10">
158
+ <button type="submit" class="btn btn-success">Save</button>
159
+ <button {{action 'cancel'}} class="btn btn-danger">Cancel</button>
160
+ </div>
161
+ </div>
162
+ </form>
163
+ </script>
164
+
165
+ <script type="text/x-handlebars" id="host/edit">
166
+ <header class="clearfix">
167
+ <h2 class="pull-left">Edit Host '{{name}}'</h2>
168
+ <a {{action 'delete' this}} class="pull-right btn btn-danger btn-sm">Delete</a>
169
+ <a {{action 'test' this}} class="pull-right btn btn-info btn-sm">{{test_connection}}</a>
170
+ </header>
171
+ <hr/>
172
+
173
+ <form class="form-horizontal" role="form" {{action 'save' on='submit'}}>
174
+ <div class="form-group">
175
+ <label class="col-sm-2 control-label">Name</label>
176
+ <div class="col-sm-10">
177
+ {{input value=name type="text" class="form-control" placeholder="A nickname for the host e.g 'fred' - OPTIONAL"}}
178
+ </div>
179
+ </div>
180
+ <div class="form-group">
181
+ <label class="col-sm-2 control-label">FQDN</label>
182
+ <div class="col-sm-10">
183
+ {{input value=fqdn type="text" class="form-control" placeholder="The machine fully qualified domain name e.g 'server1.host.com'"}}
184
+ </div>
185
+ </div>
186
+ <div class="form-group">
187
+ <label class="col-sm-2 control-label">Host</label>
188
+ <div class="col-sm-10">
189
+ {{input value=host type="text" class="form-control" placeholder="The machine host, this could be an IP address or FQDN"}}
190
+ </div>
191
+ </div>
192
+ <div class="form-group">
193
+ <label class="col-sm-2 control-label">Port</label>
194
+ <div class="col-sm-10">
195
+ {{input value=port type="text" class="form-control" placeholder="The port to connect on, if empty this is assumed to be 22"}}
196
+ </div>
197
+ </div>
198
+ <div class="form-group">
199
+ <div class="col-sm-offset-2 col-sm-10">
200
+ <button type="submit" class="btn btn-success">Save</button>
201
+ <button {{action 'cancel' this}} class="btn btn-danger">Cancel</button>
202
+ </div>
203
+ </div>
204
+ </form>
205
+ </script>
@@ -0,0 +1,203 @@
1
+ <script type="text/x-handlebars" id="jobs/index">
2
+ <header class="clearfix">
3
+ <h2 class="pull-left">Jobs</h2>
4
+ {{#link-to 'jobs.new' class="pull-right btn btn-success btn-sm"}}Add New Job{{/link-to}}
5
+ </header>
6
+ <hr/>
7
+
8
+ <table class="table table-striped table-hover">
9
+ <thead>
10
+ <tr>
11
+ <th>ID</th>
12
+ <th>Name</th>
13
+ <th>Host</th>
14
+ <th>Actions</th>
15
+ </tr>
16
+ </thead>
17
+
18
+ <tbody>
19
+ {{#each model}}
20
+ <tr>
21
+ <td>{{#link-to 'job' id}}{{id}}{{/link-to}}</td>
22
+ <td>{{name}}</td>
23
+ <td>{{#link-to 'host' host.id}}{{host.name}}{{/link-to}}</td>
24
+ <td>
25
+ {{#link-to 'job' id class="btn btn-info btn-xs"}}View{{/link-to}}
26
+ {{#link-to 'job.edit' id class="btn btn-warning btn-xs"}}Edit{{/link-to}}
27
+ <a {{action 'delete' this}} class="btn btn-danger btn-xs">Delete</a>
28
+ </th>
29
+ </tr>
30
+ {{/each}}
31
+ </body>
32
+ </table>
33
+ </script>
34
+
35
+ <script type="text/x-handlebars" id="job/index">
36
+ <section>
37
+ <header class="clearfix">
38
+ <h2 class="pull-left">Job '{{name}}'</h2>
39
+ <a {{action 'delete' this}} class="pull-right btn btn-danger btn-sm">Delete</a>
40
+ {{#link-to 'job.edit' id class="pull-right btn btn-warning btn-sm"}}Edit{{/link-to}}
41
+ </header>
42
+ <hr/>
43
+
44
+ <form class="form-horizontal" role="form">
45
+ <div class="form-group">
46
+ <label class="col-sm-2 control-label">Name</label>
47
+ <div class="col-sm-10">
48
+ <div class="form-control form-control-view">{{name}}</div>
49
+ </div>
50
+ </div>
51
+ <div class="form-group">
52
+ <label class="col-sm-2 control-label">Command</label>
53
+ <div class="col-sm-10">
54
+ <div class="form-control form-control-view">{{command}}</div>
55
+ </div>
56
+ </div>
57
+ <div class="form-group">
58
+ <label class="col-sm-2 control-label">Host</label>
59
+ <div class="col-sm-10">
60
+ <div class="form-control form-control-view">{{host.name}}</div>
61
+ </div>
62
+ </div>
63
+ <div class="form-group">
64
+ <label class="col-sm-2 control-label">Created At</label>
65
+ <div class="col-sm-10">
66
+ <div class="form-control form-control-view">{{created_at}}</div>
67
+ </div>
68
+ </div>
69
+ <div class="form-group">
70
+ <label class="col-sm-2 control-label">Updated At</label>
71
+ <div class="col-sm-10">
72
+ <div class="form-control form-control-view">{{updated_at}}</div>
73
+ </div>
74
+ </div>
75
+ </form>
76
+ </section>
77
+
78
+ <section>
79
+ <header class="clearfix">
80
+ <h2 class="pull-left">Schedule</h2>
81
+ {{#link-to 'schedules.new' id class="pull-right btn btn-success btn-sm"}}Add New Schedule{{/link-to}}
82
+ </header>
83
+
84
+ <table class="table table-striped table-hover">
85
+ <thead>
86
+ <tr>
87
+ <th>ID</th>
88
+ <th>Schedule</th>
89
+ <th>Actions</th>
90
+ </tr>
91
+ </thead>
92
+
93
+ <tbody>
94
+ {{#each schedule in schedules}}
95
+ <tr>
96
+ <td>{{schedule.id}}</td>
97
+ <td>{{schedule.formatted}}</td>
98
+ <td>
99
+ {{#link-to 'schedule' schedule.id class="btn btn-info btn-xs"}}View{{/link-to}}
100
+ {{#link-to 'schedule.edit' schedule.id class="btn btn-warning btn-xs"}}Edit{{/link-to}}
101
+ </td>
102
+ </tr>
103
+ {{/each}}
104
+ </body>
105
+ </table>
106
+ </section>
107
+
108
+ <section>
109
+ <header class="clearfix">
110
+ <h2>Executions</h2>
111
+ </header>
112
+ <hr/>
113
+
114
+ <table class="table table-striped table-hover">
115
+ <thead>
116
+ <tr>
117
+ <th>ID</th>
118
+ <th>Started At</th>
119
+ <th>Finished At</th>
120
+ <th>Exit Status</th>
121
+ <th>Actions</th>
122
+ </tr>
123
+ </thead>
124
+
125
+ <tbody>
126
+ {{#each execution in executions}}
127
+ {{! TODO: contextual classes here for execution status }}
128
+ <tr>
129
+ <td>{{#link-to 'execution' execution.id}}{{execution.id}}{{/link-to}}</td>
130
+ <td>{{date execution/started_at}}</td>
131
+ <td>{{date execution.finished_at}}</td>
132
+ <td>{{execution.exit_status}}</td>
133
+ <td>{{#link-to 'execution' execution.id class="btn btn-info btn-xs"}}View{{/link-to}}</td>
134
+ </tr>
135
+ {{/each}}
136
+ </body>
137
+ </table>
138
+ </section>
139
+ </script>
140
+
141
+ <script type="text/x-handlebars" id="jobs/new">
142
+ <header>
143
+ <h2>Add New Job</h2>
144
+ </header>
145
+ <hr/>
146
+
147
+ <form class="form-horizontal" role="form" {{action 'save' on='submit'}}>
148
+ <div class="form-group">
149
+ <label class="col-sm-2 control-label">Name</label>
150
+ <div class="col-sm-10">
151
+ {{input value=job_name type="text" class="form-control" placeholder="A nickname for the job"}}
152
+ </div>
153
+ </div>
154
+ <div class="form-group">
155
+ <label class="col-sm-2 control-label">Command</label>
156
+ <div class="col-sm-10">
157
+ {{input value=job_command type="text" class="form-control" placeholder="What the job actually does"}}
158
+ </div>
159
+ </div>
160
+ <div class="form-group">
161
+ <label class="col-sm-2 control-label">Host</label>
162
+ <div class="col-sm-10">
163
+ {{view
164
+ Ember.Select
165
+ contentBinding='content'
166
+ optionLabelPath='content.name'
167
+ optionValuePath='content.id'
168
+ prompt='Please select a host'
169
+ value=id
170
+ class="form-control"}}
171
+ </div>
172
+ </div>
173
+ <div class="form-group">
174
+ <div class="col-sm-offset-2 col-sm-10">
175
+ <button type="submit" class="btn btn-success">{{save_button}}</button>
176
+ <button {{action 'cancel' this}} class="btn btn-danger">Cancel</button>
177
+ </div>
178
+ </div>
179
+ </form>
180
+ </script>
181
+
182
+ <script type="text/x-handlebars" id="job/edit">
183
+ <header class="clearfix">
184
+ <h2 class="pull-left">Edit Job '{{name}}'</h2>
185
+ <a {{action 'delete' this}} class="pull-right btn btn-danger btn-sm">Delete</a>
186
+ </header>
187
+ <hr/>
188
+
189
+ <form class="form-horizontal" role="form" {{action 'save' on='submit'}}>
190
+ <div class="form-group">
191
+ <label class="col-sm-2 control-label">Name</label>
192
+ <div class="col-sm-10">
193
+ {{input value=name type="text" class="form-control" placeholder="A nickname for the job"}}
194
+ </div>
195
+ </div>
196
+ <div class="form-group">
197
+ <div class="col-sm-offset-2 col-sm-10">
198
+ <button type="submit" class="btn btn-success">Save</button>
199
+ <button {{action 'cancel' this}} class="btn btn-danger">Cancel</button>
200
+ </div>
201
+ </div>
202
+ </form>
203
+ </script>