Compare commits
2 Commits
e271eafc9e
...
e1f022908c
Author | SHA1 | Date |
---|---|---|
Lykin | e1f022908c | |
Lykin | c0415fe23d |
|
@ -9,6 +9,7 @@ import (
|
|||
"fmt"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
"math"
|
||||
"net/url"
|
||||
"os"
|
||||
"slices"
|
||||
|
@ -998,10 +999,17 @@ func (b *browserService) GetKeyDetail(param types.KeyDetailParam) (resp types.JS
|
|||
if doFilter && !strings.Contains(val, param.MatchPattern) {
|
||||
continue
|
||||
}
|
||||
items = append(items, types.ZSetEntryItem{
|
||||
Score: z.Score,
|
||||
entry := types.ZSetEntryItem{
|
||||
Value: val,
|
||||
})
|
||||
}
|
||||
if math.IsInf(z.Score, 1) {
|
||||
entry.ScoreStr = "+inf"
|
||||
} else if math.IsInf(z.Score, -1) {
|
||||
entry.ScoreStr = "-inf"
|
||||
} else {
|
||||
entry.Score = z.Score
|
||||
}
|
||||
items = append(items, entry)
|
||||
if doConvert {
|
||||
if dv, _, _ := convutil.ConvertTo(val, param.Decode, param.Format, decoder); dv != val {
|
||||
items[len(items)-1].DisplayValue = dv
|
||||
|
|
|
@ -31,6 +31,7 @@ type SetEntryItem struct {
|
|||
|
||||
type ZSetEntryItem struct {
|
||||
Score float64 `json:"s"`
|
||||
ScoreStr string `json:"ss,omitempty"`
|
||||
Value string `json:"v"`
|
||||
DisplayValue string `json:"dv,omitempty"`
|
||||
}
|
||||
|
|
|
@ -68,6 +68,11 @@ const onClearFilter = () => {
|
|||
onClearMatch()
|
||||
}
|
||||
|
||||
const onUpdateMatch = () => {
|
||||
inputData.filter = inputData.match
|
||||
onClearMatch()
|
||||
}
|
||||
|
||||
const onClearMatch = () => {
|
||||
const changed = !isEmpty(inputData.match)
|
||||
inputData.match = ''
|
||||
|
@ -97,9 +102,9 @@ defineExpose({
|
|||
@keyup.enter="onKeyup">
|
||||
<template #prefix>
|
||||
<slot name="prefix" />
|
||||
<n-tooltip v-if="hasMatch">
|
||||
<n-tooltip v-if="hasMatch" placement="bottom">
|
||||
<template #trigger>
|
||||
<n-tag closable size="small" @close="onClearMatch">
|
||||
<n-tag closable size="small" @close="onClearMatch" @dblclick="onUpdateMatch">
|
||||
{{ inputData.match }}
|
||||
</n-tag>
|
||||
</template>
|
||||
|
@ -141,4 +146,11 @@ defineExpose({
|
|||
</n-input-group>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
//:deep(.n-input__prefix) {
|
||||
// max-width: 50%;
|
||||
//}
|
||||
//:deep(.n-tag__content) {
|
||||
// overflow: hidden;
|
||||
//}
|
||||
</style>
|
||||
|
|
|
@ -120,7 +120,7 @@ const scoreColumn = computed(() => ({
|
|||
// return true
|
||||
// },
|
||||
render: (row) => {
|
||||
return row.s
|
||||
return row.ss || row.s
|
||||
},
|
||||
}))
|
||||
|
||||
|
|
Loading…
Reference in New Issue