mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-01 18:06:53 +01:00
refactor(SQLite): improved sqlite window title
This commit is contained in:
parent
690cdcb2eb
commit
d61acf8a00
@ -79,7 +79,7 @@ export default {
|
||||
|
||||
const connectionName = this.getConnectionName(this.selectedWorkspace);
|
||||
const workspace = this.getWorkspace(this.selectedWorkspace);
|
||||
const breadcrumbs = Object.values(workspace.breadcrumbs).filter(breadcrumb => breadcrumb);
|
||||
const breadcrumbs = Object.values(workspace.breadcrumbs).filter(breadcrumb => breadcrumb) || [workspace.client];
|
||||
|
||||
return [connectionName, ...breadcrumbs].join(' • ');
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ export default {
|
||||
const connection = state.connections.filter(connection => connection.uid === uid)[0];
|
||||
let connectionName = '';
|
||||
|
||||
if (connection.name)
|
||||
if (connection?.name)
|
||||
connectionName = connection.name;
|
||||
else if (connection.ask)
|
||||
else if (connection?.ask)
|
||||
connectionName = `${connection.host}:${connection.port}`;
|
||||
else if (connection.databasePath) {
|
||||
let string = connection.databasePath.split(/[/\\]+/).pop();
|
||||
@ -38,8 +38,14 @@ export default {
|
||||
|
||||
connectionName = string;
|
||||
}
|
||||
else
|
||||
connectionName = `${connection.user + '@'}${connection.host}:${connection.port}`;
|
||||
else {
|
||||
if (connection.user) connectionName += `${connection.user}@`;
|
||||
|
||||
if (connection.host) {
|
||||
connectionName += connection.host;
|
||||
if (connection.port) connectionName += `:${connection.port}`;
|
||||
}
|
||||
}
|
||||
|
||||
return connectionName;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user