mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 08:46:00 +00:00
connection workflow
This commit is contained in:
@@ -5,7 +5,7 @@ export function getDatabaseFileLabel(databaseFile) {
|
||||
return databaseFile;
|
||||
}
|
||||
|
||||
export default function getConnectionLabel(connection, { allowExplicitDatabase = true } = {}) {
|
||||
function getConnectionLabelCore(connection, { allowExplicitDatabase = true } = {}) {
|
||||
if (!connection) {
|
||||
return null;
|
||||
}
|
||||
@@ -27,3 +27,13 @@ export default function getConnectionLabel(connection, { allowExplicitDatabase =
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
export default function getConnectionLabel(connection, { allowExplicitDatabase = true, showUnsaved = false } = {}) {
|
||||
const res = getConnectionLabelCore(connection, { allowExplicitDatabase });
|
||||
|
||||
if (res && showUnsaved && connection?.unsaved) {
|
||||
return `${res} - unsaved`;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -148,6 +148,9 @@ export async function duplicateTab(tab) {
|
||||
}
|
||||
|
||||
export function getTabDbKey(tab) {
|
||||
if (tab.tabComponent == 'ConnectionTab') {
|
||||
return 'connections.';
|
||||
}
|
||||
if (tab.props && tab.props.conid && tab.props.database) {
|
||||
return `database://${tab.props.database}-${tab.props.conid}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user