rhea 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -2
  3. data/Dockerfile +29 -0
  4. data/README.md +84 -41
  5. data/app/assets/stylesheets/rhea/layout.css.sass +3 -0
  6. data/app/controllers/rhea/commands_controller.rb +0 -1
  7. data/app/views/rhea/commands/_form.html.haml +7 -2
  8. data/app/views/rhea/commands/_table.html.haml +8 -7
  9. data/app/views/rhea/commands/index.html.haml +35 -28
  10. data/app/views/rhea/events/index.html.haml +3 -3
  11. data/app/views/rhea/nodes/index.html.haml +2 -2
  12. data/credentials/.gitkeep +0 -0
  13. data/examples/rhea-rails/.gitignore +13 -0
  14. data/examples/rhea-rails/Gemfile +4 -0
  15. data/examples/rhea-rails/README.rdoc +28 -0
  16. data/examples/rhea-rails/Rakefile +6 -0
  17. data/examples/rhea-rails/app/assets/images/.keep +0 -0
  18. data/examples/rhea-rails/app/assets/javascripts/application.js +1 -0
  19. data/examples/rhea-rails/app/assets/stylesheets/application.css +15 -0
  20. data/examples/rhea-rails/app/controllers/application_controller.rb +5 -0
  21. data/examples/rhea-rails/app/controllers/concerns/.keep +0 -0
  22. data/examples/rhea-rails/app/helpers/application_helper.rb +2 -0
  23. data/examples/rhea-rails/app/mailers/.keep +0 -0
  24. data/examples/rhea-rails/app/models/.keep +0 -0
  25. data/examples/rhea-rails/app/models/concerns/.keep +0 -0
  26. data/examples/rhea-rails/app/views/layouts/application.html.erb +14 -0
  27. data/examples/rhea-rails/bin/bundle +3 -0
  28. data/examples/rhea-rails/bin/rails +9 -0
  29. data/examples/rhea-rails/bin/rake +9 -0
  30. data/examples/rhea-rails/bin/setup +29 -0
  31. data/examples/rhea-rails/bin/spring +15 -0
  32. data/examples/rhea-rails/config.ru +4 -0
  33. data/examples/rhea-rails/config/application.rb +32 -0
  34. data/examples/rhea-rails/config/boot.rb +3 -0
  35. data/examples/rhea-rails/config/environment.rb +5 -0
  36. data/examples/rhea-rails/config/environments/development.rb +38 -0
  37. data/examples/rhea-rails/config/environments/production.rb +76 -0
  38. data/examples/rhea-rails/config/environments/test.rb +42 -0
  39. data/examples/rhea-rails/config/initializers/assets.rb +11 -0
  40. data/examples/rhea-rails/config/initializers/backtrace_silencers.rb +7 -0
  41. data/examples/rhea-rails/config/initializers/cookies_serializer.rb +3 -0
  42. data/examples/rhea-rails/config/initializers/filter_parameter_logging.rb +4 -0
  43. data/examples/rhea-rails/config/initializers/inflections.rb +16 -0
  44. data/examples/rhea-rails/config/initializers/mime_types.rb +4 -0
  45. data/examples/rhea-rails/config/initializers/session_store.rb +3 -0
  46. data/examples/rhea-rails/config/initializers/wrap_parameters.rb +9 -0
  47. data/examples/rhea-rails/config/locales/en.yml +23 -0
  48. data/examples/rhea-rails/config/routes.rb +3 -0
  49. data/examples/rhea-rails/config/secrets.yml +22 -0
  50. data/examples/rhea-rails/db/seeds.rb +7 -0
  51. data/examples/rhea-rails/lib/assets/.keep +0 -0
  52. data/examples/rhea-rails/lib/tasks/.keep +0 -0
  53. data/examples/rhea-rails/log/.keep +0 -0
  54. data/examples/rhea-rails/public/404.html +67 -0
  55. data/examples/rhea-rails/public/422.html +67 -0
  56. data/examples/rhea-rails/public/500.html +66 -0
  57. data/examples/rhea-rails/public/favicon.ico +0 -0
  58. data/examples/rhea-rails/public/robots.txt +5 -0
  59. data/examples/rhea-rails/vendor/assets/javascripts/.keep +0 -0
  60. data/examples/rhea-rails/vendor/assets/stylesheets/.keep +0 -0
  61. data/lib/rhea/command_type.rb +3 -1
  62. data/lib/rhea/version.rb +1 -1
  63. data/rhea.gemspec +1 -1
  64. data/rhea.rb.example +16 -0
  65. metadata +57 -5
  66. data/app/views/rhea/command_types/_list.html.haml +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 517c470dc81b2fce8bda550ee12ab84b56363806
