mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 21:05:59 +00:00
redis key tab name & icon
This commit is contained in:
@@ -179,6 +179,7 @@
|
|||||||
'img type-stream': 'mdi mdi-view-stream color-icon-blue',
|
'img type-stream': 'mdi mdi-view-stream color-icon-blue',
|
||||||
'img type-binary': 'mdi mdi-file color-icon-blue',
|
'img type-binary': 'mdi mdi-file color-icon-blue',
|
||||||
'img type-rejson': 'mdi mdi-color-json color-icon-blue',
|
'img type-rejson': 'mdi mdi-color-json color-icon-blue',
|
||||||
|
'img keydb': 'mdi mdi-key color-icon-blue',
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,13 @@
|
|||||||
const getCurrentEditor = () => getActiveComponent('DbKeyDetailTab');
|
const getCurrentEditor = () => getActiveComponent('DbKeyDetailTab');
|
||||||
|
|
||||||
export const matchingProps = ['conid', 'database', 'isDefaultBrowser'];
|
export const matchingProps = ['conid', 'database', 'isDefaultBrowser'];
|
||||||
export const allowAddToFavorites = props => true;
|
export const allowAddToFavorites = props => false;
|
||||||
|
|
||||||
|
function getKeyText(key) {
|
||||||
|
const keySplit = key.split(':');
|
||||||
|
if (keySplit.length > 1) return keySplit[keySplit.length - 1];
|
||||||
|
return key;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -25,7 +31,9 @@
|
|||||||
import DbKeyItemDetail from '../dbkeyvalue/DbKeyItemDetail.svelte';
|
import DbKeyItemDetail from '../dbkeyvalue/DbKeyItemDetail.svelte';
|
||||||
import DbKeyAddItemModal from '../modals/DbKeyAddItemModal.svelte';
|
import DbKeyAddItemModal from '../modals/DbKeyAddItemModal.svelte';
|
||||||
import ErrorMessageModal from '../modals/ErrorMessageModal.svelte';
|
import ErrorMessageModal from '../modals/ErrorMessageModal.svelte';
|
||||||
|
import { changeTab } from '../utility/common';
|
||||||
|
|
||||||
|
export let tabid;
|
||||||
export let conid;
|
export let conid;
|
||||||
export let database;
|
export let database;
|
||||||
export let key;
|
export let key;
|
||||||
@@ -39,6 +47,11 @@
|
|||||||
let refreshToken = 0;
|
let refreshToken = 0;
|
||||||
let editedValue = null;
|
let editedValue = null;
|
||||||
|
|
||||||
|
$: changeTab(tabid, tab => ({
|
||||||
|
...tab,
|
||||||
|
title: getKeyText(key),
|
||||||
|
}));
|
||||||
|
|
||||||
function handleChangeTtl(keyInfo) {
|
function handleChangeTtl(keyInfo) {
|
||||||
showModal(InputTextModal, {
|
showModal(InputTextModal, {
|
||||||
value: keyInfo.ttl,
|
value: keyInfo.ttl,
|
||||||
|
|||||||
@@ -148,7 +148,8 @@
|
|||||||
} else {
|
} else {
|
||||||
openNewTab({
|
openNewTab({
|
||||||
tabComponent: 'DbKeyDetailTab',
|
tabComponent: 'DbKeyDetailTab',
|
||||||
title: 'Key: ' + database,
|
title: item.text,
|
||||||
|
icon: 'img keydb',
|
||||||
props: {
|
props: {
|
||||||
isDefaultBrowser: true,
|
isDefaultBrowser: true,
|
||||||
conid,
|
conid,
|
||||||
|
|||||||
Reference in New Issue
Block a user