Skip to content

Commit

Permalink
r0b08x [chore] 4/1/2024, 11:43:42 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Apr 1, 2024
1 parent 6ddc72d commit 1af5a49
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 31 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.211
# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.212



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

[![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
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.211",
"version": "2024.4.212",
"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
2 changes: 1 addition & 1 deletion src/angular/dialog/p3xr-dialog-key-new-or-set.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ <h2 flex md-truncate>


<div ng-if="valueType === 'object'" class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.isBuffer }} {{ bufferDisplay(model.value) }}
{{ $root.p3xr.strings.label.isBuffer({ maxValueAsBuffer: $root.p3xr.settings.prettyBytes($root.p3xr.settings.maxValueAsBuffer)}) }} {{ bufferDisplay(model.value) }}
</div>

<md-input-container class="md-block">
Expand Down
4 changes: 1 addition & 3 deletions src/angular/dialog/p3xr-dialog-key-new-or-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ p3xr.ng.factory('p3xrDialogKeyNewOrSet', function (p3xrCommon, $mdDialog, p3xrSo
controller: function ($scope, $mdDialog) {


const prettyBytes = require('pretty-bytes');

$scope.bufferDisplay = (value) => {
const result = '(' + prettyBytes(value.byteLength) + ')'
const result = '(' + p3xr.settings.prettyBytes(value.byteLength) + ')'
//console.log('bufferDisplay', result )
return result
}
Expand Down
2 changes: 2 additions & 0 deletions src/angular/dialog/p3xr-dialog-ttl.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ p3xr.ng.factory('p3xrDialogTtl', function (p3xrCommon, $mdDialog) {

const humanizeDuration = require("humanize-duration");


if (typeof $scope.model.ttl === 'number' && $scope.model.ttl > 0) {

$scope.convertTextToTime = humanizeDuration($scope.model.ttl * 1000, {
delimiter: ' ',
language: p3xr.settings.getHumanizeDurationLanguage(),
})
} else {
$scope.convertTextToTime = '';
Expand Down
4 changes: 2 additions & 2 deletions src/angular/pages/main/key/p3xr-main-key-string.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@
<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.label.edit }}</label>
<div class="p3xr-md-input-container-bottom-info" ng-if="$ctrl.p3xrValue && $ctrl.p3xrValue.toString() === '[object ArrayBuffer]'">
{{ $root.p3xr.strings.label.isBuffer }} {{$ctrl.bufferDisplay($ctrl.p3xrValue)}}
{{ $root.p3xr.strings.label.isBuffer({ maxValueAsBuffer: $root.p3xr.settings.prettyBytes($root.p3xr.settings.maxValueAsBuffer)}) }} {{$ctrl.bufferDisplay($ctrl.p3xrValue)}}
</div>
<textarea ng-model="$ctrl.p3xrValue" ng-if="!$ctrl.buffer" p3x-validate-json
p3x-validate-json-required="validateJson"></textarea>
<span ng-if="$ctrl.buffer">
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.isBuffer }} {{$ctrl.bufferDisplay($ctrl.p3xrValueBuffer)}}
{{ $root.p3xr.strings.label.isBuffer({ maxValueAsBuffer: $root.p3xr.settings.prettyBytes($root.p3xr.settings.maxValueAsBuffer)}) }} {{$ctrl.bufferDisplay($ctrl.p3xrValueBuffer)}}
</div>
<textarea ng-model="$ctrl.p3xrValueBuffer" p3x-validate-json
p3x-validate-json-required="validateJson"></textarea>
Expand Down
4 changes: 1 addition & 3 deletions src/angular/pages/main/key/p3xr-main-key-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ p3xr.ng.component('p3xrMainKeyString', {
}


const prettyBytes = require('pretty-bytes');

this.bufferDisplay = (value) => {
const result = '(' + prettyBytes(value.byteLength) + ')'
const result = '(' + p3xr.settings.prettyBytes(value.byteLength) + ')'
//console.log('bufferDisplay', result )
return result
}
Expand Down
18 changes: 3 additions & 15 deletions src/angular/pages/main/p3xr-main-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,10 @@ p3xr.ng.component('p3xrMainKey', {
this.ttlParsed = ' ' + duration
*/

let language
switch(p3xr.settings.language.current) {
case 'zn':
language = 'zh_CN'
break;
case 'ru':
language = 'ru'
break;
default:
language = 'en'
break;
}


this.ttlParsed = ' ' + humanizeDuration(this.response.ttl * 1000, {
language: language,
language: p3xr.settings.getHumanizeDurationLanguage(),
delimiter: ' ',
})
const counterEl = document.getElementById('p3xr-main-key-ttl-counter')
Expand Down Expand Up @@ -240,8 +229,7 @@ p3xr.ng.component('p3xrMainKey', {
if (length < 1024 || length === undefined) {
return ''
}
const prettyBytes = require('pretty-bytes');
return '(' + prettyBytes(length) + ')'
return '(' + p3xr.settings.prettyBytes(length) + ')'
}

this.refresh = async (options) => {
Expand Down
24 changes: 23 additions & 1 deletion src/core/settings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
const cookieExpiry = new Date()
cookieExpiry.setFullYear(cookieExpiry.getFullYear() + 5)

const prettyBytes = require('pretty-bytes')

p3xr.settings = {
prettyBytes: (value) => {
return prettyBytes(value, {
locale: p3xr.settings.language.current
})
},
getHumanizeDurationLanguage: () => {
let language
switch(p3xr.settings.language.current) {
case 'zn':
language = 'zh_CN'
break;
case 'ru':
language = 'ru'
break;
default:
language = 'en'
break;
}
return language
},
maxLightKeysCount: 110000,
// maxLightKeysCount: 1,
resizeMinWidth: 350,
Expand Down Expand Up @@ -59,7 +81,7 @@ p3xr.settings = {
},
pageCount: 50,
maxValueDisplay: 1024,
maxValueAsBuffer: 512 * 1024,
maxValueAsBuffer: 1000 * 256,
maxValueDisplaySetting: {
default: 1024,
cookieName: 'p3xr-main-treecontrol-max-value-display'
Expand Down
2 changes: 1 addition & 1 deletion src/strings/en/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const strings = {
sshPrivateKey: 'SSH private key',

},
isBuffer: "[object ArrayBuffer] means that the value is binary data or the value is bigger than 0.5MB",
isBuffer: (opts) => `[object ArrayBuffer] means that the value is binary data or the value is bigger than ${opts.maxValueAsBuffer}`,
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
2 changes: 1 addition & 1 deletion src/strings/ru/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const strings = {
sshPassword: 'Пароль SSH',
sshPrivateKey: 'Приватный ключ SSH',
},
isBuffer: "[object ArrayBuffer] означает, что значение представляет собой двоичный буфер или значение превышает 0.5 МБ.",
isBuffer: (opts) => `[object ArrayBuffer] означает, что значение представляет собой двоичный буфер или значение превышает ${opts.maxValueAsBuffer}`,
streamValue: `Поле и значение потока это однополосник. Например: поле1 значение1 "поле 2" "значение 2"`,
streamTimestampId: `'*' означает автогенерацию или определяется как <millisecondsTime>-<sequenceNumber>`,
unableToLoadKey: ({ key }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/strings/zn/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const strings = {
sshPassword: 'SSH密码',
sshPrivateKey: 'SSH 私钥',
},
isBuffer: "[object ArrayBuffer] 表示該值是二進位緩衝區或該值大於 0.5MB",
isBuffer: (opts) => `[object ArrayBuffer] 表示該值是二進位緩衝區或該值大於 ${opts.maxValueAsBuffer}`,
streamValue: `流字段和值是唯一的。 例如:field1 value1 "field 2" "value 2"`,
streamTimestampId: `'*'表示自动生成或指定为<millisecondsTime>-<sequenceNumber>`,
unableToLoadKey: ({ key }) => {
Expand Down

0 comments on commit 1af5a49

Please sign in to comment.