4
- data.tar.gz: 47ddc6ea4d1f24b1a03fb5b6e97b449623ae52b7
3
+ metadata.gz: c8f09f9a769acb9cda54ffa31ad07056446cabe4
4
+ data.tar.gz: 134245ddf59d1e8ab6ed27a7230bc0e7151a38e9
5
5
  SHA512:
6
- metadata.gz: 2cb4e796d986f4dcae2d66f3e271ef6a9002ecd511d73bc4d1c1d324b831bbb46ab0bf50d6fbdd7a81d4647960b7bc60a437c28dfd4819adbfef6c8ccfef996b
7
- data.tar.gz: 35fae2399ffa3ef7de23070493cf11a9c4a30499130bb216a64feb2ea74f7363be018bc60475a97f964235b4b803375e4b6fb9d2bb00812ae736e6eeaa2c1d08
6
+ metadata.gz: 2eca1512f4b3febb16bda502565699e2b91a51096cfc684a20a114920141c00183ea9c8e117b04f8e979d3907a643edee4ceb8b27a020c5259dad80de81dbb86
7
+ data.tar.gz: de1e9be0fda7f30dfd81976815acd809f83bdb2baafd8c908bbe2403b3dda1f6f305fb0d7a52315e80513872f56c5d7aeae2fbbeb88f055defb701b1037039d0
data/.gitignore CHANGED
@@ -1,6 +1,9 @@
1
1
  .DS_Store
2
- Gemfile.lock
3
2
  *.gem
