prometheus-splash 0.6.1 → 0.7.0

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
  SHA256:
3
- metadata.gz: 3048edcf69c8bac285eab790a497fddbb9a4420a5cee8738ee1397c0a7c39587
4
- data.tar.gz: adb8f52b4e3b2d808728e092960e648768a45d8fbb66876ca7c585f492516c86
3
+ metadata.gz: 4e97bc4cce28c28f041ef5699bf6d3236001e84517bdefe8449cc572952997d2
4
+ data.tar.gz: c8e67cdc8089ff1db9e19ea4b86b84b52a64515d167b11df4f70e0e85e42f9f8
5
5
  SHA512:
6
- metadata.gz: fd9ed4dc543ea0a81cd163c73988424a87b76a5e094f548900e30ff71db7e8525798d9c824113ecf8972d2e26b6a616d2393a1afb3a1e3caaa8f62ebb331f3dc
7
- data.tar.gz: 23635fa7711d83e15f8b859d47bdcea3fa4dadc268cb899b46282555b73a2f998bf38614a48ec54997e9fe9986a78098fc2a9c818183be37e7dbd913bc7cfe8a
6
+ metadata.gz: 6642f9127b2f422e839d0b19c10c4625eb8b86bb1feeb7cd8ff2ba00369905fc1bb8a3f078a896cf3cf5e661273fc355c6194dde625673e9a17dc4bba14c3bc9
7
+ data.tar.gz: 10d052291ebe57a916f4079c23934fda5dac4e44d3ec45856982ba2b827c2764a57dd3990bd4819847278d7f6a5b22996f7e24dd5a4bcfc3936091b71d599645
@@ -104,6 +104,8 @@ module CLISplash
104
104
  def schedule(sequence)
105
105
  options[:sequence] = sequence
106
106
  acase = run_as_root :schedule_seq, options
107
+ log = get_logger
108
+ log.info "Feature in development"
107
109
  splash_exit acase
108
110
  end
109
111
 
@@ -7,7 +7,7 @@ module Splash
7
7
  module Constants
8
8
 
9
9
  # Current splash version
10
- VERSION = "0.6.1"
10
+ VERSION = "0.7.0"
11
11
 
12
12
  # the path to th config file, not overridable by config
13
13
  CONFIG_FILE = "/etc/splash.yml"
@@ -0,0 +1,28 @@
1
+
2
+
3
+
4
+
5
+ WebAdminApp.get '/api/sequences/list.?:format?' do
6
+ log = get_logger
7
+ format = (params[:format])? format_by_extensions(params[:format]) : format_by_extensions('json')
8
+ log.call "api : sequences, verb : GET, route : list, format : #{format}"
9
+ obj = splash_return case: :quiet_exit, :more => "Sequences list"
10
+ obj[:data] = get_config.sequences
11
+ content_type format
12
+ format_response(obj, (params[:format])? format_by_extensions(params[:format]): request.accept.first)
13
+ end
14
+
15
+ WebAdminApp.get '/api/sequences/show/:name.?:format?' do
16
+ log = get_logger
17
+ format = (params[:format])? format_by_extensions(params[:format]) : format_by_extensions('json')
18
+ log.call "api : sequences, verb : GET, route : show, item : #{params[:name]} , format : #{format}"
19
+ sequences_recordset = get_config.sequences[params[:name].to_sym]
20
+ unless sequences_recordset.nil? then
21
+ obj = splash_return case: :quiet_exit
22
+ obj[:data] = sequences_recordset
23
+ else
24
+ obj = splash_return case: :not_found, :more => "Sequence not configured"
25
+ end
26
+ content_type format
27
+ format_response(obj, (params[:format])? format_by_extensions(params[:format]): request.accept.first)
28
+ end
@@ -1,5 +1,5 @@
1
1
  WebAdminApp.get '/documentation' do
2
- get_menu 5
2
+ get_menu 6
3
3
  filename = search_file_in_gem("prometheus-splash","README.md")
4
4
  @data = Kramdown::Document.new(File::readlines(filename).join).to_html
5
5
  slim :documentation, :format => :html
@@ -12,7 +12,7 @@ WebAdminApp.use Rack::ReverseProxy do
12
12
  end
13
13
 
14
14
  WebAdminApp.get '/proxy/links' do
15
- get_menu 4
15
+ get_menu 5
16
16
 
17
17
  config = get_config
18
18
  if config.webadmin_proxy == true then
@@ -1,5 +1,5 @@
1
1
  WebAdminApp.get '/restclient' do
2
- get_menu 3
2
+ get_menu 4
3
3
  slim :restclient, :format => :html
4
4
  end
5
5
 
