这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,18 @@ class InsertItem extends Component {
};

const colType = col.data_type;

const placeHolder = hasDefault
? col.column_default
: getPlaceholder(colType);

let typedInput = (
<input {...standardInputProps} placeholder={getPlaceholder(colType)} />
<input {...standardInputProps} placeholder={placeHolder} />
);

if (isAutoIncrement) {
typedInput = (
<input
{...standardInputProps}
readOnly
placeholder={getPlaceholder(colType)}
/>
<input {...standardInputProps} readOnly placeholder={placeHolder} />
);
}

Expand All @@ -134,7 +135,7 @@ class InsertItem extends Component {
typedInput = (
<input
{...standardInputProps}
placeholder={getPlaceholder(colType)}
placeholder={placeHolder}
defaultValue={
clone && colName in clone ? JSON.stringify(clone[colName]) : ''
}
Expand All @@ -151,8 +152,11 @@ class InsertItem extends Component {
e.target.parentNode.parentNode.click();
e.target.focus();
}}
defaultValue={placeHolder}
>
<option value="" disabled>-- bool --</option>
<option value="" disabled>
-- bool --
</option>
<option value="true">True</option>
<option value="false">False</option>
</select>
Expand Down
2 changes: 2 additions & 0 deletions console/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export const getPlaceholder = type => {
return '{"name": "foo"} or [12, "bar"]';
case 'jsonb':
return '{"name": "foo"} or [12, "bar"]';
case 'boolean':
return '';
default:
return 'text';
}
Expand Down