mirror of
https://github.com/dbgate/dbgate
synced 2024-11-21 23:39:46 +00:00
#246 omit sngle-database dbs in ctrl+p seach
This commit is contained in:
parent
25ae5bf048
commit
38dfad4dfc
@ -12,3 +12,4 @@ DEVMODE=1
|
||||
|
||||
# LOGIN_PASSWORD_test=test
|
||||
# LOGIN_PERMISSIONS_test=~*, widgets/database
|
||||
# WORKSPACE_DIR=/home/jena/dbgate-data-2
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user