structure tabs have different icons

This commit is contained in:
Jan Prochazka 2021-11-21 10:41:46 +01:00
parent 4d7339d085
commit 13030defc1
3 changed files with 17 additions and 4 deletions

View File

@ -39,6 +39,7 @@
{
label: 'Open structure',
tab: 'TableStructureTab',
icon: 'img table-structure',
},
{
label: 'Drop table',
@ -113,6 +114,7 @@
{
label: 'Open structure',
tab: 'TableStructureTab',
icon: 'img view-structure',
},
{
label: 'Drop view',
@ -325,7 +327,8 @@
scriptTemplate,
{ schemaName, pureName, conid, database, objectTypeField },
forceNewTab,
initialData
initialData,
icon
) {
const connection = await getConnectionInfo({ conid });
const tooltip = `${getConnectionLabel(connection)}\n${database}\n${fullDisplayName({
@ -337,7 +340,7 @@
{
title: scriptTemplate ? 'Query #' : pureName,
tooltip,
icon: scriptTemplate ? 'img sql-file' : databaseObjectIcons[objectTypeField],
icon: icon || (scriptTemplate ? 'img sql-file' : databaseObjectIcons[objectTypeField]),
tabComponent: scriptTemplate ? 'QueryTab' : tabComponent,
props: {
schemaName,
@ -367,6 +370,7 @@
objectTypeField,
},
forceNewTab,
null,
null
);
}
@ -535,7 +539,14 @@
obj.pureName = newName;
});
} else {
openDatabaseObjectDetail(menu.tab, menu.scriptTemplate, data, menu.forceNewTab, menu.initialData);
openDatabaseObjectDetail(
menu.tab,
menu.scriptTemplate,
data,
menu.forceNewTab,
menu.initialData,
menu.icon
);
}
},
};

View File

@ -129,7 +129,7 @@ registerCommand({
openNewTab(
{
title: 'Table #',
icon: 'img table',
icon: 'img table-structure',
tabComponent: 'TableStructureTab',
props: {
conid: connection._id,

View File

@ -125,6 +125,8 @@
'img view': 'mdi mdi-table color-icon-magenta',
'img procedure': 'mdi mdi-cog color-icon-blue',
'img function': 'mdi mdi-function-variant',
'img table-structure': 'mdi mdi-tools color-icon-blue',
'img view-structure': 'mdi mdi-tools color-icon-magenta',
'img sort-asc': 'mdi mdi-sort-alphabetical-ascending color-icon-green',
'img sort-desc': 'mdi mdi-sort-alphabetical-descending color-icon-green',