mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 11:56:00 +00:00
feat(diagram): show data type and nullability
This commit is contained in:
@@ -701,9 +701,43 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const changeStyleFunc = (name, value) => () => {
|
||||
callChange(current => {
|
||||
return {
|
||||
...current,
|
||||
style: {
|
||||
...current?.style,
|
||||
[name]: value,
|
||||
},
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
function createMenu() {
|
||||
return [
|
||||
menu,
|
||||
settings?.chooseColumnProperties && [
|
||||
{ divider: true },
|
||||
{
|
||||
text: 'Column properties',
|
||||
submenu: [
|
||||
{
|
||||
text: `Nullability: ${value?.style?.showNullability ? 'YES' : 'NO'}`,
|
||||
onClick: changeStyleFunc('showNullability', !value?.style?.showNullability),
|
||||
},
|
||||
{
|
||||
text: `Data type: ${value?.style?.showDataType ? 'YES' : 'NO'}`,
|
||||
onClick: changeStyleFunc('showDataType', !value?.style?.showDataType),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="wrapper noselect" use:contextMenu={menu}>
|
||||
<div class="wrapper noselect" use:contextMenu={createMenu}>
|
||||
{#if !(tables?.length > 0)}
|
||||
<div class="empty">Drag & drop tables or views from left panel here</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user