#246 omit sngle-database dbs in ctrl+p seach

This commit is contained in:
Jan Prochazka 2022-03-24 16:25:36 +01:00
parent 25ae5bf048
commit 38dfad4dfc
4 changed files with 17 additions and 2 deletions

View File

@ -12,3 +12,4 @@ DEVMODE=1
# LOGIN_PASSWORD_test=test
# LOGIN_PERMISSIONS_test=~*, widgets/database
# WORKSPACE_DIR=/home/jena/dbgate-data-2

View File

@ -20,8 +20,18 @@ const ensureDirectory = (dir, clean) => {
}
};
function datadirCore() {
if (process.env.WORKSPACE_DIR) {
return process.env.WORKSPACE_DIR;
}
if (processArgs.workspaceDir) {
return processArgs.workspaceDir;
}
return path.join(os.homedir(), 'dbgate-data');
}
function datadir() {
const dir = path.join(os.homedir(), 'dbgate-data');
const dir = datadirCore();
ensureDirectory(dir);
return dir;

View File

@ -10,6 +10,7 @@ const checkParent = process.argv.includes('--checkParent');
const startProcess = getNamedArg('--start-process');
const isForkedApi = process.argv.includes('--is-forked-api');
const pluginsDir = getNamedArg('--plugins-dir');
const workspaceDir = getNamedArg('--workspace-dir');
function getPassArgs() {
const res = [];
@ -28,4 +29,5 @@ module.exports = {
isForkedApi,
getPassArgs,
pluginsDir,
workspaceDir,
};

View File

@ -39,6 +39,8 @@
const databaseList = [];
for (const connection of connectionList || []) {
const conid = connection._id;
if (connection.singleDatabase) continue;
if (getCurrentConfig()?.singleDatabase) continue;
const databases = getLocalStorage(`database_list_${conid}`) || [];
for (const db of databases) {
databaseList.push({
@ -65,9 +67,9 @@
import { databaseObjectIcons, handleDatabaseObjectClick } from '../appobj/DatabaseObjectAppObject.svelte';
import FontIcon from '../icons/FontIcon.svelte';
import {
commands,
commandsCustomized,
currentDatabase,
getCurrentConfig,
getVisibleCommandPalette,
visibleCommandPalette,
} from '../stores';