Skip to content

Commit 23e3752

Browse files
SamLau95yuvipanda
authored andcommitted
Fix Python in Javascript
Looks like we tried to use the `str` function in our Javascript which doesn't work. Also fixes `'memory'` key in the data.
1 parent 9e75c0b commit 23e3752

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nbresuse/static/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ define(['jquery', 'base/js/utils'], function ($, utils) {
1717
$.getJSON(utils.get_body_data('baseUrl') + 'metrics', function(data) {
1818
// FIXME: Proper setups for MB and GB. MB should have 0 things
1919
// after the ., but GB should have 2.
20-
var display = str((data['rss'] / (1024 * 1024)).toFixed(0)) + " MB";
20+
var display = Math.round(data['rss'] / (1024 * 1024)) + " MB";
2121

22-
if (data['limits']['mem'] !== null) {
23-
display += " / " + (data['limits']['mem'] / (1024 * 1024));
22+
if (data['limits']['memory'] !== null) {
23+
display += " / " + (data['limits']['memory'] / (1024 * 1024));
2424
}
2525
$('#nbresuse-mem').text(display);
2626
});

0 commit comments

Comments
 (0)