Compare commits

..

No commits in common. "0038092193d135f58d780bd202f14225fcbb8a8b" and "237b25086c74e2aeda14f340233ae22ba0ab3f0b" have entirely different histories.

10 changed files with 5 additions and 71 deletions

View File

@ -1241,7 +1241,7 @@ func (b *browserService) SetKeyValue(param types.SetKeyParam) (resp types.JSResp
if len(param.Format) <= 0 { if len(param.Format) <= 0 {
param.Format = types.FORMAT_RAW param.Format = types.FORMAT_RAW
} }
var savedValue string var savedValue any
switch strings.ToLower(param.KeyType) { switch strings.ToLower(param.KeyType) {
case "string": case "string":
if str, ok := param.Value.(string); !ok { if str, ok := param.Value.(string); !ok {
@ -1339,10 +1339,7 @@ func (b *browserService) SetKeyValue(param types.SetKeyParam) (resp types.JSResp
if err == nil && expiration > 0 { if err == nil && expiration > 0 {
client.Expire(ctx, key, expiration) client.Expire(ctx, key, expiration)
} }
var ok bool savedValue = param.Value
if savedValue, ok = param.Value.(string); !ok {
savedValue = ""
}
} }
if err != nil { if err != nil {
@ -1351,7 +1348,7 @@ func (b *browserService) SetKeyValue(param types.SetKeyParam) (resp types.JSResp
} }
resp.Success = true resp.Success = true
resp.Data = map[string]any{ resp.Data = map[string]any{
"value": strutil.EncodeRedisKey(savedValue), "value": savedValue,
} }
return return
} }

View File

@ -13,7 +13,6 @@ const DECODE_BASE64 = "Base64"
const DECODE_GZIP = "GZip" const DECODE_GZIP = "GZip"
const DECODE_DEFLATE = "Deflate" const DECODE_DEFLATE = "Deflate"
const DECODE_ZSTD = "ZStd" const DECODE_ZSTD = "ZStd"
const DECODE_LZ4 = "LZ4"
const DECODE_BROTLI = "Brotli" const DECODE_BROTLI = "Brotli"
const DECODE_MSGPACK = "Msgpack" const DECODE_MSGPACK = "Msgpack"
const DECODE_PHP = "PHP" const DECODE_PHP = "PHP"

View File

@ -24,7 +24,6 @@ var (
gzipConv GZipConvert gzipConv GZipConvert
deflateConv DeflateConvert deflateConv DeflateConvert
zstdConv ZStdConvert zstdConv ZStdConvert
lz4Conv LZ4Convert
brotliConv BrotliConvert brotliConv BrotliConvert
msgpackConv MsgpackConvert msgpackConv MsgpackConvert
phpConv = NewPhpConvert() phpConv = NewPhpConvert()
@ -45,7 +44,6 @@ var BuildInDecoders = map[string]DataConvert{
types.DECODE_GZIP: gzipConv, types.DECODE_GZIP: gzipConv,
types.DECODE_DEFLATE: deflateConv, types.DECODE_DEFLATE: deflateConv,
types.DECODE_ZSTD: zstdConv, types.DECODE_ZSTD: zstdConv,
types.DECODE_LZ4: lz4Conv,
types.DECODE_BROTLI: brotliConv, types.DECODE_BROTLI: brotliConv,
types.DECODE_MSGPACK: msgpackConv, types.DECODE_MSGPACK: msgpackConv,
types.DECODE_PHP: phpConv, types.DECODE_PHP: phpConv,
@ -140,11 +138,6 @@ func autoDecode(str string, customDecoder []CmdConvert) (value, resultDecode str
return return
} }
if value, ok = lz4Conv.Decode(str); ok {
resultDecode = types.DECODE_LZ4
return
}
// FIXME: skip decompress with brotli due to incorrect format checking // FIXME: skip decompress with brotli due to incorrect format checking
//if value, ok = decodeBrotli(str); ok { //if value, ok = decodeBrotli(str); ok {
// resultDecode = types.DECODE_BROTLI // resultDecode = types.DECODE_BROTLI

View File

@ -1,39 +0,0 @@
package convutil
import (
"bytes"
"github.com/pierrec/lz4/v4"
"io"
)
type LZ4Convert struct{}
func (LZ4Convert) Enable() bool {
return true
}
func (LZ4Convert) Encode(str string) (string, bool) {
var compress = func(b []byte) (string, error) {
var buf bytes.Buffer
writer := lz4.NewWriter(&buf)
if _, err := writer.Write([]byte(str)); err != nil {
writer.Close()
return "", err
}
writer.Close()
return string(buf.Bytes()), nil
}
if gzipStr, err := compress([]byte(str)); err == nil {
return gzipStr, true
}
return str, false
}
func (LZ4Convert) Decode(str string) (string, bool) {
reader := lz4.NewReader(bytes.NewReader([]byte(str)))
if decompressed, err := io.ReadAll(reader); err == nil {
return string(decompressed), true
}
return str, false
}

View File

@ -13,7 +13,7 @@ import ContentLogPane from './components/content/ContentLogPane.vue'
import ContentValueTab from '@/components/content/ContentValueTab.vue' import ContentValueTab from '@/components/content/ContentValueTab.vue'
import ToolbarControlWidget from '@/components/common/ToolbarControlWidget.vue' import ToolbarControlWidget from '@/components/common/ToolbarControlWidget.vue'
import { EventsOn, WindowIsFullscreen, WindowIsMaximised, WindowToggleMaximise } from 'wailsjs/runtime/runtime.js' import { EventsOn, WindowIsFullscreen, WindowIsMaximised, WindowToggleMaximise } from 'wailsjs/runtime/runtime.js'
import { isMacOS, isWindows } from '@/utils/platform.js' import { isMacOS } from '@/utils/platform.js'
import iconUrl from '@/assets/images/icon.png' import iconUrl from '@/assets/images/icon.png'
import ResizeableWrapper from '@/components/common/ResizeableWrapper.vue' import ResizeableWrapper from '@/components/common/ResizeableWrapper.vue'
import { extraTheme } from '@/utils/extra_theme.js' import { extraTheme } from '@/utils/extra_theme.js'
@ -57,9 +57,6 @@ const logoPaddingLeft = ref(10)
const maximised = ref(false) const maximised = ref(false)
const hideRadius = ref(false) const hideRadius = ref(false)
const wrapperStyle = computed(() => { const wrapperStyle = computed(() => {
if (isWindows()) {
return {}
}
return hideRadius.value return hideRadius.value
? {} ? {}
: { : {
@ -68,11 +65,6 @@ const wrapperStyle = computed(() => {
} }
}) })
const spinStyle = computed(() => { const spinStyle = computed(() => {
if (isWindows()) {
return {
backgroundColor: themeVars.value.bodyColor,
}
}
return hideRadius.value return hideRadius.value
? { ? {
backgroundColor: themeVars.value.bodyColor, backgroundColor: themeVars.value.bodyColor,

View File

@ -22,7 +22,6 @@ export const decodeTypes = {
GZIP: 'GZip', GZIP: 'GZip',
DEFLATE: 'Deflate', DEFLATE: 'Deflate',
ZSTD: 'ZStd', ZSTD: 'ZStd',
LZ4: 'LZ4',
BROTLI: 'Brotli', BROTLI: 'Brotli',
MSGPACK: 'Msgpack', MSGPACK: 'Msgpack',
PHP: 'PHP', PHP: 'PHP',

View File

@ -10,7 +10,3 @@ export async function loadEnvironment() {
export function isMacOS() { export function isMacOS() {
return os === 'darwin' return os === 'darwin'
} }
export function isWindows() {
return os === 'windows'
}

1
go.mod
View File

@ -7,7 +7,6 @@ require (
github.com/andybalholm/brotli v1.1.0 github.com/andybalholm/brotli v1.1.0
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
github.com/klauspost/compress v1.17.9 github.com/klauspost/compress v1.17.9
github.com/pierrec/lz4/v4 v4.1.21
github.com/redis/go-redis/v9 v9.6.1 github.com/redis/go-redis/v9 v9.6.1
github.com/vmihailenco/msgpack/v5 v5.4.1 github.com/vmihailenco/msgpack/v5 v5.4.1
github.com/vrischmann/userdir v0.0.0-20151206171402-20f291cebd68 github.com/vrischmann/userdir v0.0.0-20151206171402-20f291cebd68

2
go.sum
View File

@ -60,8 +60,6 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

View File

@ -114,7 +114,7 @@ func main() {
Windows: &windows.Options{ Windows: &windows.Options{
WebviewIsTransparent: true, WebviewIsTransparent: true,
WindowIsTranslucent: true, WindowIsTranslucent: true,
DisableFramelessWindowDecorations: false, DisableFramelessWindowDecorations: true,
}, },
Linux: &linux.Options{ Linux: &linux.Options{
ProgramName: "Tiny RDM", ProgramName: "Tiny RDM",