mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 15:36:28 +00:00
Added key rename modal
This commit is contained in:
@@ -87,6 +87,32 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleKeyRename(keyInfo) {
|
||||||
|
showModal(InputTextModal, {
|
||||||
|
value: keyInfo.key,
|
||||||
|
label: 'New key name',
|
||||||
|
header: `Rename key ${keyInfo.key}`,
|
||||||
|
onConfirm: async value => {
|
||||||
|
const res = await apiCall('database-connections/call-method', {
|
||||||
|
conid,
|
||||||
|
database,
|
||||||
|
method: 'rename',
|
||||||
|
args: [keyInfo.key, value],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.errorMessage) {
|
||||||
|
showModal(ErrorMessageModal, { message: res.errorMessage });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
activeDbKeysStore.update(store => ({
|
||||||
|
...store,
|
||||||
|
[`${conid}:${database}`]: value,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
editedValue = null;
|
editedValue = null;
|
||||||
refreshToken += 1;
|
refreshToken += 1;
|
||||||
@@ -136,6 +162,7 @@
|
|||||||
<div class="key-name">
|
<div class="key-name">
|
||||||
<TextField value={key} readOnly />
|
<TextField value={key} readOnly />
|
||||||
</div>
|
</div>
|
||||||
|
<FormStyledButton value="Rename Key" on:click={() => handleKeyRename(keyInfo)} />
|
||||||
<FormStyledButton value={`TTL:${keyInfo.ttl}`} on:click={() => handleChangeTtl(keyInfo)} />
|
<FormStyledButton value={`TTL:${keyInfo.ttl}`} on:click={() => handleChangeTtl(keyInfo)} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user