mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-16 10:15:24 -06:00
Fix file browser path issue which occurs when client is on Windows and server is on Mac/Linux. Fixes #4164
This commit is contained in:
parent
f02f91cbf1
commit
036bd66638
@ -14,5 +14,6 @@ Features
|
||||
Bug fixes
|
||||
*********
|
||||
|
||||
| `Bug #4164 <https://redmine.postgresql.org/issues/4164>`_ - Fix file browser path issue which occurs when client is on Windows and server is on Mac/Linux.
|
||||
| `Bug #4218 <https://redmine.postgresql.org/issues/4218>`_ - Properly assign dropdownParent in Select2 controls.
|
||||
| `Bug #4219 <https://redmine.postgresql.org/issues/4219>`_ - Ensure popper.js is installed when needed.
|
@ -157,7 +157,7 @@ module.exports = Alertify.dialog('createModeDlg', function() {
|
||||
extension isn't *, then we add the extension.
|
||||
*/
|
||||
|
||||
if (navigator.platform.toUpperCase().indexOf('WIN')!==-1) {
|
||||
if ($('.file_manager').attr('data-platform') === 'win32') {
|
||||
sep = '\\';
|
||||
}
|
||||
|
||||
|
@ -1193,6 +1193,8 @@ define([
|
||||
Item Actions - Object events
|
||||
---------------------------------------------------------*/
|
||||
|
||||
$('.file_manager').attr('data-platform', config.options.platform_type);
|
||||
|
||||
// Switch to folder view
|
||||
$('.file_manager .fileinfo').on('click', function() {
|
||||
$('.file_manager #uploader .input-path').val($('.currentpath').val());
|
||||
@ -1388,7 +1390,7 @@ define([
|
||||
path = '/';
|
||||
}
|
||||
|
||||
if (navigator.platform.toUpperCase().indexOf('WIN')!==-1) {
|
||||
if (config.options.platform_type === 'win32') {
|
||||
path = path.replace(/\//g, '\\');
|
||||
} else {
|
||||
path = path.replace(/\\/g, '/');
|
||||
@ -1533,20 +1535,20 @@ define([
|
||||
$('.storage_dialog #uploader').find('a').remove();
|
||||
$('.storage_dialog #uploader').find('b').remove();
|
||||
|
||||
if (navigator.platform.toUpperCase().indexOf('WIN')!==-1) {
|
||||
if (config.options.platform_type === 'win32') {
|
||||
path = path.replace(/\//g, '\\');
|
||||
} else {
|
||||
path = path.replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
path = decodeURI(path);
|
||||
if (navigator.platform.toUpperCase().indexOf('WIN')!==-1) {
|
||||
if (config.options.platform_type === 'win32') {
|
||||
if (config.options.show_volumes && path == '\\') {
|
||||
$('.storage_dialog #uploader .input-path').val('');
|
||||
} else {
|
||||
$('.storage_dialog #uploader .input-path').val(path);
|
||||
}
|
||||
} else if (!(navigator.platform.toUpperCase().indexOf('WIN')!==-1) &&
|
||||
} else if (!(config.options.platform_type === 'win32') &&
|
||||
(path == '' || !S.startsWith(path, '/'))) {
|
||||
path = '/' + path;
|
||||
$('.storage_dialog #uploader .input-path').val(path);
|
||||
@ -1706,7 +1708,7 @@ define([
|
||||
// helpful in show/hide toolbar button for Windows
|
||||
hideButtons: function() {
|
||||
return (
|
||||
navigator.platform.toUpperCase().indexOf('WIN')!==-1 &&
|
||||
this.config.options.platform_type === 'win32' &&
|
||||
$('.currentpath').val() === ''
|
||||
);
|
||||
},
|
||||
|
@ -10,6 +10,7 @@
|
||||
"fileRoot": "{{data.fileroot}}",
|
||||
"capabilities": [{% for i in data.capabilities %}{% if loop.index != 1 %}, {% endif %}"{{i}}"{% endfor %}],
|
||||
"allowed_file_types": [{% for i in data.supported_types %}{% if loop.index != 1 %}, {% endif %}"{{i}}"{% endfor %}],
|
||||
"platform_type": "{{ data.platform_type }}",
|
||||
"show_volumes": {% if data.show_volumes %}true{% else %}false{% endif %}
|
||||
},
|
||||
"security": {
|
||||
|
Loading…
Reference in New Issue
Block a user