mutx 0.1.69 → 0.2.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.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/documentation/repos.md +21 -24
  4. data/lib/generators/task_rack.rb +8 -2
  5. data/lib/generators/templates/config.ru.tt +1 -1
  6. data/lib/mutx/API/execution.rb +8 -44
  7. data/lib/mutx/API/repo.rb +7 -10
  8. data/lib/mutx/background_jobs/workers/executor.rb +44 -38
  9. data/lib/mutx/commands/install.rb +1 -1
  10. data/lib/mutx/commands/start.rb +1 -1
  11. data/lib/mutx/custom/execution.rb +1 -1
  12. data/lib/mutx/database/mongo_connector.rb +19 -22
  13. data/lib/mutx/execution.rb +1 -0
  14. data/lib/mutx/lib/authentication.rb +23 -0
  15. data/lib/mutx/lib/helpers.rb +52 -0
  16. data/lib/mutx/lib/middlewares/database_middleware.rb +16 -0
  17. data/lib/mutx/lib/middlewares/flash_middleware.rb +31 -0
  18. data/lib/mutx/lib/middlewares/logger_middleware.rb +13 -0
  19. data/lib/mutx/lib/monkey_patch.rb +28 -0
  20. data/lib/mutx/lib/paths.rb +80 -0
  21. data/lib/mutx/platforms/ruby.rb +8 -0
  22. data/lib/mutx/public/css/bootstrap.min.css +7 -0
  23. data/lib/mutx/public/css/font-awesome.min.css +4 -0
  24. data/lib/mutx/public/css/jquery.json-viewer.css +44 -0
  25. data/{favicon.ico → lib/mutx/public/img/favicon.ico} +0 -0
  26. data/lib/mutx/public/js/bootstrap.min.js +6 -0
  27. data/lib/mutx/public/js/jquery.json-viewer.js +148 -0
  28. data/lib/mutx/public/js/jquery.min.js +6 -0
  29. data/lib/mutx/{view/javascript.mote → public/js/mutx.js} +0 -5
  30. data/lib/mutx/public/js/notify.min.js +1 -0
  31. data/lib/mutx/results/result.rb +60 -68
  32. data/lib/mutx/results/results.rb +4 -0
  33. data/lib/mutx/routes.rb +85 -883
  34. data/lib/mutx/routes/admin_routes.rb +16 -0
  35. data/lib/mutx/routes/admin_routes/custom_params_routes.rb +97 -0
  36. data/lib/mutx/routes/admin_routes/repositories_routes.rb +35 -0
  37. data/lib/mutx/routes/admin_routes/tasks_routes.rb +110 -0
  38. data/lib/mutx/routes/api_routes.rb +49 -0
  39. data/lib/mutx/routes/api_routes/custom_params_routes.rb +41 -0
  40. data/lib/mutx/routes/api_routes/input_routes.rb +48 -0
  41. data/lib/mutx/routes/api_routes/repos_routes.rb +74 -0
  42. data/lib/mutx/routes/api_routes/results_routes.rb +50 -0
  43. data/lib/mutx/routes/api_routes/tasks_routes.rb +47 -0
  44. data/lib/mutx/routes/api_routes/tests_routes.rb +42 -0
  45. data/lib/mutx/routes/features_routes.rb +24 -0
  46. data/lib/mutx/routes/help_routes.rb +23 -0
  47. data/lib/mutx/routes/logs_routes.rb +22 -0
  48. data/lib/mutx/routes/message_routes.rb +24 -0
  49. data/lib/mutx/routes/repositories_routes.rb +25 -0
  50. data/lib/mutx/routes/results_routes.rb +53 -0
  51. data/lib/mutx/routes/task_results_routes.rb +25 -0
  52. data/lib/mutx/routes/tasks_routes.rb +67 -0
  53. data/lib/mutx/routes/tests_routes.rb +66 -0
  54. data/lib/mutx/support/change_inspector.rb +3 -3
  55. data/lib/mutx/support/files_cleanner.rb +12 -3
  56. data/lib/mutx/support/git.rb +11 -2
  57. data/lib/mutx/support/processes.rb +2 -2
  58. data/lib/mutx/support/project_type.rb +12 -0
  59. data/lib/mutx/tasks/task.rb +8 -2
  60. data/lib/mutx/version.rb +1 -1
  61. data/lib/mutx/view/{custom/params/delete_form.mote → admin/custom-params/_delete_form.mote} +2 -4
  62. data/lib/mutx/view/{custom/params/create_edit_form.mote → admin/custom-params/_form.mote} +5 -9
  63. data/lib/mutx/view/{custom/params/custom_param_task_deleting_box.mote → admin/custom-params/_task_deleting_box.mote} +1 -2
  64. data/lib/mutx/view/{custom/params → admin/custom-params}/delete.mote +1 -3
  65. data/lib/mutx/view/{custom/params → admin/custom-params}/edit.mote +1 -5
  66. data/lib/mutx/view/{custom/params/list.mote → admin/custom-params/index.mote} +8 -13
  67. data/lib/mutx/view/{custom/params → admin/custom-params}/new.mote +1 -5
  68. data/lib/mutx/view/{custom/params/custom_param_selection_box.mote → admin/custom-params/selection_box.mote} +2 -3
  69. data/lib/mutx/view/{list_repos.mote → admin/repositories/index.mote} +2 -6
  70. data/lib/mutx/view/{repos.mote → admin/repositories/new.mote} +2 -6
  71. data/lib/mutx/view/{tasks/admin/delete_form.mote → admin/tasks/_delete_form.mote} +2 -12
  72. data/lib/mutx/view/{tasks/admin/create_edit_form.mote → admin/tasks/_form.mote} +6 -9
  73. data/lib/mutx/view/{tasks/admin → admin/tasks}/delete.mote +1 -3
  74. data/lib/mutx/view/{tasks/admin → admin/tasks}/edit.mote +1 -4
  75. data/lib/mutx/view/{tasks/admin/list.mote → admin/tasks/index.mote} +5 -10
  76. data/lib/mutx/view/{tasks/admin → admin/tasks}/new.mote +1 -5
  77. data/lib/mutx/view/{tasks/admin/view.mote → admin/tasks/show.mote} +1 -3
  78. data/lib/mutx/view/body.mote +13 -51
  79. data/lib/mutx/view/{custom/params.mote → custom-params/_custom_params.mote} +3 -4
  80. data/lib/mutx/view/{custom/params → custom-params/types}/json.mote +0 -0
  81. data/lib/mutx/view/{custom/params → custom-params/types}/select_list.mote +0 -0
  82. data/lib/mutx/view/{custom/params → custom-params/types}/text.mote +0 -0
  83. data/lib/mutx/view/error_handler.mote +4 -54
  84. data/lib/mutx/view/features/{feature.mote → file.mote} +0 -0
  85. data/lib/mutx/view/features/index.mote +9 -0
  86. data/lib/mutx/view/git_information.mote +2 -8
  87. data/lib/mutx/view/help/{main.mote → _main.mote} +0 -0
  88. data/lib/mutx/view/help/{page.mote → _page.mote} +0 -0
  89. data/lib/mutx/view/help/{search_result.mote → _search_result.mote} +0 -0
  90. data/lib/mutx/view/help/index.mote +38 -0
  91. data/lib/mutx/view/layout/flash.mote +7 -0
  92. data/lib/mutx/view/{footer.mote → layout/footer.mote} +1 -1
  93. data/lib/mutx/view/layout/javascript.mote +6 -0
  94. data/lib/mutx/view/{modals.mote → layout/modals.mote} +0 -0
  95. data/lib/mutx/view/layout/navigation_bar.mote +88 -0
  96. data/lib/mutx/view/{styles.mote → layout/styles.mote} +10 -0
  97. data/lib/mutx/view/logs/{logs.mote → index.mote} +1 -1
  98. data/lib/mutx/view/logs/show.mote +3 -0
  99. data/lib/mutx/view/repositories/_repository.mote +7 -0
  100. data/lib/mutx/view/repositories/index.mote +23 -0
  101. data/lib/mutx/view/repositories/show.mote +21 -0
  102. data/lib/mutx/view/results/{detailed_info.mote → _result.mote} +5 -5
  103. data/lib/mutx/view/results/console.mote +63 -106
  104. data/lib/mutx/view/results/{all.mote → index.mote} +18 -24
  105. data/lib/mutx/view/sections.rb +36 -24
  106. data/lib/mutx/view/task_results/_result.mote +57 -0
  107. data/lib/mutx/view/{results/result.mote → task_results/_result_item.mote} +6 -5
  108. data/lib/mutx/view/task_results/index.mote +35 -0
  109. data/lib/mutx/view/tasks/_task.mote +90 -0
  110. data/lib/mutx/view/tasks/index.mote +61 -0
  111. data/lib/mutx/view/tasks/show.mote +167 -0
  112. data/lib/mutx/view/tests/_test.mote +90 -0
  113. data/lib/mutx/view/tests/index.mote +59 -0
  114. data/lib/mutx/view/tests/show.mote +172 -0
  115. data/lib/mutx/view/view.rb +172 -10
  116. metadata +89 -50
  117. data/lib/mutx/database/middleware.rb +0 -18
  118. data/lib/mutx/view/features.mote +0 -57
  119. data/lib/mutx/view/features/features_list.mote +0 -10
  120. data/lib/mutx/view/help.mote +0 -75
  121. data/lib/mutx/view/logs/log.mote +0 -3
  122. data/lib/mutx/view/message.mote +0 -8
  123. data/lib/mutx/view/navigation_bar.mote +0 -67
  124. data/lib/mutx/view/results/results.mote +0 -112
  125. data/lib/mutx/view/tasks/message.mote +0 -37
  126. data/lib/mutx/view/tasks/task.mote +0 -167
  127. data/lib/mutx/view/tasks/task_item.mote +0 -77
  128. data/lib/mutx/view/tasks/tasks.mote +0 -74
