Fixed an issue where default EOL in the query tool should be based on the OS. #7393

This commit is contained in:
Rohit Bhati 2024-10-03 17:29:58 +05:30 committed by GitHub
parent 33c88ceb68
commit d736f4266c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -736,3 +736,16 @@ export const memoizeTimeout = (fn, time) => new Proxy(fn, {
return result;
}
});
export function getPlatform() {
const platform = navigator.userAgent;
if (platform.includes('Win')) {
return 'Windows';
} else if (platform.includes('Mac')) {
return 'Mac';
} else if (platform.includes('Linux')) {
return 'Linux';
} else {
return 'Unknown';
}
}

View File

@ -7,6 +7,7 @@
//
//////////////////////////////////////////////////////////////
import gettext from 'sources/gettext';
import { getPlatform } from '../../../../../static/js/utils';
export const QUERY_TOOL_EVENTS = {
TRIGGER_STOP_EXECUTION: 'TRIGGER_STOP_EXECUTION',
@ -113,4 +114,4 @@ export const PANELS = {
export const MAX_QUERY_LENGTH = 1000000;
export const OS_EOL = navigator.platform === 'win32' ? 'crlf' : 'lf';
export const OS_EOL = getPlatform() === 'Windows' ? 'crlf' : 'lf';