.gitignore000066400000000000000000000003441520051531700130460ustar00rootroot00000000000000/build /node_modules /*.log /*.iws .idea/workspace.xml .idea/tasks.xml .idea/profiles_settings.xml .idea/inspectionProfiles/Project_Default.xml .idea/inspectionProfiles/profiles_settings.xml node_modules/.yarn-integrity /dist.npmignore000066400000000000000000000002351520051531700130540ustar00rootroot00000000000000/.idea /artifacts /build /test /node_modules /*.iml /*.ipr /*.iws /.travis.yml /.scrutinizer.yml /Gruntfile.js /*.lock *.log /corifeus-boot.json /src/**/*.*.travis.yml000066400000000000000000000014301520051531700131640ustar00rootroot00000000000000language: node_js node_js: - node before_script: - npm install -g grunt-cli npm env: global: secure: ndPY/yENX+jrLScJBSsu+GV93TZcnmFyPirG19UBvu2ZdUyh+jUnDfvsqtz9VCoYgArDoXaE2cn+O7ymlhzo3FaiTn4uhZFwWkNDvB/o4yVUY8JfqUJiKM1Ed/1FCwsKNQ5ClH9EyTKlsecu68f3Tl36C+YRI2n0ar2ILD9Fz4SzcFUS1sxAa1zAk20P5JKeEL/sEzHHYT/ex2p/TEltN/6SaV4ITV6z94FH5dxIuwgz7WQeteNx3dPG6H/b+mkpE6Lyzgb5fRhYSdoSiynWK6/Z4gswftXLG12YIue8NVR8Fa2RMAESA2Nzeu0SDfZl/jRJqw0DWKlNq+8Wzme81TPJw0S8aQDYVNWJAnbIXI2qGibXidy7+WHhM8AhoK/e+1VAKuD61H2W75YERGkktiN9oldcoGiyO/ODkxQ6gGZ6URsxC57SbtQdsTDWCAOGjkZOrcXE4qT30ItrfkVif0BpHtHhgCd8iAsnVDKcuTzj995gI/gNDitAKJjnMgIVlS3nLTYBATy7xJh90BMfDBG0MDvnonA7Co5Qrz04MotgQZ5abXckaNPkBAe9WTFeQ51pHcWSoWcuK/InTPIZCB6Hb6i/q5y8SOlGzTpr2v6vxPw9h83X2AxJLabxB6WgXCwr/DbehgnATK09O7s7QvwmG4PzfqqllcfCC6r4QRs= Gruntfile.js000066400000000000000000000100001520051531700133410ustar00rootroot00000000000000const utils = require('corifeus-utils'); module.exports = (grunt) => { const builder = require(`corifeus-builder`); const gruntUtil = builder.utils; const loader = new builder.loader(grunt); loader.js({ jit: { injector: 'grunt-injector', }, config: { injector: { options: {}, jsAngular: { options: { transform: function (filePath) { const relative = gruntUtil.injectorRelativePathGenerator({ srcDir: 'src/angular/', filePath: filePath, }) return `require('./${relative}');`; }, starttag: '//injector-angular-start', endtag: '//injector-angular-end' }, files: { 'src/angular/injector.js': [ 'src/angular/**/*.js', '!src/angular/injector.js', '!src/angular/boot.js', '!src/angular/routes.js', ], } }, sass: { options: { transform: function (filePath) { const relative = gruntUtil.injectorRelativePathGenerator({ srcDir: 'src/', filePath: filePath, }) return `@import "./${relative}";`; }, starttag: '//injector-sass-start', endtag: '//injector-sass-end', }, files: { 'src/injector.scss': [ 'src/**/*.scss', '!src/scss/index.scss', '!src/injector.scss', ] } }, }, watch: { options: { atBegin: true }, js: { files: [ 'src/angular/**/*.js', '!src/angular/injector.js', '!src/angular/boot.js', '!src/angular/routes.js', ], tasks: [ 'injector:jsAngular', ], }, sass: { files: [ 'src/**/*.scss', '!src/scss/index.scss', '!src/injector.scss', ], tasks: [ 'injector:sass' ], }, }, } }); grunt.registerTask('default', ['cory-npm', 'clean', 'cory-replace', 'cory:license']); grunt.registerTask('inject', ['watch:js', 'watch:sass']); grunt.registerTask('build', ['injector']); grunt.registerTask('publish', async function() { const done = this.async() const cwd = process.cwd() try { await gruntUtil.spawn({ grunt: grunt, gruntThis: this, }, { cmd: `${cwd}/node_modules/.bin/grunt${gruntUtil.commandAddon}`, args: [ 'injector' ] }); await gruntUtil.spawn({ grunt: grunt, gruntThis: this, }, { cmd: `${cwd}/node_modules/.bin/webpack${gruntUtil.commandAddon}`, args: [ '--config', './src/builder/webpack.config.js', '--production' ] }); done() } catch(e) { done(e) } }) } LICENSE000066400000000000000000000024171520051531700120660ustar00rootroot00000000000000 @license p3x-redis-ui-material v2018.9.8-7 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via https. https://pages.corifeus.com/redis-ui-material Copyright (c) 2018 Patrik Laszlo / P3X / Corifeus and contributors. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. README.md000066400000000000000000000050411520051531700123340ustar00rootroot00000000000000[//]: #@corifeus-header [![Build Status](https://travis-ci.org/patrikx3/redis-ui-material.svg?branch=master)](https://travis-ci.org/patrikx3/redis-ui-material) [![Uptime Robot ratio (30 days)](https://img.shields.io/uptimerobot/ratio/m780749701-41bcade28c1ea8154eda7cca.svg)](https://uptimerobot.patrikx3.com/) --- # The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via https. v2018.9.8-8 This is an open-source project. Star this repository, if you like it, or even donate! Thank you so much! :) I run my own server with dynamic IP address, so, it may happen, that the server can not be reachable for about max 15 minutes, due to nature of the dynamic DNS. The server may also be unreachable, when I backup the SSD with Clonzilla (very rarely) or an electrical issue (but this should not happen again). When the server is down, please hang on for 15-30 minutes and the server will be back up. All my domains (patrikx3.com and corifeus.com) could have errors, since I am developing in my free time. However, it is usually stable. **Bugs are evident™ - MATRIX️** ### Node Version Requirement ``` >=8.11.4 ``` ### Built on Node ``` v10.10.0 ``` The ```async``` and ```await``` keywords are required. Install NodeJs: https://nodejs.org/en/download/package-manager/ # Description [//]: #@corifeus-header:end The is the `p3x-redis-ui-material` web gui, that uses the `p3x-redis-ui-server`. It is based on Socket.IO and AngularJs Material, uses themes light/dark schema and internationalization (English is implemented by default). [//]: #@corifeus-footer --- [**P3X-REDIS-UI-MATERIAL**](https://pages.corifeus.com/redis-ui-material) Build v2018.9.8-8 [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![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) ## P3X Sponsors [IntelliJ - The most intelligent Java IDE](https://www.jetbrains.com) [![JetBrains](https://cdn.corifeus.com/assets/svg/jetbrains-logo.svg)](https://www.jetbrains.com/) [![NoSQLBooster](https://cdn.corifeus.com/assets/png/nosqlbooster-70x70.png)](https://www.nosqlbooster.com/) [The Smartest IDE for MongoDB](https://www.nosqlbooster.com) [//]: #@corifeus-footer:endpackage.json000066400000000000000000000052171520051531700133500ustar00rootroot00000000000000{ "name": "p3x-redis-ui-material", "version": "2018.9.8-8", "description": "The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via https.", "corifeus": { "icon": "fas fa-database", "code": "Fireball", "opencollective": false, "build": true, "nodejs": "v10.10.0", "reponame": "redis-ui-material", "publish": true, "prefix": "p3x-", "type": "p3x" }, "main": "src/index.js", "scripts": { "test": "grunt", "run": "concurrently \"grunt watch:js\" \"grunt watch:sass\" \"webpack-dev-server --hot --inline --config ./src/builder/webpack.config.js\"", "run-webpack": "webpack-dev-server --hot --inline --config ./src/builder/webpack.config.js", "build": "grunt build && webpack --config ./src/builder/webpack.config.js --production" }, "repository": { "type": "git", "url": "https://github.com/patrikx3/redis-ui-material.git" }, "keywords": [ "redis", "ui", "gui", "web", "electron", "desktop", "server", "angularjs", "javascript", "material", "dark", "light" ], "author": "Patrik Laszlo ", "license": "MIT", "devDependencies": { "clean-webpack-plugin": "^0.1.19", "concurrently": "^4.0.1", "corifeus-builder": "^2018.9.8-0", "css-loader": "^1.0.0", "extract-text-webpack-plugin": "^4.0.0-beta.0", "file-loader": "^2.0.0", "grunt-injector": "^1.1.0", "html-loader": "^0.5.5", "html-webpack-plugin": "^3.2.0", "node-sass": "^4.9.3", "optimize-css-assets-webpack-plugin": "^5.0.1", "raw-loader": "^0.5.1", "sass-loader": "^7.1.0", "style-loader": "^0.23.0", "uglifyjs-webpack-plugin": "^1.3.0", "webpack": "^4.17.2", "webpack-cli": "^3.1.0", "webpack-dev-server": "^3.1.8", "@fortawesome/fontawesome-free": "^5.3.1", "@uirouter/angularjs": "^1.0.20", "angular": "^1.7.4", "angular-animate": "^1.7.4", "angular-aria": "^1.7.4", "angular-cookies": "^1.7.4", "angular-material": "^1.1.10", "angular-messages": "^1.7.4", "jquery": "^3.3.1", "lodash": "^4.17.10", "material-design-icons-iconfont": "^3.0.3", "moment": "^2.22.2", "socket.io-client": "^2.1.1", "typeface-roboto": "0.0.54" }, "engines": { "node": ">=8.11.4" }, "homepage": "https://pages.corifeus.com/redis-ui-material", "dependencies": {} } redis-ui-material.iml000066400000000000000000000005171520051531700151000ustar00rootroot00000000000000 src/000077500000000000000000000000001520051531700116445ustar00rootroot00000000000000src/angular/000077500000000000000000000000001520051531700132755ustar00rootroot00000000000000src/angular/boot.js000066400000000000000000000022161520051531700145770ustar00rootroot00000000000000p3xr.ng = angular.module('p3x-redis-ui', [ 'ngCookies', 'ngAnimate', 'ngAria', 'ngMessages', 'ngMaterial', 'ui.router', ] ); require('./injector') p3xr.ng.config(($qProvider, $locationProvider, $stateProvider, p3xrThemeProvider) => { $qProvider.errorOnUnhandledRejections(false); $locationProvider.html5Mode(true); // $urlRouterProvider.otherwise('/'); // $httpProvider.interceptors.push('ngivrHttpInterceptor'); p3xrThemeProvider.start(); const routes = require('./routes') routes($stateProvider); }) p3xr.ng.run(($rootScope, p3xrSocket, p3xrTheme, $mdMedia, $state, $timeout) => { $rootScope.p3xr = p3xr; $rootScope.$mdMedia = $mdMedia; $rootScope.hasConnected = () => { if (Object.keys(p3xr.state.redisConnections).length === 0) { return false } return true; } //console.warn('p3xrTheme', p3xrTheme) p3xrTheme.start() console.info('P3X Redis UI ran') }) angular.element(document).ready(() => { const bootstrapElement = document.getElementById('p3x-redis-ui-bootstrap'); angular.bootstrap(bootstrapElement, ['p3x-redis-ui']); }) src/angular/dialog/000077500000000000000000000000001520051531700145345ustar00rootroot00000000000000src/angular/dialog/p3xr-dialog-connection.html000066400000000000000000000063761520051531700217240ustar00rootroot00000000000000

