mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 21:46:00 +00:00
translation-table editor, query, table structure
This commit is contained in:
@@ -27,41 +27,41 @@
|
||||
<FormProvider initialValues={fillEditorColumnInfo(columnInfo || {}, tableInfo)}>
|
||||
<ModalBase {...$$restProps}>
|
||||
<svelte:fragment slot="header"
|
||||
>{columnInfo ? 'Edit column' : `Add column ${(tableInfo?.columns || []).length + 1}`}</svelte:fragment
|
||||
>{columnInfo ? _t('columnEditor.editColumn', { defaultMessage: 'Edit column' }) : _t('columnEditor.addColumn', { defaultMessage: 'Add column {columnNumber}', values: { columnNumber: (tableInfo?.columns || []).length + 1 } })}</svelte:fragment
|
||||
>
|
||||
|
||||
<FormTextField name="columnName" label="Column name" focused disabled={isReadOnly} />
|
||||
<FormTextField name="columnName" label={_t('columnEditor.columnName', { defaultMessage: 'Column name' })} focused disabled={isReadOnly} />
|
||||
<DataTypeEditor dialect={driver?.dialect} disabled={isReadOnly} />
|
||||
|
||||
{#if !driver?.dialect?.specificNullabilityImplementation}
|
||||
<FormCheckboxField name="notNull" label="NOT NULL" disabled={isReadOnly} />
|
||||
{/if}
|
||||
<FormCheckboxField name="isPrimaryKey" label="Is Primary Key" disabled={isReadOnly} />
|
||||
<FormCheckboxField name="isPrimaryKey" label={_t('columnEditor.isPrimaryKey', { defaultMessage: 'Is Primary Key' })} disabled={isReadOnly} />
|
||||
{#if !driver?.dialect?.disableAutoIncrement}
|
||||
<FormCheckboxField name="autoIncrement" label="Is Autoincrement" disabled={isReadOnly} />
|
||||
<FormCheckboxField name="autoIncrement" label={_t('columnEditor.autoIncrement', { defaultMessage: 'Is Autoincrement' })} disabled={isReadOnly} />
|
||||
{/if}
|
||||
<FormTextField
|
||||
name="defaultValue"
|
||||
label="Default value. Please use valid SQL expression, eg. 'Hello World' for string value, '' for empty string"
|
||||
label={_t('columnEditor.defaultValue', { defaultMessage: "Default value. Please use valid SQL expression, eg. 'Hello World' for string value, '' for empty string" })}
|
||||
disabled={!setTableInfo}
|
||||
/>
|
||||
<FormTextField name="computedExpression" label="Computed expression" disabled={isReadOnly} />
|
||||
<FormTextField name="computedExpression" label={_t('columnEditor.computedExpression', { defaultMessage: 'Computed expression' })} disabled={isReadOnly} />
|
||||
{#if driver?.dialect?.columnProperties?.isUnsigned}
|
||||
<FormCheckboxField name="isUnsigned" label="Unsigned" disabled={isReadOnly} />
|
||||
<FormCheckboxField name="isUnsigned" label={_t('columnEditor.isUnsigned', { defaultMessage: 'Unsigned' })} disabled={isReadOnly} />
|
||||
{/if}
|
||||
{#if driver?.dialect?.columnProperties?.isZerofill}
|
||||
<FormCheckboxField name="isZerofill" label="Zero fill" disabled={isReadOnly} />
|
||||
<FormCheckboxField name="isZerofill" label={_t('columnEditor.isZerofill', { defaultMessage: 'Zero fill' })} disabled={isReadOnly} />
|
||||
{/if}
|
||||
{#if driver?.dialect?.columnProperties?.columnComment}
|
||||
<FormTextField name="columnComment" label="Comment" disabled={isReadOnly} />
|
||||
<FormTextField name="columnComment" label={_t('columnEditor.columnComment', { defaultMessage: 'Comment' })} disabled={isReadOnly} />
|
||||
{/if}
|
||||
{#if driver?.dialect?.columnProperties?.isSparse}
|
||||
<FormCheckboxField name="isSparse" label="Sparse" disabled={isReadOnly} />
|
||||
<FormCheckboxField name="isSparse" label={_t('columnEditor.isSparse', { defaultMessage: 'Sparse' })} disabled={isReadOnly} />
|
||||
{/if}
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<FormSubmit
|
||||
value={columnInfo ? 'Save' : 'Save and next'}
|
||||
value={columnInfo ? _t('common.save', { defaultMessage: 'Save' }) : _t('common.saveAndNext', { defaultMessage: 'Save and next' })}
|
||||
disabled={isReadOnly}
|
||||
on:click={e => {
|
||||
closeCurrentModal();
|
||||
@@ -85,11 +85,11 @@
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<FormStyledButton type="button" value="Close" on:click={closeCurrentModal} />
|
||||
<FormStyledButton type="button" value={_t('common.close', { defaultMessage: 'Close' })} on:click={closeCurrentModal} />
|
||||
{#if columnInfo}
|
||||
<FormStyledButton
|
||||
type="button"
|
||||
value="Remove"
|
||||
value={_t('common.remove', { defaultMessage: 'Remove' })}
|
||||
on:click={() => {
|
||||
closeCurrentModal();
|
||||
setTableInfo(tbl => editorDeleteColumn(tbl, columnInfo, addDataCommand));
|
||||
|
||||
Reference in New Issue
Block a user