Skip to content

Commit c9da9d7

Browse files
pavel-blagodovMichael Wiederhold
authored and
Michael Wiederhold
committed
MB-24033 revised usage meters & server/bucket details
- removed some data/labels from usage meters to simplify them and customized the display of each -> overview, servers, buckets - should be NO change to add bucket dialog - tightened layout of the details area in buckets and servers - added some new data to the text list of propoerties in servers/buckets - removed unused itemStyle and labelStyle - removed markers Change-Id: I6ddd046bd419da746873eeea07427f2a2517763e Reviewed-on: http://review.couchbase.org/77162 Tested-by: Pavel Blagodov <[email protected]> Reviewed-by: Michael Wiederhold <[email protected]>
1 parent 4cef37a commit c9da9d7

File tree

9 files changed

+153
-211
lines changed

9 files changed

+153
-211
lines changed

priv/public/ui/app/components/directives/mn_bar_usage/mn_bar_usage.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
ng-repeat="item in config.items | orderBy:[]:true"
1515
ng-style="{width: item.itemStyle.width}"
1616
ng-class="'usage-item-' + $index"></div>
17-
<!-- <i
18-
class="marker"
19-
ng-repeat="marker in config.markers | orderBy:[]:true"
20-
ng-style="{left: marker.itemStyle.left}"
21-
ng-class="'marker-' + $index"></i> -->
2217
</div>
2318
<div class="row">
2419
<span

priv/public/ui/app/components/directives/mn_bar_usage/mn_bar_usage.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,10 @@
4141
_.each(values, function (item, i) {
4242
var v = values[i];
4343
values[i] += sum;
44+
newOptions.items[i].itemStyle = newOptions.items[i].itemStyle || {};
4445
newOptions.items[i].itemStyle.width = values[i] + "%";
4546
sum += v;
4647
});
47-
_.each(newOptions.markers, function (marker) {
48-
var percent = mnCalculatePercentFilter(marker.value, total);
49-
var i;
50-
if (_.indexOf(values, percent) < 0 && (i = _.indexOf(values, percent+1)) >= 0) {
51-
// if we're very close to some value, stick to it, so that
52-
// rounding error is not visible
53-
if (items[i].value - marker.value < sum*0.01) {
54-
percent++;
55-
}
56-
}
57-
marker.itemStyle = marker.itemStyle || {};
58-
marker.itemStyle.left = (percent > 100 ? 100 : percent) + '%';
59-
marker.itemStyle.zIndex = 4;
60-
});
6148
newOptions.tdItems = _.select(newOptions.items, function (item) {
6249
return item.name !== null;
6350
});

