Skip to content

Commit

Permalink
r0b08x [chore] 3/24/2024, 8:45:45 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Mar 24, 2024
1 parent 5a6a949 commit df7f31e
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 5 additions & 0 deletions src/angular/dialog/p3xr-dialog-key-new-or-set.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ <h2 flex md-truncate>
{{ $root.p3xr.strings.label.streamValue }}
</div>


<div ng-if="valueType === 'object'" class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.isBuffer }}
</div>

<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.form.key.field.value }}</label>
<textarea ng-model="model.value" required p3x-validate-json
Expand Down
6 changes: 6 additions & 0 deletions src/angular/dialog/p3xr-dialog-key-new-or-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ p3xr.ng.factory('p3xrDialogKeyNewOrSet', function (p3xrCommon, $mdDialog, p3xrSo
if (options.hasOwnProperty('model')) {
Object.assign($scope.model, options.model)
}

Object.defineProperty($scope, 'valueType', {
get: () => {
return typeof $scope.model.value
}
})
//console.warn($scope.model)

// Promise reject
Expand Down
2 changes: 1 addition & 1 deletion src/angular/pages/main/key/p3xr-main-key-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ p3xr.ng.component('p3xrMainKeyHash', {
$event: options.$event,
model: {
type: 'hash',
value: value,
value: value.length < p3xr.settings.maxValueAsBuffer ? value : this.p3xrValueBuffer[hashKey],
hashKey: hashKey,
key: this.p3xrKey
}
Expand Down
2 changes: 1 addition & 1 deletion src/angular/pages/main/key/p3xr-main-key-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ p3xr.ng.component('p3xrMainKeyList', {
$event: options.$event,
model: {
type: 'list',
value: value,
value: value.length < p3xr.settings.maxValueAsBuffer ? value : this.p3xrValueBuffer[index],
index: options.index,
key: this.p3xrKey
}
Expand Down
2 changes: 1 addition & 1 deletion src/angular/pages/main/key/p3xr-main-key-set.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</md-tooltip>
</md-button>

<md-button class="md-icon-button md-primary" ng-click="$ctrl.editValue({ value: value, $event: $event})">
<md-button class="md-icon-button md-primary" ng-click="$ctrl.editValue({ $index: $index + (($ctrl.page -1) * $root.p3xr.settings.keyPageCount ), value: value, $event: $event})">
<md-tooltip>{{ $root.p3xr.strings.intention.edit }}</md-tooltip>
<md-icon>edit</md-icon>
</md-button>
Expand Down
2 changes: 1 addition & 1 deletion src/angular/pages/main/key/p3xr-main-key-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ p3xr.ng.component('p3xrMainKeySet', {
$event: options.$event,
model: {
type: 'set',
value: value,
value: value.length < p3xr.settings.maxValueAsBuffer ? value : this.p3xrValueBuffer[options.$index],
key: this.p3xrKey
}
})
Expand Down
9 changes: 8 additions & 1 deletion src/angular/pages/main/key/p3xr-main-key-string.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,15 @@
<div ng-if="$ctrl.editable">
<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.label.edit }}</label>
<textarea ng-model="$ctrl.p3xrValue" p3x-validate-json
<textarea ng-model="$ctrl.p3xrValue" ng-if="$ctrl.p3xrValue.length < $root.p3xr.settings.maxValueAsBuffer" p3x-validate-json
p3x-validate-json-required="validateJson"></textarea>
<span ng-if="$ctrl.p3xrValue.length >= $root.p3xr.settings.maxValueAsBuffer">
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.isBuffer }}
</div>
<textarea ng-model="$ctrl.p3xrValueBuffer" p3x-validate-json
p3x-validate-json-required="validateJson"></textarea>
</span>
</md-input-container>
</div>
</div>
20 changes: 16 additions & 4 deletions src/angular/pages/main/key/p3xr-main-key-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand All @@ -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
Expand All @@ -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,
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/angular/pages/main/key/p3xr-main-key-zset.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</md-button>

<md-button class="md-icon-button md-primary"
ng-click="$ctrl.editValue({ score: value[0], member: value[1], $event: $event})">
ng-click="$ctrl.editValue({ score: value[0], member: value[1], $event: $event, $index: $index + (($ctrl.page -1) * $root.p3xr.settings.keyPageCount )})">
<md-tooltip>{{ $root.p3xr.strings.intention.edit }}</md-tooltip>
<md-icon>edit</md-icon>
</md-button>
Expand Down
2 changes: 1 addition & 1 deletion src/angular/pages/main/key/p3xr-main-key-zset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})
Expand Down
1 change: 1 addition & 0 deletions src/core/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ p3xr.settings = {
},
pageCount: 50,
maxValueDisplay: 1024,
maxValueAsBuffer: 512 * 1024,
maxValueDisplaySetting: {
default: 1024,
cookieName: 'p3xr-main-treecontrol-max-value-display'
Expand Down
1 change: 1 addition & 0 deletions src/strings/en/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <millisecondsTime>-<sequenceNumber>`,
unableToLoadKey: ({ key }) => {
Expand Down
1 change: 1 addition & 0 deletions src/strings/ru/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const strings = {
quickConsole: "Быстрый",
},
label: {
isBuffer: "[object ArrayBuffer] означает, что значение представляет собой двоичный буфер или значение превышает 0.5 МБ.",
streamValue: `Поле и значение потока это однополосник. Например: поле1 значение1 "поле 2" "значение 2"`,
streamTimestampId: `'*' означает автогенерацию или определяется как <millisecondsTime>-<sequenceNumber>`,
unableToLoadKey: ({ key }) => {
Expand Down
1 change: 1 addition & 0 deletions src/strings/zn/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const strings = {
quickConsole: "快的",
},
label: {
isBuffer: "[object ArrayBuffer] 表示該值是二進位緩衝區或該值大於 0.5MB",
streamValue: `流字段和值是唯一的。 例如:field1 value1 "field 2" "value 2"`,
streamTimestampId: `'*'表示自动生成或指定为<millisecondsTime>-<sequenceNumber>`,
unableToLoadKey: ({ key }) => {
Expand Down

0 comments on commit df7f31e

Please sign in to comment.