From df7f31e7555a5105420d0607e3fc67b05b9bff47 Mon Sep 17 00:00:00 2001 From: patrikx3 Date: Sun, 24 Mar 2024 08:45:45 +0100 Subject: [PATCH] r0b08x [chore] 3/24/2024, 8:45:45 AM --- README.md | 4 ++-- package.json | 2 +- .../dialog/p3xr-dialog-key-new-or-set.html | 5 +++++ .../dialog/p3xr-dialog-key-new-or-set.js | 6 ++++++ .../pages/main/key/p3xr-main-key-hash.js | 2 +- .../pages/main/key/p3xr-main-key-list.js | 2 +- .../pages/main/key/p3xr-main-key-set.html | 2 +- .../pages/main/key/p3xr-main-key-set.js | 2 +- .../pages/main/key/p3xr-main-key-string.html | 9 ++++++++- .../pages/main/key/p3xr-main-key-string.js | 20 +++++++++++++++---- .../pages/main/key/p3xr-main-key-zset.html | 2 +- .../pages/main/key/p3xr-main-key-zset.js | 2 +- src/core/settings.js | 1 + src/strings/en/strings.js | 1 + src/strings/ru/strings.js | 1 + src/strings/zn/strings.js | 1 + 16 files changed, 48 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d2b78ee..673344b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ https://corifeus.com/redis-ui --- -# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.153 +# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.154 @@ -77,7 +77,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-REDIS-UI-MATERIAL**](https://corifeus.com/redis-ui-material) Build v2024.4.153 +[**P3X-REDIS-UI-MATERIAL**](https://corifeus.com/redis-ui-material) Build v2024.4.154 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/package.json b/package.json index 43c64aa..79b2d5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p3x-redis-ui-material", - "version": "2024.4.153", + "version": "2024.4.154", "description": "💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io", "corifeus": { "icon": "fas fa-database", diff --git a/src/angular/dialog/p3xr-dialog-key-new-or-set.html b/src/angular/dialog/p3xr-dialog-key-new-or-set.html index c371746..ea50309 100644 --- a/src/angular/dialog/p3xr-dialog-key-new-or-set.html +++ b/src/angular/dialog/p3xr-dialog-key-new-or-set.html @@ -130,6 +130,11 @@