priv/public/ui/app/css/cbui-components.css

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,13 @@ section.error {
638638
line-height: 2.2;
639639
font-size: .75rem;
640640
flex: 0 1 auto;
641+
max-width: 280px;
641642
}
642643
.cbui-table-props {
643-
margin-top: 1rem;
644644
font-size: .75rem;
645645
flex: 0 1 auto;
646+
min-width: 280px;
647+
max-width: 580px;
646648
}
647649
.cbui-table-props div {
648650
margin-top: .75rem;
@@ -652,10 +654,22 @@ section.error {
652654
margin-top: 0;
653655
}
654656
.cbui-table-meters {
655-
margin: 1rem 0 0 4rem;
656-
flex: 0 2 100%;
657+
margin: 1rem 2rem 0 2rem;
658+
flex: 0 1 100%;
659+
max-width: 480px;
660+
}
661+
.cbui-table-meters + .cbui-table-meters {
662+
margin: 1rem 2rem 0 1rem;
663+
}
664+
.cbui-table-meters.buckets .row {
665+
display: block;
666+
}
667+
.cbui-table-meters.buckets .row span {
668+
display: block;
669+
}
670+
.cbui-table-meters.servers .bar-usages .label-bottom-1.with-square:before {
671+
background-color: #efebe0;
657672
}
658-
659673
/* table cell-related stuff --------- */
660674
.cbui-table-cell {
661675
-webkit-box-flex: 1;
@@ -1218,6 +1232,18 @@ meter {
12181232
.bar-usages.overcommitted .marker-1 {
12191233
background-color: rgb(68, 66, 69);
12201234
}
1235+
.bar-usages.overcommitted.bar-usages-dashboard .label-bottom-1:before {
1236+
background-color: #e07f82; /* .red-3 */
1237+
}
1238+
.bar-usages.overcommitted.bar-usages-dashboard .label-bottom-2:before {
1239+
background-color: #efebe0;
1240+
}
1241+
.bar-usages.overcommitted.bar-usages-dashboard.has-free-space .usage-item-0 {
1242+
background-color: #efebe0;
1243+
}
1244+
.bar-usages.overcommitted.bar-usages-dashboard.has-free-space .usage-item-1 {
1245+
background-color: #e07f82; /* .red-3 */
1246+
}
12211247

12221248
/* spinner ---------------- */
12231249

priv/public/ui/app/mn_admin/mn_buckets/details/mn_buckets_details.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
<span ng-show="bucket.isEphemeral">Ephemeral</span>
1010
</div>
1111
<div class="nowrap" ng-show="rbac.cluster.bucket[bucket.name].settings.read">
12-
<strong>RAM Quota: </strong>
12+
<strong>Bucket RAM Quota: </strong>
1313
{{bucket.quota.ram | mnFormatQuantity}}
1414
</div>
15+
<div class="nowrap" ng-show="rbac.cluster.bucket[bucket.name].settings.read">
16+
<strong>Cluster RAM Quota: </strong>
17+
{{bucket.basicStats.storageTotals.ram.quotaTotalPerNode | mnFormatQuantity}}
18+
</div>
1519
<div
1620
class="nowrap"
1721
ng-if="rbac.cluster.bucket[bucket.name].settings.read"
@@ -43,7 +47,7 @@
4347
</div>
4448
</div>
4549

46-
<div class="cbui-table-meters">
50+
<div class="cbui-table-meters buckets">
4751
<h5 ng-show="rbac.cluster.bucket[bucket.name].settings.read">Memory</h5>
4852
<hr>
4953
<div
@@ -53,12 +57,12 @@ <h5 ng-show="rbac.cluster.bucket[bucket.name].settings.read">Memory</h5>
5357
ng-show="rbac.cluster.bucket[bucket.name].settings.read">
5458
</div>
5559
</div>
56-
<div class="cbui-table-meters">
60+
<div class="cbui-table-meters buckets">
5761
<h5 ng-show="bucket.isMembase">Disk</h5>
5862
<hr ng-show="bucket.isMembase">
5963
<div ng-if="bucket.isMembase && rbac.cluster.bucket[bucket.name].settings.read">
6064
<div
61-
class="bar-usages label-top-has-square label-top-0-other-data"
65+
class="bar-usages"
6266
mn-bar-usage
6367
base-info="bucketsDetailsCtl.getGuageConfig(bucketsDetailsCtl.bucketDetails)"
6468
ng-if="rbac.cluster.bucket[bucket.name].settings.read">
@@ -71,10 +75,11 @@ <h5 ng-show="bucket.isMembase">Disk</h5>
7175
ng-if="bucketsDetailsCtl.warmUpTasks.length && rbac.cluster.tasks.read"
7276
mn-warmup-progress
7377
warm-up-tasks="bucketsDetailsCtl.warmUpTasks"
74-
sort-by="hostname">
78+
sort-by="hostname"
79+
class="margin-bottom1">
7580
</div>
7681

77-
<div class="row flex-right margin-top1">
82+
<div class="row flex-right">
7883
<span>
7984
<button
8085
class="outline"

priv/public/ui/app/mn_admin/mn_buckets/details/mn_buckets_details_service.js

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -62,42 +62,24 @@
6262
};
6363
bucketRamGuageConfig.items = [{
6464
name: 'other buckets',
65-
value: ramSummary.otherBuckets,
66-
itemStyle: {'background-color': '#00BCE9', 'z-index': '2'},
67-
labelStyle: {'color': '#1878a2', 'text-align': 'left'}
65+
value: ramSummary.otherBuckets
6866
}, {
6967
name: 'this bucket',
70-
value: ramSummary.thisAlloc,
71-
itemStyle: {'background-color': '#7EDB49', 'z-index': '1'},
72-
labelStyle: {'color': '#409f05', 'text-align': 'center'}
68+
value: ramSummary.thisAlloc
7369
}, {
7470
name: 'remaining',
75-
value: ramSummary.total - ramSummary.otherBuckets - ramSummary.thisAlloc,
76-
itemStyle: {'background-color': '#E1E2E3'},
77-
labelStyle: {'color': '#444245', 'text-align': 'right'}
71+
value: ramSummary.total - ramSummary.otherBuckets - ramSummary.thisAlloc
7872
}];
79-
bucketRamGuageConfig.markers = [];
8073

8174
if (bucketRamGuageConfig.items[2].value < 0) {
8275
bucketRamGuageConfig.items[1].value = ramSummary.total - ramSummary.otherBuckets;
8376
bucketRamGuageConfig.items[2] = {
8477
name: 'overcommitted',
85-
value: ramSummary.otherBuckets + ramSummary.thisAlloc - ramSummary.total,
86-
itemStyle: {'background-color': '#F40015'},
87-
labelStyle: {'color': '#e43a1b'}
78+
value: ramSummary.otherBuckets + ramSummary.thisAlloc - ramSummary.total
8879
};
89-
bucketRamGuageConfig.markers.push({
90-
value: ramSummary.total,
91-
itemStyle: {'background-color': '#444245'}
92-
});
93-
bucketRamGuageConfig.markers.push({
94-
value: ramSummary.otherBuckets + ramSummary.thisAlloc,
95-
itemStyle: {'background-color': 'red'}
96-
});
9780
bucketRamGuageConfig.topLeft = {
9881
name: 'total allocated',
99-
value: ramSummary.otherBuckets + ramSummary.thisAlloc,
100-
itemStyle: {'color': '#e43a1b'}
82+
value: ramSummary.otherBuckets + ramSummary.thisAlloc
10183
};
10284
}
10385
return bucketRamGuageConfig;
@@ -106,35 +88,19 @@
10688
function getGuageConfig(total, thisBucket, otherBuckets, otherData) {
10789
var free = total - otherData - thisBucket - otherBuckets;
10890

109-
guageConfig.topLeft = {
110-
name: 'other data',
111-
value: otherData,
112-
itemStyle: {color: "#C19710"}
113-
};
11491
guageConfig.topRight = {
11592
name: 'total cluster storage',
11693
value: total
11794
};
11895
guageConfig.items = [{
119-
name: null,
120-
value: otherData,
121-
itemStyle: {'background-color':'#FDC90D', 'z-index': '3'},
122-
labelStyle: {}
123-
}, {
12496
name: 'other buckets',
125-
value: otherBuckets,
126-
itemStyle: {'background-color':'#00BCE9', 'z-index': '2'},
127-
labelStyle: {'color':'#1878a2', 'text-align': 'left'}
97+
value: otherBuckets
12898
}, {
12999
name: 'this bucket',
130-
value: thisBucket,
131-
itemStyle: {'background-color':'#7EDB49', 'z-index': '1'},
132-
labelStyle: {'color':'#409f05', 'text-align': 'center'}
100+
value: thisBucket
133101
}, {
134102
name: 'remaining',
135-
value: free,
136-
itemStyle: {'background-color':'#E1E2E3'},
137-
labelStyle: {'color':'#444245', 'text-align': 'right'}
103+
value: free
138104
}];
139105

140106
return guageConfig;

priv/public/ui/app/mn_admin/mn_overview/mn_overview.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ <h4>XDCR</h4>
8080
class="column width-6">
8181
<h4>Data Service Memory</h4>
8282
<div
83-
class="bar-usages"
83+
ng-class="{
84+
overcommitted: overviewCtl.mnOverviewConfig.ramOverviewConfig.items[1].name === 'overused',
85+
'has-free-space': overviewCtl.mnOverviewConfig.ramOverviewConfig.items[2].name === 'available'
86+
}"
87+
class="bar-usages bar-usages-dashboard"
8488
mn-bar-usage
8589
base-info="overviewCtl.mnOverviewConfig.ramOverviewConfig"></div>
8690
</div>

priv/public/ui/app/mn_admin/mn_overview/mn_overview_service.js

Lines changed: 21 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -28,52 +28,28 @@
2828
};
2929

3030
var ramOverviewConfigBase = {
31-
topLeft: {
32-
name: 'Total Allocated'
33-
},
3431
topRight: {
35-
name: 'Total in Cluster'
32+
name: 'total quota'
3633
},
3734
items: [{
38-
name: 'In Use',
39-
itemStyle: {'background-color': '#00BCE9', 'z-index': 3},
40-
labelStyle: {'color':'#1878a2', 'text-align': 'left'}
35+
name: 'in use'
4136
}, {
42-
name: 'Unused',
43-
itemStyle: {'background-color': '#7EDB49', 'z-index': 2},
44-
labelStyle: {'color': '#409f05', 'text-align': 'center'}
37+
name: 'unused quota'
4538
}, {
46-
name: 'Unallocated',
47-
itemStyle: {'background-color': '#E1E2E3'},
48-
labelStyle: {'color': '#444245', 'text-align': 'right'}
49-
}],
50-
markers: [{
51-
itemStyle: {'background-color': '#e43a1b'}
39+
name: 'unallocated'
5240
}]
5341
};
5442

5543
var hddOverviewConfigBase = {
56-
topLeft: {
57-
name: 'Usable Free Space'
58-
},
5944
topRight: {
60-
name: 'Total Cluster Storage'
45+
name: 'usable free space'
6146
},
6247
items: [{
63-
name: 'In Use',
64-
itemStyle: {'background-color': '#00BCE9', 'z-index': 3},
65-
labelStyle: {'color': '#1878A2', 'text-align': 'left'}
48+
name: 'in use by couchbase'
6649
}, {
67-
name: 'Other Data',
68-
itemStyle: {'background-color': '#FDC90D', 'z-index': 2},
69-
labelStyle: {'color': '#C19710', 'text-align': 'center'}
50+
name: 'other data'
7051
}, {
71-
name: "Free",
72-
itemStyle: {'background-color': '#E1E2E3'},
73-
labelStyle: {'color': '#444245', 'text-align': 'right'}
74-
}],
75-
markers: [{
76-
itemStyle: {'background-color': '#E43A1B'}
52+
name: "free"
7753
}]
7854
};
7955

@@ -144,30 +120,28 @@
144120

145121
var ramOverviewConfig = _.clone(ramOverviewConfigBase, true);
146122

147-
ramOverviewConfig.topLeft.value = bucketsQuota;
148-
ramOverviewConfig.topRight.value = quotaTotal;
123+
ramOverviewConfig.topRight.value = bucketsQuota;
149124
ramOverviewConfig.items[0].value = usedQuota;
150125
ramOverviewConfig.items[1].value = bucketsQuota - usedQuota;
151126
ramOverviewConfig.items[2].value = Math.max(quotaTotal - bucketsQuota, 0);
152-
ramOverviewConfig.markers[0].value = bucketsQuota
153127

154128
if (ramOverviewConfig.items[1].value < 0) {
155129
ramOverviewConfig.items[0].value = bucketsQuota;
156130
ramOverviewConfig.items[1] = {
157-
name: 'Overused',
158-
value: usedQuota - bucketsQuota,
159-
itemStyle: {'background-color': '#F40015', 'z-index': 4},
160-
labelStyle: {'color': '#e43a1b'}
131+
name: 'overused',
132+
value: usedQuota - bucketsQuota
133+
};
134+
ramOverviewConfig.topRight = {
135+
name: 'cluster quota',
136+
value: quotaTotal
161137
};
162138
if (usedQuota < quotaTotal) {
163-
ramOverviewConfig.items[2].name = 'Available';
164-
ramOverviewConfig.items[2].value = quotaTotal - usedQuota;
139+
ramOverviewConfig.items[2] = {
140+
name: 'available',
141+
value: quotaTotal - usedQuota
142+
};
165143
} else {
166-
ramOverviewConfig.items.length = 2;
167-
ramOverviewConfig.markers.push({
168-
value: quotaTotal,
169-
itemStyle: {'color': '#444245', 'z-index': 5}
170-
})
144+
ramOverviewConfig.items.pop();
171145
}
172146
}
173147

@@ -184,12 +158,10 @@
184158

185159
var hddOverviewConfig = _.clone(hddOverviewConfigBase, true);
186160

187-
hddOverviewConfig.topLeft.value = free;
188-
hddOverviewConfig.topRight.value = total;
161+
hddOverviewConfig.topRight.value = free;
189162
hddOverviewConfig.items[0].value = usedSpace;
190163
hddOverviewConfig.items[1].value = other;
191164
hddOverviewConfig.items[2].value = total - other - usedSpace;
192-
hddOverviewConfig.markers[0].value = other + usedSpace + free;
193165

194166
rv.hddOverviewConfig = hddOverviewConfig;
195167
})();

0 commit comments

Comments
 (0)