mutx 0.1.69 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/documentation/repos.md +21 -24
- data/lib/generators/task_rack.rb +8 -2
- data/lib/generators/templates/config.ru.tt +1 -1
- data/lib/mutx/API/execution.rb +8 -44
- data/lib/mutx/API/repo.rb +7 -10
- data/lib/mutx/background_jobs/workers/executor.rb +44 -38
- data/lib/mutx/commands/install.rb +1 -1
- data/lib/mutx/commands/start.rb +1 -1
- data/lib/mutx/custom/execution.rb +1 -1
- data/lib/mutx/database/mongo_connector.rb +19 -22
- data/lib/mutx/execution.rb +1 -0
- data/lib/mutx/lib/authentication.rb +23 -0
- data/lib/mutx/lib/helpers.rb +52 -0
- data/lib/mutx/lib/middlewares/database_middleware.rb +16 -0
- data/lib/mutx/lib/middlewares/flash_middleware.rb +31 -0
- data/lib/mutx/lib/middlewares/logger_middleware.rb +13 -0
- data/lib/mutx/lib/monkey_patch.rb +28 -0
- data/lib/mutx/lib/paths.rb +80 -0
- data/lib/mutx/platforms/ruby.rb +8 -0
- data/lib/mutx/public/css/bootstrap.min.css +7 -0
- data/lib/mutx/public/css/font-awesome.min.css +4 -0
- data/lib/mutx/public/css/jquery.json-viewer.css +44 -0
- data/{favicon.ico → lib/mutx/public/img/favicon.ico} +0 -0
- data/lib/mutx/public/js/bootstrap.min.js +6 -0
- data/lib/mutx/public/js/jquery.json-viewer.js +148 -0
- data/lib/mutx/public/js/jquery.min.js +6 -0
- data/lib/mutx/{view/javascript.mote → public/js/mutx.js} +0 -5
- data/lib/mutx/public/js/notify.min.js +1 -0
- data/lib/mutx/results/result.rb +60 -68
- data/lib/mutx/results/results.rb +4 -0
- data/lib/mutx/routes.rb +85 -883
- data/lib/mutx/routes/admin_routes.rb +16 -0
- data/lib/mutx/routes/admin_routes/custom_params_routes.rb +97 -0
- data/lib/mutx/routes/admin_routes/repositories_routes.rb +35 -0
- data/lib/mutx/routes/admin_routes/tasks_routes.rb +110 -0
- data/lib/mutx/routes/api_routes.rb +49 -0
- data/lib/mutx/routes/api_routes/custom_params_routes.rb +41 -0
- data/lib/mutx/routes/api_routes/input_routes.rb +48 -0
- data/lib/mutx/routes/api_routes/repos_routes.rb +74 -0
- data/lib/mutx/routes/api_routes/results_routes.rb +50 -0
- data/lib/mutx/routes/api_routes/tasks_routes.rb +47 -0
- data/lib/mutx/routes/api_routes/tests_routes.rb +42 -0
- data/lib/mutx/routes/features_routes.rb +24 -0
- data/lib/mutx/routes/help_routes.rb +23 -0
- data/lib/mutx/routes/logs_routes.rb +22 -0
- data/lib/mutx/routes/message_routes.rb +24 -0
- data/lib/mutx/routes/repositories_routes.rb +25 -0
- data/lib/mutx/routes/results_routes.rb +53 -0
- data/lib/mutx/routes/task_results_routes.rb +25 -0
- data/lib/mutx/routes/tasks_routes.rb +67 -0
- data/lib/mutx/routes/tests_routes.rb +66 -0
- data/lib/mutx/support/change_inspector.rb +3 -3
- data/lib/mutx/support/files_cleanner.rb +12 -3
- data/lib/mutx/support/git.rb +11 -2
- data/lib/mutx/support/processes.rb +2 -2
- data/lib/mutx/support/project_type.rb +12 -0
- data/lib/mutx/tasks/task.rb +8 -2
- data/lib/mutx/version.rb +1 -1
- data/lib/mutx/view/{custom/params/delete_form.mote → admin/custom-params/_delete_form.mote} +2 -4
- data/lib/mutx/view/{custom/params/create_edit_form.mote → admin/custom-params/_form.mote} +5 -9
- data/lib/mutx/view/{custom/params/custom_param_task_deleting_box.mote → admin/custom-params/_task_deleting_box.mote} +1 -2
- data/lib/mutx/view/{custom/params → admin/custom-params}/delete.mote +1 -3
- data/lib/mutx/view/{custom/params → admin/custom-params}/edit.mote +1 -5
- data/lib/mutx/view/{custom/params/list.mote → admin/custom-params/index.mote} +8 -13
- data/lib/mutx/view/{custom/params → admin/custom-params}/new.mote +1 -5
- data/lib/mutx/view/{custom/params/custom_param_selection_box.mote → admin/custom-params/selection_box.mote} +2 -3
- data/lib/mutx/view/{list_repos.mote → admin/repositories/index.mote} +2 -6
- data/lib/mutx/view/{repos.mote → admin/repositories/new.mote} +2 -6
- data/lib/mutx/view/{tasks/admin/delete_form.mote → admin/tasks/_delete_form.mote} +2 -12
- data/lib/mutx/view/{tasks/admin/create_edit_form.mote → admin/tasks/_form.mote} +6 -9
- data/lib/mutx/view/{tasks/admin → admin/tasks}/delete.mote +1 -3
- data/lib/mutx/view/{tasks/admin → admin/tasks}/edit.mote +1 -4
- data/lib/mutx/view/{tasks/admin/list.mote → admin/tasks/index.mote} +5 -10
- data/lib/mutx/view/{tasks/admin → admin/tasks}/new.mote +1 -5
- data/lib/mutx/view/{tasks/admin/view.mote → admin/tasks/show.mote} +1 -3
- data/lib/mutx/view/body.mote +13 -51
- data/lib/mutx/view/{custom/params.mote → custom-params/_custom_params.mote} +3 -4
- data/lib/mutx/view/{custom/params → custom-params/types}/json.mote +0 -0
- data/lib/mutx/view/{custom/params → custom-params/types}/select_list.mote +0 -0
- data/lib/mutx/view/{custom/params → custom-params/types}/text.mote +0 -0
- data/lib/mutx/view/error_handler.mote +4 -54
- data/lib/mutx/view/features/{feature.mote → file.mote} +0 -0
- data/lib/mutx/view/features/index.mote +9 -0
- data/lib/mutx/view/git_information.mote +2 -8
- data/lib/mutx/view/help/{main.mote → _main.mote} +0 -0
- data/lib/mutx/view/help/{page.mote → _page.mote} +0 -0
- data/lib/mutx/view/help/{search_result.mote → _search_result.mote} +0 -0
- data/lib/mutx/view/help/index.mote +38 -0
- data/lib/mutx/view/layout/flash.mote +7 -0
- data/lib/mutx/view/{footer.mote → layout/footer.mote} +1 -1
- data/lib/mutx/view/layout/javascript.mote +6 -0
- data/lib/mutx/view/{modals.mote → layout/modals.mote} +0 -0
- data/lib/mutx/view/layout/navigation_bar.mote +88 -0
- data/lib/mutx/view/{styles.mote → layout/styles.mote} +10 -0
- data/lib/mutx/view/logs/{logs.mote → index.mote} +1 -1
- data/lib/mutx/view/logs/show.mote +3 -0
- data/lib/mutx/view/repositories/_repository.mote +7 -0
- data/lib/mutx/view/repositories/index.mote +23 -0
- data/lib/mutx/view/repositories/show.mote +21 -0
- data/lib/mutx/view/results/{detailed_info.mote → _result.mote} +5 -5
- data/lib/mutx/view/results/console.mote +63 -106
- data/lib/mutx/view/results/{all.mote → index.mote} +18 -24
- data/lib/mutx/view/sections.rb +36 -24
- data/lib/mutx/view/task_results/_result.mote +57 -0
- data/lib/mutx/view/{results/result.mote → task_results/_result_item.mote} +6 -5
- data/lib/mutx/view/task_results/index.mote +35 -0
- data/lib/mutx/view/tasks/_task.mote +90 -0
- data/lib/mutx/view/tasks/index.mote +61 -0
- data/lib/mutx/view/tasks/show.mote +167 -0
- data/lib/mutx/view/tests/_test.mote +90 -0
- data/lib/mutx/view/tests/index.mote +59 -0
- data/lib/mutx/view/tests/show.mote +172 -0
- data/lib/mutx/view/view.rb +172 -10
- metadata +89 -50
- data/lib/mutx/database/middleware.rb +0 -18
- data/lib/mutx/view/features.mote +0 -57
- data/lib/mutx/view/features/features_list.mote +0 -10
- data/lib/mutx/view/help.mote +0 -75
- data/lib/mutx/view/logs/log.mote +0 -3
- data/lib/mutx/view/message.mote +0 -8
- data/lib/mutx/view/navigation_bar.mote +0 -67
- data/lib/mutx/view/results/results.mote +0 -112
- data/lib/mutx/view/tasks/message.mote +0 -37
- data/lib/mutx/view/tasks/task.mote +0 -167
- data/lib/mutx/view/tasks/task_item.mote +0 -77
- data/lib/mutx/view/tasks/tasks.mote +0 -74
@@ -1,4 +1,14 @@
|
|
1
|
+
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
|
2
|
+
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
|
3
|
+
<!--
|
4
|
+
<link href='https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/jumbotron-narrow.css' rel='stylesheet'>
|
5
|
+
-->
|
6
|
+
<link href="/css/jquery.json-viewer.css" rel="stylesheet">
|
1
7
|
<style>
|
8
|
+
|
9
|
+
body {
|
10
|
+
padding-top: 40px;
|
11
|
+
}
|
2
12
|
label{
|
3
13
|
font-family: Verdana;
|
4
14
|
text-vertical-align: center;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="btn-group" role="group" aria-label="...">
|
2
2
|
% Mutx::Support::Logs.all.keys.each do |log|
|
3
|
-
<button type="button" class="btn btn-default">Left</button><a href='
|
3
|
+
<button type="button" class="btn btn-default">Left</button><a href='{{ path_for(:logs_show, log_name: log) }}'>{{ log.split('_').first.capitalize }}</a></li>
|
4
4
|
% end
|
5
5
|
|
6
6
|
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
% if repositories.empty?
|
2
|
+
<br>
|
3
|
+
<br>
|
4
|
+
<div id='well'>
|
5
|
+
<h3>No Respositories defined</h3>
|
6
|
+
</div>
|
7
|
+
<br>
|
8
|
+
<br>
|
9
|
+
% else
|
10
|
+
<div class="panel panel-default">
|
11
|
+
<div class="panel-heading"><h4>{{section.capitalize}}</h4></div>
|
12
|
+
<table class="table table-striped table-hover">
|
13
|
+
<tbody>
|
14
|
+
% repositories.each do |repository|
|
15
|
+
<tr>
|
16
|
+
{{ partial('repositories/_repository', repository: repository) }}
|
17
|
+
</tr>
|
18
|
+
% end
|
19
|
+
</tbody>
|
20
|
+
</table>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
% end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class='starter-template'>
|
2
|
+
|
3
|
+
<div class="panel panel-default">
|
4
|
+
<div class="panel-heading">
|
5
|
+
<h4>{{ repository['repo_name'] }}</h4>
|
6
|
+
<p class="text-right">Last Update {{ repository['last_update'] }} </p>
|
7
|
+
</div>
|
8
|
+
<div class="panel-body" >
|
9
|
+
<ul class='list-group'>
|
10
|
+
<li class="list-group-item">
|
11
|
+
<div id="json-viewer" style="min-height: 500px; max-height: 500px; overflow-y: scroll;">
|
12
|
+
</div>
|
13
|
+
</li>
|
14
|
+
</ul>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<script type="text/javascript">
|
20
|
+
$('#json-viewer').jsonViewer({{ repository['value'].to_json }});
|
21
|
+
</script>
|
@@ -77,7 +77,7 @@
|
|
77
77
|
<small>Execution data</small>
|
78
78
|
</th>
|
79
79
|
<th>
|
80
|
-
<a href="#" class='label label-default' onclick="window.open('
|
80
|
+
<a href="#" class='label label-default' onclick="window.open('{{ path_for(:api_results_data, result_id: result["_id"]) }}', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');">Click here to see</a>
|
81
81
|
</th>
|
82
82
|
</tr>
|
83
83
|
|
@@ -88,22 +88,22 @@
|
|
88
88
|
</table>
|
89
89
|
|
90
90
|
% if result["status"] == 'finished' and result["has_report"].eql? true
|
91
|
-
<a onclick="window.open('
|
91
|
+
<a onclick="window.open('{{ path_for(:results_report, result_id: result["_id"]) }}', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');" class='btn btn-{{Mutx::View.color(result["show_as"])}}'>
|
92
92
|
See Report
|
93
93
|
</a>
|
94
94
|
% end
|
95
95
|
|
96
|
-
<a href='
|
96
|
+
<a href='{{ path_for(:results_log, result_id: result["_id"]) }}', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600';" class='btn btn-info'>
|
97
97
|
Console Log
|
98
98
|
</a>
|
99
99
|
|
100
|
-
<a onclick="window.open('
|
100
|
+
<a onclick="window.open('{{ path_for(:api_results_data, result_id: result["_id"]) }}', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');" class='btn btn-default'>
|
101
101
|
Raw
|
102
102
|
</a>
|
103
103
|
|
104
104
|
% unless result["status"] =~ /finished|stopped/
|
105
105
|
|
106
|
-
<a href='
|
106
|
+
<a href='{{ path_for(:results_reset, result_id: result["_id"]) }}' class='btn btn-danger'>
|
107
107
|
Stop execution
|
108
108
|
</a>
|
109
109
|
|
@@ -1,22 +1,9 @@
|
|
1
1
|
|
2
2
|
<?
|
3
|
-
result = Mutx::Results::Result.get(result_id)
|
4
3
|
if result
|
5
4
|
result.mark_as_saw! if (result.finished? or result.stopped?)
|
6
|
-
text = ""
|
7
|
-
|
8
|
-
text += result.console_output.split("\n").join("</p><p>") if result.console_output
|
9
|
-
#if text.empty?
|
10
|
-
# lines = []
|
11
|
-
# begin
|
12
|
-
# File.open("ls_#{result.id}.out","r").each_line do |line|
|
13
|
-
# lines << line
|
14
|
-
# end
|
15
|
-
# rescue
|
16
|
-
# lines << "Wait..."
|
17
|
-
# end
|
18
|
-
# text = lines.join("</small></p><p><small>")
|
19
|
-
#end
|
5
|
+
text = result.console_output.split("\n").join("</p><p>") if result.console_output
|
6
|
+
|
20
7
|
size_of_lines = text.split("</p>").size
|
21
8
|
|
22
9
|
task = Mutx::Tasks::Task.get(result.task_id)
|
@@ -25,101 +12,71 @@ if result
|
|
25
12
|
|
26
13
|
execution_name = result.execution_name.empty? ? 'Not Defined' : result.execution_name.gsub('-_-',' ')
|
27
14
|
|
28
|
-
git_log = result.git_log.split('Author').first
|
29
|
-
else
|
30
|
-
|
31
15
|
end
|
32
16
|
|
33
|
-
javascript = Mote.parse(File.read("#{Mutx::View.path}/javascript.mote"), self, []).call()
|
34
|
-
|
35
17
|
?>
|
36
|
-
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
<body>
|
54
|
-
% if result
|
55
|
-
<div class='container'>
|
56
|
-
<br>
|
57
|
-
<div class='well'>
|
58
|
-
<h3>Result for <b>{{result.task_name}}</b> execution {{result.stopped? ? '(Stopped)' : ''}}</h3>
|
59
|
-
<h6><b>Result ID:</b> {{result.id}}</h6>
|
60
|
-
% if Mutx::Support::Configuration.use_git?
|
61
|
-
<h6><b>Git log:</b> {{git_log}}</h6>
|
62
|
-
% end
|
63
|
-
<h6><b>Status: </b>{{result.status}}</h6>
|
64
|
-
% if result.timeout
|
65
|
-
<h6><b>Timeout:</b> Stopped After {{result.timeout}} seconds</h6>
|
66
|
-
% end
|
67
|
-
% if result.started_at
|
68
|
-
<h6><b>Duration:</b> {{result.elapsed_time}} seconds</h6>
|
69
|
-
% end
|
70
|
-
<h6><b>Execution Name: </b>{{execution_name}}</h6>
|
71
|
-
<h6><b>Custom parameters:</b>{{custom_params}}</h6>
|
72
|
-
<h6> </h6>
|
73
|
-
<h6>
|
74
|
-
<div>
|
75
|
-
<a onclick="window.history.go(-1);" style="cursor:pointer;" class='label label-default' >GO BACK</a>
|
76
|
-
<a href='#' class='label label-info' onclick="window.open('/api/results/{{result.id}}', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');" class='btn btn-default'>
|
77
|
-
Result Data</a>
|
78
|
-
<a href='#' class='label label-warning' onclick="window.open('/api/results/{{result.id}}/data', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');" class='btn btn-default'>
|
79
|
-
Execution Data</a>
|
80
|
-
% unless result.status =~ /finished|stopped/
|
81
|
-
<a href='#' onclick="getAndClose('/results/{{result.id}}/reset');" class='label label-danger'>
|
82
|
-
Stop execution
|
83
|
-
</a>
|
84
|
-
% end
|
85
|
-
</div>
|
86
|
-
</h6>
|
87
|
-
</div>
|
88
|
-
<div class='page-header'>
|
89
|
-
<h4>Console Output</h4>
|
90
|
-
</div>
|
91
|
-
<div id='result'>
|
92
|
-
% if size_of_lines > 15
|
93
|
-
<button type='button' class='btn btn-default' title='Go down' onclick='goToBottom()' style='float: right'><span class='glyphicon glyphicon-chevron-down' aria-hidden='true'></span> Go down</button>
|
94
|
-
<br>
|
95
|
-
% end
|
96
|
-
<h3>
|
97
|
-
<small>
|
98
|
-
<pre style="height:400px; overflow:scroll; white-space:pre; word-wrap:normal;">
|
99
|
-
<b style='color:Black'>{{text}}</b>
|
100
|
-
</pre>
|
101
|
-
</small>
|
102
|
-
</h3>
|
103
|
-
% if size_of_lines > 15
|
104
|
-
<button type='button' class='btn btn-default' title='Go up' onclick='goToTop()' style='float: right'><span class='glyphicon glyphicon-chevron-up' aria-hidden='true'></span> Go up</button><br><br>
|
105
|
-
% end
|
106
|
-
</div>
|
107
|
-
<br>
|
18
|
+
% if result
|
19
|
+
<br>
|
20
|
+
<div class='well'>
|
21
|
+
<h3>{{result.task['type'].capitalize}} <b>{{result.task_name}}</b> result execution {{result.stopped? ? '(Stopped)' : ''}}</h3>
|
22
|
+
<h6><b>ID:</b> {{result.id}}</h6>
|
23
|
+
<h6><b>Status: </b>{{result.status}}</h6>
|
24
|
+
% if result.timeout
|
25
|
+
<h6><b>Timeout:</b> Stopped After {{result.timeout}} seconds</h6>
|
26
|
+
% end
|
27
|
+
% if result.started_at
|
28
|
+
<h6><b>Duration:</b>{{Mutx::View.formatted_for result.elapsed_time}}</h6>
|
29
|
+
% end
|
30
|
+
<h6><b>Execution Name: </b>{{execution_name}}</h6>
|
31
|
+
<h6><b>Custom parameters:</b>{{custom_params}}</h6>
|
32
|
+
<h6> </h6>
|
33
|
+
<h6>
|
108
34
|
<div>
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
<
|
35
|
+
% if result.task['type'] == "task"
|
36
|
+
<a onclick="goClean('{{path_for(:tasks_show, task_name:result.task['name'])}}');" style="cursor:pointer;" class='btn btn-default' >
|
37
|
+
{{Mutx::View.icon_for("back")}} Return to task
|
38
|
+
</a>
|
39
|
+
% else
|
40
|
+
<a onclick="goClean('{{path_for(:tests_show, test_name:result.task['name'])}}');" style="cursor:pointer;" class='btn btn-default' >
|
41
|
+
{{Mutx::View.icon_for("back")}} Return to test
|
42
|
+
</a>
|
43
|
+
% end
|
44
|
+
<a href='#' onclick="window.open('{{ path_for(:api_results_show, result_id: result.id) }}', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');" class='btn btn-default'>
|
45
|
+
JSON Data</a>
|
46
|
+
<a href='#' onclick="window.open('{{ path_for(:api_results_data, result_id: result.id) }}', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');" class='btn btn-default'>
|
47
|
+
Execution Data</a>
|
119
48
|
</div>
|
49
|
+
</h6>
|
50
|
+
</div>
|
51
|
+
<div class='page-header'>
|
52
|
+
<h4>Console Output</h4>
|
53
|
+
</div>
|
54
|
+
<div id='result'>
|
55
|
+
% if size_of_lines > 15
|
56
|
+
<button type='button' class='btn btn-default' title='Go down' onclick='goToBottom()' style='float: right'><span class='glyphicon glyphicon-chevron-down' aria-hidden='true'></span> Go down</button>
|
120
57
|
<br>
|
121
|
-
|
122
|
-
|
58
|
+
% end
|
59
|
+
<h3>
|
60
|
+
<small>
|
61
|
+
<pre style="height:400px; overflow:scroll; white-space:pre; word-wrap:normal;">
|
62
|
+
<b style='color:Black'>{{text}}</b>
|
63
|
+
</pre>
|
64
|
+
</small>
|
65
|
+
</h3>
|
66
|
+
% if size_of_lines > 15
|
67
|
+
<button type='button' class='btn btn-default' title='Go up' onclick='goToTop()' style='float: right'><span class='glyphicon glyphicon-chevron-up' aria-hidden='true'></span> Go up</button><br><br>
|
123
68
|
% end
|
124
|
-
|
125
|
-
|
69
|
+
</div>
|
70
|
+
<br>
|
71
|
+
<div>
|
72
|
+
<a onclick="window.history.go(-1);" style="cursor:pointer;" class='label label-default' >Return to task</a>
|
73
|
+
</div>
|
74
|
+
<br>
|
75
|
+
<br>
|
76
|
+
% else
|
77
|
+
<div id='well'>
|
78
|
+
<h3>There is no result with id: <b>{{result_id}}</b></h3>
|
79
|
+
</div>
|
80
|
+
<br>
|
81
|
+
<a onclick="window.history.go(-1);" style="cursor:pointer;" class='label label-default' >Back</a>
|
82
|
+
% end
|
@@ -1,15 +1,11 @@
|
|
1
1
|
<?
|
2
2
|
|
3
|
-
key =
|
4
|
-
status =
|
5
|
-
application =
|
6
|
-
|
7
|
-
|
8
|
-
results = Mutx::API::Results.show()
|
9
|
-
results_list = results["results"]
|
3
|
+
key = query_string.keyword if (query_string.keyword and !query_string.keyword.empty?)
|
4
|
+
status = query_string.status if (query_string.status and !query_string.status.empty?)
|
5
|
+
application = query_string.application if (query_string.application and !query_string.application.empty?)
|
10
6
|
if key
|
11
7
|
keyword = key.downcase
|
12
|
-
|
8
|
+
results.select! do |result_data|
|
13
9
|
result_data["execution_name"].downcase.include? keyword or
|
14
10
|
result_data["summary"].downcase.include? keyword or
|
15
11
|
result_data["task"].inspect.downcase.include? keyword or
|
@@ -18,12 +14,12 @@
|
|
18
14
|
result_data["custom_params"].inspect.downcase.include? keyword
|
19
15
|
end
|
20
16
|
|
21
|
-
|
17
|
+
results.select!{|result_data| result_data["_id"]==key} if key.is_a? Fixnum
|
22
18
|
|
23
19
|
end
|
24
20
|
|
25
21
|
if status
|
26
|
-
|
22
|
+
results.select! do |res|
|
27
23
|
by_status = res["status"].downcase==status.downcase
|
28
24
|
by_first_part_summary = res["summary"].split("step").first.downcase.include? status.downcase
|
29
25
|
first_part = res["summary"].split("step").first
|
@@ -38,7 +34,7 @@
|
|
38
34
|
end
|
39
35
|
|
40
36
|
if application
|
41
|
-
|
37
|
+
results.select! do |res|
|
42
38
|
by_application = res["application"].downcase==application.downcase
|
43
39
|
by_first_part_summary = res["summary"].split("step").first.downcase.include? application.downcase
|
44
40
|
first_part = res["summary"].split("step").first
|
@@ -53,18 +49,18 @@
|
|
53
49
|
end
|
54
50
|
|
55
51
|
results_size_text = if (key or status)
|
56
|
-
"#{
|
52
|
+
"#{results.size} result#{'s' if results.size>1} found"
|
57
53
|
else
|
58
|
-
total_of_results =
|
59
|
-
|
60
|
-
"Showing #{
|
54
|
+
total_of_results = results.size
|
55
|
+
results = results[0..19] if total_of_results > 20
|
56
|
+
"Showing #{results.size} results of #{total_of_results}."
|
61
57
|
end
|
62
58
|
|
63
59
|
|
64
60
|
?>
|
65
61
|
|
66
62
|
<div class='well'>
|
67
|
-
<form name='search' method='get' action='
|
63
|
+
<form name='search' method='get' action='{{ path_for(:results_index) }}'>
|
68
64
|
<input type='text' name='keyword' title='' placeholder='Search' value='{{key}}' style='height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;' />
|
69
65
|
<select id='status' name='status' style='height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;'>
|
70
66
|
<option value='' {{'selected' if status.nil?}}>Any status</option>
|
@@ -80,10 +76,10 @@
|
|
80
76
|
</select>
|
81
77
|
<input type='submit' class='btn btn-success' value='Search'>
|
82
78
|
% if key or status or application
|
83
|
-
<a class='btn btn-danger' href='
|
79
|
+
<a class='btn btn-danger' href='{{ path_for(:results_index) }}' role='button'>Clear</a>
|
84
80
|
% end
|
85
81
|
|
86
|
-
% if
|
82
|
+
% if results.size > 0
|
87
83
|
<div class='btn-group pull-right' role='group'>
|
88
84
|
<button type='button' class='btn btn-default' aria-label='Left Align' title='Toggle collapse' onclick="autoCollapse()" title='collapse all panels'>
|
89
85
|
<div id='collapse_icon'>
|
@@ -98,12 +94,10 @@
|
|
98
94
|
<p style='text-align:right'>{{results_size_text}}</p>
|
99
95
|
</div>
|
100
96
|
|
101
|
-
%
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
% end
|
106
|
-
% else
|
97
|
+
% results.each do |result_data|
|
98
|
+
{{ partial('results/_result', result: result_data) }}
|
99
|
+
% end
|
100
|
+
% unless results.size > 0
|
107
101
|
<br>
|
108
102
|
<br>
|
109
103
|
<div id='well'>
|
data/lib/mutx/view/sections.rb
CHANGED
@@ -4,33 +4,45 @@ module Mutx
|
|
4
4
|
class Sections
|
5
5
|
|
6
6
|
@@sections = {
|
7
|
-
|
8
|
-
"
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
|
19
|
-
"
|
20
|
-
"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
7
|
+
|
8
|
+
"Admin Tasks" => "admin/tasks/index",
|
9
|
+
"Admin Tasks New" => "admin/tasks/new",
|
10
|
+
"Admin Tasks Edit" => "admin/tasks/edit",
|
11
|
+
"Admin Task" => "admin/tasks/show",
|
12
|
+
"Admin Tasks Delete" => "admin/tasks/delete",
|
13
|
+
|
14
|
+
"Admin Custom Params" => "admin/custom-params/index",
|
15
|
+
"Admin Custom Params New" => "admin/custom-params/new",
|
16
|
+
"Admin Custom Params Edit" => "admin/custom-params/edit",
|
17
|
+
"Admin Custom Params Delete" => "admin/custom-params/delete",
|
18
|
+
|
19
|
+
"Admin Repositories New" => "admin/repositories/new",
|
20
|
+
"Admin Repositories" => "admin/repositories/index",
|
21
|
+
|
22
|
+
'Tests' => "tests/index",
|
23
|
+
'Test' => "tests/show",
|
24
|
+
'Tasks' => "tasks/index",
|
25
|
+
'Task' => "tasks/show",
|
26
|
+
|
27
|
+
'Task Results' => 'task_results/index',
|
28
|
+
|
29
|
+
"Results"=> "results/index",
|
30
|
+
"Result Console" => "results/console",
|
31
|
+
"Result Report" => "results/report",
|
32
|
+
|
33
|
+
"Features" => "features/index",
|
34
|
+
"Feature" => "features/file",
|
35
|
+
|
26
36
|
"View Configuration" => "admin/config",
|
27
37
|
"Edit Configuration" => "admin/config/edit",
|
28
38
|
"Repo" => "",
|
29
|
-
"
|
30
|
-
"
|
31
|
-
"
|
32
|
-
"
|
33
|
-
"
|
39
|
+
"Repositories" => "repositories/index",
|
40
|
+
"Repository" => "repositories/show",
|
41
|
+
"Logs" => "logs/index",
|
42
|
+
"Log" => "logs/show",
|
43
|
+
"Help" => "help/index",
|
44
|
+
|
45
|
+
"Error" => "error_handler"
|
34
46
|
}
|
35
47
|
|
36
48
|
def self.path_for section
|