This commit is contained in:
SPRINX0\prochazka
2025-04-10 17:43:32 +02:00
8 changed files with 79 additions and 11 deletions

View File

@@ -7,6 +7,7 @@
export let value;
export let jsonParsedValue = undefined;
export let editorTypes;
export let rightMargin = false;
$: stringified = stringifyCellValue(
value,
@@ -20,7 +21,7 @@
{#if rowData == null}
<span class="null">(No row)</span>
{:else}
<span class={stringified.gridStyle} title={stringified.gridTitle}>{stringified.value}</span>
<span class={stringified.gridStyle} title={stringified.gridTitle} class:rightMargin>{stringified.value}</span>
{/if}
<style>
@@ -31,4 +32,8 @@
.valueCellStyle {
color: var(--theme-icon-green);
}
.rightMargin {
margin-right: 16px;
}
</style>

View File

@@ -73,7 +73,13 @@
class:alignRight={_.isNumber(value) && !showHint}
{style}
>
<CellValue {rowData} {value} {jsonParsedValue} {editorTypes} />
<CellValue
{rowData}
{value}
{jsonParsedValue}
{editorTypes}
rightMargin={_.isNumber(value) && !showHint && (editorTypes?.explicitDataType || col.foreignKey)}
/>
{#if showHint}
<span class="hint"

View File

@@ -43,7 +43,7 @@
if (e.detail == '@create') {
showModal(InputTextModal, {
header: 'Archive',
label: 'Name of new folder',
label: 'Name of new archive folder',
onConfirm: createOption,
});
}

View File

@@ -23,6 +23,8 @@
import { findEngineDriver } from 'dbgate-tools';
import AceEditor from '../query/AceEditor.svelte';
import { _t } from '../translations';
import { showModal } from '../modals/modalTools';
import InputTextModal from '../modals/InputTextModal.svelte';
export let direction;
export let storageTypeField;
@@ -54,7 +56,7 @@
{ value: 'query', label: _t('common.query', { defaultMessage: 'Query' }), directions: ['source'] },
{
value: 'archive',
label: _t('common.archive', { defaultMessage: 'Archive' }),
label: _t('common.archive', { defaultMessage: 'Archive (JSONL)' }),
directions: ['source', 'target'],
},
];
@@ -108,11 +110,18 @@
<FormStyledButton
value="New archive"
on:click={() => {
values.update(x => ({
...x,
[storageTypeField]: 'archive',
[archiveFolderField]: `import-${moment().format('YYYY-MM-DD-hh-mm-ss')}`,
}));
showModal(InputTextModal, {
header: 'Archive',
label: 'Name of new archive folder',
value: `import-${moment().format('YYYY-MM-DD-hh-mm-ss')}`,
onConfirm: value => {
values.update(x => ({
...x,
[storageTypeField]: 'archive',
[archiveFolderField]: value,
}));
},
});
}}
/>
{/if}

View File

@@ -433,7 +433,7 @@ ORDER BY
<FormCheckboxField
name="behaviour.jsonPreviewWrap"
label={_t('settings.behaviour.jsonPreviewWrap', { defaultMessage: 'Wrap json in preview' })}
label={_t('settings.behaviour.jsonPreviewWrap', { defaultMessage: 'Wrap JSON in preview' })}
defaultValue={false}
/>