From ff8da4ca60e7bfd815d6770de1a5a32ec3a03441 Mon Sep 17 00:00:00 2001 From: tiny-craft <137850705+tiny-craft@users.noreply.github.com> Date: Mon, 30 Oct 2023 21:54:20 +0800 Subject: [PATCH] fix: long string overflow in value page fix: border radius show and hide logic incorrect on Windows --- backend/utils/string/common.go | 13 +++++--- frontend/src/AppContent.vue | 33 ++++++++++++++----- .../content_value/ContentValueString.vue | 2 +- frontend/src/consts/value_view_type.js | 2 ++ go.mod | 3 +- go.sum | 6 ++-- 6 files changed, 41 insertions(+), 18 deletions(-) diff --git a/backend/utils/string/common.go b/backend/utils/string/common.go index c93d177..e0746a9 100644 --- a/backend/utils/string/common.go +++ b/backend/utils/string/common.go @@ -1,9 +1,10 @@ package strutil -import "unicode/utf8" +import ( + "unicode" +) func containsBinary(str string) bool { - //buf := []byte(str) //size := 0 //for start := 0; start < len(buf); start += size { // var r rune @@ -11,9 +12,11 @@ func containsBinary(str string) bool { // return true // } //} - - if !utf8.ValidString(str) { - return true + rs := []rune(str) + for _, r := range rs { + if !unicode.IsPrint(r) { + return true + } } return false } diff --git a/frontend/src/AppContent.vue b/frontend/src/AppContent.vue index 99aa974..0f742d0 100644 --- a/frontend/src/AppContent.vue +++ b/frontend/src/AppContent.vue @@ -69,6 +69,16 @@ const wrapperStyle = computed(() => { borderRadius: '10px', } }) +const spinStyle = computed(() => { + return hideRadius.value + ? { + backgroundColor: themeVars.value.bodyColor, + } + : { + backgroundColor: themeVars.value.bodyColor, + borderRadius: '10px', + } +}) const onToggleFullscreen = (fullscreen) => { hideRadius.value = fullscreen @@ -82,10 +92,14 @@ const onToggleFullscreen = (fullscreen) => { const onToggleMaximize = (isMaximised) => { if (isMaximised) { maximised.value = true - hideRadius.value = isMacOS() + if (!isMacOS()) { + hideRadius.value = true + } } else { maximised.value = false - hideRadius.value = !isMacOS() + if (!isMacOS()) { + hideRadius.value = false + } } } @@ -105,10 +119,7 @@ onMounted(async () => {