foreman-tasks 0.16.0 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.babelrc +4 -1
- data/.eslintrc +4 -13
- data/app/assets/stylesheets/foreman_tasks/application.css.scss +0 -37
- data/app/controllers/foreman_tasks/api/tasks_controller.rb +9 -5
- data/app/controllers/foreman_tasks/tasks_controller.rb +23 -19
- data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +28 -29
- data/app/lib/actions/bulk_action.rb +1 -1
- data/app/models/foreman_tasks/task.rb +1 -1
- data/app/models/foreman_tasks/task/dynflow_task.rb +30 -0
- data/app/services/foreman_tasks/troubleshooting_help_generator.rb +4 -0
- data/app/views/foreman_tasks/api/tasks/details.json.rabl +18 -0
- data/app/views/foreman_tasks/layouts/react.html.erb +1 -1
- data/app/views/foreman_tasks/tasks/index.html.erb +3 -0
- data/app/views/foreman_tasks/tasks/show.html.erb +10 -134
- data/config/routes.rb +3 -0
- data/lib/foreman_tasks/engine.rb +1 -1
- data/lib/foreman_tasks/tasks/export_tasks.rake +1 -2
- data/lib/foreman_tasks/version.rb +1 -1
- data/package.json +6 -20
- data/test/controllers/tasks_controller_test.rb +11 -0
- data/test/helpers/foreman_tasks/foreman_tasks_helper_test.rb +39 -0
- data/test/unit/actions/bulk_action_test.rb +2 -0
- data/test/unit/task_test.rb +4 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Errors.js +60 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js +46 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js +73 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js +55 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +202 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskHelper.js +38 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +238 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Errors.test.js +36 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Locks.test.js +28 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Raw.test.js +27 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +29 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +18 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskHelper.test.js +77 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskInfo.test.js +60 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Errors.test.js.snap +77 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Locks.test.js.snap +108 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Raw.test.js.snap +174 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/RunningSteps.test.js.snap +62 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +282 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskHelper.test.js.snap +37 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +568 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +87 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.scss +63 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.stories.js +5 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +109 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js +18 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js +44 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +83 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TasksDetailsHelper.js +1 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +12 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +20 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js +33 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +97 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +43 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap +26 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap +122 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +63 -0
- data/webpack/ForemanTasks/Components/TaskDetails/index.js +77 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.js +6 -1
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/__snapshots__/PausedTasksCard.test.js.snap +2 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/RunningTasksCard/RunningTasksCard.js +6 -1
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/RunningTasksCard/__snapshots__/RunningTasksCard.test.js.snap +2 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.js +3 -6
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.scss +0 -3
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/__snapshots__/ScheduledTasksCard.test.js.snap +3 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.js +2 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.scss +0 -4
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCardHelper.js +3 -3
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCard.test.js.snap +495 -54
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.js +1 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.scss +6 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutChart/TasksDonutChart.scss +0 -3
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.scss +1 -1
- data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.scss +2 -2
- data/webpack/ForemanTasks/Components/common/ClickConfirmation/index.js +83 -0
- data/webpack/ForemanTasks/ForemanTasksReducers.js +2 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +2 -0
- data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +2 -0
- data/webpack/index.js +5 -0
- metadata +46 -9
- data/app/views/foreman_tasks/tasks/_details.html.erb +0 -195
- data/app/views/foreman_tasks/tasks/_errors.html.erb +0 -42
- data/app/views/foreman_tasks/tasks/_locks.html.erb +0 -19
- data/app/views/foreman_tasks/tasks/_raw.html.erb +0 -28
- data/app/views/foreman_tasks/tasks/_running_steps.html.erb +0 -40
@@ -1,42 +0,0 @@
|
|
1
|
-
<% if @task.is_a? ForemanTasks::Task::DynflowTask %>
|
2
|
-
<div>
|
3
|
-
<% failed_steps = @task.failed_steps %>
|
4
|
-
<% if @task.execution_plan.nil? %>
|
5
|
-
<div class="alert alert-danger">
|
6
|
-
<%= _("Execution plan data not available ") %>
|
7
|
-
</div>
|
8
|
-
<% elsif failed_steps.empty? %>
|
9
|
-
<div class="alert alert-success">
|
10
|
-
<%= _("No errors") %>
|
11
|
-
</div>
|
12
|
-
<% else %>
|
13
|
-
<% failed_steps.each do |step| %>
|
14
|
-
<div class="alert alert-danger">
|
15
|
-
<% action = step.action(@task.execution_plan) %>
|
16
|
-
<span class="param-name"><%= _("Action") %>:</span>
|
17
|
-
<span class="param-value">
|
18
|
-
<pre><%= action.class %></pre>
|
19
|
-
</span>
|
20
|
-
<span class="param-name"><%= _("Input") %>:</span>
|
21
|
-
<span class="param-value">
|
22
|
-
<pre><%= action.input.pretty_inspect %></pre>
|
23
|
-
</span>
|
24
|
-
<span class="param-name"><%= _("Output") %>:</span>
|
25
|
-
<span class="param-value">
|
26
|
-
<pre><%= action.output.pretty_inspect %></pre>
|
27
|
-
</span>
|
28
|
-
<% if step.error %>
|
29
|
-
<span class="param-name"><%= _("Exception") %>:</span>
|
30
|
-
<span class="param-value">
|
31
|
-
<pre><%= step.error.exception_class %>: <%= step.error.message %></pre>
|
32
|
-
</span>
|
33
|
-
<span class="param-name"><%= _("Backtrace") %>:</span>
|
34
|
-
<span class="param-value">
|
35
|
-
<pre><%= step.error.backtrace.join("\n") %></pre>
|
36
|
-
</span>
|
37
|
-
<% end %>
|
38
|
-
</div>
|
39
|
-
<% end %>
|
40
|
-
<% end %>
|
41
|
-
</div>
|
42
|
-
<% end %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<%= alert(:close => false, :class => 'alert-info', :header => '',
|
2
|
-
:text => _("You can find resource locks on this page. Exclusive lock marked with locked icon means that no other task can use locked resource while this task is running. Non-exclusive lock marked with unlocked icon means other tasks can access the resource freely, it is only used to indicate the relation of this task with the resource")) %>
|
3
|
-
|
4
|
-
<div class="container-fluid container-cards-pf">
|
5
|
-
<div class="row row-cards-pf">
|
6
|
-
<% @task.locks.each do |lock| %>
|
7
|
-
<div class="col-xs-6 col-sm-4 col-md-4">
|
8
|
-
<div class="card-pf card-pf-accented card-pf-aggregate-status">
|
9
|
-
<h2 class="card-pf-title">
|
10
|
-
<span class="fa <%= lock.exclusive ? 'fa-lock' : 'fa-unlock-alt' %>"></span> <%= lock.name %>
|
11
|
-
</h2>
|
12
|
-
<div class="card-pf-body">
|
13
|
-
<%= format('%s id:%s', lock.resource_type, lock.resource_id) %><br>
|
14
|
-
</div>
|
15
|
-
</div>
|
16
|
-
</div>
|
17
|
-
<% end %>
|
18
|
-
</div>
|
19
|
-
</div>
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<div>
|
2
|
-
<span class="param-name list-group-item-heading"><%= _("Id") %>:</span>
|
3
|
-
<span class="param-value"><%= @task.id %></span>
|
4
|
-
</div>
|
5
|
-
<div>
|
6
|
-
<span class="param-name list-group-item-heading"><%= _("Label") %>:</span>
|
7
|
-
<span class="param-value"><%= @task.label %></span>
|
8
|
-
</div>
|
9
|
-
<div>
|
10
|
-
<span class="param-name list-group-item-heading"><%= _("Duration") %>:</span>
|
11
|
-
<span class="param-value"><%= duration_in_words_span(@task.started_at, @task.ended_at || Time.now.utc) %></span>
|
12
|
-
</div>
|
13
|
-
<div>
|
14
|
-
<span class="param-name list-group-item-heading"><%= _("Raw input") %>:</span>
|
15
|
-
<span class="param-value">
|
16
|
-
<pre><%= @task.input.pretty_inspect %></pre>
|
17
|
-
</span>
|
18
|
-
</div>
|
19
|
-
<div>
|
20
|
-
<span class="param-name list-group-item-heading"><%= _("Raw output") %>:</span>
|
21
|
-
<span class="param-value">
|
22
|
-
<pre><%= @task.output.pretty_inspect %></pre>
|
23
|
-
</span>
|
24
|
-
</div>
|
25
|
-
<div>
|
26
|
-
<span class="param-name list-group-item-heading"><%= _("External Id") %>:</span>
|
27
|
-
<span class="param-value"><%= @task.external_id %></span>
|
28
|
-
</div>
|
@@ -1,40 +0,0 @@
|
|
1
|
-
<% if @task.is_a? ForemanTasks::Task::DynflowTask %>
|
2
|
-
<div>
|
3
|
-
<% running_steps = @task.running_steps %>
|
4
|
-
<% if running_steps.empty? %>
|
5
|
-
<%= _("No running steps") %>
|
6
|
-
<% else %>
|
7
|
-
<% running_steps.each do |step| %>
|
8
|
-
<% action = step.action(@task.execution_plan) %>
|
9
|
-
<div class="alert alert-warning">
|
10
|
-
<p>
|
11
|
-
<% if @task.cancellable_action?(action) %>
|
12
|
-
<%= link_to(_('Cancel'),
|
13
|
-
cancel_step_foreman_tasks_task_path(@task, :step_id => step.id),
|
14
|
-
class: ['btn', 'btn-sm', 'btn-primary'].compact,
|
15
|
-
method: :post) %>
|
16
|
-
<% end %>
|
17
|
-
</p>
|
18
|
-
<p>
|
19
|
-
<span class="param-name"><%= _("Action") %>:</span>
|
20
|
-
<span class="param-value">
|
21
|
-
<pre><%= action.class %></pre>
|
22
|
-
</span>
|
23
|
-
<p>
|
24
|
-
<span class="param-name"><%= _("State") %>:</span>
|
25
|
-
<span class="param-value"><%= action.humanized_state %></span>
|
26
|
-
</p>
|
27
|
-
<span class="param-name"><%= _("Input") %>:</span>
|
28
|
-
<span class="param-value">
|
29
|
-
<pre><%= action.input.pretty_inspect %></pre>
|
30
|
-
</span>
|
31
|
-
<span class="param-name"><%= _("Output") %>:</span>
|
32
|
-
<span class="param-value">
|
33
|
-
<pre><%= action.output.pretty_inspect %></pre>
|
34
|
-
</span>
|
35
|
-
</div>
|
36
|
-
<% end %>
|
37
|
-
</p>
|
38
|
-
<% end %>
|
39
|
-
</div>
|
40
|
-
<% end %>
|