mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 18:56:00 +00:00
tabstrips
This commit is contained in:
@@ -1,60 +1,60 @@
|
||||
<script lang="ts" context="module">
|
||||
const getCurrentEditor = () => getActiveComponent('TableEditor');
|
||||
|
||||
// registerCommand({
|
||||
// id: 'tableEditor.addColumn',
|
||||
// category: 'Table editor',
|
||||
// name: 'Add column',
|
||||
// icon: 'icon add-column',
|
||||
// toolbar: true,
|
||||
// isRelatedToTab: true,
|
||||
// testEnabled: () => getCurrentEditor()?.writable(),
|
||||
// onClick: () => getCurrentEditor().addColumn(),
|
||||
// });
|
||||
registerCommand({
|
||||
id: 'tableEditor.addColumn',
|
||||
category: 'Table editor',
|
||||
name: 'Add column',
|
||||
icon: 'icon add-column',
|
||||
toolbar: true,
|
||||
isRelatedToTab: true,
|
||||
testEnabled: () => getCurrentEditor()?.writable(),
|
||||
onClick: () => getCurrentEditor().addColumn(),
|
||||
});
|
||||
|
||||
// registerCommand({
|
||||
// id: 'tableEditor.addPrimaryKey',
|
||||
// category: 'Table editor',
|
||||
// name: 'Add primary key',
|
||||
// icon: 'icon add-key',
|
||||
// toolbar: true,
|
||||
// isRelatedToTab: true,
|
||||
// testEnabled: () => getCurrentEditor()?.allowAddPrimaryKey(),
|
||||
// onClick: () => getCurrentEditor().addPrimaryKey(),
|
||||
// });
|
||||
registerCommand({
|
||||
id: 'tableEditor.addPrimaryKey',
|
||||
category: 'Table editor',
|
||||
name: 'Add primary key',
|
||||
icon: 'icon add-key',
|
||||
toolbar: true,
|
||||
isRelatedToTab: true,
|
||||
testEnabled: () => getCurrentEditor()?.allowAddPrimaryKey(),
|
||||
onClick: () => getCurrentEditor().addPrimaryKey(),
|
||||
});
|
||||
|
||||
// registerCommand({
|
||||
// id: 'tableEditor.addForeignKey',
|
||||
// category: 'Table editor',
|
||||
// name: 'Add foreign key',
|
||||
// icon: 'icon add-key',
|
||||
// toolbar: true,
|
||||
// isRelatedToTab: true,
|
||||
// testEnabled: () => getCurrentEditor()?.writable(),
|
||||
// onClick: () => getCurrentEditor().addForeignKey(),
|
||||
// });
|
||||
registerCommand({
|
||||
id: 'tableEditor.addForeignKey',
|
||||
category: 'Table editor',
|
||||
name: 'Add foreign key',
|
||||
icon: 'icon add-key',
|
||||
toolbar: true,
|
||||
isRelatedToTab: true,
|
||||
testEnabled: () => getCurrentEditor()?.writable(),
|
||||
onClick: () => getCurrentEditor().addForeignKey(),
|
||||
});
|
||||
|
||||
// registerCommand({
|
||||
// id: 'tableEditor.addIndex',
|
||||
// category: 'Table editor',
|
||||
// name: 'Add index',
|
||||
// icon: 'icon add-key',
|
||||
// toolbar: true,
|
||||
// isRelatedToTab: true,
|
||||
// testEnabled: () => getCurrentEditor()?.writable(),
|
||||
// onClick: () => getCurrentEditor().addIndex(),
|
||||
// });
|
||||
registerCommand({
|
||||
id: 'tableEditor.addIndex',
|
||||
category: 'Table editor',
|
||||
name: 'Add index',
|
||||
icon: 'icon add-key',
|
||||
toolbar: true,
|
||||
isRelatedToTab: true,
|
||||
testEnabled: () => getCurrentEditor()?.writable(),
|
||||
onClick: () => getCurrentEditor().addIndex(),
|
||||
});
|
||||
|
||||
// registerCommand({
|
||||
// id: 'tableEditor.addUnique',
|
||||
// category: 'Table editor',
|
||||
// name: 'Add unique',
|
||||
// icon: 'icon add-key',
|
||||
// toolbar: true,
|
||||
// isRelatedToTab: true,
|
||||
// testEnabled: () => getCurrentEditor()?.writable(),
|
||||
// onClick: () => getCurrentEditor().addUnique(),
|
||||
// });
|
||||
registerCommand({
|
||||
id: 'tableEditor.addUnique',
|
||||
category: 'Table editor',
|
||||
name: 'Add unique',
|
||||
icon: 'icon add-key',
|
||||
toolbar: true,
|
||||
isRelatedToTab: true,
|
||||
testEnabled: () => getCurrentEditor()?.writable(),
|
||||
onClick: () => getCurrentEditor().addUnique(),
|
||||
});
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -105,9 +105,9 @@
|
||||
});
|
||||
}
|
||||
|
||||
// export function allowAddPrimaryKey() {
|
||||
// return writable() && !tableInfo?.primaryKey;
|
||||
// }
|
||||
export function allowAddPrimaryKey() {
|
||||
return writable() && !tableInfo?.primaryKey;
|
||||
}
|
||||
|
||||
export function addPrimaryKey() {
|
||||
showModal(PrimaryKeyEditorModal, {
|
||||
|
||||
Reference in New Issue
Block a user