{{ options.type === 'new' ? $root.p3xr.strings.label.connectiondAdd : $root.p3xr.strings.label.connectiondEdit }}

close
{{ $root.p3xr.strings.form.error.required }}
{{ $root.p3xr.strings.form.error.port }}
{{ $root.p3xr.strings.intention.testConnection }} close {{ $root.p3xr.strings.intention.cancel }} {{ options.type === 'new' ? 'add' : 'save' }} {{ options.type === 'new' ? $root.p3xr.strings.intention.add : $root.p3xr.strings.intention.save }}
src/angular/dialog/p3xr-dialog-connection.js000066400000000000000000000115661520051531700213710ustar00rootroot00000000000000p3xr.ng.factory('p3xrDialogConnection', function (p3xrCommon, $mdDialog, p3xrSocket) { return new function () { this.show = async(options) => { try { const result = await $mdDialog.show({ controller: function ($scope, $mdDialog) { $scope.options = options if (options.model !== undefined) { $scope.model = options.model } else { $scope.model = { name: undefined, host: undefined, port: undefined, password: undefined, id: undefined, } } // Promise reject $scope.cancel = function () { p3xrCommon.toast({ message: p3xr.strings.status.cancelled }) $mdDialog.cancel(); }; /* // Promise resolve $scope.hide = function () { $mdDialog.hide(); }; // Promise resolve - with result $scope.answer = function (answer) { $mdDialog.hide(answer); }; */ const handleInvalidForm = () => { if ($scope.p3xrConnectionForm.$invalid) { p3xrCommon.toast({ message: p3xr.strings.form.error.invalid }) return false } return true } $scope.testConnection = async() => { $scope.p3xrConnectionForm.$setSubmitted(); if (!handleInvalidForm()) { return; } try { const response = await p3xrSocket.request({ action: 'redis-test-connection', payload: { model: $scope.model }, }) p3xrCommon.toast({ message: p3xr.strings.status.redisConnected }) } catch(e) { p3xrCommon.generalHandleError(e) } } $scope.submit = async () => { if (!handleInvalidForm()) { return; } if ($scope.model.host === undefined) { $scope.model.host = 'localhost' } if ($scope.model.port === undefined) { $scope.model.port = 6379 } if (options.type === 'new') { $scope.model.id = p3xr.nextId() } try { const response = await p3xrSocket.request({ action: 'connection-save', payload: { model: angular.copy($scope.model) }, }) p3xrCommon.toast({ message: $scope.options.type === 'new' ? p3xr.strings.status.added : p3xr.strings.status.saved }) //$scope.options.type = 'edit'; $mdDialog.cancel(); } catch(e) { p3xrCommon.generalHandleError(e) } } }, template: require('./p3xr-dialog-connection.html'), parent: angular.element(document.body), targetEvent: options.$event, clickOutsideToClose: true, // fullscreen: true // Only for -xs, -sm breakpoints. }) console.warn(result) } catch(error) { p3xrCommon.generalHandleError(error) } } } }); src/angular/factory/000077500000000000000000000000001520051531700147445ustar00rootroot00000000000000src/angular/factory/p3xr-common.js000066400000000000000000000026021520051531700174640ustar00rootroot00000000000000p3xr.ng.factory('p3xrCommon', function ($mdToast) { const generalHandleError = (dataOrError) => { if (dataOrError === undefined) { return; } if (! (dataOrError instanceof Error || dataOrError instanceof Object)) { dataOrError = new Error(dataOrError) } if (dataOrError instanceof Error || dataOrError.status === 'error') { let error if (dataOrError instanceof Error) { error = dataOrError } else { error = dataOrError.error } console.error(error) $mdToast.show( $mdToast.simple() .textContent(error.hasOwnProperty('message') ? error.message : error) .position(p3xr.settings.toast.position) .theme(p3xr.state.themeLayout) .hideDelay(p3xr.settings.toast.timeout) ); return false } return true } const toast = (options) => { $mdToast.show( $mdToast.simple() .textContent(options.message) .position(p3xr.settings.toast.position) .theme(p3xr.state.themeLayout) .hideDelay(p3xr.settings.toast.timeout) ); } return { generalHandleError: generalHandleError, toast: toast, }; }); src/angular/factory/p3xr-socket.js000066400000000000000000000075141520051531700174730ustar00rootroot00000000000000p3xr.ng.factory('p3xrSocket', function ($rootScope, p3xrCommon, $state) { // socket.io now auto-configures its connection when we ommit a connection url const ioOptions = { rejectUnauthorized: false, path: '/socket.io', transports: ['websocket'], secure: true, } const ioClient = io.connect(p3xr.api.host, ioOptions); let reconnect = false; ioClient.on('connect', async function () { if (reconnect) { console.log('p3xr-socket (socket) RE-connected', ioClient.id) //return; } else { console.log('p3xr-socket (socket) connected', ioClient.id) } reconnect = true; }) ioClient.on('disconnect', async function () { location.reload() }) ioClient.on('connections', (data) => { //console.log(data) if (!p3xrCommon.generalHandleError(data)) { p3xr.connectionsReset() return; } p3xr.state.connections = data.connections $rootScope.$digest() }) ioClient.on('redis-disconnected', async(data) => { if ($rootScope.p3xr.state.connection !== undefined && $rootScope.p3xr.state.connection.id === data.connectionId) { $rootScope.p3xr.state.connection = undefined; if (data.status === 'error') { p3xrCommon.toast({ message: p3xr.strings.status.redisDisconnected(data) }) } else if (data.status === 'code') { if (!p3xr.strings.code.hasOwnProperty(data.code)) { p3xrCommon.toast({ message: `unknown redis disconnect code: ${data.code}` }) } else { p3xrCommon.toast({ message: p3xr.strings.code[data.code] }) } } $state.go('main') try { await request({ action: 'trigger-redis-disconnect', enableResponse: false, }) } catch(e) { p3xrCommon.generalHandleError(e) } $rootScope.$digest(); } }) ioClient.on('redis-status', (data) => { $rootScope.p3xr.state.redisConnections = data.redisConnections //console.warn(data.redisConnections) $rootScope.$digest(); }) ioClient.on('error', p3xrCommon.generalHandleError) const request = (options) => { let { enableResponse } = options if (enableResponse !== false) { enableResponse = true } if (enableResponse) { return new Promise((resolve, reject) => { options.requestId = p3xr.nextId(); const responseEvent = `p3xr-response-${options.requestId}` let timeout const response = (data) => { clearTimeout(timeout) ioClient.off(responseEvent) if (data.status === 'ok') { resolve(data) } else { const error = new Error(data.error.message) reject(error) } $rootScope.$digest() } timeout = setTimeout(() => { ioClient.off(responseEvent, response) reject(new Error(`socket.io request timeout ${p3xr.settings.socket.timeout}ms`)); $rootScope.$digest() }, p3xr.settings.socket.timeout) ioClient.on(responseEvent, response) ioClient.emit('p3xr-request', options) }) } else { ioClient.emit('p3xr-request', options) } } return { ioClient: ioClient, request: request, }; }); src/angular/injector.js000066400000000000000000000010701520051531700154460ustar00rootroot00000000000000//injector-angular-start require('./dialog/p3xr-dialog-connection.js'); require('./factory/p3xr-common.js'); require('./factory/p3xr-socket.js'); require('./layout/p3xr-layout.js'); require('./pages/p3xr-console.js'); require('./pages/p3xr-main.js'); require('./pages/p3xr-overview.js'); require('./pages/p3xr-settings.js'); require('./provider/p3xr-theme.js'); require('./provider/theme-generator/p3xr-theme-dark.js'); require('./provider/theme-generator/p3xr-theme-light.js'); require('./ui/p3xr-accordion.js'); require('./ui/p3xr-button.js'); //injector-angular-endsrc/angular/layout/000077500000000000000000000000001520051531700146125ustar00rootroot00000000000000src/angular/layout/p3xr-layout.html000066400000000000000000000060701520051531700177120ustar00rootroot00000000000000
src/angular/layout/p3xr-layout.js000066400000000000000000000053111520051531700173570ustar00rootroot00000000000000p3xr.ng.component('p3xrLayout', { template: require('./p3xr-layout.html'), controller: function (p3xrTheme, $rootScope, p3xrSocket, p3xrCommon, $state) { this.setTheme = (theme) => { p3xrTheme.setTheme(p3xrTheme.generateThemeName(theme)) } this.openLink = { github: () => { window.open(`https://github.com/patrikx3/${p3xr.pkg.corifeus.reponame}`, `github-patrikx3-${p3xr.pkg.corifeus.reponame}`) } } Object.defineProperty(this, 'themeSelectedKey', { get: () => { let key = p3xr.state.theme key = key.slice('p3xrTheme'.length) key = key.toLowerCase() return key } }) this.connect = async (connection) => { connection = angular.copy(connection) try { const response = await p3xrSocket.request({ action: 'connection-connect', payload: { connection: connection, }, }) let dbIndex = 0 const databaseIndexes = [] console.warn(response) while(dbIndex < response.databases) { databaseIndexes.push(dbIndex++) } $rootScope.p3xr.state.databaseIndexes = databaseIndexes $rootScope.p3xr.state.connection = connection } catch(error) { $rootScope.p3xr.state.connection = undefined p3xrCommon.generalHandleError(error) } $rootScope.$digest() } this.disconnect = async () => { try { await p3xrSocket.request({ action: 'connection-disconnect', payload: { connectionId: p3xr.state.connection.id, }, }) $rootScope.p3xr.state.connection = undefined } catch(error) { p3xrCommon.generalHandleError(error) } $state.go('main') $rootScope.$digest() } Object.defineProperty(this, 'connectionName', { get: () => { if ($rootScope.p3xr.state.connection !== undefined) { return $rootScope.p3xr.strings.label.connected({ name: $rootScope.p3xr.state.connection.name }) } else { return $rootScope.p3xr.strings.intention.connect } } }) this.isMain = () => { return $state.current.name === 'main' } } }) src/angular/layout/p3xr-layout.scss000066400000000000000000000011141520051531700177130ustar00rootroot00000000000000@import '~angular-material/modules/scss/angular-material.layout-attributes'; $height: 64px; .p3xr-layout-content { margin-bottom: $height; margin-top: $height; padding: 5px; position: absolute; left: 0px; right: 0px; } .p3xr-layout-header-container { top: 0px; } .p3xr-layout-footer-container { bottom: 0px; } .p3xr-layout-header-container, .p3xr-layout-footer-container { position: fixed; z-index: 1; left: 0px; width: 100%; .md-toolbar-tools { height: $height !important; min-height: $height !important; max-height: $height !important; } } src/angular/pages/000077500000000000000000000000001520051531700143745ustar00rootroot00000000000000src/angular/pages/p3xr-console.html000066400000000000000000000011721520051531700176170ustar00rootroot00000000000000

{{ $root.p3xr.strings.label.console }}

src/angular/pages/p3xr-console.js000066400000000000000000000075161520051531700172770ustar00rootroot00000000000000p3xr.ng.component('p3xrConsole', { template: require('./p3xr-console.html'), controller: function(p3xrCommon, p3xrSocket, $state, $rootScope) { // .p3xr-layout-footer-container // .p3xr-layout-header-container // #p3xr-console-header // #p3xr-console-input // $window.height() let $container let $header; let $footer; let $consoleHeader let $input let $output let scrollers if (!$rootScope.hasConnected()) { $state.go('main') } const debounce = require('lodash/debounce') const resize = debounce(() => { let minus = 0 for(let item of [$header, $footer, $consoleHeader, $input]) { minus += item.outerHeight() } const windowHeight = $window.height() //console.log(windowHeight, minus) const outputHeight = Math.max(windowHeight - minus - 50, 100) $container.height(outputHeight) $container.css('max-height', `${outputHeight}px`) }, p3xr.settings.debounce) this.$onInit = () => { $container = $('#p3xr-console-content') $header = $('.p3xr-layout-header-container') $footer = $('.p3xr-layout-footer-container') $consoleHeader = $('#p3xr-console-header') $input = $('#p3xr-console-input') $output = $('#p3xr-console-content-output') $input.focus() scrollers = $container[0] $window.on('resize', resize) resize() this.clearConsole() } this.$onDestroy = function () { $window.off('resize', resize) }; this.inputValue = '' this.actionEnter = async() => { try { const enter = String(this.inputValue).trim() if (enter === '') { return; } $output.append(`
${enter}
`) this.inputValue = '' const response = await p3xrSocket.request({ action: 'console', payload: { command: enter } }) // console.warn(typeof response.result, response.result) if (typeof response.result === 'object') { let result = '' Object.keys(response.result).forEach(key => { if (result !== '') { result += "\n" } result += response.result[key] }) $output.append(`
${result}
`) } else { $output.append(`
${response.result}
`) } if (response.hasOwnProperty('database')) { $rootScope.p3xr.state.currentDatabase = response.database } } catch(e) { $output.append(`
${e.message}
`) } finally { //console.log(scrollers.scrollHeight, scrollers.scrollTop, scrollers.height) scrollers.scrollTop = scrollers.scrollHeight; //$output.scrollTop($output.prop("scrollHeight")); $input.focus() } } this.action = ($event) => { console.warn($event.keyCode) switch($event.keyCode) { case 13: return this.actionEnter() } } this.clearConsole = () => { $output.empty() $output.append('
' + $rootScope.p3xr.strings.label.welcomeConsole + '
') $input.focus() } } }) src/angular/pages/p3xr-console.scss000066400000000000000000000010731520051531700176260ustar00rootroot00000000000000p3xr-console { #p3xr-console-content { font-family: monospace, monospace !important; $minWidthCalc: 20px; text-align: center; #p3xr-console-content-output { pre { font-family: monospace, monospace !important; } min-width: calc(100% - #{$minWidthCalc}); text-align: left; .p3xr-console-content-output-item:before { content: "> "; opacity: 0.5; } } input { min-width: calc(100% - 40px); position: fixed; bottom: 75px; left: 10px; right: 10px; } } }src/angular/pages/p3xr-main.html000066400000000000000000000035601520051531700171040ustar00rootroot00000000000000

{{ $root.p3xr.strings.intention.main }}

{{ $root.p3xr.strings.form.main.label.database }}: {{ $root.p3xr.strings.form.main.label.database }} {{ dbIndex }}
{{ $root.p3xr.strings.title.main }}
{{ $root.p3xr.strings.intention.noConnections }}
src/angular/pages/p3xr-main.js000066400000000000000000000054621520051531700165570ustar00rootroot00000000000000p3xr.ng.component('p3xrMain', { template: require('./p3xr-main.html'), controller: function($cookies, p3xrSocket) { const cookieNameCurrentDatabase = 'p3xr-main-current-database' let $container let $header; let $footer; let $consoleHeader let scrollers const debounce = require('lodash/debounce') const resize = debounce(() => { let minus = 0 for(let item of [$header, $footer, $consoleHeader]) { minus += item.outerHeight() } const windowHeight = $window.height() //console.log(windowHeight, minus) const outputHeight = Math.max(windowHeight - minus- 28, 100) $container.height(outputHeight) $container.css('max-height', `${outputHeight}px`) }, p3xr.settings.debounce) this.$onInit = () => { $container = $('#p3xr-main-content') $header = $('.p3xr-layout-header-container') $footer = $('.p3xr-layout-footer-container') $consoleHeader = $('#p3xr-main-header') scrollers = $container[0] resize() $window.on('resize', resize) } this.$onDestroy = function () { $window.off('resize', resize) }; let selectedDatabase = 0 let currentDatabase Object.defineProperty(this, 'currentDatabase', { get: () => { let currentDatabase = p3xr.state.currentDatabase if (currentDatabase === undefined) { currentDatabase = $cookies.get(cookieNameCurrentDatabase + '-' + p3xr.state.connection.id) } if (currentDatabase === undefined) { currentDatabase = 0; } return currentDatabase; }, set: async(value) => { currentDatabase = value if (selectedDatabase !== currentDatabase) { selectedDatabase = value try { const response = await p3xrSocket.request({ action: 'console', payload: { command: `select ${selectedDatabase}` } }) } catch(e) { p3xrCommon.generalHandleError(e) } } $cookies.put(cookieNameCurrentDatabase + '-' + p3xr.state.connection.id, String(value), { expires: p3xr.settings.cookieExpiry, }) } }) this.selectDatabase = async(selectDbIndex) => { this.currentDatabase = selectDbIndex alert(selectDbIndex) } } }) src/angular/pages/p3xr-overview.html000066400000000000000000000016531520051531700200270ustar00rootroot00000000000000 {{ $root.p3xr.strings.page.overview.overviewClients }}

{{ connectionValue.connection.name }}

{{ connectionValue.connection.name }}:{{ connectionValue.connection.port }}

{{ $root.p3xr.strings.page.overview.connectedCount({ length: connectionValue.clients.length }) }}

src/angular/pages/p3xr-overview.js000066400000000000000000000003371520051531700174750ustar00rootroot00000000000000p3xr.ng.component('p3xrOverview', { template: require('./p3xr-overview.html'), controller: function($rootScope, $state) { if (!$rootScope.hasConnected()) { $state.go('main') } } }) src/angular/pages/p3xr-settings.html000066400000000000000000000035371520051531700200240ustar00rootroot00000000000000
{{ $root.p3xr.strings.intention.noConnectionsInSettings }}

{{connection.name}}

{{connection.host}}:{{connection.port}}

edit {{ $root.p3xr.strings.intention.edit }} {{ $root.p3xr.strings.intention.edit }} delete_forever {{ $root.p3xr.strings.intention.delete }} {{ $root.p3xr.strings.intention.delete }}
src/angular/pages/p3xr-settings.js000066400000000000000000000026331520051531700174700ustar00rootroot00000000000000p3xr.ng.component('p3xrSettings', { template: require('./p3xr-settings.html'), controller: function(p3xrCommon, p3xrDialogConnection, $mdDialog, p3xrSocket) { this.connectionForm = (options) => { p3xrDialogConnection.show(options) } this.deleteConnection = async (options) => { const { model, ev } = options; const confirm = $mdDialog.confirm() .title(p3xr.strings.title.confirm.deleteConnection) .textContent(p3xr.strings.title.confirm.deleteConnectionText) .targetEvent(ev) .ok(p3xr.strings.intention.delete) .cancel(p3xr.strings.intention.cancel); try { await $mdDialog.show(confirm); const response = await p3xrSocket.request({ action: 'connection-delete', payload: { id: model.id }, }) p3xrCommon.toast({ message: p3xr.strings.status.deleted }); } catch(error) { if (error === undefined) { p3xrCommon.toast({ message: p3xr.strings.status.cancelled }); return; } p3xrCommon.generalHandleError(error) } } } }) src/angular/provider/000077500000000000000000000000001520051531700151275ustar00rootroot00000000000000src/angular/provider/p3xr-theme.js000066400000000000000000000055031520051531700174640ustar00rootroot00000000000000p3xr.ng.provider('p3xrTheme', function p3xrThemeProvider($mdThemingProvider, ) { const selfProvider = this; $mdThemingProvider.generateThemesOnDemand(true); $mdThemingProvider.alwaysWatchTheme(true); $mdThemingProvider.setNonce(); const themeCookieName = 'p3xr-theme' const themeDefault = 'p3xrThemeLight'; this.start = () => { // console.warn('ngivrTheme we are in the provider eg: config')( Object.keys(p3xr.theme).forEach(theme => { //console.warn('provider theme: ', theme) p3xr.theme[theme]($mdThemingProvider) }) $mdThemingProvider.setDefaultTheme(themeDefault); } const themeIsGenerated = {}; // this is the service eg: ngivrTheme this.$get = ['$mdTheming', '$rootScope' , '$cookies', function p3xxThemeFactory($mdTheming, $rootScope, $cookies ) { // let's assume that the UnicornLauncher constructor was also changed to // accept and use the useTinfoilShielding argument return new function p3xrTheme() { const self = this; this.start = () => { // console.log(selfProvider); // console.log('ngivrTheme we are in the service eg: run or injector') self.setTheme(); } this.setTheme = (themeName) => { if (themeName === undefined) { themeName = $cookies.get(themeCookieName) if (themeName === undefined) { themeName = themeDefault } } //console.warn(`theme will generate theme on the fly: ${theme}`); if (!themeIsGenerated.hasOwnProperty(themeName)) { //console.warn(`theme generating theme on the fly: ${theme}`); $mdTheming.generateTheme(themeName); $mdTheming.generateTheme(`${themeName}Layout`); $mdTheming.generateTheme(`${themeName}Common`); themeIsGenerated[themeName] = true; } //console.warn(themeIsGenerated) //console.warn(`theme registered: ${$mdTheming.registered(theme)}`); $mdThemingProvider.setDefaultTheme(themeName); $rootScope.p3xr.state.theme = themeName; const expiry = new Date(); expiry.setFullYear(expiry.getFullYear() + 1) $cookies.put(themeCookieName, themeName, {expires: expiry}); } this.getCurrentThemeName = () => { return $cookies.get(themeCookieName); } this.generateThemeName = (themeNameRaw) => { const generateThemeName = 'p3xrTheme' + themeNameRaw[0].toUpperCase() + themeNameRaw.substring(1) return generateThemeName; } }; }]; }); src/angular/provider/theme-generator/000077500000000000000000000000001520051531700202155ustar00rootroot00000000000000src/angular/provider/theme-generator/p3xr-theme-dark.js000066400000000000000000000020351520051531700234660ustar00rootroot00000000000000p3xr.theme.dark = function ($mdThemingProvider) { $mdThemingProvider.theme(`p3xrThemeDarkLayout`) .primaryPalette('grey', { 'default': '800', 'hue-1': '50', 'hue-2': '700', 'hue-3': '900', }) .accentPalette('grey') .warnPalette('blue-grey') .backgroundPalette('grey', { 'default': 'A700', 'hue-1': '800', 'hue-2': '700', 'hue-3': '900', }) ; $mdThemingProvider.theme(`p3xrThemeDarkLayout`).dark() $mdThemingProvider.theme(`p3xrThemeDark`) .primaryPalette('blue-grey') .accentPalette('teal') .warnPalette('red') .backgroundPalette('grey') ; $mdThemingProvider.theme(`p3xrThemeDark`).dark() $mdThemingProvider.theme(`p3xrThemeDarkCommon`) .primaryPalette('light-green') .accentPalette('deep-orange') .warnPalette('lime') .backgroundPalette('grey') ; $mdThemingProvider.theme(`p3xrThemeDarkCommon`).dark() } src/angular/provider/theme-generator/p3xr-theme-light.js000066400000000000000000000016331520051531700236570ustar00rootroot00000000000000p3xr.theme.light = function ($mdThemingProvider, p3xrThemeNameGenerator) { $mdThemingProvider.theme('p3xrThemeLightLayout') .primaryPalette('blue-grey', { 'default': '800', 'hue-1': '50', 'hue-2': '700', 'hue-3': '900', }) .accentPalette('blue-grey') .warnPalette('red') .backgroundPalette('blue-grey', { 'default': 'A100', 'hue-1': '50', 'hue-2': '700', 'hue-3': '900', }) ; $mdThemingProvider.theme(`p3xrThemeLight`) .primaryPalette('deep-purple') .accentPalette('purple') .warnPalette('red') .backgroundPalette('blue-grey') ; $mdThemingProvider.theme(`p3xrThemeLightCommon`) .primaryPalette('green') .accentPalette('orange') .warnPalette('yellow') .backgroundPalette('blue-grey') ; } src/angular/routes.js000066400000000000000000000011231520051531700151510ustar00rootroot00000000000000const routes = ($stateProvider) => { $stateProvider.state({ name: 'settings', url: '/settings', template: '' }) $stateProvider.state({ name: 'main', url: '/', template: '' }) $stateProvider.state({ name: 'overview', url: '/overview', template: '' }) $stateProvider.state({ name: 'console', url: '/console', template: '' }) } module.exports = routessrc/angular/ui/000077500000000000000000000000001520051531700137125ustar00rootroot00000000000000src/angular/ui/p3xr-accordion.html000066400000000000000000000014121520051531700174310ustar00rootroot00000000000000

{{ $ctrl.p3xrTitle }}

{{ !$ctrl.extended ? 'keyboard_arrow_down' : 'keyboard_arrow_up' }} {{ !$ctrl.extended ? $root.p3xr.strings.intention.extend : $root.p3xr.strings.intention.collapse}}
src/angular/ui/p3xr-accordion.js000066400000000000000000000025001520051531700171000ustar00rootroot00000000000000let accordionKey = 0 p3xr.ng.component('p3xrAccordion', { template: require('./p3xr-accordion.html'), bindings: { p3xrTitle: '<', p3xrAccordionKey: '@', }, transclude: { 'actions': '?p3xrAccordionActions', 'content': 'p3xrAccordionContent', }, controller: function ($transclude, $cookies) { this.transcludePresent = function (slot) { return $transclude.isSlotFilled(slot); }; this.$onInit = function() { //console.log(this.p3xrAccordionKey) if (this.p3xrAccordionKey === undefined || this.p3xrAccordionKey === '') { console.log('wrong') this.p3xAccordionKey = ++accordionKey; } const cookieName = `p3xr-accordion-extended-${this.p3xrAccordionKey}` //console.log(cookieName) Object.defineProperty(this, 'extended', { get: () => { const cookieValue = $cookies.get(cookieName) return cookieValue === undefined ? true : cookieValue === 'true' }, set: (value) => { $cookies.put(cookieName, String(value), { expires: p3xr.settings.cookieExpiry, }) } }) } } }) src/angular/ui/p3xr-button.html000066400000000000000000000006321520051531700170060ustar00rootroot00000000000000 {{ $ctrl.p3xrMdIcon }} {{ $ctrl.p3xrLabel }} {{ $ctrl.p3xrLabel }} src/angular/ui/p3xr-button.js000066400000000000000000000003601520051531700164540ustar00rootroot00000000000000p3xr.ng.component('p3xrButton', { template: require('./p3xr-button.html'), bindings: { p3xrLabel: '<', p3xrMdIcon: '@', p3xrFaIcon: '@', p3xrTooltipDirection: '@', p3xrClasses: '@' }, }) src/builder/000077500000000000000000000000001520051531700132725ustar00rootroot00000000000000src/builder/webpack.config.js000066400000000000000000000142321520051531700165120ustar00rootroot00000000000000const webpack = require('webpack'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const fileAsset = `[name].[hash].[ext]`; const minimize = process.argv.includes('--production'); const mode = minimize ? 'development' : 'production'; const filenamePrefix = minimize ? '[name].[hash]' : '[name]' let minimizer = undefined; const top = process.cwd() const buildDir = top + `/dist`; let devtool; const basePath = __dirname; const targetPath = '../..'; const targetFolder = 'dist'; const pkg = require('../../package') const plugins = [ new HtmlWebpackPlugin({ template: `${top}/src/index.html`, inject: 'head', chunksSortMode: 'dependency', chunks: ['bundle'], title: pkg.description, minify: minimize }), new ExtractTextPlugin({ filename: `${filenamePrefix}.css`, disable: false, allChunks: true }), ]; if (minimize) { const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); plugins.unshift( new CleanWebpackPlugin([targetFolder], { root: basePath + '/' + targetPath }) ) plugins.push( new OptimizeCssAssetsPlugin({ assetNameRegExp: /\.css$/g, // cssProcessor: require('cssnano'), // cssProcessorOptions: { safe: true, discardComments: { removeAll: true } }, canPrint: true }) ) devtool = false; const bannerText = require('corifeus-builder').utils.license(); minimizer = [ new UglifyJsPlugin({ sourceMap: true, parallel: true, cache: true, extractComments: { condition: /^\**!|@preserve|@license|@cc_on/, file: function (fileName) { return `${fileName}.LICENSE.txt`; }, banner: function (webpackBanner) { return ` ${bannerText} For more information about all licenses, please see ${webpackBanner} `; } }, uglifyOptions: { compress: { warnings: false }, ecma: 8, // todo found out if mangle use or not // mangle: false === keep function names // mangle: true === drop function names mangle: false, sourceMap: true, comments: false, beautify: false }, }), ] plugins.push( new webpack.BannerPlugin({ banner: bannerText, include: /\.css$/, exclude: /\.ts$|\.js$/, // hash:[hash], chunkhash:[chunkhash], name:[name], filebase:[filebase], query:[query], file:[file] }) ) plugins.push( new webpack.SourceMapDevToolPlugin({ filename: 'sourcemaps/[file].map', append: '\n//# sourceMappingURL=./[url]' }) ) } const fileLoader = [ { loader: 'file-loader', options: { name: fileAsset, outputPath: 'assets', context: 'assets', // publicPath: 'webpack/assets', // useRelativePath: true, } } ] module.exports = { // watch: true, devtool: devtool, entry: { bundle: top + "/src/bundle.js", }, output: { path: buildDir, filename: `${filenamePrefix}.js`, chunkFilename: '[id].chunk.js', // publicPath: '{{ app.url_subdir }}/webpack/', publicPath: ``, }, module: { rules: [ { test: /\.(scss|css)$/, // exclude: [`${cwd}/src/assets/ngivr.scss`], use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: [ { loader: 'css-loader', options: { sourceMap: true, minimize: minimize === true } } , 'sass-loader'], }) }, { test: /\.html$/, use: [{ loader: 'html-loader', options: { minimize: mode, caseSensitive: true } }] }, { test: /\.(png|jpe?g|gif|ico)$/, use: fileLoader }, { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, use: fileLoader }, { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, use: fileLoader }, { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: fileLoader }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: fileLoader }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: fileLoader }, { test: /\.css$/, use: ExtractTextPlugin.extract({ // fallback: "style-loader", use: [ { loader: 'css-loader', options: { minimize: minimize, sourceMap: true }, }] }) } ] }, optimization: { minimize: minimize, minimizer: minimizer }, plugins: plugins, mode: mode, devServer: { host: '0.0.0.0', disableHostCheck: true, historyApiFallback: { rewrites: [ {from: /.*\..*/, to: '/index.html'} ] }, hot: true, inline: true, stats: { colors: true }, clientLogLevel: 'none', progress: true, noInfo: false }, } src/bundle.js000066400000000000000000000015151520051531700134550ustar00rootroot00000000000000require('typeface-roboto'); require('./scss/index.scss') // fontawesome require('@fortawesome/fontawesome-free/js/all') // jquery global.$ = require('jquery/dist/jquery.slim') global.jQuery = global.$ global.$window = $(window); // socket global.io = require('socket.io-client') // angular global.angular = require('angular'); require('angular-aria'); require('angular-messages'); require('angular-animate'); require('angular-cookies'); require('@uirouter/angularjs') require('angular-material'); require('./decorate/string') global.p3xr = global.p3xr || {} require('./core/strings') require('./core/settings') require('./core/random') require('./core/next-id') require('./core/api') require('./core/state') p3xr.pkg = require('../../package') p3xr.theme = { dark: undefined, light: undefined, } require('./angular/boot'); src/core/000077500000000000000000000000001520051531700125745ustar00rootroot00000000000000src/core/api.js000066400000000000000000000003521520051531700137030ustar00rootroot00000000000000global.p3xr.api = { host: undefined, } const apiUrl = new URL(location.toString()) if (apiUrl.port === "8080") { global.p3xr.api.host = 'https://localhost:7843' } else { global.p3xr.api.host = `https://${apiUrl.host}` } src/core/next-id.js000066400000000000000000000010611520051531700145000ustar00rootroot00000000000000let currentId = 0 let currentIdTime = Date.now() global.p3xr.nextId = () => { const now = Date.now(); if (currentIdTime !== now) { currentId = 0; currentIdTime = now } const comingId = ++currentId; const randomHex = global.p3xr.random().reverse().padStart(15, '0'); const timeHex = currentIdTime.toString(16).padStart(12, '0').reverse() const comingIdHex = comingId.toString(16).padStart(3, '0').reverse(); const newId = `P3Xid${timeHex}${comingIdHex}${randomHex}`; //console.log(newId) return newId } src/core/random.js000066400000000000000000000002211520051531700144050ustar00rootroot00000000000000global.p3xr.random = () => { return (Math.floor(Math.random() * (99999999999999999 - 10000000000000000)) + 10000000000000000).toString(16) } src/core/settings.js000066400000000000000000000004271520051531700147750ustar00rootroot00000000000000const cookieExpiry = new Date() cookieExpiry.setFullYear(cookieExpiry.getFullYear() + 5) p3xr.settings = { socket: { timeout: 5000, }, toast: { timeout: 5000, position: 'bottom right', }, debounce: 250, cookieExpiry: cookieExpiry, }src/core/state.js000066400000000000000000000010151520051531700142470ustar00rootroot00000000000000p3xr.state = { theme: undefined, connection: undefined, currentDatabase: undefined, databaseIndexes: [0], connections: [], redisConnections: {} } Object.defineProperty(p3xr.state, 'themeLayout', { get: () => { return p3xr.state.theme + 'Layout' } }) Object.defineProperty(p3xr.state, 'themeCommon', { get: () => { return p3xr.state.theme + 'Common' } }) p3xr.connectionsReset = () => { p3xr.state.connections = { list: [] } } p3xr.connectionsReset()src/core/strings.js000066400000000000000000000001451520051531700146230ustar00rootroot00000000000000p3xr.translations = { en: require('../strings/en/strings') } p3xr.strings = p3xr.translations.en src/decorate/000077500000000000000000000000001520051531700134325ustar00rootroot00000000000000src/decorate/string.js000066400000000000000000000002071520051531700152750ustar00rootroot00000000000000if (!String.prototype.reverse) { String.prototype.reverse = function () { return this.split('').reverse().join('') } } src/index.html000066400000000000000000000006011520051531700136360ustar00rootroot00000000000000 P3X Redis UI src/injector.scss000066400000000000000000000002031520051531700143510ustar00rootroot00000000000000//injector-sass-start @import "./angular/layout/p3xr-layout.scss"; @import "./angular/pages/p3xr-console.scss"; //injector-sass-endsrc/jquery/000077500000000000000000000000001520051531700131635ustar00rootroot00000000000000src/jquery/center.js000066400000000000000000000004071520051531700150020ustar00rootroot00000000000000$.fn.center = function () { this.css("position", "fixed"); this.css("top", ($window.height() - this.height()) / 2 + $window.scrollTop() + "px"); this.css("left", ($window.width() - this.width()) / 2 + $window.scrollLeft() + "px"); return this; }; src/scss/000077500000000000000000000000001520051531700126175ustar00rootroot00000000000000src/scss/index.scss000066400000000000000000000010271520051531700146230ustar00rootroot00000000000000@import '~material-design-icons-iconfont/dist/material-design-icons.css'; @import '~angular-material/angular-material.css'; #p3x-redis-ui-bootstrap { height: 100vh; } .fa, .fas, .fab, far, .svg-inline--fa { transform: scale(1.5) !important; margin-right: 5px !important; margin-left: 5px !important; } .md-button { min-width: auto; } input:-webkit-autofill { background-color: transparent !important;; } .p3xr-md-menu-item-selected { background-color: rgba(128, 128, 128, 0.5) !important; } @import '../injector'; src/strings/000077500000000000000000000000001520051531700133355ustar00rootroot00000000000000src/strings/en/000077500000000000000000000000001520051531700137375ustar00rootroot00000000000000src/strings/en/strings.js000066400000000000000000000054731520051531700157770ustar00rootroot00000000000000const strings = { title: { name: 'P3X Redis UI', main: 'You may choose a REDIS connection to connect from the left bottom menu.', confirm: { deleteConnection: 'Confirm', deleteConnectionText: 'Are you sure to delete this Redis connection?' }, }, intention: { refresh: 'Refresh', clear: 'Clear', main: 'Home', cancel: 'Cancel', theme: 'Theme', github: 'GitHub', settings: 'Settings', connect: 'Connect', disconnect: 'Disconnect', overview: 'Overview', console: 'Console', noConnections: 'No connections, add a connection in the settings menu.', noConnectionsInSettings: 'No connections, you may add a NEW CONNECTION above.', connectionAdd: 'New connection', extend: 'Extend', collapse: 'Collapse', add: 'Add', edit: 'Edit', save: 'Save', 'delete': 'Remove', testConnection: 'Test connection', }, label: { welcomeConsole: 'Welcome to the Redis Console', console: 'Console', connectiondAdd: 'Add connection', connectiondEdit: 'Edit connection', connections: 'Connections', theme: { light: 'Light', dark: 'Dark', }, connected: (opts) => { return `Connected: ${opts.name}` } }, status: { redisConnected: 'Redis connected successful', added: 'Added', saved: 'Updated', cancelled: 'Cancelled', deleted: 'Deleted', redisDisconnected: (opts) => { return `The current connection had an error: ${opts.error.message}` } }, code: { 'delete-connection': 'This connection was deleted, so you are disconnected to this Redis instance.', 'save-connection': 'This connection was changed, so you are disconnected to this Redis instance. You may re-connect.', }, form: { error: { required: 'Required', port: 'The port is between 1-65535', invalid: 'The form is invalid' }, connection: { label: { name: 'Name', host: 'Hostname', port: 'Port', password: 'Password', }, }, main: { label: { database: 'DB', } } }, page: { overview: { noConnected: 'There is no connection to Redis.', overviewClients: 'List the connected by the count of clients', connectedCount: (opt) => { if (opt.length === 1) { return '1 client' } return `${opt.length} clients` } } } } module.exports = strings;