mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-10-13 10:53:42 +08:00
perf: support display binary key name which unreadable(convert to hex string) #49
This commit is contained in:
@@ -15,6 +15,10 @@ const props = defineProps({
|
||||
name: String,
|
||||
db: Number,
|
||||
keyPath: String,
|
||||
keyCode: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
ttl: {
|
||||
type: Number,
|
||||
default: -1,
|
||||
@@ -23,6 +27,14 @@ const props = defineProps({
|
||||
size: Number,
|
||||
})
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {ComputedRef<string|number[]>}
|
||||
*/
|
||||
const keyName = computed(() => {
|
||||
return !isEmpty(props.keyCode) ? props.keyCode : props.keyPath
|
||||
})
|
||||
|
||||
const filterOption = [
|
||||
{
|
||||
value: 1,
|
||||
@@ -149,11 +161,11 @@ const actionColumn = {
|
||||
const { success, msg } = await connectionStore.removeZSetItem(
|
||||
props.name,
|
||||
props.db,
|
||||
props.keyPath,
|
||||
keyName.value,
|
||||
row.value,
|
||||
)
|
||||
if (success) {
|
||||
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
|
||||
connectionStore.loadKeyValue(props.name, props.db, keyName.value).then((r) => {})
|
||||
$message.success(i18n.t('dialogue.delete_key_succ', { key: row.value }))
|
||||
} else {
|
||||
$message.error(msg)
|
||||
@@ -172,13 +184,13 @@ const actionColumn = {
|
||||
const { success, msg } = await connectionStore.updateZSetItem(
|
||||
props.name,
|
||||
props.db,
|
||||
props.keyPath,
|
||||
keyName.value,
|
||||
row.value,
|
||||
newValue,
|
||||
currentEditRow.value.score,
|
||||
)
|
||||
if (success) {
|
||||
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
|
||||
connectionStore.loadKeyValue(props.name, props.db, keyName.value).then((r) => {})
|
||||
$message.success(i18n.t('dialogue.save_value_succ'))
|
||||
} else {
|
||||
$message.error(msg)
|
||||
@@ -222,7 +234,7 @@ const tableData = computed(() => {
|
||||
})
|
||||
|
||||
const onAddRow = () => {
|
||||
dialogStore.openAddFieldsDialog(props.name, props.db, props.keyPath, types.ZSET)
|
||||
dialogStore.openAddFieldsDialog(props.name, props.db, props.keyPath, props.keyCode, types.ZSET)
|
||||
}
|
||||
|
||||
const filterValue = ref('')
|
||||
@@ -266,7 +278,13 @@ const onUpdateFilter = (filters, sourceColumn) => {
|
||||
|
||||
<template>
|
||||
<div class="content-wrapper flex-box-v">
|
||||
<content-toolbar :db="props.db" :key-path="props.keyPath" :key-type="keyType" :server="props.name" :ttl="ttl" />
|
||||
<content-toolbar
|
||||
:db="props.db"
|
||||
:key-path="props.keyPath"
|
||||
:key-code="props.keyCode"
|
||||
:key-type="keyType"
|
||||
:server="props.name"
|
||||
:ttl="ttl" />
|
||||
<div class="tb2 flex-box-h">
|
||||
<div class="flex-box-h">
|
||||
<n-input-group>
|
||||
|
Reference in New Issue
Block a user