Skip to content

Commit 4343ce1

Browse files
committed
Fix formatting of data in tables
1 parent 2e0311a commit 4343ce1

File tree

3 files changed

+75
-34
lines changed

3 files changed

+75
-34
lines changed

server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/table.js

+45-13
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@ function initTabletsTable(tableId) {
4747
"url": tabletsUrl,
4848
"dataSrc": ""
4949
},
50+
"stateSave": true,
51+
"columnDefs": [{
52+
"targets": "big-num",
53+
"render": function (data, type) {
54+
if (type === 'display') {
55+
data = bigNumberForQuantity(data);
56+
}
57+
return data;
58+
}
59+
},
60+
{
61+
"targets": "big-size",
62+
"render": function (data, type) {
63+
if (type === 'display') {
64+
data = bigNumberForSize(data);
65+
}
66+
return data;
67+
}
68+
}
69+
],
5070
"columns": [{
5171
"data": "tabletId",
5272
"title": "Tablet ID"
@@ -75,8 +95,7 @@ function initTabletsTable(tableId) {
7595
"data": "location",
7696
"title": "Location"
7797
}
78-
],
79-
"stateSave": true
98+
]
8099
});
81100
}
82101

@@ -97,6 +116,29 @@ function initTableServerTable(tableId) {
97116
return [json];
98117
}
99118
},
119+
"stateSave": true,
120+
"searching": false,
121+
"paging": false,
122+
"info": false,
123+
"columnDefs": [{
124+
"targets": "big-num",
125+
"render": function (data, type) {
126+
if (type === 'display') {
127+
data = bigNumberForQuantity(data);
128+
}
129+
return data;
130+
}
131+
},
132+
{
133+
"targets": "big-size",
134+
"render": function (data, type) {
135+
if (type === 'display') {
136+
data = bigNumberForSize(data);
137+
}
138+
return data;
139+
}
140+
}
141+
],
100142
"columns": [{
101143
"data": "totalEntries",
102144
"title": "Entry Count"
@@ -149,17 +191,7 @@ function initTableServerTable(tableId) {
149191
"data": "totalUnassignedTablets",
150192
"title": "UnassignedTablets"
151193
}
152-
],
153-
"stateSave": true,
154-
"columnDefs": [{
155-
"targets": "big-num",
156-
"render": function (data, type) {
157-
if (type === 'display') {
158-
data = bigNumberForQuantity(data);
159-
}
160-
return data;
161-
}
162-
}]
194+
]
163195
});
164196

165197
refreshTable();

server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/table.ftl

+17-17
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@
3737
<caption><span class="table-caption">${table}</span></caption>
3838
<thead>
3939
<tr>
40-
<th>Entry Count</th>
41-
<th>Size on disk</th>
42-
<th>File Count</th>
43-
<th>WAL Count</th>
44-
<th>Total Tablet Count</th>
45-
<th>Always Hosted Count</th>
46-
<th>On Demand Count</th>
47-
<th>Never Hosted Count</th>
48-
<th>Assigned Count</th>
49-
<th>Assigned To Dead Server Tablets</th>
50-
<th>Hosted Tablets</th>
51-
<th>Suspended Tablets</th>
52-
<th>Unassigned Tablets</th>
40+
<th class="big-num">Entry Count</th>
41+
<th class="big-size">Size on disk</th>
42+
<th class="big-num">File Count</th>
43+
<th class="big-num">WAL Count</th>
44+
<th class="big-num">Total Tablet Count</th>
45+
<th class="big-num">Always Hosted Count</th>
46+
<th class="big-num">On Demand Count</th>
47+
<th class="big-num">Never Hosted Count</th>
48+
<th class="big-num">Assigned Count</th>
49+
<th class="big-num">Assigned To Dead Server Tablets</th>
50+
<th class="big-num">Hosted Tablets</th>
51+
<th class="big-num">Suspended Tablets</th>
52+
<th class="big-num">Unassigned Tablets</th>
5353
</tr>
5454
</thead>
5555
<tbody></tbody>
@@ -65,11 +65,11 @@
6565
<thead>
6666
<tr>
6767
<th>Tablet ID</th>
68-
<th>Estimated Size</th>
69-
<th>Estimated Entries</th>
68+
<th class="big-size">Estimated Size</th>
69+
<th class="big-num">Estimated Entries</th>
7070
<th>Availability</th>
71-
<th>Files</th>
72-
<th>WALs</th>
71+
<th class="big-num">Files</th>
72+
<th class="big-num">WALs</th>
7373
<th>Location</th>
7474
</tr>
7575
</thead>

server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tables.ftl

+13-4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,20 @@
4040
"stateSave": true,
4141
"columnDefs": [
4242
{
43-
"type": "num",
4443
"targets": "big-num",
45-
"render": function (data, type, row) {
46-
if (type === 'display')
44+
"render": function (data, type) {
45+
if (type === 'display') {
4746
data = bigNumberForQuantity(data);
47+
}
48+
return data;
49+
}
50+
},
51+
{
52+
"targets": "big-size",
53+
"render": function (data, type) {
54+
if (type === 'display') {
55+
data = bigNumberForSize(data);
56+
}
4857
return data;
4958
}
5059
}
@@ -101,7 +110,7 @@
101110
<th title="Table Name">Table&nbsp;Name</th>
102111
<th title="Tables are broken down into ranges of rows called tablets." class="big-num">Tablets</th>
103112
<th title="Key/value pairs over each instance, table or tablet." class="big-num">Entries</th>
104-
<th title="Total size on disk." class="big-num">Size on Disk</th>
113+
<th title="Total size on disk." class="big-size">Size on Disk</th>
105114
<th title="Total number of files." class="big-num">Files</th>
106115
<th title="Total number of WALs." class="big-num">WALs</th>
107116
<th title="Number of tablets that are always hosted." class="big-num">Always Available</th>

0 commit comments

Comments
 (0)