mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +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_PASSWORD_test=test
|
||||||
# LOGIN_PERMISSIONS_test=~*, widgets/database
|
# 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() {
|
function datadir() {
|
||||||
const dir = path.join(os.homedir(), 'dbgate-data');
|
const dir = datadirCore();
|
||||||
ensureDirectory(dir);
|
ensureDirectory(dir);
|
||||||
|
|
||||||
return dir;
|
return dir;
|
||||||
|
@ -10,6 +10,7 @@ const checkParent = process.argv.includes('--checkParent');
|
|||||||
const startProcess = getNamedArg('--start-process');
|
const startProcess = getNamedArg('--start-process');
|
||||||
const isForkedApi = process.argv.includes('--is-forked-api');
|
const isForkedApi = process.argv.includes('--is-forked-api');
|
||||||
const pluginsDir = getNamedArg('--plugins-dir');
|
const pluginsDir = getNamedArg('--plugins-dir');
|
||||||
|
const workspaceDir = getNamedArg('--workspace-dir');
|
||||||
|
|
||||||
function getPassArgs() {
|
function getPassArgs() {
|
||||||
const res = [];
|
const res = [];
|
||||||
@ -28,4 +29,5 @@ module.exports = {
|
|||||||
isForkedApi,
|
isForkedApi,
|
||||||
getPassArgs,
|
getPassArgs,
|
||||||
pluginsDir,
|
pluginsDir,
|
||||||
|
workspaceDir,
|
||||||
};
|
};
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
const databaseList = [];
|
const databaseList = [];
|
||||||
for (const connection of connectionList || []) {
|
for (const connection of connectionList || []) {
|
||||||
const conid = connection._id;
|
const conid = connection._id;
|
||||||
|
if (connection.singleDatabase) continue;
|
||||||
|
if (getCurrentConfig()?.singleDatabase) continue;
|
||||||
const databases = getLocalStorage(`database_list_${conid}`) || [];
|
const databases = getLocalStorage(`database_list_${conid}`) || [];
|
||||||
for (const db of databases) {
|
for (const db of databases) {
|
||||||
databaseList.push({
|
databaseList.push({
|
||||||
@ -65,9 +67,9 @@
|
|||||||
import { databaseObjectIcons, handleDatabaseObjectClick } from '../appobj/DatabaseObjectAppObject.svelte';
|
import { databaseObjectIcons, handleDatabaseObjectClick } from '../appobj/DatabaseObjectAppObject.svelte';
|
||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import {
|
import {
|
||||||
commands,
|
|
||||||
commandsCustomized,
|
commandsCustomized,
|
||||||
currentDatabase,
|
currentDatabase,
|
||||||
|
getCurrentConfig,
|
||||||
getVisibleCommandPalette,
|
getVisibleCommandPalette,
|
||||||
visibleCommandPalette,
|
visibleCommandPalette,
|
||||||
} from '../stores';
|
} from '../stores';
|
||||||
|
Loading…
Reference in New Issue
Block a user