Skip to content

Commit

Permalink
r0b08x [chore] 3/24/2024, 1:35:17 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Mar 24, 2024
1 parent f2c4f06 commit 95cf5dd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 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.157
# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.158



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.157
[**P3X-REDIS-UI-MATERIAL**](https://corifeus.com/redis-ui-material) Build v2024.4.158

[![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.157",
"version": "2024.4.158",
"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
39 changes: 29 additions & 10 deletions src/angular/pages/main/p3xr-main-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,36 @@ p3xr.ng.component('p3xrMainKey', {
return;
}
response.size = 0
console.log('response', response, 'typeof response.valueBuffer === object', typeof response.valueBuffer === 'object')
if (typeof response.valueBuffer === 'object' && response.length > 0) {
for (let keys of Object.keys(response.valueBuffer)) {
response.size += response.valueBuffer[keys].maxByteLength
}
} else if (Array.isArray(response.valueBuffer)) {
for (let i = 0; i < response.valueBuffer.length; i++) {
response.size += response.valueBuffer[i].maxByteLength
}

if (response.type !== 'stream') {
if (typeof response.valueBuffer === 'object' && response.length > 0) {
for (let keys of Object.keys(response.valueBuffer)) {
response.size += response.valueBuffer[keys].byteLength
}
} else if (Array.isArray(response.valueBuffer)) {
for (let i = 0; i < response.valueBuffer.length; i++) {
response.size += response.valueBuffer[i].byteLength
}
} else {
response.size = response.valueBuffer.byteLength
}
} else {
response.size = response.valueBuffer.maxByteLength
//console.log('response', response)
function sumMaxByteLength(arr) {
let total = 0;

function processElement(element) {
if (ArrayBuffer.isView(element) || element instanceof ArrayBuffer) {
total += element.byteLength;
} else if (Array.isArray(element)) {
element.forEach(processElement);
}
}

arr.forEach(processElement);
return total;
}
response.size = sumMaxByteLength(response.valueBuffer)
}

if (response.ttl > -1) {
Expand Down

0 comments on commit 95cf5dd

Please sign in to comment.