mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
sqlgen design
This commit is contained in:
parent
d5118909d1
commit
9713c9b88e
@ -1,5 +1,7 @@
|
||||
<script context="module">
|
||||
export function computeSplitterSize(initialValue, clientSize) {
|
||||
if (_.isString(initialValue) && initialValue.startsWith('~') && initialValue.endsWith('px'))
|
||||
return clientSize - parseInt(initialValue.slice(1, -2));
|
||||
if (_.isString(initialValue) && initialValue.endsWith('px')) return parseInt(initialValue.slice(0, -2));
|
||||
if (_.isString(initialValue) && initialValue.endsWith('%'))
|
||||
return (clientSize * parseFloat(initialValue.slice(0, -1))) / 100;
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
import ModalBase from './ModalBase.svelte';
|
||||
import { closeCurrentModal } from './modalTools';
|
||||
import WidgetTitle from '../widgets/WidgetTitle.svelte';
|
||||
|
||||
export let conid;
|
||||
export let database;
|
||||
@ -90,25 +91,31 @@
|
||||
|
||||
<HorizontalSplitter initialValue="300px" bind:size={managerSize}>
|
||||
<svelte:fragment slot="1">
|
||||
<WidgetColumnBar>
|
||||
<WidgetColumnBarItem title="Choose objects" name="objects" height="60%">
|
||||
<SearchBoxWrapper>
|
||||
<SearchInput placeholder="Search tables or objects" bind:value={objectsFilter} />
|
||||
</SearchBoxWrapper>
|
||||
<div>
|
||||
<WidgetTitle>Choose objects</WidgetTitle>
|
||||
<SearchBoxWrapper>
|
||||
<SearchInput placeholder="Search tables or objects" bind:value={objectsFilter} />
|
||||
</SearchBoxWrapper>
|
||||
|
||||
<WidgetsInnerContainer>
|
||||
<AppObjectList
|
||||
list={objectList.map(x => ({ ...x, conid, database }))}
|
||||
module={databaseObjectAppObject}
|
||||
groupFunc={data => _.startCase(data.objectTypeField)}
|
||||
isExpandable={data => data.objectTypeField == 'tables' || data.objectTypeField == 'views'}
|
||||
filter={objectsFilter}
|
||||
{checkedObjectsStore}
|
||||
/>
|
||||
</WidgetsInnerContainer>
|
||||
</WidgetColumnBarItem>
|
||||
<WidgetsInnerContainer>
|
||||
<AppObjectList
|
||||
list={objectList.map(x => ({ ...x, conid, database }))}
|
||||
module={databaseObjectAppObject}
|
||||
groupFunc={data => _.startCase(data.objectTypeField)}
|
||||
isExpandable={data => data.objectTypeField == 'tables' || data.objectTypeField == 'views'}
|
||||
filter={objectsFilter}
|
||||
{checkedObjectsStore}
|
||||
/>
|
||||
</WidgetsInnerContainer>
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
|
||||
<WidgetColumnBarItem title="Settings" name="settings">
|
||||
<svelte:fragment slot="2">
|
||||
<HorizontalSplitter initialValue="~300px">
|
||||
<svelte:fragment slot="1">
|
||||
<SqlEditor readOnly value={sqlPreview} />
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="2">
|
||||
<WidgetsInnerContainer>
|
||||
<FormValues let:values>
|
||||
<FormCheckboxField label="Drop tables" name="dropTables" />
|
||||
@ -143,12 +150,8 @@
|
||||
<HashCheckBox label='Create' hashName={`gensql.create${objTypePascal}`} onChange={onChange} /> -->
|
||||
</FormValues>
|
||||
</WidgetsInnerContainer>
|
||||
</WidgetColumnBarItem>
|
||||
</WidgetColumnBar>
|
||||
</svelte:fragment>
|
||||
|
||||
<svelte:fragment slot="2">
|
||||
<SqlEditor readOnly value={sqlPreview} />
|
||||
</svelte:fragment>
|
||||
</HorizontalSplitter>
|
||||
</svelte:fragment>
|
||||
</HorizontalSplitter>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user