@@ -0,0 +1,57 @@
1
+ % results_list = Mutx::API::Result.results_list_for(task["_id"])
2
+ % if results_list.size > 0
3
+ % results_list_size = Mutx::View.round_plus(results_list.size)
4
+ <div class="panel panel-primary">
5
+ <div class="panel-heading" data-toggle="collapse" data-target='#{{task["_id"]}}'>
6
+ <h3 class="panel-title">
7
+ {{task["name"]}}
8
+ <div class="pull-right">{{results_list_size}} Results</div>
9
+ </h3>
10
+ <div></div>
11
+ </div>
12
+ <div class="panel-body collapse in" id='{{task["_id"]}}'>
13
+ <table class="table">
14
+ <thead>
15
+ <tr>
16
+ <th style="font-weight: bold;">When started</th>
17
+ <th style="font-weight: bold;">Label</th>
18
+ <th style="font-weight: bold;">Time Elapsed</th>
19
+ <th style="font-weight: bold; text-align: center;">Viewed</th>
20
+ <th style="font-weight: bold; text-align: center;">Notified</th>
21
+ <th style="font-weight: bold; text-align: center;">File Attached</th>
22
+ <th style="font-weight: bold;">Output</th>
23
+ <th style="font-weight: bold;">Status</th>
24
+ </tr>
25
+ </thead>
26
+ % results_list_size = results_list.size
27
+ % results_list = results_list[0..2] unless query_string.values['task_name']
28
+ % results_list.each do |result_data|
29
+ {{ partial('task_results/_result_item', result: result_data) }}
30
+ % end
31
+ </table>
32
+ <div class="text-center">
33
+ <a href="/tasks/{{task["name"]}}" class="btn btn-info">
34
+ Go to task
35
+ </a>
36
+ % unless query_string.values['task_name']
37
+ <a href="{{ path_for(:task_results_index, query_string: { task_name: task["name"]} ) }}" class="btn btn-default">
38
+ &nbsp;&nbsp;All results for this Task&nbsp;
39
+ <span class="label label-info label-as-badge">
40
+ {{results_list_size}}
41
+ </span>
42
+ </a>
43
+ % end
44
+ </div>
45
+ </div>
46
+ </div>
47
+ % else
48
+ <!--
49
+ <br>
50
+ <br>
51
+ <div id='well'>
52
+ <h4>No results found for execution: '{{task[:name]}}', go ahead and run it</h4>
53
+ </div>
54
+ <br>
55
+ <br>
56
+ -->
57
+ % end
@@ -1,9 +1,10 @@
1
1
  <div title="Command: {{result['command']}}">
