Merge ~ya-bo-ng/maas:kvm-storage-improvements into maas:master

Proposed by Anthony Dillon
Status: Merged
Approved by: Anthony Dillon
Approved revision: 7835a976b56cf39ce1d9f4f66577b79e90682eb1
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ya-bo-ng/maas:kvm-storage-improvements
Merge into: maas:master
Diff against target: 175 lines (+38/-21)
4 files modified
src/maasserver/static/js/angular/controllers/pod_details.js (+7/-7)
src/maasserver/static/partials/node-details.html (+2/-0)
src/maasserver/static/partials/pod-details.html (+14/-11)
src/maasserver/static/scss/_patterns_charts.scss (+15/-3)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Blake Rouse (community) Approve
Review via email: mp+357728@code.launchpad.net

Commit message

Styling improvements to the KVM compose storage UI

Description of the change

Styling improvements to the KVM compose storage UI and a bug fix to the overcommitted RAM bar chart.

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b kvm-storage-improvements lp:~ya-bo-ng/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 2a05418252560152281e0e104339f6e0a40734c1

review: Approve
16db28b... by Anthony Dillon

Fix memory chart

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

UNIT TESTS
-b kvm-storage-improvements lp:~ya-bo-ng/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 53a0c77bf2621ae932e521eb3404e5ef50e3e426

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

UNIT TESTS
-b kvm-storage-improvements lp:~ya-bo-ng/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 16db28bb480a4b5d415b1ec7c171f56b63c167e7

review: Approve
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good, other than the change that should not be in this branch.

review: Needs Fixing
5ca7d60... by Anthony Dillon

Revert unexpected change

d9c9e10... by Anthony Dillon

Revert unexpected change

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

Blake, thanks updated.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Thanks for the fix.

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

UNIT TESTS
-b kvm-storage-improvements lp:~ya-bo-ng/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: d9c9e10c6152ab170655cb0b9c0ba8329be9cbf3

review: Approve
7835a97... by Anthony Dillon

Remove the overcommit styling in Pod summary

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

UNIT TESTS
-b kvm-storage-improvements lp:~ya-bo-ng/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 7835a976b56cf39ce1d9f4f66577b79e90682eb1

