Skip to content

Commit

Permalink
r0b08x [chore] 3/29/2024, 1:21:31 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Mar 29, 2024
1 parent 03fadac commit 5cce402
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 68 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.174
# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.175



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

[![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.174",
"version": "2024.4.175",
"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
188 changes: 125 additions & 63 deletions src/angular/dialog/p3xr-dialog-connection.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ <h2 flex md-truncate>{{ $root.p3xr.state.cfg.readonlyConnections ?
<md-dialog-content md-theme="{{ $root.p3xr.state.theme }}" >
<md-content>
<div class="p3xr-padding">


<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.form.connection.label.name }}</label>
<input required name="name" ng-model="model.name"
Expand All @@ -23,47 +25,105 @@ <h2 flex md-truncate>{{ $root.p3xr.state.cfg.readonlyConnections ?
</md-input-container>


<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.form.connection.label.host }}</label>
<input name="host" ng-model="model.host" ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
</md-input-container>


<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.form.connection.label.port }}</label>
<input name="port" type="number" min="1" max="65535" ng-model="model.port"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
<div ng-messages="p3xrConnectionForm.port.$error">
<div ng-message-exp="['min', 'max']">
{{ $root.p3xr.strings.form.error.port }}
<span ng-if="$root.p3xr.state.donated">
<md-switch ng-model="model.ssh" name="ssh" aria-label="" style="margin: 0;"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
{{ model.ssh ? $root.p3xr.strings.label.ssh.on : $root.p3xr.strings.label.ssh.off }}
</md-switch>

<fieldset ng-if="model.ssh">
<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.label.ssh.sshHost }}</label>
<input required name="sshHost" ng-model="model.sshHost"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
<div ng-messages="p3xrConnectionForm.sshHost.$error">
<div ng-message="required">{{ $root.p3xr.strings.form.error.required }}</div>
</div>
</md-input-container>

<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.label.ssh.sshPort }}</label>
<input required name="sshPort" type="number" min="1" max="65535" ng-model="model.sshPort"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
<div ng-messages="p3xrConnectionForm.sshPort.$error">
<div ng-message="required">{{ $root.p3xr.strings.form.error.required }}</div>
</div>
</md-input-container>

<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.label.ssh.sshUsername }}</label>
<input required name="sshUsername" ng-model="model.sshUsername"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
<div ng-messages="p3xrConnectionForm.sshPort.$error">
<div ng-message="required">{{ $root.p3xr.strings.form.error.required }}</div>
</div>
</md-input-container>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>{{ $root.p3xr.strings.label.ssh.sshPassword }}</label>
<input name="sshPassword" type="password" ng-model="model.sshPassword"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off">
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.passwordSecure }}
</div>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>{{ $root.p3xr.strings.label.ssh.sshPrivateKey }}</label>
<textarea name="sshPrivateKey" ng-model="model.sshPrivateKey"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off"></textarea>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.secureFeature }}
</div>
</div>
</md-input-container>

<md-switch ng-model="model.askAuth" name="askAuth" aria-label=""
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
{{ $root.p3xr.strings.label.askAuth }}
</md-switch>
<br/>
</fieldset>
</span>

<br/>

<span>
<fieldset>
<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.form.connection.label.username }}</label>
<input name="username" type="text" ng-model="model.username"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off">
<label>{{ $root.p3xr.strings.form.connection.label.host }}</label>
<input name="host" ng-model="model.host" ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
</md-input-container>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>{{ $root.p3xr.strings.form.connection.label.password }}</label>
<input name="password" type="password" ng-model="model.password"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off">


<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.form.connection.label.port }}</label>
<input name="port" type="number" min="1" max="65535" ng-model="model.port"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
<div ng-messages="p3xrConnectionForm.port.$error">
<div ng-message-exp="['min', 'max']">
{{ $root.p3xr.strings.form.error.port }}
</div>
</div>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.passwordSecure }}
</div>
<br/>
</span>

<md-switch ng-model="model.askAuth" name="askAuth" aria-label=""
ng-disabled="$root.p3xr.state.cfg.readonlyConnections">
{{ $root.p3xr.strings.label.askAuth }}
</md-switch>


<span>
<md-input-container class="md-block">
<label>{{ $root.p3xr.strings.form.connection.label.username }}</label>
<input name="username" type="text" ng-model="model.username"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off">
</md-input-container>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>{{ $root.p3xr.strings.form.connection.label.password }}</label>
<input name="password" type="password" ng-model="model.password"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off">
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.passwordSecure }}
</div>
<br/>
</span>
</fieldset>