{{ $root.p3xr.strings.label.streamValue }} + +
+ {{ $root.p3xr.strings.label.isBuffer }} +
+ + +
+ {{ $root.p3xr.strings.label.isBuffer }} +
+ +
diff --git a/src/angular/pages/main/key/p3xr-main-key-string.js b/src/angular/pages/main/key/p3xr-main-key-string.js index 1a7bd40..d6af1b4 100644 --- a/src/angular/pages/main/key/p3xr-main-key-string.js +++ b/src/angular/pages/main/key/p3xr-main-key-string.js @@ -90,15 +90,27 @@ p3xr.ng.component('p3xrMainKeyString', { } this.editable = false; + this.buffer = false let originalValue this.edit = () => { - originalValue = angular.copy(this.p3xrValue) + if (this.p3xrValue.length < p3xr.settings.maxValueAsBuffer ) { + originalValue = angular.copy(this.p3xrValue) + this.buffer = false + } else { + originalValue = angular.copy(this.p3xrValueBuffer) + this.buffer = true + } this.editable = true } this.cancelEdit = () => { - this.p3xrValue = originalValue + if (this.buffer === true) { + this.p3xrValueBuffer = originalValue + } else { + this.p3xrValue = originalValue + } this.editable = false + this.buffer = false } @@ -108,7 +120,7 @@ p3xr.ng.component('p3xrMainKeyString', { try { if (this.validateJson === true) { try { - JSON.parse(this.p3xrValue) + JSON.parse(this.buffer ? this.p3xrValueBuffer : this.p3xrValue) } catch (e) { p3xrCommon.toast({ message: p3xr.strings.label.jsonViewNotParsable @@ -121,7 +133,7 @@ p3xr.ng.component('p3xrMainKeyString', { action: 'key-set', payload: { type: this.p3xrResponse.type, - value: this.p3xrValue, + value: this.buffer ? this.p3xrValueBuffer : this.p3xrValue, key: this.p3xrKey, } }) diff --git a/src/angular/pages/main/key/p3xr-main-key-zset.html b/src/angular/pages/main/key/p3xr-main-key-zset.html index c6ab811..037429a 100644 --- a/src/angular/pages/main/key/p3xr-main-key-zset.html +++ b/src/angular/pages/main/key/p3xr-main-key-zset.html @@ -53,7 +53,7 @@ + ng-click="$ctrl.editValue({ score: value[0], member: value[1], $event: $event, $index: $index + (($ctrl.page -1) * $root.p3xr.settings.keyPageCount )})"> {{ $root.p3xr.strings.intention.edit }} edit diff --git a/src/angular/pages/main/key/p3xr-main-key-zset.js b/src/angular/pages/main/key/p3xr-main-key-zset.js index 51c6813..3884487 100644 --- a/src/angular/pages/main/key/p3xr-main-key-zset.js +++ b/src/angular/pages/main/key/p3xr-main-key-zset.js @@ -164,7 +164,7 @@ p3xr.ng.component('p3xrMainKeyZset', { model: { type: 'zset', score: options.score, - value: member, + value: member.length < p3xr.settings.maxValueAsBuffer ? member : this.p3xrValueBuffer[(options.$index * 2) ], key: this.p3xrKey } }) diff --git a/src/core/settings.js b/src/core/settings.js index 217e049..57d8ece 100644 --- a/src/core/settings.js +++ b/src/core/settings.js @@ -59,6 +59,7 @@ p3xr.settings = { }, pageCount: 50, maxValueDisplay: 1024, + maxValueAsBuffer: 512 * 1024, maxValueDisplaySetting: { default: 1024, cookieName: 'p3xr-main-treecontrol-max-value-display' diff --git a/src/strings/en/strings.js b/src/strings/en/strings.js index 2ad4609..e2d5039 100644 --- a/src/strings/en/strings.js +++ b/src/strings/en/strings.js @@ -128,6 +128,7 @@ const strings = { quickConsole: "Quick Console", }, label: { + isBuffer: "[object ArrayBuffer] means that the value is a binary buffer or the value is bigger than 0.5MB", streamValue: `Stream field and value is a oneliner. Eg.: field1 value1 "field 2" "value 2"`, streamTimestampId: `'*' means auto generated or the specification as -`, unableToLoadKey: ({ key }) => { diff --git a/src/strings/ru/strings.js b/src/strings/ru/strings.js index ece97bf..ef76fe9 100644 --- a/src/strings/ru/strings.js +++ b/src/strings/ru/strings.js @@ -131,6 +131,7 @@ const strings = { quickConsole: "Быстрый", }, label: { + isBuffer: "[object ArrayBuffer] означает, что значение представляет собой двоичный буфер или значение превышает 0.5 МБ.", streamValue: `Поле и значение потока это однополосник. Например: поле1 значение1 "поле 2" "значение 2"`, streamTimestampId: `'*' означает автогенерацию или определяется как -`, unableToLoadKey: ({ key }) => { diff --git a/src/strings/zn/strings.js b/src/strings/zn/strings.js index 7036775..8fff192 100644 --- a/src/strings/zn/strings.js +++ b/src/strings/zn/strings.js @@ -121,6 +121,7 @@ const strings = { quickConsole: "快的", }, label: { + isBuffer: "[object ArrayBuffer] 表示該值是二進位緩衝區或該值大於 0.5MB", streamValue: `流字段和值是唯一的。 例如:field1 value1 "field 2" "value 2"`, streamTimestampId: `'*'表示自动生成或指定为-`, unableToLoadKey: ({ key }) => {