Skip to content

Commit

Permalink
r0b08x [chore] 4/3/2024, 3:17:43 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Apr 3, 2024
1 parent adcd1de commit b2ebd4b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 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.215
# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.217



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

[![NPM](https://img.shields.io/npm/v/p3x-redis-ui-material.svg)](https://www.npmjs.com/package/p3x-redis-ui-material) [![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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p3x-redis-ui-material",
"version": "2024.4.215",
"version": "2024.4.217",
"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 Expand Up @@ -46,7 +46,7 @@
"@babel/preset-env": "^7.24.3",
"@fontsource/roboto": "^5.0.12",
"@fontsource/roboto-mono": "^5.0.17",
"@fortawesome/fontawesome-free": "^6.5.1",
"@fortawesome/fontawesome-free": "^6.5.2",
"@uirouter/angularjs": "^1.1.0",
"angular": "^1.8.3",
"angular-animate": "^1.8.3",
Expand Down
36 changes: 30 additions & 6 deletions src/angular/factory/p3xr-redis-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,66 @@ p3xr.ng.factory('p3xrRedisParser', function ($rootScope) {
const obj = {}
for (let row of rows) {
const rowLine = row.split(fieldDivider)
obj[rowLine[0]] = rowLine[1].trim()
const rowLineData = rowLine[1] ?? ''
obj[rowLine[0]] = rowLineData.trim()
}
return obj
}

this.info = (str) => {
//console.log( str)
const lines = str.split('\n')
const obj = {}
let section
let currentSectionObj
let hadSection = false

//let pikaIndex = 0
for (let line of lines) {
if (line.startsWith('#')) {
if (hadSection) {
continue
}
hadSection = true
if (section !== undefined) {
obj[section] = currentSectionObj
}
section = line.substring(1).toLowerCase().trim()
currentSectionObj = {}
} else if (line.length > 2) {
const lineArray = line.split(':')
const value = lineArray[1] ?? "";
hadSection = false
let lineArray
let value
if (line.includes(':')) {
lineArray = line.split(':')
value = lineArray[1] ?? "";
} else {
continue
}

currentSectionObj[lineArray[0]] = value.includes(',') ? selfMain.array({
line: value.trim()
}) : value.trim()
}
}
if (section !== undefined) {
if (section !== undefined && Object.keys(currentSectionObj).length > 0) {
obj[section] = currentSectionObj
}


obj.keyspaceDatabases = {}
if (obj.hasOwnProperty('keyspace')) {
obj.keyspaceDatabases = {}
alert('ok')
Object.keys(obj.keyspace).forEach(key => {
key = parseInt(key.substring(2))
obj.keyspaceDatabases[key] = true
})
}


//console.log('obj', obj)


return obj
}

Expand Down Expand Up @@ -155,4 +179,4 @@ p3xr.ng.factory('p3xrRedisParser', function ($rootScope) {
}

};
});
});

0 comments on commit b2ebd4b

Please sign in to comment.