Compare commits

...

3 Commits

8 changed files with 47 additions and 20 deletions

View File

@ -2561,6 +2561,7 @@ func (b *browserService) GetSlowLogs(server string, num int64) (resp types.JSRes
resp.Msg = err.Error()
return
}
num = max(1, num)
client, ctx := item.client, item.ctx
var logs []redis.SlowLog

View File

@ -12,9 +12,10 @@ import WindowClose from '@/components/icons/WindowClose.vue'
import Pin from '@/components/icons/Pin.vue'
import OffScreen from '@/components/icons/OffScreen.vue'
import ContentEditor from '@/components/content_value/ContentEditor.vue'
import { toString } from 'lodash'
import { isEmpty, toString } from 'lodash'
const props = defineProps({
keyPath: String,
show: {
type: Boolean,
},
@ -58,8 +59,8 @@ const emit = defineEmits([
watchEffect(
() => {
if (props.show && props.value != null) {
onFormatChanged()
if (props.show && !isEmpty(props.keyPath)) {
onFormatChanged(props.decode, props.format)
} else {
viewAs.value = ''
}
@ -127,6 +128,8 @@ const onFormatChanged = async (decode = null, format = null) => {
editingContent.value = viewAs.value = value
viewAs.decode = decode || retDecode
viewAs.format = format || retFormat
emit('update:decode', viewAs.decode)
emit('update:format', viewAs.format)
} finally {
loading.value = false
}

View File

@ -178,6 +178,7 @@ const onListLimitChanged = (limit) => {
<n-form-item :label="$t('slog.limit')">
<n-input-number
v-model:value="data.listLimit"
:min="1"
:max="9999"
style="width: 120px"
@update:value="onListLimitChanged" />

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { computed, h, nextTick, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
@ -142,6 +142,8 @@ const startEdit = async (no, key, value) => {
currentEditRow.no = no
currentEditRow.key = key
currentEditRow.value = value
currentEditRow.decode = props.decode
currentEditRow.format = props.format
}
const saveEdit = async (field, value, decode, format) => {
@ -183,8 +185,11 @@ const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.key = ''
currentEditRow.value = null
currentEditRow.format = formatTypes.RAW
currentEditRow.decode = decodeTypes.NONE
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
// currentEditRow.format = formatTypes.RAW
// currentEditRow.decode = decodeTypes.NONE
}
const actionColumn = {
@ -397,11 +402,12 @@ defineExpose({
class="entry-editor-container flex-item-expand"
style="width: 100%">
<content-entry-editor
v-model:decode="currentEditRow.decode"
v-model:format="currentEditRow.format"
v-model:fullscreen="fullEdit"
:decode="currentEditRow.decode"
:field="currentEditRow.key"
:field-label="$t('common.field')"
:format="currentEditRow.format"
:key-path="props.keyPath"
:show="inEdit"
:value="currentEditRow.value"
:value-label="$t('common.value')"

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { computed, h, nextTick, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
@ -116,6 +116,8 @@ const valueColumn = computed(() => ({
const startEdit = async (no, value) => {
currentEditRow.no = no
currentEditRow.value = value
currentEditRow.decode = props.decode
currentEditRow.format = props.format
}
/**
@ -160,6 +162,9 @@ const saveEdit = async (pos, value, decode, format) => {
const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.value = null
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
}
const actionColumn = {
@ -370,12 +375,13 @@ defineExpose({
class="entry-editor-container flex-item-expand"
style="width: 100%">
<content-entry-editor
v-model:decode="currentEditRow.decode"
v-model:format="currentEditRow.format"
v-model:fullscreen="fullEdit"
:decode="currentEditRow.decode"
:field="currentEditRow.no"
:field-label="$t('common.index')"
:field-readonly="true"
:format="currentEditRow.format"
:key-path="props.keyPath"
:show="inEdit"
:value="currentEditRow.value"
:value-label="$t('common.value')"

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { computed, h, nextTick, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
@ -115,6 +115,8 @@ const valueColumn = computed(() => ({
const startEdit = async (no, value) => {
currentEditRow.no = no
currentEditRow.value = value
currentEditRow.decode = props.decode
currentEditRow.format = props.format
}
/**
@ -157,6 +159,9 @@ const saveEdit = async (pos, value, decode, format) => {
const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.value = null
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
}
const actionColumn = {
@ -367,12 +372,13 @@ defineExpose({
class="entry-editor-container flex-item-expand"
style="width: 100%">
<content-entry-editor
v-model:decode="currentEditRow.decode"
v-model:format="currentEditRow.format"
v-model:fullscreen="fullEdit"
:decode="currentEditRow.decode"
:field="currentEditRow.no"
:field-label="$t('common.index')"
:field-readonly="true"
:format="currentEditRow.format"
:key-path="props.keyPath"
:show="inEdit"
:value="currentEditRow.value"
:value-label="$t('common.value')"

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { computed, h, nextTick, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
@ -166,6 +166,8 @@ const startEdit = async (no, score, value) => {
currentEditRow.no = no
currentEditRow.score = score
currentEditRow.value = value
currentEditRow.decode = props.decode
currentEditRow.format = props.format
}
const saveEdit = async (field, value, decode, format) => {
@ -204,8 +206,9 @@ const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.score = 0
currentEditRow.value = null
currentEditRow.format = formatTypes.RAW
currentEditRow.decode = decodeTypes.NONE
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
}
const actionColumn = {
@ -403,11 +406,12 @@ defineExpose({
class="entry-editor-container flex-item-expand"
style="width: 100%">
<content-entry-editor
v-model:decode="currentEditRow.decode"
v-model:format="currentEditRow.format"
v-model:fullscreen="fullEdit"
:decode="currentEditRow.decode"
:field="currentEditRow.score"
:field-label="$t('common.score')"
:format="currentEditRow.format"
:key-path="props.keyPath"
:show="inEdit"
:value="currentEditRow.value"
:value-label="$t('common.value')"

View File

@ -109,7 +109,7 @@ func main() {
Icon: icon,
},
WebviewIsTransparent: false,
WindowIsTranslucent: true,
WindowIsTranslucent: false,
},
Windows: &windows.Options{
WebviewIsTransparent: true,