2
- <tr class="small">
2
+ <tr class="small" onclick="goClean('/results/{{result["_id"]}}/log/');">
3
3
  <th>{{Mutx::Support::TimeHelper.formatted_time_for(result["started_at"])}}</th>
4
4
  % execution_name = !result["execution_name"].empty? ? result["execution_name"].gsub("-_-"," ") : '<small>Not defined</small>'
5
5
  <th>{{execution_name}}</th>
6
- <th>{{Mutx::View.formatted_for(result["elapsed_time"])}}</th>
6
+ % elapsed = (result["finished_at"] || Time.now.to_i) - result["started_at"]
7
+ <th>{{Mutx::View.formatted_for(elapsed)}}</th>
7
8
  <th style="text-align: center;" >
8
9
  % if result["saw"]
9
10
  <a href="#">
@@ -28,12 +29,12 @@
28
29
  % end
29
30
  </th>
30
31
  <th>
31
- <a href='/results/{{result["_id"]}}/log', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600';" class="label label-default">
32
- Console Log
32
+ <a href='{{ path_for(:results_log, result_id: result["_id"]) }}'>
33
+ {{Mutx::View.icon_for("console_log")}}
33
34
  </a>
34
35
  </th>
35
36
  <th>
36
- {{Mutx::View.label_color_for(result)}}
37
+ {{Mutx::View.icon_for_result_status(result)}}
37
38
  </th>