<span ng-if="$root.p3xr.state.donated">
<md-switch ng-model="model.readonly" name="readonly" aria-label="" style="margin: 0;"
Expand Down Expand Up @@ -174,36 +234,38 @@ <h2 flex md-truncate>{{ $root.p3xr.state.cfg.readonlyConnections ?

<div ng-if="model.tlsWithoutCert !== true" style="padding-top: 4px;">

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>TLS (redis.crt)</label>
<textarea name="tlsCrt" ng-model="model.tlsCrt"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off"></textarea>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.tlsSecure }}
</div>
<br/>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>TLS (redis.key)</label>
<textarea name="tlsKey" ng-model="model.tlsKey"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off"></textarea>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.tlsSecure }}
</div>
<br/>
<fieldset>
<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>TLS (redis.crt)</label>
<textarea name="tlsCrt" ng-model="model.tlsCrt"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off"></textarea>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.tlsSecure }}
</div>
<br/>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>TLS (redis.key)</label>
<textarea name="tlsKey" ng-model="model.tlsKey"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off"></textarea>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.tlsSecure }}
</div>
<br/>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>TLS (ca.crt)</label>
<textarea name="tlsCa" ng-model="model.tlsCa"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off"></textarea>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.tlsSecure }}
</div>

<md-input-container class="md-block p3xr-md-input-container-no-bottom">
<label>TLS (ca.crt)</label>
<textarea name="tlsCa" ng-model="model.tlsCa"
ng-disabled="$root.p3xr.state.cfg.readonlyConnections" autocomplete="off"></textarea>
</md-input-container>
<div class="p3xr-md-input-container-bottom-info">
{{ $root.p3xr.strings.label.tlsSecure }}
</div>

<br/>
<br/>
</fieldset>
</div>


Expand Down
22 changes: 21 additions & 1 deletion src/angular/dialog/p3xr-dialog-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ p3xr.ng.factory('p3xrDialogConnection', function (p3xrCommon, $mdDialog, p3xrSoc
$scope.model.tlsCrt = options.model.id
$scope.model.tlsKey = options.model.id
$scope.model.tlsCa = options.model.id
$scope.model.sshPassword = options.model.id
$scope.model.sshPrivateKey = options.model.id

} else {
$scope.model = {
name: undefined,
host: undefined,
port: undefined,
port: 6379,
askAuth: false,
password: undefined,
username: undefined,
Expand All @@ -36,6 +38,16 @@ p3xr.ng.factory('p3xrDialogConnection', function (p3xrCommon, $mdDialog, p3xrSoc
tlsCa: undefined,
}
}
if (!$scope.model.hasOwnProperty('ssh')) {
$scope.model = { ...$scope.model,
ssh: false,
sshHost: undefined,
sshPort: 22,
sshUsername: undefined,
sshPassword: options.model?.id,
sshPrivateKey: options.model?.id,
}
}
if (!$scope.model.hasOwnProperty('cluster')) {
$scope.model.cluster = false
}
Expand All @@ -51,14 +63,22 @@ p3xr.ng.factory('p3xrDialogConnection', function (p3xrCommon, $mdDialog, p3xrSoc
node.password = node.id
}

$scope.$watch('model.ssh', function (newValue, oldValue) {
if (newValue === true) {
$scope.model.sentinel = false
$scope.model.cluster = false
}
})
$scope.$watch('model.cluster', function (newValue, oldValue) {
if (newValue === true) {
$scope.model.sentinel = false
$scope.model.ssh = false
}
})
$scope.$watch('model.sentinel', function (newValue, oldValue) {
if (newValue === true) {
$scope.model.cluster = false
$scope.model.ssh = false
}
})

Expand Down
1 change: 0 additions & 1 deletion src/angular/pages/p3xr-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ p3xr.ng.component('p3xrSettings', {
controller: function (p3xrCommon, p3xrDialogConnection, $mdDialog, p3xrSocket, p3xrDialogTreecontrolSettings, $scope) {

this.connectionForm = (options) => {

p3xrDialogConnection.show(options)

}
Expand Down
11 changes: 11 additions & 0 deletions src/strings/en/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ const strings = {
quickConsole: "Quick Console",
},
label: {
secureFeature: 'If you see a value that starts with a P3X an look like the same, it is a secure feature. To change the settings, just replace these settings with empty or something else and they will be saved. If you do not change the settings, the settings will be kept as they are on the server.',
ssh: {
on: 'SSH on',
off: 'SSH off',
sshHost: 'SSH Host',
sshPort: 'SSH port',
sshUsername: 'SSH username',
sshPassword: 'SSH password',
sshPrivateKey: 'SSH private key',

},
isBuffer: "[object ArrayBuffer] means that the value is binary data 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>`,
Expand Down
Loading

0 comments on commit 5cce402

Please sign in to comment.