mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 03:13:58 +00:00
Show Data/Structure button in one place #1015
This commit is contained in:
@@ -67,6 +67,7 @@
|
|||||||
'icon parameter': 'mdi mdi-at',
|
'icon parameter': 'mdi mdi-at',
|
||||||
'icon trigger': 'mdi mdi-lightning-bolt',
|
'icon trigger': 'mdi mdi-lightning-bolt',
|
||||||
'icon scheduler-event': 'mdi mdi-calendar-blank',
|
'icon scheduler-event': 'mdi mdi-calendar-blank',
|
||||||
|
'icon arrow-link': 'mdi mdi-arrow-top-right-thick',
|
||||||
|
|
||||||
'icon window-restore': 'mdi mdi-window-restore',
|
'icon window-restore': 'mdi mdi-window-restore',
|
||||||
'icon window-maximize': 'mdi mdi-window-maximize',
|
'icon window-maximize': 'mdi mdi-window-maximize',
|
||||||
|
|||||||
@@ -94,6 +94,50 @@
|
|||||||
{/await}
|
{/await}
|
||||||
|
|
||||||
<svelte:fragment slot="toolstrip">
|
<svelte:fragment slot="toolstrip">
|
||||||
|
{#if objectTypeField == 'tables' || objectTypeField == 'views' || objectTypeField == 'matviews'}
|
||||||
|
<ToolStripButton
|
||||||
|
icon="icon structure"
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
|
on:click={() => {
|
||||||
|
openNewTab({
|
||||||
|
title: pureName,
|
||||||
|
icon: 'img table-structure',
|
||||||
|
tabComponent: 'TableStructureTab',
|
||||||
|
tabPreviewMode: true,
|
||||||
|
props: {
|
||||||
|
schemaName,
|
||||||
|
pureName,
|
||||||
|
conid,
|
||||||
|
database,
|
||||||
|
objectTypeField,
|
||||||
|
defaultActionId: 'openStructure',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}>Structure</ToolStripButton
|
||||||
|
>
|
||||||
|
<ToolStripButton
|
||||||
|
icon="icon table"
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
|
on:click={() => {
|
||||||
|
openNewTab({
|
||||||
|
title: pureName,
|
||||||
|
icon: objectTypeField == 'tables' ? 'img table' : 'img view',
|
||||||
|
tabComponent: objectTypeField == 'tables' ? 'TableDataTab' : 'ViewDataTab',
|
||||||
|
objectTypeField,
|
||||||
|
tabPreviewMode: true,
|
||||||
|
props: {
|
||||||
|
schemaName,
|
||||||
|
pureName,
|
||||||
|
conid,
|
||||||
|
database,
|
||||||
|
objectTypeField,
|
||||||
|
defaultActionId: 'openTable',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}>Data</ToolStripButton
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<SelectField
|
<SelectField
|
||||||
isNative
|
isNative
|
||||||
value={scriptTemplate ?? defaultScriptTemplate}
|
value={scriptTemplate ?? defaultScriptTemplate}
|
||||||
@@ -111,47 +155,6 @@
|
|||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{#if objectTypeField == 'tables' || objectTypeField == 'views' || objectTypeField == 'matviews'}
|
|
||||||
<ToolStripButton
|
|
||||||
icon="icon structure"
|
|
||||||
on:click={() => {
|
|
||||||
openNewTab({
|
|
||||||
title: pureName,
|
|
||||||
icon: 'img table-structure',
|
|
||||||
tabComponent: 'TableStructureTab',
|
|
||||||
tabPreviewMode: true,
|
|
||||||
props: {
|
|
||||||
schemaName,
|
|
||||||
pureName,
|
|
||||||
conid,
|
|
||||||
database,
|
|
||||||
objectTypeField,
|
|
||||||
defaultActionId: 'openStructure',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}>Open structure</ToolStripButton
|
|
||||||
>
|
|
||||||
<ToolStripButton
|
|
||||||
icon="icon table"
|
|
||||||
on:click={() => {
|
|
||||||
openNewTab({
|
|
||||||
title: pureName,
|
|
||||||
icon: objectTypeField == 'tables' ? 'img table' : 'img view',
|
|
||||||
tabComponent: objectTypeField == 'tables' ? 'TableDataTab' : 'ViewDataTab',
|
|
||||||
objectTypeField,
|
|
||||||
tabPreviewMode: true,
|
|
||||||
props: {
|
|
||||||
schemaName,
|
|
||||||
pureName,
|
|
||||||
conid,
|
|
||||||
database,
|
|
||||||
objectTypeField,
|
|
||||||
defaultActionId: 'openTable',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}>Open data</ToolStripButton
|
|
||||||
>
|
|
||||||
{/if}
|
|
||||||
{#each getSupportedScriptTemplates(appObjectData.objectTypeField) as template}
|
{#each getSupportedScriptTemplates(appObjectData.objectTypeField) as template}
|
||||||
<ToolStripButton
|
<ToolStripButton
|
||||||
icon="img sql-file"
|
icon="img sql-file"
|
||||||
|
|||||||
@@ -262,6 +262,48 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<svelte:fragment slot="toolstrip">
|
<svelte:fragment slot="toolstrip">
|
||||||
|
<ToolStripButton
|
||||||
|
icon="icon structure"
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
|
on:click={() => {
|
||||||
|
openNewTab({
|
||||||
|
title: pureName,
|
||||||
|
icon: 'img table-structure',
|
||||||
|
tabComponent: 'TableStructureTab',
|
||||||
|
tabPreviewMode: true,
|
||||||
|
props: {
|
||||||
|
schemaName,
|
||||||
|
pureName,
|
||||||
|
conid,
|
||||||
|
database,
|
||||||
|
objectTypeField: 'tables',
|
||||||
|
defaultActionId: 'openStructure',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}>Structure</ToolStripButton
|
||||||
|
>
|
||||||
|
|
||||||
|
<ToolStripButton
|
||||||
|
icon="img sql-file"
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
|
on:click={() => {
|
||||||
|
openNewTab({
|
||||||
|
title: pureName,
|
||||||
|
icon: 'img sql-file',
|
||||||
|
tabComponent: 'SqlObjectTab',
|
||||||
|
tabPreviewMode: true,
|
||||||
|
props: {
|
||||||
|
schemaName,
|
||||||
|
pureName,
|
||||||
|
conid,
|
||||||
|
database,
|
||||||
|
objectTypeField: 'tables',
|
||||||
|
defaultActionId: 'showSql',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}>SQL</ToolStripButton
|
||||||
|
>
|
||||||
|
|
||||||
<ToolStripCommandSplitButton
|
<ToolStripCommandSplitButton
|
||||||
buttonLabel={autoRefreshStarted ? `Refresh (every ${autoRefreshInterval}s)` : null}
|
buttonLabel={autoRefreshStarted ? `Refresh (every ${autoRefreshInterval}s)` : null}
|
||||||
commands={['dataGrid.refresh', ...createAutoRefreshMenu()]}
|
commands={['dataGrid.refresh', ...createAutoRefreshMenu()]}
|
||||||
@@ -292,46 +334,6 @@
|
|||||||
<ToolStripCommandButton command="dataGrid.switchToTable" hideDisabled />
|
<ToolStripCommandButton command="dataGrid.switchToTable" hideDisabled />
|
||||||
<ToolStripExportButton {quickExportHandlerRef} />
|
<ToolStripExportButton {quickExportHandlerRef} />
|
||||||
|
|
||||||
<ToolStripButton
|
|
||||||
icon="icon structure"
|
|
||||||
on:click={() => {
|
|
||||||
openNewTab({
|
|
||||||
title: pureName,
|
|
||||||
icon: 'img table-structure',
|
|
||||||
tabComponent: 'TableStructureTab',
|
|
||||||
tabPreviewMode: true,
|
|
||||||
props: {
|
|
||||||
schemaName,
|
|
||||||
pureName,
|
|
||||||
conid,
|
|
||||||
database,
|
|
||||||
objectTypeField: 'tables',
|
|
||||||
defaultActionId: 'openStructure',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}>Open structure</ToolStripButton
|
|
||||||
>
|
|
||||||
|
|
||||||
<ToolStripButton
|
|
||||||
icon="img sql-file"
|
|
||||||
on:click={() => {
|
|
||||||
openNewTab({
|
|
||||||
title: pureName,
|
|
||||||
icon: 'img sql-file',
|
|
||||||
tabComponent: 'SqlObjectTab',
|
|
||||||
tabPreviewMode: true,
|
|
||||||
props: {
|
|
||||||
schemaName,
|
|
||||||
pureName,
|
|
||||||
conid,
|
|
||||||
database,
|
|
||||||
objectTypeField: 'tables',
|
|
||||||
defaultActionId: 'showSql',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}>Table SQL</ToolStripButton
|
|
||||||
>
|
|
||||||
|
|
||||||
<ToolStripButton
|
<ToolStripButton
|
||||||
icon={$collapsedLeftColumnStore ? 'icon columns-outline' : 'icon columns'}
|
icon={$collapsedLeftColumnStore ? 'icon columns-outline' : 'icon columns'}
|
||||||
on:click={() => collapsedLeftColumnStore.update(x => !x)}>View columns</ToolStripButton
|
on:click={() => collapsedLeftColumnStore.update(x => !x)}>View columns</ToolStripButton
|
||||||
|
|||||||
@@ -170,16 +170,9 @@
|
|||||||
: null}
|
: null}
|
||||||
/>
|
/>
|
||||||
<svelte:fragment slot="toolstrip">
|
<svelte:fragment slot="toolstrip">
|
||||||
<ToolStripCommandButton
|
|
||||||
command="tableStructure.save"
|
|
||||||
buttonLabel={$editorValue?.base ? 'Alter table' : 'Create table'}
|
|
||||||
/>
|
|
||||||
<ToolStripCommandButton command="tableStructure.reset" />
|
|
||||||
<ToolStripCommandButton command="tableEditor.addColumn" />
|
|
||||||
<ToolStripCommandButton command="tableEditor.addIndex" hideDisabled />
|
|
||||||
|
|
||||||
<ToolStripButton
|
<ToolStripButton
|
||||||
icon={'icon table'}
|
icon={'icon table'}
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
openNewTab({
|
openNewTab({
|
||||||
title: pureName,
|
title: pureName,
|
||||||
@@ -195,10 +188,12 @@
|
|||||||
defaultActionId: 'openTable',
|
defaultActionId: 'openTable',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}>Open data</ToolStripButton
|
}}>Data</ToolStripButton
|
||||||
>
|
>
|
||||||
|
|
||||||
<ToolStripButton
|
<ToolStripButton
|
||||||
icon="img sql-file"
|
icon="img sql-file"
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
openNewTab({
|
openNewTab({
|
||||||
title: pureName,
|
title: pureName,
|
||||||
@@ -214,7 +209,15 @@
|
|||||||
defaultActionId: 'showSql',
|
defaultActionId: 'showSql',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}>Show SQL</ToolStripButton
|
}}>SQL</ToolStripButton
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<ToolStripCommandButton
|
||||||
|
command="tableStructure.save"
|
||||||
|
buttonLabel={$editorValue?.base ? 'Alter table' : 'Create table'}
|
||||||
|
/>
|
||||||
|
<ToolStripCommandButton command="tableStructure.reset" />
|
||||||
|
<ToolStripCommandButton command="tableEditor.addColumn" />
|
||||||
|
<ToolStripCommandButton command="tableEditor.addIndex" hideDisabled />
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</ToolStripContainer>
|
</ToolStripContainer>
|
||||||
|
|||||||
@@ -82,11 +82,9 @@
|
|||||||
formViewComponent={SqlFormView}
|
formViewComponent={SqlFormView}
|
||||||
/>
|
/>
|
||||||
<svelte:fragment slot="toolstrip">
|
<svelte:fragment slot="toolstrip">
|
||||||
<ToolStripCommandButton command="dataGrid.refresh" />
|
|
||||||
<ToolStripExportButton {quickExportHandlerRef} />
|
|
||||||
|
|
||||||
<ToolStripButton
|
<ToolStripButton
|
||||||
icon="icon structure"
|
icon="icon structure"
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
openNewTab({
|
openNewTab({
|
||||||
title: pureName,
|
title: pureName,
|
||||||
@@ -102,11 +100,12 @@
|
|||||||
defaultActionId: 'openStructure',
|
defaultActionId: 'openStructure',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}>Open structure</ToolStripButton
|
}}>Structure</ToolStripButton
|
||||||
>
|
>
|
||||||
|
|
||||||
<ToolStripButton
|
<ToolStripButton
|
||||||
icon="img sql-file"
|
icon="img sql-file"
|
||||||
|
iconAfter="icon arrow-link"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
openNewTab({
|
openNewTab({
|
||||||
title: pureName,
|
title: pureName,
|
||||||
@@ -122,8 +121,11 @@
|
|||||||
defaultActionId: 'showSql',
|
defaultActionId: 'showSql',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}>View SQL</ToolStripButton
|
}}>SQL</ToolStripButton
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<ToolStripCommandButton command="dataGrid.refresh" />
|
||||||
|
<ToolStripExportButton {quickExportHandlerRef} />
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</ToolStripContainer>
|
</ToolStripContainer>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user