mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 01:26:01 +00:00
handle readonly connection
This commit is contained in:
@@ -272,7 +272,8 @@
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
||||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleSqlRestore, text: 'Restore/import SQL dump' },
|
driver?.databaseEngineTypes?.includes('sql') &&
|
||||||
|
!data.isReadOnly && { onClick: handleSqlRestore, text: 'Restore/import SQL dump' },
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -294,7 +294,8 @@
|
|||||||
{ divider: true },
|
{ divider: true },
|
||||||
isSqlOrDoc && !connection.isReadOnly && { onClick: handleImport, text: 'Import wizard' },
|
isSqlOrDoc && !connection.isReadOnly && { onClick: handleImport, text: 'Import wizard' },
|
||||||
isSqlOrDoc && { onClick: handleExport, text: 'Export wizard' },
|
isSqlOrDoc && { onClick: handleExport, text: 'Export wizard' },
|
||||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleSqlRestore, text: 'Restore/import SQL dump' },
|
driver?.databaseEngineTypes?.includes('sql') &&
|
||||||
|
!connection.isReadOnly && { onClick: handleSqlRestore, text: 'Restore/import SQL dump' },
|
||||||
driver?.supportsDatabaseDump && { onClick: handleSqlDump, text: 'Backup/export SQL dump' },
|
driver?.supportsDatabaseDump && { onClick: handleSqlDump, text: 'Backup/export SQL dump' },
|
||||||
isSqlOrDoc &&
|
isSqlOrDoc &&
|
||||||
!connection.isReadOnly &&
|
!connection.isReadOnly &&
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
$: showTable = $editorValue ? $editorValue.current : tableInfoWithPairingId;
|
$: showTable = $editorValue ? $editorValue.current : tableInfoWithPairingId;
|
||||||
|
|
||||||
export function canSave() {
|
export function canSave() {
|
||||||
return objectTypeField == 'tables' && !!$editorValue;
|
return objectTypeField == 'tables' && !!$editorValue && !$connection?.isReadOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function save() {
|
export function save() {
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
tableInfo={showTable}
|
tableInfo={showTable}
|
||||||
dbInfo={$dbInfo}
|
dbInfo={$dbInfo}
|
||||||
{driver}
|
{driver}
|
||||||
setTableInfo={objectTypeField == 'tables'
|
setTableInfo={objectTypeField == 'tables' && !$connection?.isReadOnly
|
||||||
? tableInfoUpdater =>
|
? tableInfoUpdater =>
|
||||||
setEditorData(tbl =>
|
setEditorData(tbl =>
|
||||||
tbl
|
tbl
|
||||||
|
|||||||
Reference in New Issue
Block a user