prometheus-splash 0.8.0 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -3
- data/README.md +400 -178
- data/config/splash.yml +28 -14
- data/lib/splash/backends.rb +7 -1
- data/lib/splash/backends/file.rb +1 -1
- data/lib/splash/cli/commands.rb +122 -37
- data/lib/splash/cli/config.rb +12 -1
- data/lib/splash/cli/daemon.rb +1 -1
- data/lib/splash/cli/logs.rb +144 -48
- data/lib/splash/cli/process.rb +145 -52
- data/lib/splash/cli/transfers.rb +10 -3
- data/lib/splash/commands.rb +115 -40
- data/lib/splash/config.rb +112 -29
- data/lib/splash/config/flush.rb +2 -2
- data/lib/splash/constants.rb +3 -4
- data/lib/splash/daemon/orchestrator.rb +6 -7
- data/lib/splash/daemon/orchestrator/grammar.rb +1 -1
- data/lib/splash/dependencies.rb +1 -0
- data/lib/splash/exiter.rb +1 -1
- data/lib/splash/helpers.rb +1 -1
- data/lib/splash/logs.rb +94 -16
- data/lib/splash/monkeys.rb +5 -0
- data/lib/splash/processes.rb +91 -16
- data/lib/splash/sequences.rb +6 -1
- data/lib/splash/transfers.rb +13 -8
- data/lib/splash/webadmin/api/routes/commands.rb +15 -3
- data/lib/splash/webadmin/api/routes/config.rb +140 -2
- data/lib/splash/webadmin/api/routes/logs.rb +32 -17
- data/lib/splash/webadmin/api/routes/process.rb +21 -9
- data/lib/splash/webadmin/api/routes/sequences.rb +2 -2
- data/lib/splash/webadmin/main.rb +15 -1
- data/lib/splash/webadmin/portal/controllers/commands.rb +101 -1
- data/lib/splash/webadmin/portal/controllers/documentation.rb +2 -0
- data/lib/splash/webadmin/portal/controllers/home.rb +6 -1
- data/lib/splash/webadmin/portal/controllers/logs.rb +71 -1
- data/lib/splash/webadmin/portal/controllers/processes.rb +75 -3
- data/lib/splash/webadmin/portal/controllers/proxy.rb +2 -1
- data/lib/splash/webadmin/portal/controllers/restclient.rb +6 -1
- data/lib/splash/webadmin/portal/controllers/sequences.rb +2 -0
- data/lib/splash/webadmin/portal/public/css/ultragreen.css +6 -0
- data/lib/splash/webadmin/portal/public/favicon.ico +0 -0
- data/lib/splash/webadmin/portal/views/command_form.slim +45 -0
- data/lib/splash/webadmin/portal/views/command_history.slim +27 -0
- data/lib/splash/webadmin/portal/views/commands.slim +70 -20
- data/lib/splash/webadmin/portal/views/documentation.slim +1 -1
- data/lib/splash/webadmin/portal/views/home.slim +19 -20
- data/lib/splash/webadmin/portal/views/layout.slim +2 -2
- data/lib/splash/webadmin/portal/views/log_form.slim +27 -0
- data/lib/splash/webadmin/portal/views/log_history.slim +24 -0
- data/lib/splash/webadmin/portal/views/logs.slim +95 -21
- data/lib/splash/webadmin/portal/views/nav.slim +1 -1
- data/lib/splash/webadmin/portal/views/not_found.slim +1 -1
- data/lib/splash/webadmin/portal/views/process_form.slim +24 -0
- data/lib/splash/webadmin/portal/views/process_history.slim +24 -0
- data/lib/splash/webadmin/portal/views/processes.slim +80 -7
- data/lib/splash/webadmin/portal/views/proxy.slim +2 -2
- data/lib/splash/webadmin/portal/views/restclient.slim +7 -4
- data/lib/splash/webadmin/portal/views/restclient_result.slim +24 -20
- data/lib/splash/webadmin/portal/views/sequences.slim +1 -1
- data/prometheus-splash.gemspec +4 -4
- data/ultragreen_roodi_coding_convention.yml +4 -4
- metadata +18 -10
@@ -1,7 +1,107 @@
|
|
1
|
-
WebAdminApp.get '/commands' do
|
1
|
+
WebAdminApp.get '/commands/?:status?/?:command?' do
|
2
2
|
get_menu 2
|
3
|
+
log = get_logger
|
4
|
+
log.call "WEB : commands, verb : GET, controller : /commands"
|
3
5
|
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/commands/list.yml"
|
4
6
|
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
5
7
|
@data = YAML::load(raw)[:data]
|
8
|
+
@command_failed = params[:command] if params[:status] == 'failure'
|
9
|
+
@command_saved = params[:command] if params[:status] == 'success'
|
6
10
|
slim :commands, :format => :html
|
7
11
|
end
|
12
|
+
|
13
|
+
WebAdminApp.get '/get_command_history/:command' do
|
14
|
+
get_menu 2
|
15
|
+
log = get_logger
|
16
|
+
log.call "WEB : commands, verb : GET, controller : /get_command_history/:command"
|
17
|
+
@data = {}
|
18
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/commands/history/#{params[:command].to_s}.yml"
|
19
|
+
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
20
|
+
res = YAML::load(raw)
|
21
|
+
@data = res[:data] if res[:status] == :success
|
22
|
+
@command = params[:command].to_s
|
23
|
+
slim :command_history, :format => :html
|
24
|
+
end
|
25
|
+
|
26
|
+
WebAdminApp.get '/add_modify_command/?:command?' do
|
27
|
+
get_menu 2
|
28
|
+
log = get_logger
|
29
|
+
log.call "WEB : commands, verb : GET, controller : /add_modify_command/?:command?"
|
30
|
+
@data = {}
|
31
|
+
if params[:command] then
|
32
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/commands/show/#{params[:command].to_s}.yml"
|
33
|
+
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
34
|
+
res = YAML::load(raw)
|
35
|
+
@data = res[:data] if res[:status] == :success
|
36
|
+
if @data[:retention].class == Hash then
|
37
|
+
prov = @data[:retention].flatten.reverse.join(' ')
|
38
|
+
@data[:retention] = prov
|
39
|
+
end
|
40
|
+
if @data[:schedule].class == Hash then
|
41
|
+
prov = @data[:schedule].flatten.join(' ')
|
42
|
+
@data[:schedule] = prov
|
43
|
+
end
|
44
|
+
if @data[:delegate_to].class == Hash then
|
45
|
+
prov = "#{@data[:delegate_to][:remote_command]}@#{@data[:delegate_to][:host]}"
|
46
|
+
@data[:delegate_to] = prov
|
47
|
+
end
|
48
|
+
@data[:old_command] = params[:command].to_s
|
49
|
+
end
|
50
|
+
slim :command_form, :format => :html
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
WebAdminApp.post '/save_command' do
|
55
|
+
get_menu 2
|
56
|
+
log = get_logger
|
57
|
+
log.call "WEB : commands, verb : POST, controller : /save_command"
|
58
|
+
data = {}
|
59
|
+
unless params[:retention].blank?
|
60
|
+
value, key = params[:retention].split(' ')
|
61
|
+
key = (key.nil?)? :days : key.to_sym
|
62
|
+
value = value.to_i
|
63
|
+
key = :days if key == :day
|
64
|
+
key = :hours if key == :hour
|
65
|
+
if [:hours,:days].include? key then
|
66
|
+
data[:retention] = {key => value}
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
unless params[:schedule].blank?
|
71
|
+
key, value = params[:schedule].split(' ')
|
72
|
+
key = key.to_sym unless key.nil?
|
73
|
+
value = '' if value.nil?
|
74
|
+
if [:in,:every,:at].include? key and value.match(/\d+[m,d,s,h]/) then
|
75
|
+
data[:schedule] = {key => value }
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
unless params[:delegate_to].blank?
|
80
|
+
key, value = params[:delegate_to].split('@')
|
81
|
+
unless key.blank? or value.blank? then
|
82
|
+
data[:delegate_to] = {:remote_command => key.to_sym, :host => value.to_sym }
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
data[:desc] = params[:desc]
|
87
|
+
data[:command] = params[:command] unless params[:command].blank?
|
88
|
+
data[:on_failure] = params[:on_failure].to_sym unless params[:on_failure].blank?
|
89
|
+
data[:on_success] = params[:on_success].to_sym unless params[:on_success].blank?
|
90
|
+
data[:user] = params[:user] unless params[:user].blank?
|
91
|
+
data[:name] = params[:name].split(' ').first.to_sym
|
92
|
+
puts params.to_yaml
|
93
|
+
puts data.to_yaml
|
94
|
+
redirect "/command/failure/#{params[:name].to_s}" if data[:command].blank? and data[:delegate_to].blank?
|
95
|
+
if params[:update] then
|
96
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/deletecommand/#{params[:old_command]}"
|
97
|
+
raw = RestClient::Request.execute(method: 'DELETE', url: url,timeout: 10)
|
98
|
+
end
|
99
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/addcommand.yml"
|
100
|
+
raw = RestClient::Request.execute(method: 'POST', url: url,timeout: 10, payload: data.to_yaml)
|
101
|
+
res = YAML::load(raw)
|
102
|
+
if res[:status] == :success then
|
103
|
+
redirect "/commands/success/#{params[:name].to_s}"
|
104
|
+
else
|
105
|
+
redirect "/commands/failure/#{params[:name].to_s}"
|
106
|
+
end
|
107
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
WebAdminApp.get '/documentation' do
|
2
2
|
get_menu 6
|
3
|
+
log = get_logger
|
4
|
+
log.call "WEB : documentation, verb : GET, controller : /documentation"
|
3
5
|
filename = search_file_in_gem("prometheus-splash","README.md")
|
4
6
|
@data = Kramdown::Document.new(File::readlines(filename).join).to_html
|
5
7
|
slim :documentation, :format => :html
|
@@ -1,4 +1,6 @@
|
|
1
1
|
WebAdminApp.get '/' do
|
2
|
+
log = get_logger
|
3
|
+
log.call "WEB : BASE, verb : GET, controller : /"
|
2
4
|
get_menu -1
|
3
5
|
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/full.yml"
|
4
6
|
@raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
@@ -9,12 +11,15 @@ end
|
|
9
11
|
|
10
12
|
WebAdminApp.get '/home' do
|
11
13
|
get_menu 0
|
14
|
+
log = get_logger
|
15
|
+
log.call "WEB : home, verb : GET, controller : /home"
|
12
16
|
slim :home, :format => :html
|
13
17
|
end
|
14
18
|
|
15
19
|
WebAdminApp.get '/daemon/:action' do
|
16
20
|
content_type :text
|
17
|
-
|
21
|
+
log = get_logger
|
22
|
+
log.call "WEB : daemon, verb : GET, controller : /daemon/:action"
|
18
23
|
case params[:action]
|
19
24
|
when 'start'
|
20
25
|
startdaemon scheduling: true, purge: false
|
@@ -1,5 +1,7 @@
|
|
1
|
-
WebAdminApp.get '/logs' do
|
1
|
+
WebAdminApp.get '/logs/?:status?/?:label?' do
|
2
2
|
get_menu 0
|
3
|
+
log = get_logger
|
4
|
+
log.call "WEB : logs, verb : GET, controller : /logs/?:status?/?:label?"
|
3
5
|
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/logs/list.yml"
|
4
6
|
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
5
7
|
@data = YAML::load(raw)[:data]
|
@@ -7,8 +9,76 @@ WebAdminApp.get '/logs' do
|
|
7
9
|
raw = RestClient::Request.execute(method: 'POST', url: url,timeout: 10)
|
8
10
|
prov = YAML::load(raw)[:data]
|
9
11
|
@result = {}
|
12
|
+
@log_failed = params[:label] if params[:status] == 'failure'
|
13
|
+
@log_saved = params[:label] if params[:status] == 'success'
|
10
14
|
prov.each {|item|
|
11
15
|
@result[item[:label]] = item
|
12
16
|
}
|
13
17
|
slim :logs, :format => :html
|
14
18
|
end
|
19
|
+
|
20
|
+
|
21
|
+
WebAdminApp.get '/add_modify_log/?:label?' do
|
22
|
+
get_menu 0
|
23
|
+
log = get_logger
|
24
|
+
log.call "WEB : logs, verb : GET, controller : /add_modify_log/?:label?"
|
25
|
+
@data = {}
|
26
|
+
if params[:label] then
|
27
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/logs/show/#{params[:label].to_s}.yml"
|
28
|
+
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
29
|
+
res = YAML::load(raw)
|
30
|
+
@data = res[:data] if res[:status] == :success
|
31
|
+
@data[:old_label] = params[:label].to_s
|
32
|
+
if @data[:retention].class == Hash then
|
33
|
+
prov = @data[:retention].flatten.reverse.join(' ')
|
34
|
+
@data[:retention] = prov
|
35
|
+
end
|
36
|
+
end
|
37
|
+
slim :log_form, :format => :html
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
WebAdminApp.get '/get_log_history/:label' do
|
42
|
+
get_menu 0
|
43
|
+
log = get_logger
|
44
|
+
log.call "WEB : logs, verb : GET, controller : /get_log_history/:label"
|
45
|
+
@data = {}
|
46
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/logs/history/#{params[:label].to_s}.yml"
|
47
|
+
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
48
|
+
res = YAML::load(raw)
|
49
|
+
@data = res[:data] if res[:status] == :success
|
50
|
+
@label = params[:label].to_s
|
51
|
+
slim :log_history, :format => :html
|
52
|
+
end
|
53
|
+
|
54
|
+
WebAdminApp.post '/save_log' do
|
55
|
+
get_menu 0
|
56
|
+
log = get_logger
|
57
|
+
log.call "WEB : logs, verb : POST, controller : /save_log "
|
58
|
+
data = {}
|
59
|
+
unless params[:retention].blank?
|
60
|
+
value, key = params[:retention].split(' ')
|
61
|
+
key = (key.nil?)? :days : key.to_sym
|
62
|
+
value = value.to_i
|
63
|
+
key = :days if key == :day
|
64
|
+
key = :hours if key == :hour
|
65
|
+
if [:hours,:days].include? key then
|
66
|
+
data[:retention] = {key => value}
|
67
|
+
end
|
68
|
+
end
|
69
|
+
data[:log] = params[:log]
|
70
|
+
data[:pattern] = params[:pattern]
|
71
|
+
data[:label] = params[:label].split(' ').first.to_sym
|
72
|
+
if params[:update] then
|
73
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/deletelog/#{params[:old_label]}"
|
74
|
+
raw = RestClient::Request.execute(method: 'DELETE', url: url,timeout: 10)
|
75
|
+
end
|
76
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/addlog.yml"
|
77
|
+
raw = RestClient::Request.execute(method: 'POST', url: url,timeout: 10, payload: data.to_yaml)
|
78
|
+
res = YAML::load(raw)
|
79
|
+
if res[:status] == :success then
|
80
|
+
redirect "/logs/success/#{params[:label].to_s}"
|
81
|
+
else
|
82
|
+
redirect "/logs/failure/#{params[:label].to_s}"
|
83
|
+
end
|
84
|
+
end
|
@@ -1,14 +1,86 @@
|
|
1
|
-
WebAdminApp.get '/processes' do
|
1
|
+
WebAdminApp.get '/processes/?:status?/?:process?' do
|
2
2
|
get_menu 1
|
3
|
-
|
3
|
+
log = get_logger
|
4
|
+
log.call "WEB : processes, verb : GET, controller : /processes/?:status?/?:process?"
|
5
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/processes/list.yml"
|
4
6
|
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
5
7
|
@data = YAML::load(raw)[:data]
|
6
|
-
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/
|
8
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/processes/analyse.yml"
|
7
9
|
raw = RestClient::Request.execute(method: 'POST', url: url,timeout: 10)
|
8
10
|
prov = YAML::load(raw)[:data]
|
9
11
|
@result = {}
|
12
|
+
@process_failed = params[:process] if params[:status] == 'failure'
|
13
|
+
@process_saved = params[:process] if params[:status] == 'success'
|
10
14
|
prov.each {|item|
|
11
15
|
@result[item[:process]] = item
|
12
16
|
}
|
13
17
|
slim :processes, :format => :html
|
14
18
|
end
|
19
|
+
|
20
|
+
WebAdminApp.get '/add_modify_process/?:process?' do
|
21
|
+
get_menu 1
|
22
|
+
log = get_logger
|
23
|
+
log.call "WEB : processes, verb : GET, controller : /add_modify_process/?:process?"
|
24
|
+
@data = {}
|
25
|
+
if params[:process] then
|
26
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/processes/show/#{params[:process].to_s}.yml"
|
27
|
+
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
28
|
+
res = YAML::load(raw)
|
29
|
+
@data = res[:data] if res[:status] == :success
|
30
|
+
if @data[:retention].class == Hash then
|
31
|
+
prov = @data[:retention].flatten.reverse.join(' ')
|
32
|
+
@data[:retention] = prov
|
33
|
+
end
|
34
|
+
if @data[:patterns].class == Array then
|
35
|
+
prov = @data[:patterns].join('|')
|
36
|
+
@data[:patterns] = prov
|
37
|
+
end
|
38
|
+
@data[:old_process] = params[:process].to_s
|
39
|
+
end
|
40
|
+
slim :process_form, :format => :html
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
WebAdminApp.get '/get_process_history/:process' do
|
45
|
+
get_menu 1
|
46
|
+
log = get_logger
|
47
|
+
log.call "WEB : processes, verb : GET, controller : /get_process_history/:process"
|
48
|
+
@data = {}
|
49
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/processes/history/#{params[:process].to_s}.yml"
|
50
|
+
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
51
|
+
res = YAML::load(raw)
|
52
|
+
@data = res[:data] if res[:status] == :success
|
53
|
+
@process = params[:process].to_s
|
54
|
+
slim :process_history, :format => :html
|
55
|
+
end
|
56
|
+
|
57
|
+
WebAdminApp.post '/save_process' do
|
58
|
+
get_menu 1
|
59
|
+
log = get_logger
|
60
|
+
log.call "WEB : processes, verb : POST, controller : /save_process"
|
61
|
+
data = {}
|
62
|
+
data[:patterns] = params[:patterns].split('|')
|
63
|
+
data[:process] = params[:process].split(' ').first.to_sym
|
64
|
+
unless params[:retention].blank?
|
65
|
+
value, key = params[:retention].split(' ')
|
66
|
+
key = (key.nil?)? :days : key.to_sym
|
67
|
+
value = value.to_i
|
68
|
+
key = :days if key == :day
|
69
|
+
key = :hours if key == :hour
|
70
|
+
if [:hours,:days].include? key then
|
71
|
+
data[:retention] = {key => value}
|
72
|
+
end
|
73
|
+
end
|
74
|
+
if params[:update] then
|
75
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/deleteprocess/#{params[:old_process]}"
|
76
|
+
raw = RestClient::Request.execute(method: 'DELETE', url: url,timeout: 10)
|
77
|
+
end
|
78
|
+
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/addprocess.yml"
|
79
|
+
raw = RestClient::Request.execute(method: 'POST', url: url,timeout: 10, payload: data.to_yaml)
|
80
|
+
res = YAML::load(raw)
|
81
|
+
if res[:status] == :success then
|
82
|
+
redirect "/processes/success/#{params[:process].to_s}"
|
83
|
+
else
|
84
|
+
redirect "/processes/failure/#{params[:process].to_s}"
|
85
|
+
end
|
86
|
+
end
|
@@ -1,14 +1,19 @@
|
|
1
1
|
WebAdminApp.get '/restclient' do
|
2
|
+
log = get_logger
|
3
|
+
log.call "WEB : restclient, verb : GET, controller : /restclient"
|
2
4
|
get_menu 4
|
3
5
|
slim :restclient, :format => :html
|
4
6
|
end
|
5
7
|
|
6
8
|
WebAdminApp.post '/restclient/query' do
|
9
|
+
log = get_logger
|
10
|
+
log.call "WEB : processes, verb : GET, controller : /restclient/query"
|
7
11
|
@method = params[:method]
|
8
12
|
@url = params[:url]
|
13
|
+
@body = params[:body]
|
9
14
|
@notfound = false
|
10
15
|
begin
|
11
|
-
@result = RestClient::Request.execute(method: @method.to_sym, url: @url,timeout: 10)
|
16
|
+
@result = RestClient::Request.execute(method: @method.to_sym, url: @url,timeout: 10, payload: @body)
|
12
17
|
rescue SocketError
|
13
18
|
@result = false
|
14
19
|
rescue RestClient::NotFound => e
|
@@ -1,5 +1,7 @@
|
|
1
1
|
WebAdminApp.get '/sequences' do
|
2
2
|
get_menu 3
|
3
|
+
log = get_logger
|
4
|
+
log.call "WEB : sequences, verb : GET, controller : /sequences"
|
3
5
|
url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/sequences/list.yml"
|
4
6
|
raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
|
5
7
|
@data = YAML::load(raw)[:data]
|
Binary file
|
@@ -0,0 +1,45 @@
|
|
1
|
+
- unless @data.empty?
|
2
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Modify Splash command definition : #{@data[:process]}
|
3
|
+
- else
|
4
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Add new Splash command definition
|
5
|
+
|
6
|
+
script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js"
|
7
|
+
|
8
|
+
form.uk-form.uk-form-horizontal#query action="/save_command" method="POST"
|
9
|
+
div.uk-text-bold Definition
|
10
|
+
label.uk-form-label for="name" Name
|
11
|
+
<input class="uk-form-width-large" id="name" type="text" placeholder="name" name="name" value="#{@data[:name].to_s}" required>
|
12
|
+
div
|
13
|
+
label.uk-form-label for="command" Command
|
14
|
+
<input class="uk-form-width-large" id="command" type="text" placeholder="command" name="command" value="#{@data[:command].to_s}">
|
15
|
+
div
|
16
|
+
label.uk-form-label for="desc" Description
|
17
|
+
<input class="uk-form-width-large" id="desc" type="text" placeholder="description" name="desc" value="#{@data[:desc]}" required>
|
18
|
+
div
|
19
|
+
label.uk-form-label for="desc" Become User
|
20
|
+
<input class="uk-form-width-large" id="user" type="text" placeholder="user" name="user" value="#{@data[:user]}">
|
21
|
+
div
|
22
|
+
label.uk-form-label for="retention" Retention (Like "2 hours, 2 days")
|
23
|
+
<input class="uk-form-width-large" id="retention" type="text" placeholder="retention" name="retention" value="#{@data[:retention]}">
|
24
|
+
div
|
25
|
+
label.uk-form-label for="schedule" Scheduling (Like "'every 10m', 'in 1h', 'at 12:00'")
|
26
|
+
<input class="uk-form-width-large" id="schedule" type="text" placeholder="scheduling" name="schedule" value="#{@data[:schedule]}">
|
27
|
+
div
|
28
|
+
label.uk-form-label for="delegate_to" Delegation (Like "task_name@hostname")
|
29
|
+
<input class="uk-form-width-large" id="delegate_to" type="text" placeholder="delegation" name="delegate_to" value="#{@data[:delegate_to]}">
|
30
|
+
div
|
31
|
+
div
|
32
|
+
div.uk-text-bold Callbacks
|
33
|
+
label.uk-form-label for="on_success" On success
|
34
|
+
<input class="uk-form-width-large" id="on_success" type="text" placeholder="on success" name="on_success" value="#{@data[:on_success]}">
|
35
|
+
div
|
36
|
+
label.uk-form-label for="on_success" On failure
|
37
|
+
<input class="uk-form-width-large" id="on_failure" type="text" placeholder="on failure" name="on_failure" value="#{@data[:on_failure]}">
|
38
|
+
div
|
39
|
+
- unless @data.empty?
|
40
|
+
input type="hidden" name="update" value="true"
|
41
|
+
input type="hidden" name="old_command" value="#{@data[:old_command].to_s}"
|
42
|
+
div.uk-align-right
|
43
|
+
input.uk-button.uk-button-small-primary type="submit" value="Submit"
|
44
|
+
javascript:
|
45
|
+
$("#query").validate();
|
@@ -0,0 +1,27 @@
|
|
1
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> History for command #{@command} executions and monitoring
|
2
|
+
|
3
|
+
|
4
|
+
-
|
5
|
+
div.uk-width-medium-1-1
|
6
|
+
div.uk-panel.uk-panel-box
|
7
|
+
span.uk-text-large.uk-text-bold List of records
|
8
|
+
br
|
9
|
+
table#logrecords.uk-table.uk-table-hover.uk-table-striped
|
10
|
+
thead
|
11
|
+
tr
|
12
|
+
th Start Date
|
13
|
+
th End Date
|
14
|
+
th Execution time (sec)
|
15
|
+
th Status
|
16
|
+
th STDOUT empty ?
|
17
|
+
th STDERR empty ?
|
18
|
+
|
19
|
+
tbody
|
20
|
+
- @data.reverse.each do |key|
|
21
|
+
tr class="#{(key[key.keys.first][:status].to_s.split.last == "0")? 'uk-text-success' : 'uk-text-danger'}"
|
22
|
+
td #{key.keys.first}
|
23
|
+
td #{key[key.keys.first][:end_date]}
|
24
|
+
td #{key[key.keys.first][:exec_time]}
|
25
|
+
td #{key[key.keys.first][:status].to_s}
|
26
|
+
td #{key[key.keys.first][:stdout].empty?}
|
27
|
+
td #{key[key.keys.first][:stderr].empty?}
|