mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-3506 feat: increase max sql file size (#1687)
* CB-3506 feat: increase max sql file size * CB-3506 chore: revert setting name --------- Co-authored-by: dariamarutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
@@ -135,7 +135,7 @@ export const InputFileTextContent: InputFileTextContentType = observer(function
|
||||
}
|
||||
|
||||
function validateFileSize(size: number) {
|
||||
const maxFileSizeBytes = maxFileSize * 1000;
|
||||
const maxFileSizeBytes = maxFileSize * 1024;
|
||||
|
||||
if (size > maxFileSizeBytes) {
|
||||
throw new Error(translate('ui_file_size_exceeds', undefined, {
|
||||
|
||||
@@ -14,6 +14,7 @@ export const buttonStyles = css`
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
|
||||
/* pointer outline */
|
||||
&::before {
|
||||
@@ -42,15 +43,15 @@ export const buttonStyles = css`
|
||||
flex-direction: column;
|
||||
cursor: ew-resize;
|
||||
height: 100%;
|
||||
width: 16px;
|
||||
left: -7px;
|
||||
width: 5px;
|
||||
left: -2px;
|
||||
|
||||
&[|mode=minimize] {
|
||||
left: -4px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&[|mode=maximize] {
|
||||
left: -12px;
|
||||
left: -2px;
|
||||
}
|
||||
|
||||
& button {
|
||||
@@ -79,15 +80,15 @@ export const buttonStyles = css`
|
||||
flex-direction: row;
|
||||
cursor: ns-resize;
|
||||
width: 100%;
|
||||
height: 16px;
|
||||
top: -7px;
|
||||
height: 5px;
|
||||
top: -2px;
|
||||
|
||||
&[|mode=minimize] {
|
||||
top: -4px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
&[|mode=maximize] {
|
||||
top: -12px;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
& button {
|
||||
|
||||
@@ -46,10 +46,10 @@ export const splitStyles = css`
|
||||
ResizerControls:before {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
width: 4px;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: -5px;
|
||||
left: -1px;
|
||||
cursor: ew-resize;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -72,9 +72,9 @@ export const splitHorizontalStyles = css`
|
||||
}
|
||||
|
||||
ResizerControls:before {
|
||||
height: 12px;
|
||||
height: 4px;
|
||||
width: 100%;
|
||||
top: -5px;
|
||||
top: -1px;
|
||||
left: 0;
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export function useTools(state: ISqlEditorTabState): Readonly<State> {
|
||||
? this.sqlEditorSettingsService.deprecatedSettings.getValue('maxFileSize')
|
||||
: this.sqlEditorSettingsService.settings.getValue('maxFileSize');
|
||||
|
||||
const size = Math.round(file.size / 1000); // kilobyte
|
||||
const size = Math.round(file.size / 1024); // kilobyte
|
||||
const aboveMaxSize = size > maxSize;
|
||||
|
||||
if (aboveMaxSize) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { injectable } from '@cloudbeaver/core-di';
|
||||
import { PluginManagerService, PluginSettings } from '@cloudbeaver/core-plugin';
|
||||
|
||||
const defaultSettings = {
|
||||
maxFileSize: 100, // kilobyte
|
||||
maxFileSize: 10 * 1024, // kilobyte
|
||||
disabled: false,
|
||||
};
|
||||
|
||||
|
||||
@@ -15,13 +15,15 @@
|
||||
logBatchSize: 1000,
|
||||
maxLogRecords: 2000,
|
||||
maxFailedRequests: 3
|
||||
},
|
||||
sqlEditor: {
|
||||
// max size of the file that can be uploaded to the editor (in kilobytes)
|
||||
maxFileSize: 100
|
||||
}
|
||||
}
|
||||
},
|
||||
plugin: {
|
||||
'sql-editor': {
|
||||
// max size of the file that can be uploaded to the editor (in kilobytes)
|
||||
maxFileSize: 10240
|
||||
}
|
||||
},
|
||||
plugin_data_spreadsheet_new: {
|
||||
hidden: false
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user