Compare commits

...

2 Commits

Author SHA1 Message Date
Lykin f8ef25a323 fix: add background color for empty client list table 2024-02-27 17:20:18 +08:00
Lykin bb4ab109e7 fix: keep key sorting under "Unicode JSON" format #158 2024-02-27 14:50:19 +08:00
2 changed files with 8 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package convutil
import (
"bytes"
"encoding/json"
"strconv"
"strings"
"unicode"
"unicode/utf16"
@ -21,7 +22,7 @@ func (UnicodeJsonConvert) Decode(str string) (string, bool) {
(strings.HasPrefix(trimedStr, "[") && strings.HasSuffix(trimedStr, "]")) {
var out bytes.Buffer
if err := json.Indent(&out, []byte(trimedStr), "", " "); err == nil {
if quoteStr, ok := UnquoteUnicodeJson([]byte(trimedStr)); ok {
if quoteStr, ok := UnquoteUnicodeJson(out.Bytes()); ok {
return string(quoteStr), true
}
}
@ -50,9 +51,7 @@ func UnquoteUnicodeJson(s []byte) ([]byte, bool) {
if s[r+offset] == '"' && s[r+offset-1] != '\\' {
offset += 1
if ub, ok := unquoteBytes(s[r : r+offset]); ok {
unquoted.WriteByte('"')
unquoted.Write(ub)
unquoted.WriteByte('"')
unquoted.WriteString(strconv.Quote(string(ub)))
} else {
return nil, false
}

View File

@ -652,7 +652,11 @@ const clientTableColumns = computed(() => {
:label="$t('status.connected_clients')"
:value="get(serverInfo, 'Clients.connected_clients', '0')">
<template #suffix>
<n-tooltip trigger="click" width="70vw" @update-show="onShowClients">
<n-tooltip
:content-style="{ backgroundColor: themeVars.tableColor }"
trigger="click"
width="70vw"
@update-show="onShowClients">
<template #trigger>
<n-button :bordered="false" size="small">&LowerRightArrow;</n-button>
</template>