4
- log/*.log
5
3
  .bundle/
4
+ credentials/*
5
+ !credentials/.gitkeep
6
+ Gemfile.lock
7
+ log/*.log
6
8
  pkg/
9
+ rhea.rb
@@ -0,0 +1,29 @@
1
+ FROM alpine:3.4
2
+ MAINTAINER ayumi@entelo.com
3
+
4
+ RUN apk update && apk --update add ruby ruby-irb ruby-json ruby-rake \
5
+ ruby-bigdecimal ruby-io-console libstdc++ tzdata \
6
+ libxml2-dev libxslt-dev
7
+
8
+ ADD examples/rhea-rails/Gemfile /app/
9
+ ADD examples/rhea-rails/Gemfile.lock /app/
10
+
11
+ RUN apk --update add --virtual build-dependencies build-base git \
12
+ libc-dev linux-headers ruby-dev openssl-dev && \
13
+ gem install --no-rdoc --no-ri bundler && \
14
+ cd /app; bundle install --deployment --full-index --jobs 4 && \
15
+ apk del build-dependencies
16
+
17
+
18
+ ADD examples/rhea-rails/. /app
19
+ ADD credentials/. /app/config/credentials/
20
+ ADD rhea.rb /app/config/initializers/
21
+ RUN chown -R nobody:nogroup /app
22
+ USER nobody
23
+
24
+ EXPOSE 3000
25
+
26
+ ENV KUBE_API_URL "http://localhost:8080/api/"
27
+
28
+ WORKDIR /app
29
+ CMD ["bundle", "exec", "rails", "server", "--binding=0.0.0.0"]
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  A web UI for managing a Kubernetes cluster
4
4
 
5
5
  Overview
6
- --------
6
+ ---
7
7
 
8
8
  Rhea is a web UI for managing a Kubernetes cluster. It makes it very easy to:
9
9
 
@@ -25,65 +25,75 @@ Monitor the nodes' pods and the cluster's events:
25
25
  [<img src="docs/events.png?raw=true" width="440" />](docs/events.png?raw=true)
26
26
 
27
27
  Installation
28
- ------------
28
+ ---
29
29
 
30
- Rhea is a Rails engine. To install it, include it in your `Gemfile`:
30
+ The included Dockerfile builds a container running a Rails app with Rhea.
31
31
 
32
- ```ruby
33
- gem 'rhea'
34
- ```
32
+ 1. Configure Rhea by copying and modifying `rhea.rb.example`:
33
+ * `cp rhea.rb.example rhea.rb`
34
+ * Modify `rhea.rb` (see [Configuration](#configuration))
35
+ 2. Build the container: `docker build -it rhea .`
36
+ 3. Run it: `docker run --rm -p 3000:3000 rhea`
35
37
 
36
- Mount it in `routes.rb`:
37
38
 
38
- ```ruby
39
- mount Rhea::Engine => '/rhea'
40
- ```
41
39
 
42
- And configure it in `config/initializers/rhea.rb`:
40
+ Configuration
41
+ ---
42
+
43
+ Rhea is configured in `rhea.rb`. The only required configuration option is `kube_api`, which configures Rhea to talk to your Kubernetes API.
44
+
45
+ ### kube_api
46
+
47
+ These options are passed through to [kubeclient](https://github.com/abonas/kubeclient), so anything that's valid in `kubeclient` is valid here.
48
+
49
+ #### No authentication
43
50
 
44
51
  ```ruby
52
+ # rhea.rb
45
53
  require 'rhea'
46
54
 
47
55
  Rhea.configure do |config|
48
56
  config.kube_api = {
49
- options: {
50
- ssl_options: {
51
- client_key: OpenSSL::PKey::RSA.new(Rails.root.join(ENV['KEYS_DIRECTORY'], 'apiserver-key.pem').read),
52
- client_cert: OpenSSL::X509::Certificate.new(Rails.root.join(ENV['KEYS_DIRECTORY'], 'apiserver.pem').read),
53
- ca_file: Rails.root.join(ENV['KEYS_DIRECTORY'], 'ca.pem').to_s,
54
- verify_ssl: OpenSSL::SSL::VERIFY_PEER
55
- }
56
- },
57
- url: 'https://kubernetes.example.com/api/'
57
+ url: 'https://kubernetes.example.com/api/',
58
+ options: {}
58
59
  }
59
- config.default_image = 'docker.registry.com/myworker:latest'
60
60
  end
61
61
  ```
62
62
 
63
- Configuration
64
- -------------
63
+ #### Client certificate authentication
65
64
 
66
- See [Installation](#installation) for basic configuration.
65
+ Create a `credentials` directory in the root of this directory and copy the following files into it:
67
66
 
68
- #### kube_api
67
+ ```bash
68
+ credentials/apiserver.crt
69
+ credentials/apiserver.key
70
+ credentials/ca.crt
71
+ ```
69
72
 
70
- The API options. These are simply passed to [kubeclient](https://github.com/abonas/kubeclient), so anything that's valid in `kubeclient` is valid here. Here's an example:
73
+ Then configure `rhea.rb` to use them:
71
74
 
72
75
  ```ruby
73
- config.kube_api = {
74
- options: {
75
- ssl_options: {
76
- client_key: OpenSSL::PKey::RSA.new(Rails.root.join(ENV['KEYS_DIRECTORY'], 'apiserver-key.pem').read),
77
- client_cert: OpenSSL::X509::Certificate.new(Rails.root.join(ENV['KEYS_DIRECTORY'], 'apiserver.pem').read),
78
- ca_file: Rails.root.join(ENV['KEYS_DIRECTORY'], 'ca.pem').to_s,
79
- verify_ssl: OpenSSL::SSL::VERIFY_PEER
76
+ # rhea.rb
77
+ require 'rhea'
78
+
79
+ Rhea.configure do |config|
80
+ config.kube_api = {
81
+ url: 'https://kubernetes.example.com/api/',
82
+ options: {
83
+ ssl_options: {
84
+ client_key: OpenSSL::PKey::RSA.new(Rails.root.join('config/credentials/apiserver.key').read),
85
+ client_cert: OpenSSL::X509::Certificate.new(Rails.root.join('config/credentials/apiserver.crt').read),
86
+ ca_file: Rails.root.join('config/credentials/ca.crt').to_s,
87
+ verify_ssl: OpenSSL::SSL::VERIFY_PEER
88
+ }
80
89
  }
81
- },
82
- url: 'https://kubernetes.example.com/api/'
83
- }
90
+ }
91
+ end
84
92
  ```
85
93
 
86
- #### command_types
94
+ The `credentials/*` files above are generated when you create the cluster. For example, if you're using minikube, they're located in `~/.minikube/`.
95
+
96
+ ### command_types
87
97
 
88
98
  Command types are custom templates that let you create commands more easily. They can be used in the command creation form. `$INPUT` is the value that's passed in from the form input.
89
99
 
@@ -112,7 +122,7 @@ config.command_types = [
112
122
  ]
113
123
  ```
114
124
 
115
- #### container_options
125
+ ### container_options
116
126
 
117
127
  By default, each pod has a single, minimally-configured container. You can easily configure additional container options, which will be merged into the pod's `spec.template.spec.containers[0]`.
118
128
 
@@ -131,7 +141,7 @@ config.container_options = {
131
141
  }
132
142
  ```
133
143
 
134
- #### default_command_type_key
144
+ ### default_command_type_key
135
145
 
136
146
  This will be used to set the default command type when creating new commands.
137
147
 
@@ -139,7 +149,7 @@ This will be used to set the default command type when creating new commands.
139
149
  config.default_command_type_key = 'goworker'
140
150
  ```
141
151
 
142
- #### default_image
152
+ ### default_image
143
153
 
144
154
  This will be used to set the default image when creating new commands.
145
155
 
@@ -147,7 +157,7 @@ This will be used to set the default image when creating new commands.
147
157
  config.default_image = 'docker.registry.com/myworker:latest'
148
158
  ```
149
159
 
150
- #### env_vars
160
+ ### env_vars
151
161
 
152
162
  This will be used to set custom environment variables in pods scheduled by Rhea.
153
163
 
@@ -157,6 +167,39 @@ config.env_vars = {
157
167
  }
158
168
  ```
159
169
 
170
+ Using Rhea as a Rails engine
171
+ ---
172
+
173
+ Rhea is also available as a Rails engine. To install it in a Rails app, include it in your `Gemfile`:
174
+
175
+ ```ruby
176
+ gem 'rhea'
177
+ ```
178
+
179
+ And mount it in `routes.rb`:
180
+
181
+ ```ruby
182
+ mount Rhea::Engine => '/rhea'
183
+ ```
184
+
185
+ You'll then configure Rhea in `config/initializers/rhea.rb`. See [Configuration](#configuration) for details.
186
+
187
+ Development
188
+ ---
189
+
190
+ Use the sample Rails app with Rhea.
191
+
192
+ 1. `cd examples/rhea-rails`
193
+ 2. Update the rhea Gem in the sample app's `Gemfile`:
194
+ - `gem 'rhea', git: 'https://github.com/entelo/rhea.git'`
195
+ to
196
+ - `gem 'rhea', path: '../../'`
197
+
198
+ 3. Modify `config/rhea.yml` for your needs
199
+ 4. `bundle install`
200
+ 5. `rails server KUBE_API_URL=http://localhost:8080/api/`
201
+ 6. Visit http://localhost:3000
202
+
160
203
  Testing
161
204
  -------
162
205
 
@@ -29,3 +29,6 @@ h1, h2, h3, h4, h5, h6
29
29
 
30
30
  .form-horizontal .control-label
31
31
  padding-right: 0
32
+
33
+ table
34
+ word-wrap: break-word
@@ -4,7 +4,6 @@ module Rhea
4
4
  @commands = Rhea::Kubernetes::Commands::All.new.perform
5
5
  @default_image = Rhea.configuration.default_image
6
6
  @images = (@commands.map(&:image) + [@default_image]).uniq.sort
7
- params[:image] ||= @default_image
8
7
  if params[:image].present?
9
8
  @commands = @commands.select { |command| command.image == params[:image] }
10
9
  end
@@ -9,7 +9,12 @@
9
9
  .col-sm-9
10
10
  = select_tag :command_type_key, options_for_select(Rhea::CommandType.options_for_select, Rhea.configuration.default_command_type_key), class: 'form-control', style: 'width: 90px;', required: 'required'
11
11
  .form-group
12
- = label_tag :command_type_input, 'Input', class: 'col-sm-3 control-label'
12
+ = label_tag :command_syntax, 'Command', class: 'col-sm-3 control-label', style: 'font-weight: normal;'
13
+ .col-sm-9
14
+ %pre.command-syntax{style: 'font-size: 12px;'}
15
+ = Rhea::CommandType.find(Rhea.configuration.default_command_type_key).displayed_format
16
+ .form-group
17
+ = label_tag :command_type_input, '$input', class: 'col-sm-3 control-label'
13
18
  .col-sm-9
14
19
  = text_field_tag :command_type_input, nil, class: 'form-control', style: 'width: 100%;'
15
20
  .form-group
@@ -19,4 +24,4 @@
19
24
  .form-group
20
25
  .col-sm-3
21
26
  .col-sm-9
22
- = submit_tag 'Create', class: 'btn btn-default'
27
+ = submit_tag 'Create', class: 'btn btn-success'
@@ -1,7 +1,7 @@
1
1
  %table.table.table-condensed.table-striped
2
2
  %thead
3
3
  %tr
4
- %th
4
+ %th{style: 'width: 25px;'}
5
5
  %input{type: 'checkbox', id: 'check-all'}
6
6
  %th Image
7
7
  %th Command
@@ -13,7 +13,8 @@
13
13
  - commands.each do |command|
14
14
  - escaped_image_expression = CGI.escape([command.image, command.expression].join(Rhea::Command::IMAGE_EXPRESSION_SEPARATOR))
15
15
  %tr
16
- %td= check_box_tag 'batch_image_expressions[]', escaped_image_expression, false, class: 'command-checkbox'
16
+ %td
17
+ = check_box_tag 'batch_image_expressions[]', escaped_image_expression, false, class: 'command-checkbox checkbox'
17
18
  %td= humanize_image(command.image)
18
19
  %td= command.expression
19
20
  %td= command.process_count
@@ -24,9 +25,9 @@
24
25
  = time_ago_in_words(command.created_at.in_time_zone(Time.zone), include_seconds: true)
25
26
  ago
26
27
  %td{ style: 'white-space: nowrap;' }
27
- = link_to redeploy_commands_path(image_expression: escaped_image_expression), title: 'Redeploy', class: 'btn btn-info btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
28
+ = link_to redeploy_commands_path(image_expression: escaped_image_expression), title: 'Redeploy', class: 'btn btn-primary btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
28
29
  %span.glyphicon.glyphicon-cloud-download
29
- = link_to reschedule_commands_path(image_expression: escaped_image_expression), title: 'Reschedule', class: 'btn btn-info btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
30
+ = link_to reschedule_commands_path(image_expression: escaped_image_expression), title: 'Reschedule', class: 'btn btn-primary btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
30
31
  %span.glyphicon.glyphicon-fullscreen
31
32
  - if command.process_count == 0
32
33
  = link_to delete_commands_path(image_expression: escaped_image_expression), title: 'Delete', class: 'btn btn-danger btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
@@ -37,15 +38,15 @@
37
38
  %tr
38
39
  %td{ colspan: 2 }
39
40
  .batch-actions{ style: 'display: none;' }
40
- = button_tag name: 'batch_action', value: 'redeploy', title: 'Redeploy', class: 'btn btn-info btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
41
+ = button_tag name: 'batch_action', value: 'redeploy', title: 'Redeploy', class: 'btn btn-primary btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
41
42
  %span.glyphicon.glyphicon-cloud-download
42
- = button_tag name: 'batch_action', value: 'reschedule', title: 'Reschedule', class: 'btn btn-info btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
43
+ = button_tag name: 'batch_action', value: 'reschedule', title: 'Reschedule', class: 'btn btn-primary btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
43
44
  %span.glyphicon.glyphicon-fullscreen
44
45
  = button_tag name: 'batch_action', value: 'stop', title: 'Stop', class: 'btn btn-warning btn-xs btn-action', 'data-toggle': 'tooltip', 'data-placement': 'bottom' do
45
46
  %span.glyphicon.glyphicon-stop
46
47
  %td
47
48
  %td
48
49
  %td
49
- = button_tag 'Save', name: 'batch_action', value: 'scale', class: 'btn btn-default'
50
+ = button_tag 'Save', name: 'batch_action', value: 'scale', class: 'btn btn-success'
50
51
  %td
51
52
  %td
@@ -1,25 +1,31 @@
1
1
  .row
2
2
  .col-md-8
3
- .pull-right
4
- = form_tag commands_path, method: 'GET', class: 'form-inline' do
5
- .form-group
6
- = label_tag :image, 'Image:', style: 'margin-right: 5px; font-size: 12px; font-weight: normal;'
7
- - image_options = [['All', nil]] + @images.map { |image| [humanize_image(image), image] }
8
- = select_tag :image, options_for_select(image_options, params[:image].presence), class: 'form-control input-sm', onchange: "$(this).closest('form').submit();"
9
- %h3 Commands
10
- - if @commands.blank?
11
- %p No commands found.
12
- - else
13
- = form_tag batch_update_commands_path, method: 'POST' do
14
- = hidden_field_tag :redirect_to, request.fullpath
15
- = render partial: 'rhea/commands/table', locals: { commands: @commands }
16
- = link_to 'Export', export_commands_path(format: 'json'), class: 'btn btn-default'
17
- = form_tag import_commands_path, method: 'PUT', multipart: true, style: 'display: inline-block;' do
18
- %span.btn.btn-default.btn-file
19
- Import
20
- = file_field_tag :data, accept: 'application/json', onchange: "$(this).closest('form').submit();"
21
- %br
22
- %br
3
+ .row
4
+ .col-md-12
5
+ .pull-left
6
+ = form_tag commands_path, method: 'GET', class: 'form-inline' do
7
+ .form-group
8
+ = label_tag :image, 'Image', style: 'margin-right: 5px; font-size: 13px;'
9
+ - image_options = [['All', nil]] + @images.map { |image| [humanize_image(image), image] }
10
+ = select_tag :image, options_for_select(image_options, params[:image].presence), class: 'form-control', onchange: "$(this).closest('form').submit();"
11
+ .pull-right
12
+ = form_tag import_commands_path, method: 'PUT', multipart: true, style: 'display: inline-block;' do
13
+ %span.btn.btn-default.btn-file
14
+ Import
15
+ = file_field_tag :data, accept: 'application/json', onchange: "$(this).closest('form').submit();"
16
+ = link_to 'Export', export_commands_path(format: 'json'), class: 'btn btn-default'
17
+ %br
18
+ %br
19
+ %br
20
+ .row
21
+ .col-md-12
22
+ - if @commands.present?
23
+ = form_tag batch_update_commands_path, method: 'POST' do
24
+ = hidden_field_tag :redirect_to, request.fullpath
25
+ = render partial: 'rhea/commands/table', locals: { commands: @commands }
26
+ - else
27
+ %p
28
+ No commands found.
23
29
 
24
30
  .col-md-4
25
31
  .panel.panel-default
@@ -28,12 +34,6 @@
28
34
  .panel-body
29
35
  = render partial: 'rhea/commands/form'
30
36
 
31
- .panel.panel-default
32
- .panel-heading
33
- %h4 Command Types
34
- .panel-body
35
- = render partial: 'rhea/command_types/list'
36
-
37
37
  :javascript
38
38
  var checkboxes = $('.command-checkbox');
39
39
  var batchActions = $('.batch-actions');
@@ -41,11 +41,18 @@
41
41
  var toggleBatchActions = function() {
42
42
  batchActions.toggle(checkboxes.filter(':checked').length > 0);
43
43
  return true;
44
- }
44
+ };
45
+
46
+ var updateCommandSyntax = function() {
47
+ var syntax = this.selectedOptions[0].dataset.syntax;
48
+ $('.command-syntax').text(syntax);
49
+ };
45
50
 
46
51
  checkboxes.on('click', toggleBatchActions);
47
52
 
48
53
  $('#check-all').change(function(){
49
54
  $(".command-checkbox").prop('checked', $(this).prop("checked"));
50
55
  toggleBatchActions()
51
- })
56
+ });
57
+
58
+ $('#command_type_key').on('change', updateCommandSyntax);
@@ -4,7 +4,6 @@
4
4
  %th Time
5
5
  %th
6
6
  %th Host
7
- %th Message
8
7
  %th Type
9
8
  %th Resource Type
10
9
  %th Resource ID
@@ -16,9 +15,10 @@
16
15
  = time_ago_in_words(event.created_at.in_time_zone(Time.zone), include_seconds: true)
17
16
  ago
18
17
  %td= event.hostname
19
- %td= simple_format(event.message)
20
18
  %td= event.type
21
19
  %td= event.resource_type
22
20
  %td= event.resource_id
21
+ %tr
22
+ %td{colspan: 6}= simple_format(event.message)
23
23
 
24
- = paginate @events
24
+ = paginate @events
@@ -1,4 +1,4 @@
1
- %table.table.table-striped
1
+ %table.table.table-condensed.table-striped
2
2
  %thead
3
3
  %tr
4
4
  %th Host
@@ -26,4 +26,4 @@
26
26
  - if uniq_phases.length == 1
27
27
  = uniq_phases.first
28
28
  - else
29
- = phases.sort.join(', ')
29
+ = phases.sort.join(', ')