mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that units are respected when sorting by file size in the File dialog. Fixes #4647
This commit is contained in:
parent
30c7effa50
commit
a7d8b9de8c
@ -32,6 +32,7 @@ Bug fixes
|
|||||||
| `Issue #4483 <https://redmine.postgresql.org/issues/4483>`_ - Ensure the number of jobs can be specified when backing up in directory format.
|
| `Issue #4483 <https://redmine.postgresql.org/issues/4483>`_ - Ensure the number of jobs can be specified when backing up in directory format.
|
||||||
| `Issue #4564 <https://redmine.postgresql.org/issues/4564>`_ - Ensure Javascript errors during Query Tool execution are reported as such and not as Ajax errors.
|
| `Issue #4564 <https://redmine.postgresql.org/issues/4564>`_ - Ensure Javascript errors during Query Tool execution are reported as such and not as Ajax errors.
|
||||||
| `Issue #4610 <https://redmine.postgresql.org/issues/4610>`_ - Suppress Enter key presses in Alertify dialogues when the come from Select2 controls to allow item selection with Enter.
|
| `Issue #4610 <https://redmine.postgresql.org/issues/4610>`_ - Suppress Enter key presses in Alertify dialogues when the come from Select2 controls to allow item selection with Enter.
|
||||||
|
| `Issue #4647 <https://redmine.postgresql.org/issues/4647>`_ - Ensure that units are respected when sorting by file size in the File dialog.
|
||||||
| `Issue #4730 <https://redmine.postgresql.org/issues/4730>`_ - Ensure all messages are retained in the Query Tool from long running queries.
|
| `Issue #4730 <https://redmine.postgresql.org/issues/4730>`_ - Ensure all messages are retained in the Query Tool from long running queries.
|
||||||
| `Issue #4734 <https://redmine.postgresql.org/issues/4734>`_ - Updated documentation for the delete row button that only strikeout the row instead of deleting it.
|
| `Issue #4734 <https://redmine.postgresql.org/issues/4734>`_ - Updated documentation for the delete row button that only strikeout the row instead of deleting it.
|
||||||
| `Issue #4779 <https://redmine.postgresql.org/issues/4779>`_ - Updated documentation for the query tool toolbar buttons.
|
| `Issue #4779 <https://redmine.postgresql.org/issues/4779>`_ - Updated documentation for the query tool toolbar buttons.
|
||||||
|
@ -62,7 +62,7 @@ encode_json = json.JSONEncoder().encode
|
|||||||
# utility functions
|
# utility functions
|
||||||
# convert bytes type to human readable format
|
# convert bytes type to human readable format
|
||||||
def sizeof_fmt(num, suffix='B'):
|
def sizeof_fmt(num, suffix='B'):
|
||||||
for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
|
for unit in ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z']:
|
||||||
if abs(num) < 1024.0:
|
if abs(num) < 1024.0:
|
||||||
return "%3.1f %s%s" % (num, unit, suffix)
|
return "%3.1f %s%s" % (num, unit, suffix)
|
||||||
num /= 1024.0
|
num /= 1024.0
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
define([
|
define([
|
||||||
'jquery', 'underscore', 'pgadmin.alertifyjs',
|
'jquery', 'underscore', 'pgadmin.alertifyjs',
|
||||||
'sources/gettext', 'sources/url_for', 'dropzone', 'sources/pgadmin',
|
'sources/gettext', 'sources/url_for', 'dropzone', 'sources/pgadmin',
|
||||||
'sources/csrf', 'tablesorter',
|
'sources/csrf', 'tablesorter', 'tablesorter-metric',
|
||||||
], function($, _, Alertify, gettext, url_for, Dropzone, pgAdmin, csrfToken) {
|
], function($, _, Alertify, gettext, url_for, Dropzone, pgAdmin, csrfToken) {
|
||||||
|
|
||||||
/*---------------------------------------------------------
|
/*---------------------------------------------------------
|
||||||
@ -588,8 +588,8 @@ define([
|
|||||||
result += '<table id="contents" class="table table-bordered table-noouter-border table-bottom-border table-hover tablesorter file_listing_table">';
|
result += '<table id="contents" class="table table-bordered table-noouter-border table-bottom-border table-hover tablesorter file_listing_table">';
|
||||||
result += '<thead><tr><th>';
|
result += '<thead><tr><th>';
|
||||||
result += '<span>' + lg.name + '</span></th>';
|
result += '<span>' + lg.name + '</span></th>';
|
||||||
result += '<th><span>' + lg.size + '</span></th><th>';
|
result += '<th class="sorter-metric" data-metric-name-full="byte|Byte|BYTE" data-metric-name-abbr="b|B"><span>' + lg.size + '</span></th>';
|
||||||
result += '<span>' + lg.modified + '</span></th></tr></thead>';
|
result += '<th class="sorter-shortDate"><span>' + lg.modified + '</span></th></tr></thead>';
|
||||||
result += '<tbody>';
|
result += '<tbody>';
|
||||||
|
|
||||||
Object.keys(data).sort(function keyOrder(x, y) {
|
Object.keys(data).sort(function keyOrder(x, y) {
|
||||||
@ -675,8 +675,8 @@ define([
|
|||||||
*/
|
*/
|
||||||
result += '<table id="contents" class="table table-bordered table-noouter-border table-bottom-border table-hover tablesorter file_listing_table file_listing_table_no_data">';
|
result += '<table id="contents" class="table table-bordered table-noouter-border table-bottom-border table-hover tablesorter file_listing_table file_listing_table_no_data">';
|
||||||
result += '<thead><tr><th><span>' + lg.name + '</span></th>' +
|
result += '<thead><tr><th><span>' + lg.name + '</span></th>' +
|
||||||
'<th><span>' + lg.size + '</span></th>' +
|
'<th class="sorter-metric" data-metric-name-full="byte|Byte|BYTE" data-metric-name-abbr="b|B"><span>' + lg.size + '</span></th>' +
|
||||||
'<th><span>' + lg.modified + '</span></th>' +
|
'<th class="sorter-shortDate"><span>' + lg.modified + '</span></th>' +
|
||||||
'</tr></thead>' +
|
'</tr></thead>' +
|
||||||
'<tbody></tbody>';
|
'<tbody></tbody>';
|
||||||
result += '</table>';
|
result += '</table>';
|
||||||
@ -690,13 +690,7 @@ define([
|
|||||||
|
|
||||||
// Add the new markup to the DOM.
|
// Add the new markup to the DOM.
|
||||||
$('.fileinfo .file_listing').html(result);
|
$('.fileinfo .file_listing').html(result);
|
||||||
$('.fileinfo .file_listing #contents').tablesorter({
|
$('.fileinfo .file_listing #contents').tablesorter();
|
||||||
headers: {
|
|
||||||
2: {
|
|
||||||
sorter: 'shortDate',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// rename file/folder
|
// rename file/folder
|
||||||
$('.file_manager button.rename').off().on('click', function(e) {
|
$('.file_manager button.rename').off().on('click', function(e) {
|
||||||
|
@ -155,6 +155,7 @@ var webpackShimConfig = {
|
|||||||
'snap.svg': path.join(__dirname, './node_modules/snapsvg/dist/snap.svg-min'),
|
'snap.svg': path.join(__dirname, './node_modules/snapsvg/dist/snap.svg-min'),
|
||||||
'spectrum': path.join(__dirname, './node_modules/spectrum-colorpicker/spectrum'),
|
'spectrum': path.join(__dirname, './node_modules/spectrum-colorpicker/spectrum'),
|
||||||
'mousetrap': path.join(__dirname, './node_modules/mousetrap'),
|
'mousetrap': path.join(__dirname, './node_modules/mousetrap'),
|
||||||
|
'tablesorter-metric': path.join(__dirname, './node_modules/tablesorter/dist/js/parsers/parser-metric.min'),
|
||||||
|
|
||||||
// AciTree
|
// AciTree
|
||||||
'jquery.acitree': path.join(__dirname, './node_modules/acitree/js/jquery.aciTree.min'),
|
'jquery.acitree': path.join(__dirname, './node_modules/acitree/js/jquery.aciTree.min'),
|
||||||
|
Loading…
Reference in New Issue
Block a user