mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 02:36:00 +00:00
handle readonly connection in UI
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
export let isBold = false;
|
||||
export let isBusy = false;
|
||||
export let statusIcon = undefined;
|
||||
export let statusIconBefore = undefined;
|
||||
export let statusTitle = undefined;
|
||||
export let extInfo = undefined;
|
||||
export let menu = undefined;
|
||||
@@ -101,6 +102,11 @@
|
||||
<FontIcon style={`color:${colorMark}`} icon="icon square" />
|
||||
{/if}
|
||||
{title}
|
||||
{#if statusIconBefore}
|
||||
<span class="status">
|
||||
<FontIcon icon={statusIconBefore} />
|
||||
</span>
|
||||
{/if}
|
||||
{#if statusIcon}
|
||||
<span class="status">
|
||||
<FontIcon icon={statusIcon} title={statusTitle} />
|
||||
|
||||
@@ -200,6 +200,7 @@
|
||||
: _.get($currentDatabase, 'connection._id') == data._id}
|
||||
statusIcon={statusIcon || engineStatusIcon}
|
||||
statusTitle={statusTitle || engineStatusTitle}
|
||||
statusIconBefore={data.isReadOnly ? 'icon lock' : null}
|
||||
{extInfo}
|
||||
colorMark={passProps?.connectionColorFactory && passProps?.connectionColorFactory({ conid: data._id })}
|
||||
menu={getContextMenu}
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleNewTable, text: 'New table' },
|
||||
driver?.databaseEngineTypes?.includes('document') && { onClick: handleNewCollection, text: 'New collection' },
|
||||
{ divider: true },
|
||||
{ onClick: handleImport, text: 'Import' },
|
||||
!connection.isReadOnly && { onClick: handleImport, text: 'Import' },
|
||||
{ onClick: handleExport, text: 'Export' },
|
||||
{ onClick: handleShowDiagram, text: 'Show diagram' },
|
||||
{ onClick: handleSqlGenerator, text: 'SQL Generator' },
|
||||
|
||||
Reference in New Issue
Block a user