fix: limits the minimum number of slow logs to be displayed

This commit is contained in:
Lykin 2024-03-26 17:53:24 +08:00
parent d1958a3290
commit c0fdfc0ce7
2 changed files with 2 additions and 0 deletions

View File

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

View File

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