review: Approve

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/controllers/pod_details.js b/src/maasserver/static/js/angular/controllers/pod_details.js
2index f420dc5..929f2db 100644
3--- a/src/maasserver/static/js/angular/controllers/pod_details.js
4+++ b/src/maasserver/static/js/angular/controllers/pod_details.js
5@@ -377,13 +377,13 @@ angular.module('MAAS').controller('PodDetailsController', [
6 // Calculate the available cores with overcommit applied
7 $scope.availableWithOvercommit = function(
8 total, used, overcommitRatio, precisionValue) {
9- if (precisionValue) {
10- return (
11- (total * overcommitRatio) - used
12- ).toPrecision(precisionValue);
13- } else {
14- return ((total * overcommitRatio) - used);
15- }
16+ if (precisionValue) {
17+ return (
18+ (total * overcommitRatio) - used
19+ ).toPrecision(precisionValue);
20+ } else {
21+ return ((total * overcommitRatio) - used);
22+ }
23 };
24
25 // Called before the compose params is sent over the websocket.
26diff --git a/src/maasserver/static/partials/node-details.html b/src/maasserver/static/partials/node-details.html
27index ff6380c..ad85c8d 100755
28--- a/src/maasserver/static/partials/node-details.html
29+++ b/src/maasserver/static/partials/node-details.html
30@@ -15,6 +15,8 @@
31 data-ng-show="canEdit()"
32 data-ng-model="header.hostname.value"
33 data-ng-disabled="!canEdit()"
34+ data-ng-keydown="$event.keyCode == 13 && $event.preventDefault()"
35+ data-ng-keyup="$event.keyCode == 13 && saveEditHeader()"
36 data-maas-editing="editHeader()"></span>
37 <span ng-click="editHeaderDomain()" data-ng-show="!canEdit()">{$ header.hostname.value $}</span>
38 <span class="page-header__title-dot u-no-margin--top ng-hide" data-ng-show="header.editing || header.editing_domain">.</span>
39diff --git a/src/maasserver/static/partials/pod-details.html b/src/maasserver/static/partials/pod-details.html
40index 2b37076..0f762a9 100644
41--- a/src/maasserver/static/partials/pod-details.html
42+++ b/src/maasserver/static/partials/pod-details.html
43@@ -15,6 +15,8 @@
44 data-ng-show="canEdit()"
45 data-ng-model="name.value"
46 data-ng-disabled="!canEdit()"
47+ data-ng-keydown="$event.keyCode == 13 && $event.preventDefault()"
48+ data-ng-keyup="$event.keyCode == 13 && saveEditName()"
49 data-ng-click="editName()"></span>
50 </h1>
51 <button class="p-button--base u-no-margin--top ng-hide"
52@@ -312,7 +314,7 @@
53 <span class="p-tooltip p-tooltip--top-left u-float--right"
54 style="position: absolute; top: 8px; right: 8px;"
55 aria-describedby="storage-size-warning"
56- data-ng-if="!storage.size || storage.size < 8">
57+ data-ng-if="(storage.size > 0 && storage.size < 8) || storage.size == 0">
58 <i class="p-icon--warning">Warning</i>
59 <span class="p-tooltip__message" role="tooltip" id="storage-size-warning">Ubuntu typically requires 8GB minimum. Lower allocations may fail.</span>
60 </span>
61@@ -342,9 +344,11 @@
62 <li class="p-key-list__item--used">
63 <p class="p-p-compact">Used</p>
64 </li>
65+ <li class="p-key-list__item--other-requests" data-ng-if="compose.obj.storage.length > 1">
66+ <p class="p-p-compact">+</p>
67+ </li>
68 <li class="p-key-list__item--requests">
69 <p class="p-p-compact">
70- <span data-ng-if="compose.obj.storage.length > 1">+</span>
71 Request<span data-ng-if="compose.obj.storage.length > 1">s</span>
72 </p>
73 </li>
74@@ -384,25 +388,26 @@
75 <div class="p-chart__bar--used" style="width: {$ storage_pool.used / storage_pool.total * 100 $}%"></div>
76 </div>
77 </div>
78- <ul class="p-inline-list u-no-margin--bottom p-space-between"
79+ <ul class="p-inline-list u-no-margin--bottom u-flex--no-wrap"
80 ng-if="totalStoragePercentage(storage_pool, (storage.size + getOtherRequests(storage_pool, storage)) | convertGigabyteToBytes) < 100">
81- <li class="p-inline-list__item p-key-list__item--used">
82+ <li class="p-inline-list__item p-key-list__item--used u-no-padding--right">
83 <p class="p-p-compact">
84 {$ storage_pool.used | formatBytes $}
85 </p>
86 </li>
87 <li data-ng-if="compose.obj.storage.length > 1 && getOtherRequests(storage_pool, storage) > 0"
88- class="p-inline-list__item p-key-list__item--other">
89+ class="p-inline-list__item p-key-list__item--other-requests u-no-padding--right">
90 <p class="p-p-compact">
91 {$ getOtherRequests(storage_pool, storage) $} GB
92 </p>
93 </li>
94- <li ng-if="storage.pool === storage_pool" class="p-inline-list__item p-key-list__item--requests">
95+ <li ng-if="storage.pool === storage_pool"
96+ class="p-inline-list__item p-key-list__item--requests u-no-padding--right">
97 <p class="p-p-compact">
98 {$ storage.size $} GB
99 </p>
100 </li>
101- <li class="p-inline-list__item p-key-list__item--free">
102+ <li class="p-inline-list__item p-key-list__item--free u-no-padding--right">
103 <p class="p-p-compact">
104 {$ storage_pool.available | formatBytes $}
105 </p>
106@@ -536,8 +541,7 @@
107 </h4>
108 </div>
109 <div class="p-meter--cpu-cores">
110- <div class="p-meter--cpu-cores__container"
111- ng-class="{'is-over': pod.available.cores < 0}">
112+ <div class="p-meter--cpu-cores__container">
113 <span class="p-meter--cpu-cores__core--used" ng-repeat="i in pod.used.cores | range"></span>
114 <span class="p-meter--cpu-cores__core--available" ng-repeat="i in availableWithOvercommit(pod.total.cores, pod.used.cores, pod.cpu_over_commit_ratio) | range"></span>
115 </div>
116@@ -555,8 +559,7 @@
117 </h4>
118 </div>
119 <div class="p-meter__container">
120- <meter class="p-meter" max="{$ pod.total.memory $}" value="{$ pod.used.memory $}"
121- ng-class="{'is-over': pod.used.memory > pod.total.memory}"></meter>
122+ <meter class="p-meter" max="{$ pod.total.memory * pod.memory_over_commit_ratio $}" value="{$ pod.used.memory $}"></meter>
123 </div>
124 <p class="u-no-max-width">
125 <span>{$ pod.used.memory_gb $} GiB used</span>
126diff --git a/src/maasserver/static/scss/_patterns_charts.scss b/src/maasserver/static/scss/_patterns_charts.scss
127index b959f6a..1fb0e1c 100644
128--- a/src/maasserver/static/scss/_patterns_charts.scss
129+++ b/src/maasserver/static/scss/_patterns_charts.scss
130@@ -25,9 +25,7 @@
131 .p-chart__bar--used {
132 @extend .p-chart__bar;
133 background-color: $color--used;
134- &:not(:last-child) {
135- border-right: 1px solid $color-x-light;
136- }
137+ border-right: 1px solid $color-x-light;
138 }
139
140 .p-chart__bar--other {
141@@ -65,6 +63,7 @@
142 // Key inside option selector
143 %p-key-list-item--common-properties {
144 display: flex;
145+ flex: 1;
146 padding-right: $sph-intra;
147
148 &::before {
149@@ -77,6 +76,11 @@
150 padding-top: map-get($nudges, nudge--p);
151 width: $sp-unit;
152 }
153+
154+ &:last-of-type {
155+ text-align: right;
156+ justify-content: flex-end;
157+ }
158 }
159
160 .p-key-list__item--requests {
161@@ -86,6 +90,14 @@
162 }
163 }
164
165+ .p-key-list__item--other-requests {
166+ @extend %p-key-list-item--common-properties;
167+ padding-right: 0.25rem;
168+ &::before {
169+ color: #1aaf65;
170+ }
171+ }
172+
173 .p-key-list__item--used {
174 @extend %p-key-list-item--common-properties;
175 &::before {

Subscribers

People subscribed via source and target branches