@@ -0,0 +1,7 @@
1
+ WebAdminApp.get '/sequences' do
2
+ get_menu 3
3
+ url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/sequences/list.yml"
4
+ raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
5
+ @data = YAML::load(raw)[:data]
6
+ slim :sequences, :format => :html
7
+ end
@@ -4,8 +4,8 @@ Dir[File.dirname(__FILE__) + '/helpers/*.rb'].each {|file| require file unless
4
4
  Slim::Engine.set_options pretty: true
5
5
 
6
6
  def get_menu(current)
7
- @menu = ['Logs','Processes','Commands','RestCLIENT','Proxy/Links','Documentation']
8
- @menu_icons = {'Logs' => "file-text",'Processes' => "cogs",'Commands' => 'play-circle-o','RestCLIENT' => "server",'Proxy/Links' => 'random','Documetation' => 'medkit'}
7
+ @menu = ['Logs','Processes','Commands','Sequences','RestCLIENT','Proxy/Links','Documentation']
8
+ @menu_icons = {'Logs' => "file-text",'Processes' => "cogs",'Commands' => 'play-circle-o','Sequences' => "cubes",'RestCLIENT' => "server",'Proxy/Links' => 'random','Documetation' => 'medkit'}
9
9
  @current_item = nil
10
10
  @current_item = @menu[current] unless current == -1
11
11
  end
@@ -0,0 +1,50 @@
1
+ h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i>&nbsp;&nbsp;Sequences configured in Splash
2
+
3
+ div.uk-width-medium-1-1
4
+ div.uk-panel.uk-panel-box
5
+ span.uk-text-large.uk-text-bold List of sequences availables
6
+ br
7
+
8
+ div.uk-accordion(data-uk-accordion)
9
+ - @data.each do |sequence,content|
10
+ h3.uk-accordion-title <b>Name</b> : #{sequence}
11
+ div.uk-accordion-content
12
+ table.uk-table.uk-table-hover.uk-table-striped
13
+ thead
14
+ tr
15
+ th Options
16
+ th Definition
17
+ th Actions
18
+ tbody
19
+ tr
20
+ td
21
+ dl.uk-description-list-horizontal
22
+
23
+ - if content[:options]
24
+ - if content[:options][:continue]
25
+ ul
26
+ li <i class="uk-icon-check-square-o"></i>&nbsp;<b>Continue execution on error</b> : #{content[:options][:continue]}
27
+ - if content[:schedule]
28
+ ul
29
+ li <i class="uk-icon-calendar"></i>&nbsp;<b>Scheduling</b> :
30
+ <ul>
31
+ <li> <b><i>Type</b></i> : #{content[:schedule].keys.first}</li>
32
+ <li> <b><i>Value</b></i> : #{content[:schedule].values.first}</li>
33
+ </ul>
34
+ td
35
+ dl.uk-description-list-horizontal
36
+ - content[:definition].each_with_index do |step,i|
37
+ dt <i class="uk-icon-check-square-o"></i>&nbsp;Step #{i+1} :
38
+ dd #{step[:step]}
39
+ ul
40
+ li <i class="uk-icon-cog"></i>&nbsp;<b>Command</b> : #{step[:command]}
41
+ - if step[:on_host]
42
+ li <i class="uk-icon-chevron-circle-right"></i>&nbsp;<b>Remote execution target</b> : #{step[:on_host]}
43
+ - if not step[:callback].nil?
44
+ li <i class="uk-icon-share-square-o"></i>&nbsp;<b>Execute Callback</b> : #{step[:callback]}
45
+ - if not step[:trace].nil?
46
+ li <i class="uk-icon-pencil-square-o"></i>&nbsp;<b>Trace Execution</b> : #{step[:trace]}
47
+ - if not step[:notify].nil?
48
+ li <i class="uk-icon-external-link"></i>&nbsp;<b>Notify Execution in Prometheus</b> : #{step[:notify]}
49
+
50
+ td
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-splash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain GEORGES
@@ -385,6 +385,7 @@ files:
385
385
  - lib/splash/webadmin/api/routes/init.rb
386
386
  - lib/splash/webadmin/api/routes/logs.rb
387
387
  - lib/splash/webadmin/api/routes/process.rb
388
+ - lib/splash/webadmin/api/routes/sequences.rb
388
389
  - lib/splash/webadmin/main.rb
389
390
  - lib/splash/webadmin/portal/controllers/commands.rb
390
391
  - lib/splash/webadmin/portal/controllers/documentation.rb
@@ -394,6 +395,7 @@ files:
394
395
  - lib/splash/webadmin/portal/controllers/processes.rb
395
396
  - lib/splash/webadmin/portal/controllers/proxy.rb
396
397
  - lib/splash/webadmin/portal/controllers/restclient.rb
398
+ - lib/splash/webadmin/portal/controllers/sequences.rb
397
399
  - lib/splash/webadmin/portal/init.rb
398
400
  - lib/splash/webadmin/portal/public/css/ultragreen.css
399
401
  - lib/splash/webadmin/portal/public/fonts/FontAwesome.otf
@@ -414,6 +416,7 @@ files:
414
416
  - lib/splash/webadmin/portal/views/proxy.slim
415
417
  - lib/splash/webadmin/portal/views/restclient.slim
416
418
  - lib/splash/webadmin/portal/views/restclient_result.slim
419
+ - lib/splash/webadmin/portal/views/sequences.slim
417
420
  - prometheus-splash.gemspec
418
421
  - spec/helpers_spec.rb
419
422
  - spec/templates_spec.rb