Merge ~ya-bo-ng/maas:logs-tab into maas:master

Proposed by Anthony Dillon
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 5e53bba74fc399985e89e2577f19956e88341fd4
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ya-bo-ng/maas:logs-tab
Merge into: maas:master
Diff against target: 73 lines (+18/-23)
2 files modified
src/maasserver/static/js/angular/directives/call_to_action.js (+1/-1)
src/maasserver/static/partials/node-details.html (+17/-22)
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Lee Trager (community) Needs Information
Review via email: mp+338435@code.launchpad.net

Commit message

LP: #1750015 - Reinstate the logic around node logs

Description of the change

Reinstate the access and view logic for node logs in the node details page.

To post a comment you must log in.
Revision history for this message
Lee Trager (ltrager) wrote :

Thanks for fixing this. This bring back the logs tab but there are still two things wrong with the page

1. The drop doesn't work. It should always have Machine output (YAML), Machine output (XML), and if the machine is being deployed or is deployed the installation log.
2. The log output isn't readable, this seemed to be related to LP:1750007

Were you planning on fixing those separately?

https://screenshots.firefox.com/s37NLxsWjbciVlKM/10.0.0.2

review: Needs Information
Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

Thanks for the review Lee.

1. I noticed the drop down wasn't working but wasn't sure if there was only one option. I will take a look at the logic there.

2. Yeah, fixed in a current branch :) https://code.launchpad.net/~ya-bo-ng/maas/+git/maas/+merge/338451

Revision history for this message
Andres Rodriguez (andreserl) wrote :

@Ant,

I believe you've noticed already that the drop down is there, just not placed correctly [1]. Is this something that will be updated in this brnach or will you put a different branch?

If it is a different branch, I'm fine approving this one.

[1]: https://launchpadlibrarian.net/357905962/logs-tab-2-options-not-in-right-place.png

Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

@Andras Soory, was EOD. I will fix the drop down in this branch. I think its best to capture everything we can in page branches then rely on follow ups.

Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

@andres Pushed a fix for the drop down menu.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Lgtm!

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Revision history for this message
MAAS Lander (maas-lander) wrote :
Revision history for this message
MAAS Lander (maas-lander) wrote :
Revision history for this message
MAAS Lander (maas-lander) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/static/js/angular/directives/call_to_action.js b/src/maasserver/static/js/angular/directives/call_to_action.js
2index b82d57c..f43ca05 100644
3--- a/src/maasserver/static/js/angular/directives/call_to_action.js
4+++ b/src/maasserver/static/js/angular/directives/call_to_action.js
5@@ -7,7 +7,7 @@
6 angular.module('MAAS').run(['$templateCache', function ($templateCache) {
7 // Inject the cta.html into the template cache.
8 $templateCache.put('directive/templates/cta.html', [
9- '<div>',
10+ '<div class="p-contextual-menu">',
11 '<button ',
12 'class="p-button p-contextual-menu__toggle" ',
13 'aria-controls="#cta-menu" ',
14diff --git a/src/maasserver/static/partials/node-details.html b/src/maasserver/static/partials/node-details.html
15index 2f9d2f9..b4b3cb9 100755
16--- a/src/maasserver/static/partials/node-details.html
17+++ b/src/maasserver/static/partials/node-details.html
18@@ -297,9 +297,9 @@
19 data-ng-click="section.area = 'testing'"><span data-maas-script-status="script-status" data-script-status="node.testing_status"></span> Hardware tests</a>
20 </li>
21 <li class="p-tabs__item" role="presentation">
22- <a role="tab" class="p-tabs__link" data-ng-if="machine_output.viewable"
23+ <a role="tab" class="p-tabs__link" data-ng-if="node.has_logs"
24 data-ng-class="{ 'is-active': section.area === 'logs'}"
25- data-ng-click="section.area = 'logs'"><span data-maas-script-status="script-status" data-script-status="node.installation_status" data-ng-if="node.installation_results.length > 0"></span> Logs</a>
26+ data-ng-click="section.area = 'logs'"><span data-maas-script-status="script-status" data-script-status="node.installation_status" data-ng-if="node.installation_status !== -1"></span> Logs</a>
27 </li>
28 <li class="p-tabs__item" role="presentation">
29 <a role="tab" class="p-tabs__link" data-ng-if="!isDevice"
30@@ -2682,28 +2682,23 @@
31 </div>
32 </section>
33 <section class="p-strip" data-ng-if="section.area === 'logs'">
34- <div class="row">
35- <div class="col-12">
36- <div data-maas-cta="machine_output.views"
37- data-ng-model="machine_output.selectedView">
38+ <div data-ng-controller="NodeResultsController">
39+ <div class="row" data-ng-if="!resultsLoaded">
40+ <div class="col-12">
41+ <p class="u-text--loading"><i class="p-icon--spinner u-animation--spin"></i>&nbsp;&nbsp;Loading...</p>
42 </div>
43 </div>
44- </div>
45- <div class="row" data-ng-if="machine_output.selectedView.name == 'summary_yaml'">
46- <div class="col-12">
47- <pre class="p-code-numbered" data-maas-code-lines="getSummaryData('yaml')">
48- </pre>
49- </div>
50- </div>
51- <div class="row" data-ng-if="machine_output.selectedView.name == 'summary_xml'">
52- <div class="col-12">
53- <pre class="p-code-numbered" data-maas-code-lines="getSummaryData('xml')">
54- </pre>
55- </div>
56- </div>
57- <div class="row" data-ng-if="machine_output.selectedView.name == 'installation'">
58- <div class="col-12">
59- <pre class="p-code-numbered" data-maas-code-lines="getInstallationData()"></pre>
60+ <div data-ng-if="resultsLoaded">
61+ <div class="row">
62+ <div class="col-12">
63+ <div data-maas-cta="logs.availableOptions" data-ng-model="logs.option" data-ng-change="updateLogOutput()"></div>
64+ </div>
65+ </div>
66+ <div class="row">
67+ <div class="col-12">
68+ <pre class="p-code-numbered" data-maas-code-lines="logOutput"></pre>
69+ </div>
70+ </div>
71 </div>
72 </div>
73 </section>

Subscribers

People subscribed via source and target branches