Repository: cpsubrian/redis-explorer
Branch: master
Commit: fc8e9d10848e
Files: 66
Total size: 138.7 KB
Directory structure:
gitextract_o7xj8uxf/
├── .gitignore
├── Gruntfile.js
├── LICENSE
├── Makefile
├── README.md
├── fonts/
│ ├── .gitkeep
│ ├── MaterialIcons/
│ │ └── MaterialIcons.css
│ └── Roboto/
│ ├── LICENSE.txt
│ └── Roboto.css
├── images/
│ └── .gitkeep
├── index.html
├── package.json
├── resources/
│ ├── .gitkeep
│ ├── redisexplorer.icns
│ └── redisexplorer.psd
├── src/
│ ├── actions/
│ │ ├── browseActions.js
│ │ └── hostsActions.js
│ ├── alt.js
│ ├── app.js
│ ├── browser.js
│ ├── components/
│ │ ├── Header.js
│ │ ├── Highlight.js
│ │ ├── HostInfo.js
│ │ ├── HostsNav.js
│ │ ├── Icon.js
│ │ ├── KeyDetails.js
│ │ ├── LoadingRow.js
│ │ ├── ScrollList.js
│ │ ├── SidePanel.js
│ │ ├── TypeIcon.js
│ │ ├── ValuesRow.js
│ │ ├── ValuesTable.js
│ │ ├── details/
│ │ │ ├── Details.js
│ │ │ ├── HashDetails.js
│ │ │ ├── ListDetails.js
│ │ │ ├── SetDetails.js
│ │ │ ├── SortedSetDetails.js
│ │ │ └── StringDetails.js
│ │ └── handlers/
│ │ ├── BrowseHandler.js
│ │ ├── InfoHandler.js
│ │ ├── MainHandler.js
│ │ └── NotFoundHandler.js
│ ├── conf.js
│ ├── main.js
│ ├── router.js
│ ├── stores/
│ │ ├── browseStore.js
│ │ └── hostsStore.js
│ └── utils/
│ ├── db.js
│ ├── keys.js
│ ├── perf.js
│ ├── regex.js
│ ├── settings.js
│ ├── spawn.js
│ └── throttle.js
└── styles/
├── .gitkeep
├── components/
│ ├── header.less
│ ├── key-details.less
│ └── values-table.less
├── handlers/
│ ├── browse.less
│ ├── info.less
│ └── main.less
├── index.less
└── utils/
├── highlight.less
├── material-colors.less
├── mixins.less
└── variables.less
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.DS_Store
.swp
build
dist
installer
node_modules
coverage
npm-debug.log
================================================
FILE: Gruntfile.js
================================================
var electron = require('electron-prebuilt')
var packagejson = require('./package.json')
var conf = require('./src/conf.js')
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt)
var BASENAME = conf['BASENAME']
var APPNAME = BASENAME
var DEVELPER_ID = conf['DEVELPER_ID']
var COMPANY = conf['COMPANY']
var ICON = conf['ICON']
var ICON_URL = conf['ICON_URL']
var BUNDLE_ID = conf['BUNDLE_ID']
var OSX_OUT = conf['OSX_OUT']
var OSX_FILENAME = conf['OSX_FILENAME']
var ELECTRON_VERSION = require('./node_modules/electron-prebuilt/package.json').version
var target = grunt.option('target') || 'development'
var env = process.env
var certificateFile = grunt.option('certificateFile')
var certificatePassword = grunt.option('certificatePassword')
env.NODE_PATH = '..:' + env.NODE_PATH
env.NODE_ENV = target
grunt.initConfig({
IDENTITY: 'Developer ID Application: ' + DEVELPER_ID,
APPNAME: APPNAME,
OSX_OUT: OSX_OUT,
OSX_FILENAME: OSX_FILENAME,
OSX_FILENAME_ESCAPED: OSX_FILENAME.replace(' ', '\\ ').replace('(', '\\(').replace(')', '\\)'),
// Electron
electron: {
windows: {
options: {
name: BASENAME,
dir: 'build',
out: 'dist',
version: ELECTRON_VERSION,
platform: 'win32',
arch: 'x64',
asar: true,
icon: ICON + '.ico'
}
},
osx: {
options: {
name: APPNAME,
dir: 'build',
out: 'dist',
version: ELECTRON_VERSION,
platform: 'darwin',
arch: 'x64',
asar: true,
'app-bundle-id': BUNDLE_ID
}
}
},
// Edits .exe files.
rcedit: {
exes: {
files: [{
expand: true,
cwd: 'dist/' + BASENAME + '-win32',
src: [BASENAME + '.exe']
}],
options: {
icon: ICON + '.ico',
'file-version': packagejson.version,
'product-version': packagejson.version,
'version-string': {
'CompanyName': COMPANY,
'ProductVersion': packagejson.version,
'ProductName': APPNAME,
'FileDescription': APPNAME,
'InternalName': BASENAME + '.exe',
'OriginalFilename': BASENAME + '.exe',
'LegalCopyright': 'Copyright 2015 ' + COMPANY + ' All rights reserved.'
}
}
}
},
// Windows installer options.
'create-windows-installer': {
appDirectory: 'dist/' + BASENAME + '-win32/',
authors: COMPANY,
// loadingGif: 'resources/loading.gif',
// setupIcon: 'resources/setup.ico',
iconUrl: ICON_URL,
description: APPNAME,
title: APPNAME,
exe: BASENAME + '.exe',
version: packagejson.version,
signWithParams: '/f ' + certificateFile + ' /p ' + certificatePassword + ' /tr http://timestamp.comodoca.com/rfc3161'
},
// Copy files.
copy: {
dev: {
files: [{
expand: true,
cwd: '.',
src: ['package.json', 'conf.json', 'index.html'],
dest: 'build/'
}, {
expand: true,
cwd: 'images/',
src: ['**/*'],
dest: 'build/images/'
}, {
expand: true,
cwd: 'fonts/',
src: ['**/*'],
dest: 'build/fonts/'
}, {
expand: true,
cwd: 'node_modules/material-design-icons/iconfont/',
src: ['MaterialIcons-Regular.woff2'],
dest: 'build/fonts/MaterialIcons/'
}, {
expand: true,
cwd: 'node_modules/',
src: Object.keys(packagejson.dependencies).map(function (dep) { return dep + '/**/*' }),
dest: 'build/node_modules/'
}, {
src: ICON + '.png',
dest: 'build/images/logo.png'
}]
},
windows: {
files: [{
expand: true,
cwd: 'resources',
src: [],
dest: 'dist/' + BASENAME + '-win32/resources/resources/'
}],
options: {
mode: true
}
},
osx: {
files: [{
expand: true,
cwd: 'resources',
src: [],
dest: '<%= OSX_FILENAME %>/Contents/Resources/resources/'
}, {
src: ICON + '.icns',
dest: '<%= OSX_FILENAME %>/Contents/Resources/atom.icns'
}],
options: {
mode: true
}
}
},
// Javascript (Babel)
babel: {
options: {
stage: 0,
sourceMap: 'inline',
blacklist: 'regenerator'
},
dist: {
files: [{
expand: true,
cwd: 'src/',
src: ['**/*.js'],
dest: 'build/'
}]
}
},
// Styles (LESS)
less: {
options: {
sourceMapFileInline: true
},
dist: {
files: {
'build/main.css': 'styles/index.less'
}
}
},
// Rename files.
rename: {
installer: {
src: 'installer/Setup.exe',
dest: 'installer/' + BASENAME + 'Setup-' + packagejson.version + '.exe'
}
},
// Shell options.
shell: {
electron: {
command: electron + ' build',
options: {
async: true,
execOptions: {
env: env
}
}
},
sign: {
options: {
failOnError: false
},
command: [
'codesign --deep -v -f -s "<%= IDENTITY %>" <%= OSX_FILENAME_ESCAPED %>/Contents/Frameworks/*',
'codesign -v -f -s "<%= IDENTITY %>" <%= OSX_FILENAME_ESCAPED %>',
'codesign -vvv --display <%= OSX_FILENAME_ESCAPED %>',
'codesign -v --verify <%= OSX_FILENAME_ESCAPED %>'
].join(' && ')
},
zip: {
command: 'ditto -c -k --sequesterRsrc --keepParent <%= OSX_FILENAME_ESCAPED %> <%= OSX_OUT %>/' + BASENAME + '-' + packagejson.version + '.zip'
}
},
// Clean options
clean: {
release: ['build/', 'dist/', 'installer/']
},
// Live Reload
watchChokidar: {
options: {
spawn: true
},
livereload: {
options: {livereload: true},
files: ['build/**/*']
},
js: {
files: ['src/**/*.js'],
tasks: ['newer:babel']
},
less: {
files: ['styles/**/*.less'],
tasks: ['less']
},
copy: {
files: ['images/*', 'index.html', 'fonts/*'],
tasks: ['newer:copy:dev']
}
}
})
// Define default (development) task.
grunt.registerTask('default', ['newer:babel', 'less', 'newer:copy:dev', 'shell:electron', 'watchChokidar'])
// Define platform-specific release task.
if (process.platform === 'win32') {
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'rcedit:exes', 'create-windows-installer', 'rename:installer'])
} else {
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron:osx', 'copy:osx', 'shell:sign', 'shell:zip'])
}
// Bail-out on electron command if this dies.
process.on('SIGINT', function () {
grunt.task.run(['shell:electron:kill'])
process.exit(1)
})
}
================================================
FILE: LICENSE
================================================
Copyright 2015 Terra Eclipse, Inc.
http://www.terraeclipse.com/
Copyright 2015 Brian Link
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: Makefile
================================================
all: install dev
install:
@echo ""
@test -d ./node_modules || npm install
dev:
@echo ""
@./node_modules/.bin/standard ./src/**/*.js
@./node_modules/.bin/grunt
release: install
@echo ""
@./node_modules/.bin/grunt release --target="production"
run:
@echo ""
@open ./dist/RedisExplorer-darwin-x64/RedisExplorer.app
copy:
@echo ""
@rm -Rf /Applications/RedisExplorer.app
@cp -R ./dist/RedisExplorer-darwin-x64/RedisExplorer.app /Applications/
.PHONY: install
.PHONY: dev
.PHONY: release
.PHONY: run
.PHONY: copy
================================================
FILE: README.md
================================================
RedisExplorer
==============
An [electron](http://electron.atom.io/)-powered GUI for [redis](http://redis.io/).

Installation
------------
Currently, I'm only building for Mac OSX, but that may change as the feature-set
becomes more stable.
You'll find all the latest releases [here](https://github.com/cpsubrian/redis-explorer/releases).
Connecting to Remote Hosts
--------------------------
The app currently **only** supports connecting to remote hosts via an ssh tunnel
via your local `ssh-agent` and **no password**. Right now only redis servers
running on the default port can be connected to, but many more configuration
options are on the roadmap.
Available hosts will be parsed from your `~/.ssh/config`, which should contain
entries like:
```
Host myhost
Hostname [ip address]
User [username]
Host anotherhost
Hostname [ip address]
Port [port]
User [username]
```
Development
-----------
I would love to add **your** name as a collaborator here :) Please discuss bugs
or new features here on the issues queue before spending time on them, because
I'm working through an internal list of TODOs at the moment and want to avoid
stepping on toes. Once I get the main feature list implemented, I'll maintain
a roadmap and wishlist here in the README so others can contribute more easily.
Roadmap
-------
- Read All Key Types
- [x] String
- [x] List
- [ ] Change from `LRANGE -inf +inf` to an iterator, to handle really
large lists better.
- [x] Set
- [ ] Change from `SMEMBERS` to `SSCAN`, to handle large sets better.
- [x] Sorted Set
- [ ] Change from `ZRANGEBYSCORE` to `ZSCAN` or and interator-style range, to handle large sets better.
- [ ] Hash
- Keyspace 'overview'
- [ ] Implement a collapsable tree-structure for browsing the keyspace
- Configurable delimeter per hosts
- Manage Remote Hosts
- [ ] CRUD Hosts
- [ ] Import from ~/.ssh/config ?
- [ ] Support other auth schemes
- [x] ssh-agent tunnel
- others?
- Console/REPL
- [ ] Add a 'console' tab that replecates the functionality of the redis-client REPL
- Delete Data
- [ ] Delete keys
- [ ] Delete from lists
- [ ] Delete form sets/sorted-sets
- [ ] Delete hash keys
- [ ] Bulk Delete all of the above
- Edit Data
- [ ] Edit string keys
- [ ] Edit lists, Add items
- [ ] Edit sets, Add items
- [ ] Edit hashes
### How to Build
For development, you'll just need to clone this repo and run `make`.
If you want to build a release, you'll probably need to go edit the config
and include your Apple developer ID, which will need to have been set up
via XCode. How to do that is beyond the scope of this project.
- - -
#### Developed by [TerraEclipse](https://github.com/TerraEclipse)
Terra Eclipse, Inc. is a nationally recognized political technology and
strategy firm located in Santa Cruz, CA and Washington, D.C.
================================================
FILE: fonts/.gitkeep
================================================
================================================
FILE: fonts/MaterialIcons/MaterialIcons.css
================================================
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(MaterialIcons-Regular.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
width: 1em;
height: 1em;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
================================================
FILE: fonts/Roboto/LICENSE.txt
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: fonts/Roboto/Roboto.css
================================================
@font-face {
font-family: 'Roboto';
src: url('Roboto-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-Italic.ttf') format('truetype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-BoldItalic.ttf') format('truetype');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-Thin.ttf') format('truetype');
font-weight: 200;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-ThinItalic.ttf') format('truetype');
font-weight: 200;
font-style: italic;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-Light.ttf') format('truetype');
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-LightItalic.ttf') format('truetype');
font-weight: 100;
font-style: italic;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-Medium.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('Roboto-MediumItalic.ttf') format('truetype');
font-weight: 300;
font-style: italic;
}
================================================
FILE: images/.gitkeep
================================================
================================================
FILE: index.html
================================================
RedisExplorer
================================================
FILE: package.json
================================================
{
"name": "redis-explorer",
"version": "0.0.6",
"description": "A GUI for Redis",
"main": "browser.js",
"repository": {
"type": "git",
"url": "git://github.com/cpsubrian/redis-explorer.git"
},
"homepage": "https://github.com/cpsubrian/redis-explorer",
"keywords": [
"redis"
],
"author": "Brian Link ",
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
],
"bugs": {
"url": "https://github.com/cpsubrian/redis-explorer/issues"
},
"scripts": {
"test": "echo 'No Tests'"
},
"standard": {
"parser": "babel-eslint"
},
"dependencies": {
"alt": "^0.17.1",
"autobind-decorator": "^1.2.0",
"babel": "^5.6.7",
"highlight.js": "^8.6.0",
"immutable": "^3.7.4",
"material-ui": "^0.9.1",
"mkdirp": "^0.5.1",
"pure-render-decorator": "^0.1.0",
"react": "^0.13.3",
"react-hotkeys": "^0.3.3",
"react-immutable-proptypes": "^1.0.0",
"react-router": "^0.13.3",
"react-tap-event-plugin": "^0.1.7",
"redis": "^0.12.1",
"redis-info": "^3.0.6",
"ssh-config": "^0.1.0",
"tunnel-ssh": "^1.0.2",
"underscore": "^1.8.3"
},
"devDependencies": {
"babel": "^5.5.8",
"babel-eslint": "^3.1.19",
"electron-prebuilt": "^0.29.2",
"grunt": "^0.4.5",
"grunt-babel": "^5.0.1",
"grunt-chmod": "^1.0.3",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-watch-chokidar": "^1.0.0",
"grunt-download-electron": "^2.1.1",
"grunt-electron": "^2.0.0",
"grunt-electron-installer": "^0.33.0",
"grunt-if-missing": "^1.0.0",
"grunt-newer": "^1.1.1",
"grunt-rcedit": "^0.3.1",
"grunt-rename": "^0.1.4",
"grunt-shell-spawn": "^0.3.8",
"load-grunt-tasks": "^3.2.0",
"material-design-icons": "^2.0.0",
"shell-escape": "^0.2.0",
"source-map-support": "^0.3.1",
"standard": "^4.3.3"
}
}
================================================
FILE: resources/.gitkeep
================================================
================================================
FILE: src/actions/browseActions.js
================================================
import alt from '../alt'
import db from '../utils/db'
// 'Global' scan object.
let _scan
// Browse Actions.
class BrowseActions {
/* General
****************************************************************************/
resetKeys () {
this.dispatch()
}
setOffset (offset) {
this.dispatch(offset)
}
setMatch (match) {
this.dispatch(match)
}
toggleSelectedKey (key) {
this.dispatch(key)
}
toggleSelectedIndex (index) {
this.dispatch(index)
}
// `item` should be {key, index}
toggleSelected (item) {
this.dispatch(item)
}
/* Fetch Keys Lifecycle
****************************************************************************/
fetchKeys (options = {}) {
this.dispatch()
// Stop an active scan.
if (_scan) _scan.stop()
// Create the scan.
options.match = options.match ? options.match + '*' : null
options.loadTypes = true
_scan = db.scan(options)
// Start the scan.
this.actions.fetchKeysNext()
}
fetchKeysNext () {
this.dispatch()
_scan.next((err, keys) => {
if (err) {
this.actions.fetchKeysFailed(err)
} else if (keys) {
this.actions.fetchKeysAdd(keys)
} else {
this.actions.fetchKeysFinished()
}
})
}
fetchKeysAdd (keys) {
this.dispatch(keys)
this.actions.fetchValues(keys)
}
fetchKeysFailed (err) {
this.dispatch(err)
}
fetchKeysFinished () {
this.dispatch()
}
/* Fetch Values Lifecycle
****************************************************************************/
fetchValues (keys) {
this.dispatch(keys)
// Start loading the values.
db.fetchValues(keys, (err, values) => {
if (err) {
this.actions.fetchValuesFailed(err)
} else {
this.actions.fetchValuesAdd(values)
}
})
}
fetchValuesAdd (values) {
this.dispatch(values)
}
fetchValuesFailed (err) {
this.dispatch(err)
}
}
export default alt.createActions(BrowseActions)
================================================
FILE: src/actions/hostsActions.js
================================================
import alt from '../alt'
import db from '../utils/db'
class HostsActions {
/* Connection Lifecycle
****************************************************************************/
connectToHost (host) {
this.dispatch(host)
db.connect(host.toJS(), (err) => {
if (err) {
this.actions.connectToHostFailed(err)
} else {
this.actions.connectedToHost()
}
})
}
connectToHostFailed (err) {
this.dispatch(err)
}
connectedToHost () {
this.dispatch()
}
/* Fetch Info Lifecycle
****************************************************************************/
fetchHostInfo (isRefresh) {
this.dispatch(isRefresh)
db.fetchInfo((err, info) => {
if (err) {
this.actions.fetchHostInfoFailed(err)
} else {
this.actions.fetchHostInfoFinished(info)
}
})
}
fetchHostInfoFinished (info) {
this.dispatch(info)
}
fetchHostInfoFailed (err) {
this.dispatch(err)
}
}
export default alt.createActions(HostsActions)
================================================
FILE: src/alt.js
================================================
import Alt from 'alt'
// Create alt instance.
const alt = new Alt()
// Debug dispatcher.
if (process.env.NODE_ENV === 'development') {
alt.dispatcher.register((dispatch) => {
console.log(dispatch.action, dispatch.data)
})
}
export default alt
================================================
FILE: src/app.js
================================================
import remote from 'remote'
import React from 'react'
import router from './router'
import injectTapEventPlugin from 'react-tap-event-plugin'
// Constants
const app = remote.require('app')
const Menu = remote.require('menu')
const shell = remote.require('shell')
const BrowserWindow = remote.require('browser-window')
const CMDORCTRL = (process.platform === 'win32') ? 'Ctrl' : 'Command'
// Needed for onTouchTap
// Can go away when react 1.0 release
// Check this repo:
// https://github.com/zilverline/react-tap-event-plugin
injectTapEventPlugin()
// Run the router.
router.run((Handler) => {
React.render(, document.body)
})
// Application Menu
Menu.setApplicationMenu(Menu.buildFromTemplate([
{
label: 'RedisExplorer',
submenu: [
{
label: 'About RedisExplorer',
selector: 'orderFrontStandardAboutPanel:'
},
{
type: 'separator'
}, {
label: 'Hide RedisExplorer',
accelerator: CMDORCTRL + '+H',
selector: 'hide:'
},
{
label: 'Hide Others',
accelerator: CMDORCTRL + '+Shift+H',
selector: 'hideOtherApplications:'
},
{
label: 'Show All',
selector: 'unhideAllApplications:'
},
{
type: 'separator'
},
{
label: 'Quit',
accelerator: CMDORCTRL + '+Q',
click: () => app.quit()
}
]
},
{
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: CMDORCTRL + '+Z',
selector: 'undo:'
},
{
label: 'Redo',
accelerator: 'Shift+' + CMDORCTRL + '+Z',
selector: 'redo:'
},
{
type: 'separator'
},
{
label: 'Cut',
accelerator: CMDORCTRL + '+X',
selector: 'cut:'
},
{
label: 'Copy',
accelerator: CMDORCTRL + '+C',
selector: 'copy:'
},
{
label: 'Paste',
accelerator: CMDORCTRL + '+V',
selector: 'paste:'
},
{
label: 'Select All',
accelerator: CMDORCTRL + '+A',
selector: 'selectAll:'
}
]
},
{
label: 'View',
submenu: [
{
label: 'Reload',
accelerator: CMDORCTRL + '+R',
click: () => {
var focusedWindow = BrowserWindow.getFocusedWindow()
if (focusedWindow) {
focusedWindow.reload()
}
}
},
{
label: 'Toggle Full Screen',
accelerator: 'Ctrl+Command+F',
click: () => {
var focusedWindow = BrowserWindow.getFocusedWindow()
if (focusedWindow) {
focusedWindow.setFullScreen(!focusedWindow.isFullScreen())
}
}
},
{
label: 'Toggle DevTools',
accelerator: 'Alt+' + CMDORCTRL + '+I',
click: () => remote.getCurrentWindow().toggleDevTools()
}
]
},
{
label: 'Window',
submenu: [
{
label: 'Minimize',
accelerator: CMDORCTRL + '+M',
selector: 'performMiniaturize:'
},
{
label: 'Close',
accelerator: CMDORCTRL + '+W',
click: () => remote.getCurrentWindow().hide()
},
{
type: 'separator'
},
{
label: 'Bring All to Front',
selector: 'arrangeInFront:'
}
]
},
{
label: 'Help',
submenu: [
{
label: 'Report Issue or Suggest Feedback',
click: () => shell.openExternal('https://github.com/cpsubrian/redis-explorer/issues/new')
}
]
}
]))
================================================
FILE: src/browser.js
================================================
import app from 'app'
import conf from './conf'
import settings from './utils/settings'
import BrowserWindow from 'browser-window'
// Report crashes to our server.
// require('crash-reporter').start()
// Keep a reference of the window object, if you don't, the window will
// be closed automatically when the javascript object is GCed.
let mainWindow = null
// Quit when all windows are closed.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
// Get save bounds or use fallback defaults.
let bounds = settings.get('bounds', {
x: 50,
y: 50,
width: 1100,
height: 800
})
// This method will be called when Electron has done everything
// initialization and ready for creating browser windows.
app.on('ready', () => {
// Create the browser window.
mainWindow = new BrowserWindow({
'x': bounds.x,
'y': bounds.y,
'width': bounds.width,
'height': bounds.height,
'min-width': 400,
'min-height': 260,
'standard-window': false,
'resizable': true,
'show': false
})
// Open dev tools. Probably should remove this when this is more production ready.
if (process.env.NODE_ENV === 'development') {
mainWindow.openDevTools()
}
// Load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html')
// Show window after the url is loaded.
mainWindow.webContents.on('did-finish-load', () => {
mainWindow.setTitle(conf['BASENAME'])
mainWindow.show()
mainWindow.focus()
})
// Don't allow navigation to weird endpoints.
mainWindow.webContents.on('will-navigate', (e, url) => {
if (url.indexOf('build/index.html#') < 0) {
e.preventDefault()
}
})
// Save size and position of window.
mainWindow.on('resize', () => {
settings.set('bounds', mainWindow.getBounds())
})
mainWindow.on('move', () => {
settings.set('bounds', mainWindow.getBounds())
})
// Handle window close depending on platform.
app.on('window-all-closed', () => {
app.quit()
})
})
================================================
FILE: src/components/Header.js
================================================
import React from 'react'
import ImmutablePropTypes from 'react-immutable-proptypes'
import autobind from 'autobind-decorator'
import {Link} from 'react-router'
import Icon from '../components/Icon'
import {Toolbar, ToolbarGroup} from 'material-ui'
import HostsNav from '../components/HostsNav'
// @todo add pureRender after I figure out how to account for Router state
// for changes.
@autobind
class Header extends React.Component {
static propTypes = {
hosts: ImmutablePropTypes.list,
activeHost: ImmutablePropTypes.map,
connecting: React.PropTypes.bool,
connected: React.PropTypes.bool
}
onClickHostButton (e) {
e.preventDefault()
this.refs.hostsNav.toggle()
}
getHostButtonClass () {
if (this.props.connecting) {
return 'connecting'
} else if (this.props.connected) {
return 'connected'
} else {
return 'disconnected'
}
}
render () {
return (
Browse
Info
{this.props.activeHost ?
{this.props.activeHost.get('Host')}
:/*else*/
Not Connected
}
)
}
}
export default Header
================================================
FILE: src/components/Highlight.js
================================================
import React from 'react'
import autobind from 'autobind-decorator'
import hljs from 'highlight.js'
@autobind
class Highlight extends React.Component {
static propTypes = {
className: React.PropTypes.string,
innerHTML: React.PropTypes.bool,
children: React.PropTypes.node
}
static defaultProps = {
innerHTML: false,
className: ''
}
componentDidMount () {
this.highlightCode()
}
componentDidUpdate () {
this.highlightCode()
}
highlightCode () {
let nodes = React.findDOMNode(this).querySelectorAll('pre code')
if (nodes.length > 0) {
for (let i = 0; i < nodes.length; i = i + 1) {
hljs.highlightBlock(nodes[i])
}
}
}
render () {
if (this.props.innerHTML) {
return
} else {
return
)
}
return React.addons.createFragment(buttons)
}
render () {
let {_key, type} = this.props.item.toJS()
return (
)
}
}
export default SortedSetDetails
================================================
FILE: src/components/details/StringDetails.js
================================================
import React from 'react'
import pureRender from 'pure-render-decorator'
import ImmutablePropTypes from 'react-immutable-proptypes'
import clipboard from 'clipboard'
import Details from '../../components/details/Details'
import Highlight from '../../components/Highlight'
@pureRender
class KeyDetails extends React.Component {
static propTypes = {
item: ImmutablePropTypes.map
}
state = {
types: ['JSON', 'Raw'],
show: 'JSON',
hasJSON: false
}
renderValue () {
let value = this.props.item.get('value')
try {
if (this.state.show === 'Raw') {
value =
{value}
} else {
value = (
{JSON.stringify(JSON.parse(value), null, 2)}
)
}
this.state.hasJSON = true
} catch (e) {
value =
{value}
}
return value
}
renderButtons () {
let buttons = {}
let value = this.props.item.get('value')
// Create types buttons.
if (this.state.hasJSON) {
buttons.show = (