38
39
  </tr>
39
40
  </div>
@@ -0,0 +1,35 @@
1
+
2
+ % tasks.each do |task|
3
+ {{ partial('task_results/_result', task: task) }}
4
+ % end
5
+ % if tasks.empty?
6
+ <br>
7
+ <br>
8
+ <div id='well'>
9
+ <h3>No results</h3>
10
+ </div>
11
+ <br>
12
+ <br>
13
+ % end
14
+
15
+ <style>
16
+ #well {
17
+ aling: right;
18
+ height: 50px;
19
+ background: #F5F5F5;
20
+ width: 600px;
21
+ font-size: 20px;
22
+ #font-style: oblique;
23
+ color: #696969;
24
+ text-align: center;
25
+ padding: 0 20px;
26
+ margin: 20px;
27
+ display: flex;
28
+ justify-content: center;
29
+ /* align horizontal */
30
+ align-items: center;
31
+ /* align vertical */
32
+ margin-right: auto;
33
+ margin-left: auto;
34
+ }
35
+ </style>
@@ -0,0 +1,90 @@
1
+ <?
2
+ running_results = Mutx::Results.running_results_for_task_id(task["_id"])
3
+ status = if running_results.size > 0
4
+ last_execution = running_results.last
5
+ "running"
6
+ else
7
+ "READY"
8
+ end
9
+
10
+ logged = "true"
11
+
12
+ color = Mutx::View.color(status)
13
+
14
+ ?>
15
+
16
+ <th>
17
+ <a href="#" onclick="goClean('{{ path_for(:tasks_show, task_name: task['name']) }}');" >{{task["name"]}}</a>
18
+ </th>
19
+ <th>
20
+ <th>
21
+ % if status == "running"
22
+ {{Mutx::View.icon_for_running last_execution}}
23
+ % end
24
+ </th>
25
+ <th>
26
+ % if task["information"]
27
+ <a href='#' title='{{task["information"]}}' aria-hidden='true' data-toggle='modal' data-target='#myModal' onclick="javascript:info('Information about {{task["name"]}}','{{task["information"].gsub('\n','<br>')}}', null);">
28
+ {{Mutx::View.icon_for("info")}}
29
+ </a>
30
+ % end
31
+ </th>
32
+ <th>
33
+ % if ((task["blocked"].eql? "on") || (task["blocked_stop"].eql? "on"))
34
+ {{Mutx::View.icon_for("lock")}}
35
+ % end
36
+ </th>
37
+ <th>
38
+ % if (task["notifications"].eql? "on")
39
+ {{Mutx::View.icon_for("notification")}}
40
+ % end
41
+ </th>
42
+ <th>
43
+ % if (Mutx::Results.results_ids_for(task["_id"]).size > 0)
44
+ <a href='{{ path_for(:task_results_index, query_string: { task_name: task["name"]}) }}'>
45
+ {{Mutx::View.icon_for("result")}}
46
+ </a>
47
+ % end
48
+ </th>
49
+ <th>
50
+ % res = Mutx::Database::MongoConnector.results_for(task["_id"]).first
51
+ % if ( (!res.nil?) && (res["file_attached"].eql? "yes") )
52
+ {{Mutx::View.icon_for("attachment")}}
53
+ %end
54
+ </th>
55
+ <th>
56
+ % if task["cronneable"].eql? "on"
57
+ {{Mutx::View.icon_for("cron")}}
58
+ {{task["cron_time"]}}'
59
+ % end
60
+ </th>
61
+ <th>
62
+ % if task["cronneable"].eql? "on"
63
+ % if (task["task_status"].eql? "off")
64
+ <a href="{{ path_for(:tasks_status, task_name: task["name"]) }}" title= "Click to allow task to be cronned">
65
+ {{Mutx::View.icon_for("off")}}
66
+ </a>
67
+ % elsif (task["task_status"].eql? "on")
68
+ <a href="{{ path_for(:tasks_status, task_name: task["name"]) }}" title= "Click to stop task and cannot be cronned">
69
+ {{Mutx::View.icon_for("on")}}
70
+ </a>
71
+ % end
72
+ % end
73
+ </th>
74
+
75
+ <style>
76
+ .starter-template {
77
+ display:inline-block;
78
+ height: 70px;
79
+ margin: 25px;
80
+ width: auto;
81
+ margin-right: auto;
82
+ margin-left: auto;
83
+ }
84
+ .panel-body_aux {
85
+ display:inline-block;
86
+ margin: 5px;
87
+ width: auto;
88
+ padding: 10px;
89
+ }
90
+ </style>
@@ -0,0 +1,61 @@
1
+ % number_of_tasks = tasks.size
2
+
3
+ % if tasks.empty?
4
+ <br>
5
+ <br>
6
+ <div id='well'>
7
+ <h3>No {{section}} defined</h3>
8
+ </div>
9
+ <br>
10
+ <br>
11
+ % else
12
+
13
+ <div class="panel panel-default">
14
+ <div class="panel-heading">
15
+ <h4>{{section.capitalize}}</h4>
16
+ </div>
17
+ <table class="table table-striped table-hover">
18
+ <tbody>
19
+ % tasks.each do |task|
20
+ <tr>
21
+ {{ partial('tasks/_task', task: task) }}
22
+ </tr>
23
+ % end
24
+ </tbody>
25
+ </table>
26
+ </div>
27
+ <div class="panel panel-default">
28
+ <div class="panel-body">
29
+ {{Mutx::View.icon_for("info")}}: Information about task<br>
30
+ {{Mutx::View.icon_for("cron")}}: Cronned task<br>
31
+ {{Mutx::View.icon_for("lock")}}: Protected<br>
32
+ {{Mutx::View.icon_for("notification")}}: Send notification<br>
33
+ {{Mutx::View.icon_for("attachment")}}: Last execution sent attachment<br>
34
+ {{Mutx::View.icon_for("results")}}: Results for task<br>
35
+ {{Mutx::View.icon_for("off")}}: Task is off<br>
36
+ {{Mutx::View.icon_for("on")}}: Task is on<br>
37
+ </div>
38
+ </div>
39
+ % end
40
+
41
+ <style>
42
+ #well {
43
+ aling: right;
44
+ height: 50px;
45
+ background: #F5F5F5;
46
+ width: 600px;
47
+ font-size: 20px;
48
+ #font-style: oblique;
49
+ color: #696969;
50
+ text-align: center;
51
+ padding: 0 20px;
52
+ margin: 20px;
53
+ display: flex;
54
+ justify-content: center;
55
+ /* align horizontal */
56
+ align-items: center;
57
+ /* align vertical */
58
+ margin-right: auto;
59
+ margin-left: auto;
60
+ }
61
+ </style>
@@ -0,0 +1,167 @@
1
+ <?
2
+
3
+ running_results = Mutx::Results.running_results_for_task_id task["_id"]
4
+ max_number_of_execs_reached = running_results.size == task["max_execs"]
5
+
6
+ status = if running_results.size>0
7
+ "running"
8
+ else
9
+ "ready"
10
+ end
11
+
12
+
13
+
14
+
15
+ color = Mutx::View.color(status)
16
+
17
+ ?>
18
+ <div class='starter-template'>
19
+ <div class='panel panel-{{color}}'>
20
+ <div class='panel-heading' data-toggle='collapse' data-target="#{{ task['name'].gsub(' ','') }}">
21
+ <h4 class='panel-title'>
22
+ {{ task['name'] }}
23
+ </h4>
24
+ </div>
25
+
26
+ <div class='panel-body collapse in' id="{{ task['name'].gsub(' ','') }}">
27
+ <ul class='list-group'>
28
+
29
+ <!-- Si la task está en running se muestran las ejecuciones -->
30
+ % if running_results.size > 0
31
+ <li class='list-group-item'>
32
+ &nbsp;&nbsp;&nbsp;Running {{ running_results.size }} tasks
33
+ % if max_number_of_execs_reached
34
+ <small>
35
+ (Maximum no. of execution reached)
36
+ </small>
37
+ % end
38
+ <div class='panel-body'>
39
+ <div class='list-group'>
40
+ % running_results.each do |result|
41
+ <a class='list-group-item' onclick="goClean('{{ path_for(:results_log, result_id: result["_id"]) }}');">
42
+ {{Mutx::Support::TimeHelper.formatted_time_for(Mutx::Results::Result.get(result["_id"]).started_at)}}&nbsp;
43
+ <small>
44
+ {{result["execution_name"]}}
45
+ </small>&nbsp;
46
+ {{Mutx::View.icon_for_running(result)}}
47
+ </a>
48
+ % end
49
+ </div>
50
+ </div>
51
+ </li>
52
+ % end
53
+ % unless max_number_of_execs_reached
54
+ <li class='list-group-item'>
55
+ % task_type = (task["type"] == "test") ? "tests" : "tasks"
56
+ % form_url = "/#{task_type}/#{task["name"]}/run"
57
+ <form name='run' id='{{ task["name"] }}' method='GET' action='{{ path_for(:tasks_run, task_name: task["name"]) }}'>
58
+
59
+ % unless task["custom_params"].empty?
60
+ {{ partial('custom-params/_custom_params', custom_params: task["custom_params"]) }}
61
+ % end
62
+ <br>
63
+ <div class='container' style='width: inherit'>
64
+ <button type='submit' class='btn btn-success' value='Execute'/>Execute&nbsp;
65
+ {{Mutx::View.icon_for('run')}}
66
+ </button>
67
+ <input type='text' name='execution_name' class='customParam' title='This value could be used to identify the result execution from other execution of this task. E.g: You could use the release your are going to test' placeholder='Identify your execution' value='{{Mutx::Support::Configuration.auto_execution_id}}' 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; font-weight:normal;' />
68
+ <button type='button' class='btn btn-default' aria-label='Left Align' data-toggle='modal' data-target='#myModal' onclick='javascript:starterLink("{{task['name']}}","{{task['type']}}");'>
69
+ {{Mutx::View.icon_for('share')}}
70
+ Share
71
+ </button>
72
+ <br>
73
+ <br>
74
+ </div>
75
+ </form>
76
+ </li>
77
+ % end
78
+ <br>
79
+ <li class="list-group-item">
80
+ <!-- cron info -->
81
+ % if task["cronneable"]=="on"
82
+ <br>
83
+ <div class="panel panel-default">
84
+ <div class="panel-heading">
85
+ Cron information
86
+ {{Mutx::View.icon_for('repeat')}}
87
+ </div>
88
+ <div class="panel-body">
89
+ <p class="small">
90
+ Run every {{task["cron_time"]}} minutes
91
+ </p>
92
+ {{Mutx::View.from_to(task)}}
93
+ {{Mutx::View.run_on(task)}}
94
+ </div>
95
+ </div>
96
+ % end
97
+ <!-- end cron info -->
98
+
99
+ <!-- notification info -->
100
+ % if task["notifications"]=="on"
101
+ <div class="panel panel-default">
102
+ <div class="panel-heading">
103
+ Notifications
104
+ {{Mutx::View.icon_for('notification')}}
105
+ </div>
106
+ <div class="panel-body">
107
+ <p class="small">Notificates on {{task["notify_on"]}}</p>
108
+ <p class="small">To: {{task["mail"]}}</p>
109
+ <p class="small">Subject: {{task["subject"]}}</p>
110
+ </div>
111
+ </div>
112
+
113
+ % end
114
+ <!-- end notification info -->
115
+
116
+ <!-- information -->
117
+ % if task["information"]
118
+ <div class="panel panel-default">
119
+ <div class="panel-heading">
120
+ Information about {{task['name']}}
121
+ {{Mutx::View.icon_for('info')}}
122
+ </div>
123
+ <div class="panel-body">
124
+ <p class="small" style="color:red">{{task["information"]}}</p>
125
+ </div>
126
+ </div>
127
+ % end
128
+ <!-- end information -->
129
+
130
+ % results_list = Mutx::Results.all_results_for task["_id"]
131
+ % if results_list and ! results_list.empty?
132
+ <div class="panel panel-default">
133
+ <div class="panel-heading">
134
+ Results for {{task["name"]}}
135
+ </div>
136
+ <table class="table table-striped table-hover"">
137
+ <thead>
138
+ <tr>
139
+ <th>When started</th>
140
+ <th>Label</th>
141
+ <th>Time Elapsed</th>
142
+ <th style="text-align: center;">Viewed</th>
143
+ <th style="text-align: center;">Notified</th>
144
+ <th style="text-align: center;">File Attached</th>
145
+ <th>Console</th>
146
+ <th>Status</th>
147
+ </tr>
148
+ </thead>
149
+ % results_list[0..9].each do |result_data|
150
+ {{ partial('task_results/_result_item', result: result_data) }}
151
+ % end
152
+ <tr>
153
+ <th>
154
+ <a href='{{ path_for(:task_results_index, query_string: { task_name: task["name"] }) }}' class='btn btn-default'>
155
+ {{Mutx::View.icon_for('results')}}
156
+ See all results
157
+ </a>
158
+ </th>
159
+ <tr>
160
+ </table>
161
+ </div>
162
+ % end
163
+ </li>
164
+ </ul>
165
+ </div>
166
+ </div>
167
+ </div>
@@ -0,0 +1,90 @@
1
+ <?
2
+ running_results = Mutx::Results.running_results_for_task_id(test["_id"])
3
+ status = if running_results.size > 0
4
+ last_execution = running_results.last
5
+ "running"
6
+ else
7
+ "READY"
8
+ end
9
+
10
+ logged = "true"
11
+
12
+ color = Mutx::View.color(status)
13
+
14
+ ?>
15
+
16
+ <th>
17
+ <a href="#" onclick="goClean('{{ path_for(:tests_show, test_name: test['name']) }}');" >{{test["name"]}}</a>
18
+ </th>
19
+ <th>
20
+ <th>
21
+ % if status == "running"
22
+ {{Mutx::View.icon_for_running last_execution}}
23
+ % end
24
+ </th>
25
+ <th>
26
+ % if test["information"]
27
+ <a href='#' title='{{test["information"]}}' aria-hidden='true' data-toggle='modal' data-target='#myModal' onclick="javascript:info('Information about {{test["name"]}}','{{test["information"].gsub('\n','<br>')}}', null);">
28
+ {{Mutx::View.icon_for("info")}}
29
+ </a>
30
+ % end
31
+ </th>
32
+ <th>
33
+ % if ((test["blocked"].eql? "on") || (test["blocked_stop"].eql? "on"))
34
+ {{Mutx::View.icon_for("lock")}}
35
+ % end
36
+ </th>
37
+ <th>
38
+ % if (test["notifications"].eql? "on")
39
+ {{Mutx::View.icon_for("notification")}}
40
+ % end
41
+ </th>
42
+ <th>
43
+ % if (Mutx::Results.results_ids_for(test["_id"]).size > 0)
44
+ <a href='{{ path_for(:task_results_index, query_string: { task_name: test["name"]}) }}'>
45
+ {{Mutx::View.icon_for("results")}}
46
+ </a>
47
+ % end
48
+ </th>
49
+ <th>
50
+ % res = Mutx::Database::MongoConnector.results_for(test["_id"]).first
51
+ % if ( (!res.nil?) && (res["file_attached"].eql? "yes") )
52
+ {{Mutx::View.icon_for("notification")}}
53
+ %end
54
+ </th>
55
+ <th>
56
+ % if test["cronneable"].eql? "on"
57
+ {{Mutx::View.icon_for("cron")}}
58
+ {{test["cron_time"]}}'
59
+ % end
60
+ </th>
61
+ <th>
62
+ % if test["cronneable"].eql? "on"
63
+ % if (test["task_status"].eql? "off")
64
+ <a href="{{ path_for(:tests_status, query_string: { task_name: test["name"]}) }}" title= "Click to allow test to be cronned">
65
+ {{Mutx::View.icon_for("off")}}
66
+ </a>
67
+ % elsif (test["task_status"].eql? "on")
68
+ <a href="{{ path_for(:tests_status, test_name: test["name"]) }}" title= "Click to stop task and cannot be cronned">
69
+ {{Mutx::View.icon_for("on")}}
70
+ </a>
71
+ % end
72
+ % end
73
+ </th>
74
+
75
+ <style>
76
+ .starter-template {
77
+ display:inline-block;
78
+ height: 70px;
79
+ margin: 25px;
80
+ width: auto;
81
+ margin-right: auto;
82
+ margin-left: auto;
83
+ }
84
+ .panel-body_aux {
85
+ display:inline-block;
86
+ margin: 5px;
87
+ width: auto;
88
+ padding: 10px;
89
+ }
90
+ </style>