Merge branch 'master' into redis

This commit is contained in:
Jan Prochazka
2022-03-13 17:33:35 +01:00
35 changed files with 394 additions and 52 deletions

View File

@@ -37,6 +37,7 @@
import { useAppFiles, useArchiveFolders } from '../utility/metadataLoaders';
import openNewTab from '../utility/openNewTab';
import WidgetsInnerContainer from './WidgetsInnerContainer.svelte';
import { showSnackbarError } from '../utility/snackbar';
let filter = '';
@@ -66,12 +67,27 @@
});
}
async function handleNewConfigFile(fileName, content) {
if (!(await apiCall('apps/create-config-file', { fileName, content, appFolder: $currentApplication }))) {
showSnackbarError('File not created, probably already exists');
}
}
function createAddMenu() {
return [
{
text: 'New SQL command',
onClick: () => handleNewSqlFile('command.sql', 'Create new SQL command', COMMAND_TEMPLATE),
},
{
text: 'New virtual references file',
onClick: () => handleNewConfigFile('virtual-references.config.json', []),
},
{
text: 'New disctionary descriptions file',
onClick: () => handleNewConfigFile('dictionary-descriptions.config.json', []),
},
// { text: 'New query view', onClick: () => handleNewSqlFile('query.sql', 'Create new SQL query', QUERY_TEMPLATE) },
];
}

View File

@@ -387,15 +387,17 @@
draggingDbGroupTarget = null;
}}
>
<FontIcon icon={getDbIcon(tabGroup.tabDbKey)} padRight />
{tabGroup.tabDbName}
<div class="db-name-inner">
<FontIcon icon={getDbIcon(tabGroup.tabDbKey)} />
{tabGroup.tabDbName}
</div>
<span
<div
class="close-button-right tabCloseButton"
on:click={e => closeMultipleTabs(tab => tabGroup.tabs.find(x => x.tabid == tab.tabid))}
>
<FontIcon icon="icon close" />
</span>
</div>
</div>
<div class="db-group">
{#each tabGroup.tabs as tab}
@@ -505,7 +507,10 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.db-name-inner {
justify-content: center;
flex-grow: 1;
}
/* .db-name:hover {
background-color: var(--theme-bg-3);
@@ -541,7 +546,6 @@
margin-left: 5px;
margin-right: 5px;
color: var(--theme-font-3);
float: right;
}
.close-button:hover {