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,14 +1,49 @@
|
|
1
|
-
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Commands configured in Splash
|
1
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Commands configured in Splash
|
2
|
+
|
3
|
+
- unless @log_saved.nil?
|
4
|
+
javascript:
|
5
|
+
UIkit.notify("Command definition #{@command_saved} saved", {status:'success'});
|
6
|
+
- unless @log_failed.nil?
|
7
|
+
javascript:
|
8
|
+
UIkit.notify("Command definition #{@command_saved} not saved", {status:'danger'});
|
9
|
+
|
10
|
+
javascript:
|
11
|
+
$(document).on( 'click','input.delete-command',function(){
|
12
|
+
var id = this.id;
|
13
|
+
var url = "/api/config/deletecommand/" + id + ".json";
|
14
|
+
UIkit.modal.confirm('Are you sure?', function(){
|
15
|
+
console.debug(url)
|
16
|
+
$.ajax({
|
17
|
+
url: url,
|
18
|
+
type: 'DELETE',
|
19
|
+
success: function( data ) {
|
20
|
+
console.debug(data)
|
21
|
+
if (data['status'] == 'success') {
|
22
|
+
$('div#commandrecords h3#' + id).remove();
|
23
|
+
$('div#commandrecords div#' + id).remove();
|
24
|
+
UIkit.notify("Deleting log for " + id + " done", {status:'success'});
|
25
|
+
}
|
26
|
+
else
|
27
|
+
{
|
28
|
+
UIkit.notify("Deleting log for " + id + " failed !", {status:'danger'});
|
29
|
+
}
|
30
|
+
},
|
31
|
+
error: function(e) {
|
32
|
+
UIkit.notify("Deleting log for " + id + " failed !", {status:'danger'});
|
33
|
+
}
|
34
|
+
});
|
35
|
+
});
|
36
|
+
});
|
2
37
|
|
3
38
|
div.uk-width-medium-1-1
|
4
39
|
div.uk-panel.uk-panel-box
|
5
40
|
span.uk-text-large.uk-text-bold List of commands availables
|
6
41
|
br
|
7
42
|
|
8
|
-
div.uk-accordion(data-uk-accordion)
|
9
|
-
- @data.each do |command
|
10
|
-
h3.uk-accordion-title <b>Name</b> : #{command}
|
11
|
-
div.uk-accordion-content
|
43
|
+
div#commandrecords.uk-accordion(data-uk-accordion)
|
44
|
+
- @data.reverse.each do |command|
|
45
|
+
h3.uk-accordion-title id="#{command[:name].to_s}" <i class="uk-icon-play-circle-o"></i> <b>Name</b> : #{command[:name]}
|
46
|
+
div.uk-accordion-content id="#{command[:name].to_s} "
|
12
47
|
table.uk-table.uk-table-hover.uk-table-striped
|
13
48
|
thead
|
14
49
|
tr
|
@@ -19,31 +54,46 @@ div.uk-width-medium-1-1
|
|
19
54
|
td
|
20
55
|
dl.uk-description-list-horizontal
|
21
56
|
dt <i class="uk-icon-th-list"></i> Description
|
22
|
-
dd #{
|
23
|
-
- if
|
57
|
+
dd #{command[:desc]}
|
58
|
+
- if command[:command]
|
24
59
|
dt <i class="uk-icon-cog"></i> Command Line
|
25
|
-
|
26
|
-
|
60
|
+
- if command[:delegate_to]
|
61
|
+
dd.uk-text-danger #{command[:command]} <i>(ignored because delegate_to is set)</i>
|
62
|
+
- else
|
63
|
+
dd #{command[:command]}
|
64
|
+
- if command[:schedule]
|
27
65
|
dt <i class="uk-icon-calendar"></i> Schedule
|
28
66
|
dd
|
29
67
|
<ul>
|
30
|
-
<li> <b><i>Type</b></i> : #{
|
31
|
-
<li> <b><i>Value</b></i> : #{
|
68
|
+
<li> <b><i>Type</b></i> : #{command[:schedule].keys.first}</li>
|
69
|
+
<li> <b><i>Value</b></i> : #{command[:schedule].values.first}</li>
|
32
70
|
</ul>
|
33
|
-
- if
|
71
|
+
- if command[:on_success]
|
34
72
|
dt <i class="uk-icon-check"></i> Execute on success
|
35
|
-
dd #{
|
36
|
-
- if
|
73
|
+
dd #{command[:on_success]}
|
74
|
+
- if command[:on_failure]
|
37
75
|
dt <i class="uk-icon-bolt"></i> Execute on failure
|
38
|
-
dd #{
|
39
|
-
- if
|
76
|
+
dd #{command[:on_failure]}
|
77
|
+
- if command[:user]
|
40
78
|
dt <i class="uk-icon-user"></i> become user
|
41
|
-
dd #{
|
42
|
-
- if
|
79
|
+
dd #{command[:user]}
|
80
|
+
- if command[:delegate_to]
|
43
81
|
dt <i class="uk-icon-chevron-circle-right"></i> Remote delegation
|
44
82
|
dd
|
45
83
|
<ul>
|
46
|
-
<li> <i><b>Host</b></i> : #{
|
47
|
-
<li> <b><i>Remote Command</b></i> : #{
|
84
|
+
<li> <i><b>Host</b></i> : #{command[:delegate_to][:host]}</li>
|
85
|
+
<li> <b><i>Remote Command</b></i> : #{command[:delegate_to][:remote_command]}</li>
|
48
86
|
</ul>
|
87
|
+
- if command[:retention].class == Hash
|
88
|
+
dt <i class="uk-icon-calendar-minus-o"></i> History retention
|
89
|
+
dd #{command[:retention].flatten.reverse.join(' ')}
|
49
90
|
td
|
91
|
+
input.delete-command.uk-button.uk-button-mini.uk-button-danger id="#{command[:name].to_s}" value="Delete"
|
92
|
+
br
|
93
|
+
input.modify-process.uk-button.uk-button-mini.uk-button-primary id="#{command[:name].to_s}" value="Modify" onclick="location.href='/add_modify_command/#{command[:name].to_s}';"
|
94
|
+
br
|
95
|
+
input.history-command.uk-button.uk-button-mini.uk-button-primary id="#{command[:name].to_s}" value="History" onclick="location.href='/get_command_history/#{command[:name].to_s}';"
|
96
|
+
div.uk-align-right
|
97
|
+
form.uk-form.uk-form-horizontal#query action="/add_modify_command" method="GET"
|
98
|
+
div
|
99
|
+
input.add-process.uk-button type="submit" value="Add new process"
|
@@ -30,30 +30,29 @@ javascript:
|
|
30
30
|
div.uk-grid
|
31
31
|
div.uk-width-medium-1-1
|
32
32
|
div.uk-panel.uk-panel-box
|
33
|
-
div.uk-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
div.uk-button-group
|
39
|
-
- if @status == false
|
40
|
-
button.uk-button(id="start" disabled): i.uk-icon-play
|
41
|
-
button.uk-button(id="stop"): i.uk-icon-stop
|
42
|
-
- else
|
43
|
-
button.uk-button(id="start"): i.uk-icon-play
|
44
|
-
button.uk-button(id="stop" disabled): i.uk-icon-stop
|
45
|
-
td
|
46
|
-
b Status :
|
33
|
+
div.uk-grid
|
34
|
+
div.uk-width-1-3.uk-text-large.uk-text-bold.uk-text-success <i class="uk-icon-cogs uk-icon-justify uk-icon-large"></i> Splash Daemon status
|
35
|
+
div.uk-width-1-3
|
36
|
+
b Actions :
|
37
|
+
div.uk-button-group
|
47
38
|
- if @status == false
|
48
|
-
|
39
|
+
button.uk-button(id="start" disabled): i.uk-icon-play
|
40
|
+
button.uk-button(id="stop"): i.uk-icon-stop
|
49
41
|
- else
|
50
|
-
|
42
|
+
button.uk-button(id="start"): i.uk-icon-play
|
43
|
+
button.uk-button(id="stop" disabled): i.uk-icon-stop
|
44
|
+
div.uk-width-1-3
|
45
|
+
b Status :
|
46
|
+
- if @status == false
|
47
|
+
div.uk-badge.uk-badge-success.uk-badge-notifications(id="daemon") ON
|
48
|
+
- else
|
49
|
+
div.uk-badge.uk-badge-danger.uk-badge-notifications(id="daemon") OFF
|
51
50
|
|
52
51
|
|
53
52
|
div.uk-grid
|
54
53
|
div.uk-width-medium-1-2
|
55
54
|
div.uk-panel.uk-panel-box
|
56
|
-
span.uk-text-large.uk-text-bold Global Configuration
|
55
|
+
span.uk-text-large.uk-text-bold.uk-text-success Global Configuration
|
57
56
|
br
|
58
57
|
span.uk-text-bold <i>Logger and display</i> :
|
59
58
|
ul
|
@@ -68,7 +67,7 @@ div.uk-grid
|
|
68
67
|
|
69
68
|
div.uk-width-medium-1-2
|
70
69
|
div.uk-panel.uk-panel-box
|
71
|
-
span.uk-text-large.uk-text-bold Transport and Backend
|
70
|
+
span.uk-text-large.uk-text-bold.uk-text-success Transport and Backend
|
72
71
|
br
|
73
72
|
span.uk-text-bold <i>Backend</i> :
|
74
73
|
ul
|
@@ -94,7 +93,7 @@ div.uk-grid
|
|
94
93
|
div.uk-grid
|
95
94
|
div.uk-width-medium-1-2
|
96
95
|
div.uk-panel.uk-panel-box
|
97
|
-
span.uk-text-large.uk-text-bold Daemon
|
96
|
+
span.uk-text-large.uk-text-bold.uk-text-success Daemon
|
98
97
|
br
|
99
98
|
ul
|
100
99
|
li <b>Logs monitoring scheduling: </b> #{@data[:daemon_logmon_scheduling]}
|
@@ -110,7 +109,7 @@ div.uk-grid
|
|
110
109
|
|
111
110
|
div.uk-width-medium-1-2
|
112
111
|
div.uk-panel.uk-panel-box
|
113
|
-
span.uk-text-large.uk-text-bold Web UI
|
112
|
+
span.uk-text-large.uk-text-bold.uk-text-success Web UI
|
114
113
|
br
|
115
114
|
span.uk-text-bold <i>Webadmin</i> :
|
116
115
|
ul
|
@@ -11,8 +11,7 @@ html lang="fr-fr" dir="ltr"
|
|
11
11
|
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/uikit.gradient.min.css" integrity="sha512-Vjr6Vz5D/gNvTBfQW581ssADQr1j8fAOU0seE2SxO8UvsCBZBoFQS9Lec3hkmZbpcYnsifkBtdQaHU4x6MylGw==" crossorigin="anonymous"
|
12
12
|
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/components/sticky.gradient.css" integrity="sha512-BY0A+4FEGeikNxmo9Q30BZMGRDykKHScJlOSeGq0uq+ylGDJD3zAApnktyKv9tzira1p0ow+B7VqIlRR2CBWoA==" crossorigin="anonymous"
|
13
13
|
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/components/accordion.gradient.min.css" integrity="sha512-Cfd5PRktfT5WA1yUJbYkzjEHvT+9KzqPP1Z1OJud3CFUrkoAc6iIWawoMqPFmtvmxxDNV5RAHfe5DCISV+Gd9A==" crossorigin="anonymous"
|
14
|
-
|
15
|
-
|
14
|
+
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/components/notify.gradient.min.css" integrity="sha512-HOJctZ/0ww0jFHLHNlNODVEwKf1QxiDKyt3TQZRYZl7e7QSi6whfokIvuMJRoUwykB1SXW4eBeK6MecW4TWFFA==" crossorigin="anonymous"
|
16
15
|
|
17
16
|
link rel="stylesheet" href="/css/ultragreen.css"
|
18
17
|
|
@@ -20,6 +19,7 @@ html lang="fr-fr" dir="ltr"
|
|
20
19
|
script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/uikit.min.js" integrity="sha512-KI08ZutCgdasDMwp5rPKd9nF8r+eAy/bZH3Rjova6HfkDv1W7J72sNW+K++KvMp3HL7z0cCykV9vixJACHeCew==" crossorigin="anonymous"
|
21
20
|
script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/components/sticky.min.js" integrity="sha512-B21PoHN5PsI7sU3cUcNbitUsXp6Zzp81ZDlKJr1xRXwEh3WSftRmgSOgRYxB8h/SlgW+jazkmOXerT33NB7jGA==" crossorigin="anonymous"
|
22
21
|
script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/components/accordion.min.js" integrity="sha512-7UmYoHJ9tTZiNqlBuUgnr2l82TmZxhiOVXIjiMVP/hPFQJopjEBfVEFPjNdv97OX8K/FIZ4kAXSE+SRTfUkPMg==" crossorigin="anonymous"
|
22
|
+
script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/components/notify.min.js" integrity="sha512-gaUF+WYo5jZ2OjLCBfhz+4NAtt0YHDtcxulSv6/+1xDP9QysfsqljFadHN6sWkLvyXzKtQ7efofABRJfWOVwtw==" crossorigin="anonymous"
|
23
23
|
|
24
24
|
|
25
25
|
body
|
@@ -0,0 +1,27 @@
|
|
1
|
+
- unless @data.empty?
|
2
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Modify Splash log monitoring : #{@data[:label]}
|
3
|
+
- else
|
4
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Add new Splash log monitoring
|
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_log" method="POST"
|
9
|
+
label.uk-form-label for="label" Label
|
10
|
+
<input class="uk-form-width-large" id="label" type="text" placeholder="label" name="label" value="#{@data[:label].to_s}" required>
|
11
|
+
div
|
12
|
+
label.uk-form-label for="pattern" Pattern
|
13
|
+
<input class="uk-form-width-large" id="pattern" type="text" placeholder="pattern" name="pattern" value="#{@data[:pattern]}" required>
|
14
|
+
div
|
15
|
+
label.uk-form-label for="log" Log file
|
16
|
+
<input class="uk-form-width-large" id="log" type="text" placeholder="log" name="log" value="#{@data[:log]}" required>
|
17
|
+
div
|
18
|
+
label.uk-form-label for="retention" Retention (Like "2 hours, 2 days")
|
19
|
+
<input class="uk-form-width-large" id="retention" type="text" placeholder="retention" name="retention" value="#{@data[:retention]}">
|
20
|
+
div
|
21
|
+
- unless @data.empty?
|
22
|
+
input type="hidden" name="update" value="true"
|
23
|
+
input type="hidden" name="old_label" value="#{@data[:old_label].to_s}"
|
24
|
+
div.uk-align-right
|
25
|
+
input.uk-button.uk-button-small-primary type="submit" value="Submit"
|
26
|
+
javascript:
|
27
|
+
$("#query").validate();
|
@@ -0,0 +1,24 @@
|
|
1
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> History for log #{@label} 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 Date
|
13
|
+
th File
|
14
|
+
th Status
|
15
|
+
th Nb Errors
|
16
|
+
th Full Nb of lines
|
17
|
+
tbody
|
18
|
+
- @data.reverse.each do |key|
|
19
|
+
tr class="#{(key[key.keys.first][:status] == :clean)? 'uk-text-success' : 'uk-text-danger'}"
|
20
|
+
td #{key.keys.first}
|
21
|
+
td #{key[key.keys.first][:file]}
|
22
|
+
td #{key[key.keys.first][:status]}
|
23
|
+
td #{key[key.keys.first][:errors]}
|
24
|
+
td #{key[key.keys.first][:lines]}
|
@@ -1,32 +1,106 @@
|
|
1
|
-
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Logs configured in Splash
|
1
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Logs configured in Splash
|
2
|
+
|
3
|
+
|
4
|
+
- unless @log_saved.nil?
|
5
|
+
javascript:
|
6
|
+
UIkit.notify("Log record #{@log_saved} saved", {status:'success'});
|
7
|
+
- unless @log_failed.nil?
|
8
|
+
javascript:
|
9
|
+
UIkit.notify("Log record #{@log_saved} not saved", {status:'danger'});
|
10
|
+
|
11
|
+
|
12
|
+
javascript:
|
13
|
+
$(document).on( 'click','input.delete-log',function(){
|
14
|
+
var id = this.id;
|
15
|
+
var url = "/api/config/deletelog/" + id + ".json";
|
16
|
+
UIkit.modal.confirm('Are you sure?', function(){
|
17
|
+
console.debug(url)
|
18
|
+
$.ajax({
|
19
|
+
url: url,
|
20
|
+
type: 'DELETE',
|
21
|
+
success: function( data ) {
|
22
|
+
console.debug(data)
|
23
|
+
if (data['status'] == 'success') {
|
24
|
+
$('table#logrecords tr#' + id).remove();
|
25
|
+
UIkit.notify("Deleting log for " + id + " done", {status:'success'});
|
26
|
+
}
|
27
|
+
else
|
28
|
+
{
|
29
|
+
UIkit.notify("Deleting log for " + id + " failed !", {status:'danger'});
|
30
|
+
}
|
31
|
+
},
|
32
|
+
error: function(e) {
|
33
|
+
UIkit.notify("Deleting log for " + id + " failed !", {status:'danger'});
|
34
|
+
}
|
35
|
+
});
|
36
|
+
});
|
37
|
+
});
|
38
|
+
|
39
|
+
$(document).on( 'click','input.monitor-log',function(){
|
40
|
+
var url = "/api/logs/monitor.json";
|
41
|
+
UIkit.modal.confirm('Are you sure?', function(){
|
42
|
+
console.debug(url)
|
43
|
+
$.ajax({
|
44
|
+
url: url,
|
45
|
+
type: 'POST',
|
46
|
+
success: function( data ) {
|
47
|
+
console.debug(data)
|
48
|
+
if (data['status'] == 'success') {
|
49
|
+
UIkit.notify("Forced monitoring done", {status:'success'});
|
50
|
+
}
|
51
|
+
else
|
52
|
+
{
|
53
|
+
UIkit.notify("Forced monitoring failed !", {status:'danger'});
|
54
|
+
}
|
55
|
+
},
|
56
|
+
error: function(e) {
|
57
|
+
UIkit.notify("Forced monitoring failed !", {status:'danger'});
|
58
|
+
}
|
59
|
+
});
|
60
|
+
});
|
61
|
+
});
|
2
62
|
|
3
63
|
div.uk-width-medium-1-1
|
4
64
|
div.uk-panel.uk-panel-box
|
5
65
|
span.uk-text-large.uk-text-bold List of logs monitored
|
6
66
|
br
|
7
|
-
table.uk-table.uk-table-hover.uk-table-striped
|
67
|
+
table#logrecords.uk-table.uk-table-hover.uk-table-striped
|
8
68
|
thead
|
9
69
|
tr
|
10
70
|
th Log record label
|
11
71
|
th Definition
|
12
72
|
th Status
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
73
|
+
th Actions
|
74
|
+
tbody
|
75
|
+
- @data.each do |log|
|
76
|
+
tr id="#{log[:label].to_s}"
|
77
|
+
td <i class="uk-icon-tag"></i> <b>Label</b> : #{log[:label]}
|
78
|
+
td
|
79
|
+
ul
|
80
|
+
li <i class="uk-icon-file"></i> <b>File</b> : #{log[:log]}
|
81
|
+
li <i class="uk-icon-binoculars"></i> <b>Pattern</b> : #{log[:pattern]}
|
82
|
+
- if log[:retention].class == Hash
|
83
|
+
li <i class="uk-icon-calendar-minus-o"></i> <b>History retention</b> : #{log[:retention].flatten.reverse.join(' ')}
|
84
|
+
td
|
85
|
+
- if @result[log[:label]][:status] == :missing
|
86
|
+
div.uk-badge.uk-badge-warning missing
|
87
|
+
- if @result[log[:label]][:status] == :clean
|
88
|
+
div.uk-badge.uk-badge-success success
|
89
|
+
ul
|
90
|
+
li <i class="uk-icon-asterisk"></i> <b>Lines count</b> : #{@result[log[:label]][:lines]}
|
91
|
+
- if @result[log[:label]][:status] == :matched
|
92
|
+
div.uk-badge.uk-badge-danger matched
|
18
93
|
ul
|
19
|
-
li <b>
|
20
|
-
li <b>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
li <b class="uk-text-danger">Matchs count : #{@result[log[:label]][:count]} </b>
|
94
|
+
li <i class="uk-icon-asterisk"></i> <b>Lines count</b> : #{@result[log[:label]][:lines]}
|
95
|
+
li <i class="uk-icon-bolt"></i> <b class="uk-text-danger">Matchs count : #{@result[log[:label]][:count]} </b>
|
96
|
+
td
|
97
|
+
input.delete-log.uk-button.uk-button-mini.uk-button-danger id="#{log[:label].to_s}" value="Delete"
|
98
|
+
br
|
99
|
+
input.modify-log.uk-button.uk-button-mini.uk-button-primary id="#{log[:label].to_s}" value="Modify" onclick="location.href='/add_modify_log/#{log[:label].to_s}';"
|
100
|
+
br
|
101
|
+
input.history-log.uk-button.uk-button-mini.uk-button-primary id="#{log[:label].to_s}" value="History" onclick="location.href='/get_log_history/#{log[:label].to_s}';"
|
102
|
+
div.uk-align-right
|
103
|
+
form.uk-form.uk-form-horizontal#query action="/add_modify_log" method="GET"
|
104
|
+
div
|
105
|
+
input.monitor-log.uk-button value="Force monitoring"
|
106
|
+
input.add-log.uk-button type="submit" value="Add new log"
|
@@ -3,7 +3,7 @@ nav.uk-navbar.uk-navbar-attached(data-uk-sticky)
|
|
3
3
|
ul.uk-navbar-nav.uk-hidden-small
|
4
4
|
- for item in @menu
|
5
5
|
li class=( (item == @current_item)? "uk-active" : "uk-inactive")
|
6
|
-
a href="/#{item.downcase}" title="Access to #{item.capitalize}" <i class="uk-icon-#{@menu_icons[item]}"></i> #{item.capitalize}
|
6
|
+
a.uk-navbar-nav-subtitle href="/#{item.downcase}" title="Access to #{item.capitalize}" <i class="uk-icon-#{@menu_icons[item]}"></i><div> #{item.capitalize}</div>
|
7
7
|
a.uk-navbar-toggle.uk-visible-small(href="#offcanvas" data-uk-offcanvas)
|
8
8
|
div.uk-navbar-brand.uk-navbar-left.uk-visible-small
|
9
9
|
<i class="uk-icon-arrow-left"></i> Menu
|
@@ -0,0 +1,24 @@
|
|
1
|
+
- unless @data.empty?
|
2
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Modify Splash process monitoring : #{@data[:process]}
|
3
|
+
- else
|
4
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Add new Splash process monitoring
|
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_process" method="POST"
|
9
|
+
label.uk-form-label for="process" Process
|
10
|
+
<input class="uk-form-width-large" id="process" type="text" placeholder="process" name="process" value="#{@data[:process].to_s}" required>
|
11
|
+
div
|
12
|
+
label.uk-form-label for="patterns" Patterns (separator is "|")
|
13
|
+
<input class="uk-form-width-large" id="patterns" type="text" placeholder="patterns" name="patterns" value="#{@data[:patterns]}" required>
|
14
|
+
div
|
15
|
+
label.uk-form-label for="retention" Retention (Like "2 hours, 2 days")
|
16
|
+
<input class="uk-form-width-large" id="retention" type="text" placeholder="retention" name="retention" value="#{@data[:retention]}">
|
17
|
+
div
|
18
|
+
- unless @data.empty?
|
19
|
+
input type="hidden" name="update" value="true"
|
20
|
+
input type="hidden" name="old_process" value="#{@data[:old_process].to_s}"
|
21
|
+
div.uk-align-right
|
22
|
+
input.uk-button.uk-button-small-primary type="submit" value="Submit"
|
23
|
+
javascript:
|
24
|
+
$("#query").validate();
|
@@ -0,0 +1,24 @@
|
|
1
|
+
h2.uk-text-success <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> History for process #{@process} 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 Date
|
13
|
+
th Process
|
14
|
+
th Status
|
15
|
+
th % CPU
|
16
|
+
th % MEM
|
17
|
+
tbody
|
18
|
+
- @data.reverse.each do |key|
|
19
|
+
tr class="#{(key[key.keys.first][:status] == :running)? 'uk-text-success' : 'uk-text-danger'}"
|
20
|
+
td #{key.keys.first}
|
21
|
+
td #{key[key.keys.first][:process]}
|
22
|
+
td #{key[key.keys.first][:status]}
|
23
|
+
td #{key[key.keys.first][:cpu_percent]}
|
24
|
+
td #{key[key.keys.first][:mem_percent]}
|