mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-16 14:50:15 +08:00
dbeaver/pro#9586 adjust validation (#4427)
* dbeaver/pro#9586 let editing of loaded truncated values
* Revert "dbeaver/pro#9586 let editing of loaded truncated values"
This reverts commit 6b412ef57c.
* dbeaver/pro#9586 adjust quota validation check
* dbeaver/pro#9586 show limit amount
---------
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2020-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { injectable } from '@cloudbeaver/core-di';
|
||||
import { isNumber } from '@dbeaver/js-helpers';
|
||||
|
||||
import { ServerResourceQuotasResource } from './ServerResourceQuotasResource.js';
|
||||
|
||||
@@ -27,10 +29,6 @@ const DEFAULT_QUOTAS: IQuotas = {
|
||||
sqlBinaryPreviewMaxLength: 261120,
|
||||
};
|
||||
|
||||
function isNumber(value: any): value is number {
|
||||
return typeof value === 'number';
|
||||
}
|
||||
|
||||
@injectable(() => [ServerResourceQuotasResource])
|
||||
export class QuotasService {
|
||||
get quotas(): IQuotas {
|
||||
|
||||
@@ -39,6 +39,12 @@ export const QuotaPlaceholder: React.FC<React.PropsWithChildren<Props>> = observ
|
||||
const contentAction = model.source.getAction(resultIndex, ResultSetDataContentAction);
|
||||
const limitInfo = holder ? contentAction.getLimitInfo(holder) : null;
|
||||
|
||||
let limitText = translate('ui_limit');
|
||||
|
||||
if (limitInfo?.limitWithSize) {
|
||||
limitText += ` (${limitInfo.limitWithSize})`;
|
||||
}
|
||||
|
||||
return (
|
||||
<Container className={className} keepSize={keepSize} vertical center>
|
||||
<div className="tw:mb-2 tw:text-center">
|
||||
@@ -53,10 +59,10 @@ export const QuotaPlaceholder: React.FC<React.PropsWithChildren<Props>> = observ
|
||||
target="_blank"
|
||||
indicator
|
||||
>
|
||||
{translate('ui_limit')}
|
||||
{limitText}
|
||||
</Link>
|
||||
) : (
|
||||
translate('ui_limit')
|
||||
limitText
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user