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 +4 -4
- data/lib/splash/cli/sequences.rb +2 -0
- data/lib/splash/constants.rb +1 -1
- data/lib/splash/webadmin/api/routes/sequences.rb +28 -0
- data/lib/splash/webadmin/portal/controllers/documentation.rb +1 -1
- data/lib/splash/webadmin/portal/controllers/proxy.rb +1 -1
- data/lib/splash/webadmin/portal/controllers/restclient.rb +1 -1
- data/lib/splash/webadmin/portal/controllers/sequences.rb +7 -0
- data/lib/splash/webadmin/portal/init.rb +2 -2
- data/lib/splash/webadmin/portal/views/sequences.slim +50 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e97bc4cce28c28f041ef5699bf6d3236001e84517bdefe8449cc572952997d2
|
4
|
+
data.tar.gz: c8e67cdc8089ff1db9e19ea4b86b84b52a64515d167b11df4f70e0e85e42f9f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6642f9127b2f422e839d0b19c10c4625eb8b86bb1feeb7cd8ff2ba00369905fc1bb8a3f078a896cf3cf5e661273fc355c6194dde625673e9a17dc4bba14c3bc9
|
7
|
+
data.tar.gz: 10d052291ebe57a916f4079c23934fda5dac4e44d3ec45856982ba2b827c2764a57dd3990bd4819847278d7f6a5b22996f7e24dd5a4bcfc3936091b71d599645
|
data/lib/splash/cli/sequences.rb
CHANGED
data/lib/splash/constants.rb
CHANGED
@@ -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
|
@@ -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> 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> <b>Continue execution on error</b> : #{content[:options][:continue]}
|
27
|
+
- if content[:schedule]
|
28
|
+
ul
|
29
|
+
li <i class="uk-icon-calendar"></i> <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> Step #{i+1} :
|
38
|
+
dd #{step[:step]}
|
39
|
+
ul
|
40
|
+
li <i class="uk-icon-cog"></i> <b>Command</b> : #{step[:command]}
|
41
|
+
- if step[:on_host]
|
42
|
+
li <i class="uk-icon-chevron-circle-right"></i> <b>Remote execution target</b> : #{step[:on_host]}
|
43
|
+
- if not step[:callback].nil?
|
44
|
+
li <i class="uk-icon-share-square-o"></i> <b>Execute Callback</b> : #{step[:callback]}
|
45
|
+
- if not step[:trace].nil?
|
46
|
+
li <i class="uk-icon-pencil-square-o"></i> <b>Trace Execution</b> : #{step[:trace]}
|
47
|
+
- if not step[:notify].nil?
|
48
|
+
li <i class="uk-icon-external-link"></i> <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.
|
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
|