├── client ├── routes │ └── home │ │ ├── home-styles.js │ │ ├── active-host.js │ │ ├── select-host.js │ │ ├── connection-form.js │ │ ├── database-container.js │ │ ├── recent-queries.js │ │ ├── results-container.js │ │ ├── connection-modal.js │ │ ├── search.js │ │ └── home-root.js ├── imgs │ ├── loading.gif │ ├── monkey.png │ └── dancing_banana.gif ├── components │ ├── route-history.js │ ├── modal.js │ ├── folder-list.js │ ├── create-directory.js │ ├── json-structure.js │ └── json-container.js ├── css │ ├── font-awesome │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ └── less │ │ │ ├── fixed-width.less │ │ │ ├── screen-reader.less │ │ │ ├── larger.less │ │ │ ├── list.less │ │ │ ├── core.less │ │ │ ├── stacked.less │ │ │ ├── font-awesome.less │ │ │ ├── bordered-pulled.less │ │ │ ├── rotated-flipped.less │ │ │ ├── path.less │ │ │ ├── animated.less │ │ │ └── mixins.less │ ├── bootstrap │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── less │ │ │ ├── mixins │ │ │ ├── center-block.less │ │ │ ├── text-emphasis.less │ │ │ ├── size.less │ │ │ ├── background-variant.less │ │ │ ├── opacity.less │ │ │ ├── text-overflow.less │ │ │ ├── tab-focus.less │ │ │ ├── labels.less │ │ │ ├── resize.less │ │ │ ├── progress-bar.less │ │ │ ├── nav-divider.less │ │ │ ├── reset-filter.less │ │ │ ├── alerts.less │ │ │ ├── nav-vertical-align.less │ │ │ ├── responsive-visibility.less │ │ │ ├── pagination.less │ │ │ ├── border-radius.less │ │ │ ├── panels.less │ │ │ ├── list-group.less │ │ │ ├── hide-text.less │ │ │ ├── clearfix.less │ │ │ ├── table-row.less │ │ │ ├── image.less │ │ │ ├── buttons.less │ │ │ ├── forms.less │ │ │ ├── grid-framework.less │ │ │ ├── grid.less │ │ │ └── gradients.less │ │ │ ├── .csslintrc │ │ │ ├── wells.less │ │ │ ├── breadcrumbs.less │ │ │ ├── responsive-embed.less │ │ │ ├── component-animations.less │ │ │ ├── close.less │ │ │ ├── thumbnails.less │ │ │ ├── utilities.less │ │ │ ├── media.less │ │ │ ├── pager.less │ │ │ ├── jumbotron.less │ │ │ ├── mixins.less │ │ │ ├── bootstrap.less │ │ │ ├── labels.less │ │ │ ├── badges.less │ │ │ ├── code.less │ │ │ ├── grid.less │ │ │ ├── alerts.less │ │ │ ├── progress-bars.less │ │ │ ├── pagination.less │ │ │ ├── print.less │ │ │ ├── scaffolding.less │ │ │ ├── tooltip.less │ │ │ ├── list-group.less │ │ │ ├── popovers.less │ │ │ ├── modals.less │ │ │ ├── buttons.less │ │ │ ├── input-groups.less │ │ │ ├── responsive-utilities.less │ │ │ ├── tables.less │ │ │ ├── dropdowns.less │ │ │ ├── navs.less │ │ │ ├── carousel.less │ │ │ └── button-groups.less │ └── styles.less ├── styles │ ├── styles-main.js │ └── styles-form.js ├── templates │ └── index.ejs ├── reducers │ ├── reducer-notifications.js │ ├── reducer-loading.js │ └── reducer-app.js ├── utils │ ├── client-render.js │ ├── api.js │ ├── formatter-utils.js │ └── search-utils.js ├── app.js └── actions │ └── actions-home.js ├── .npmignore ├── .gitignore ├── .babelrc ├── server ├── bin │ └── index.js ├── server.js └── controllers │ └── static.js ├── README.md ├── webpack.config.js ├── package.json └── yarn-error.log /client/routes/home/home-styles.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/imgs/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/imgs/loading.gif -------------------------------------------------------------------------------- /client/imgs/monkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/imgs/monkey.png -------------------------------------------------------------------------------- /client/imgs/dancing_banana.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/imgs/dancing_banana.gif -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | npm-debug.log 3 | /server 4 | /client 5 | .babelrc 6 | .gitignore 7 | webpack.config.js 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | coverage 3 | lint 4 | npm-debug.log 5 | .env 6 | /server/public 7 | /server/templates 8 | /build 9 | -------------------------------------------------------------------------------- /client/components/route-history.js: -------------------------------------------------------------------------------- 1 | import createHashHistory from 'history/lib/createHashHistory' 2 | export default createHashHistory() -------------------------------------------------------------------------------- /client/css/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /client/styles/styles-main.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | export const hContainer = { 4 | marginTop: "40px" 5 | } 6 | 7 | export const hPaper = { 8 | padding: "20px" 9 | } -------------------------------------------------------------------------------- /client/css/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /client/css/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /client/css/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /client/css/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /client/styles/styles-form.js: -------------------------------------------------------------------------------- 1 | export const textFieldStyle = { 2 | width: "100%", 3 | marginBottom: "15px" 4 | } 5 | 6 | export const styleClass = "col-lg-6 col-md-12" -------------------------------------------------------------------------------- /client/css/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /client/css/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /client/css/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /client/css/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbahoshy/mongo-monkey/HEAD/client/css/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /client/css/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /client/templates/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react", "es2015"], 3 | "plugins": [ 4 | "transform-strict-mode", 5 | "transform-async-to-generator", 6 | "transform-es2015-modules-commonjs", 7 | "transform-react-constant-elements", 8 | "babel-plugin-transform-runtime" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /client/reducers/reducer-notifications.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | 3 | 4 | function notifications (state = null, action) { 5 | switch (action.type) { 6 | case 'POST_HOST_FAIL': 7 | case 'POST_QUERY_FAIL': 8 | alert(action.err); 9 | return state; 10 | default: 11 | return state; 12 | } 13 | } 14 | 15 | 16 | export default combineReducers({ notifications }); 17 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/bin/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import app from './../server.js'; 4 | 5 | let port = 8080; 6 | 7 | process.argv.forEach(function (val, index, array) { 8 | if (val.indexOf('p') === 0) { 9 | port = val.slice(2); 10 | } 11 | if (val.indexOf('port') === 0) { 12 | port = val.slice(5); 13 | } 14 | }); 15 | 16 | const server = app.listen(port, function() { 17 | console.dir('Server listening : localhost:' + port, { port: server.address().port, interface: server.address().address }); 18 | }); 19 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/.csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "adjoining-classes": false, 3 | "box-sizing": false, 4 | "box-model": false, 5 | "compatible-vendor-prefixes": false, 6 | "floats": false, 7 | "font-sizes": false, 8 | "gradients": false, 9 | "important": false, 10 | "known-properties": false, 11 | "outline-none": false, 12 | "qualified-headings": false, 13 | "regex-selectors": false, 14 | "shorthand": false, 15 | "text-indent": false, 16 | "unique-headings": false, 17 | "universal-selector": false, 18 | "unqualified-attributes": false 19 | } 20 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.1 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /client/reducers/reducer-loading.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | 3 | 4 | function loading (state = {}, action) { 5 | switch (action.type) { 6 | case "POST_QUERY_SUBMIT": 7 | return Object.assign({}, state, { queryLoading: true }); 8 | case "POST_QUERY_FAIL": 9 | case "POST_QUERY_SUCCESS": 10 | return Object.assign({}, state, { queryLoading: false }); 11 | case "POST_HOST_SUBMIT": 12 | return Object.assign({}, state, { dbLoading: true }); 13 | case "POST_HOST_FAIL": 14 | case "POST_HOST_SUCCESS": 15 | return Object.assign({}, state, { dbLoading: false }); 16 | default: 17 | return state; 18 | } 19 | } 20 | 21 | 22 | export default combineReducers({ loading }); 23 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | 26 | // Modifier class for 16:9 aspect ratio 27 | &.embed-responsive-16by9 { 28 | padding-bottom: 56.25%; 29 | } 30 | 31 | // Modifier class for 4:3 aspect ratio 32 | &.embed-responsive-4by3 { 33 | padding-bottom: 75%; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /client/routes/home/active-host.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ActiveHost = props => { 4 | const { activeHost, activeDb } = props; 5 | 6 | if (!activeHost) return
; 7 | 8 | const { name, port, url } = activeHost; 9 | 10 | const line = activeDb ? `${url}:${port}/${activeDb}` : `${url}:${port}`; 11 | 12 | return ( 13 |
14 | Connection Information: 15 |
16 | {name} 17 |
18 | {line} 19 |
20 |
21 | ) 22 | } 23 | 24 | export default ActiveHost; 25 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /server/server.js: -------------------------------------------------------------------------------- 1 | import koa from 'koa' 2 | import json from 'koa-json' 3 | import staticRoutes from './controllers/static' 4 | import render from 'koa-ejs' 5 | import bodyParser from 'koa-bodyparser' 6 | import path from 'path' 7 | import serve from 'koa-static' 8 | 9 | const router = require('koa-router')() 10 | 11 | const app = koa() 12 | 13 | app.use(json()) 14 | app.use(bodyParser()); 15 | 16 | render(app, { 17 | root: path.join(__dirname, 'templates'), 18 | layout: false, 19 | viewExt: 'ejs', 20 | cache: false, 21 | debug: true 22 | }) 23 | 24 | app.use(function *(next){ 25 | var start = new Date; 26 | yield next; 27 | var ms = new Date - start; 28 | console.log('%s %s - %s', this.method, this.url, ms); 29 | }); 30 | 31 | 32 | app.use(staticRoutes()) 33 | app.use(router.allowedMethods()); 34 | app.use(serve(path.join(__dirname, 'public'))); 35 | 36 | export default app; 37 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | visibility: hidden; 21 | 22 | &.in { display: block; visibility: visible; } 23 | tr&.in { display: table-row; } 24 | tbody&.in { display: table-row-group; } 25 | } 26 | 27 | .collapsing { 28 | position: relative; 29 | height: 0; 30 | overflow: hidden; 31 | .transition-property(~"height, visibility"); 32 | .transition-duration(.35s); 33 | .transition-timing-function(ease); 34 | } 35 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mongo-monkey 2 | 3 | ###A mongo client npm module. 4 | 5 | Use Mongo Monkey as your mongo client (mongo 3+ compatible)! Run multiple mongo queries with tabbed results, view json, and even browse & download gridfs files! 6 | 7 | Mongo monkey uses the native mongodb driver, so write your queries just as you would in the console. 8 | 9 | Search input now formats json 10 | 11 | **To Install** 12 | ``` 13 | npm install -g mongo-monkey 14 | ``` 15 | **To Run** 16 | ``` 17 | mongo-monkey 18 | ``` 19 | and open localhost:8080 in your favorite browser! 20 | 21 | **Options** 22 | ``` 23 | p={port} || port={port} 24 | ``` 25 | 26 | **Usage** 27 | 28 | Separate multiple queries using a semi-colon. 29 | Run query with shortcut [ctrl + enter]. 30 | 31 | ![Run multiple mongo queries at once](http://mbahoshy.github.io/imgs/mongo-monkey-sc3.png "Multiple Queries") 32 | 33 | ![Browse and download gridfs files](http://mbahoshy.github.io/imgs/mongo-monkey-sc4.png "Browse Files") 34 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | } 23 | 24 | .media-right, 25 | .media > .pull-right { 26 | padding-left: 10px; 27 | } 28 | 29 | .media-left, 30 | .media > .pull-left { 31 | padding-right: 10px; 32 | } 33 | 34 | .media-left, 35 | .media-right, 36 | .media-body { 37 | display: table-cell; 38 | vertical-align: top; 39 | } 40 | 41 | .media-middle { 42 | vertical-align: middle; 43 | } 44 | 45 | .media-bottom { 46 | vertical-align: bottom; 47 | } 48 | 49 | // Reset margins on headings for tighter default spacing 50 | .media-heading { 51 | margin-top: 0; 52 | margin-bottom: 5px; 53 | } 54 | 55 | // Media list variation 56 | // 57 | // Undo default ul/ol styles 58 | .media-list { 59 | padding-left: 0; 60 | list-style: none; 61 | } 62 | -------------------------------------------------------------------------------- /client/utils/client-render.js: -------------------------------------------------------------------------------- 1 | // client render 2 | import React from 'react' 3 | import { Provider } from 'react-redux' 4 | import {createStore, applyMiddleware, combineReducers} from 'redux' 5 | import thunkMiddleware from 'redux-thunk' 6 | import createLogger from 'redux-logger' 7 | import {reducer as formReducer} from 'redux-form'; 8 | 9 | export default function clientRender(Container, reducers) { 10 | 11 | reducers.form = formReducer 12 | 13 | const reducer = combineReducers(reducers); 14 | 15 | const middleware = [thunkMiddleware]; 16 | 17 | if (process.env.ENVIRONMENT !== 'build') { 18 | middleware.push(createLogger()); 19 | } 20 | 21 | const createStoreWithMiddleware = applyMiddleware( 22 | ...middleware 23 | )(createStore) 24 | 25 | 26 | const clientStore = createStoreWithMiddleware(reducer) 27 | 28 | class RootComponent extends React.Component { 29 | render() { 30 | return ( 31 | 32 | 33 | 34 | ) 35 | } 36 | } 37 | 38 | return RootComponent 39 | 40 | } 41 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | 17 | p { 18 | margin-bottom: (@jumbotron-padding / 2); 19 | font-size: @jumbotron-font-size; 20 | font-weight: 200; 21 | } 22 | 23 | > hr { 24 | border-top-color: darken(@jumbotron-bg, 10%); 25 | } 26 | 27 | .container &, 28 | .container-fluid & { 29 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 30 | } 31 | 32 | .container { 33 | max-width: 100%; 34 | } 35 | 36 | @media screen and (min-width: @screen-sm-min) { 37 | padding: (@jumbotron-padding * 1.6) 0; 38 | 39 | .container &, 40 | .container-fluid & { 41 | padding-left: (@jumbotron-padding * 2); 42 | padding-right: (@jumbotron-padding * 2); 43 | } 44 | 45 | h1, 46 | .h1 { 47 | font-size: (@font-size-base * 4.5); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > .dropdown-toggle& { 17 | color: @color; 18 | background-color: darken(@background, 10%); 19 | border-color: darken(@border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > .dropdown-toggle& { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: @background; 36 | border-color: @border; 37 | } 38 | } 39 | 40 | .badge { 41 | color: @background; 42 | background-color: @color; 43 | } 44 | } 45 | 46 | // Button sizes 47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 48 | padding: @padding-vertical @padding-horizontal; 49 | font-size: @font-size; 50 | line-height: @line-height; 51 | border-radius: @border-radius; 52 | } 53 | -------------------------------------------------------------------------------- /client/app.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import {Router, RoutingContext, IndexRoute, Route, Link} from 'react-router' 4 | import { connect } from 'react-redux' 5 | import history from 'route-history' 6 | import Home from 'routes/home/home-root' 7 | 8 | 9 | import ClientRender from 'utils/client-render' 10 | 11 | import 'css/styles' 12 | 13 | import appStore from 'reducers/reducer-app'; 14 | import notificationStore from 'reducers/reducer-notifications'; 15 | import loadingStore from 'reducers/reducer-loading'; 16 | 17 | function mapStateToProps(state) { 18 | return state 19 | } 20 | 21 | const routes = ( 22 | 23 | , 24 | 25 | 26 | ) 27 | 28 | class App extends React.Component{ 29 | render () { 30 | return ( 31 |
32 | 33 | 34 | {/* 35 | 40 | */} 41 |
42 | ) 43 | } 44 | } 45 | 46 | const Container = connect(mapStateToProps)(App) 47 | 48 | const RouteContainer = ClientRender(Container, { appStore, notificationStore, loadingStore }) 49 | 50 | ReactDOM.render(, document.getElementById('app')) 51 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs & { 33 | top: 0; 34 | padding: 1px 5px; 35 | } 36 | 37 | // Hover state, but only for links 38 | a& { 39 | &:hover, 40 | &:focus { 41 | color: @badge-link-hover-color; 42 | text-decoration: none; 43 | cursor: pointer; 44 | } 45 | } 46 | 47 | // Account for badges in navs 48 | .list-group-item.active > &, 49 | .nav-pills > .active > a > & { 50 | color: @badge-active-color; 51 | background-color: @badge-active-bg; 52 | } 53 | 54 | .list-group-item > & { 55 | float: right; 56 | } 57 | 58 | .list-group-item > & + & { 59 | margin-right: 5px; 60 | } 61 | 62 | .nav-pills > li > a > & { 63 | margin-left: 3px; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /client/utils/api.js: -------------------------------------------------------------------------------- 1 | // api 2 | import fetch from 'isomorphic-fetch' 3 | 4 | function checkStatus(res) { 5 | if (res.status >= 200 && res.status < 300) { 6 | return res; 7 | } 8 | const error = new Error(res.statusText); 9 | error.response = res; 10 | throw error; 11 | } 12 | 13 | export function post (url, body, qs, next) { 14 | return fetch(url, { 15 | credentials: 'same-origin', 16 | method:'post', 17 | headers: { 18 | 'Content-Type': 'application/json' 19 | }, 20 | body: JSON.stringify(body) 21 | }) 22 | .then(checkStatus) 23 | .then(res => res.json()) 24 | .then(result => { 25 | next(null, result) 26 | }) 27 | .catch(err => { 28 | next(err); 29 | }); 30 | } 31 | 32 | export function put (url, body, qs, next) { 33 | return fetch(url, { 34 | credentials: 'same-origin', 35 | method:'put', 36 | headers: { 37 | 'Content-Type': 'application/json' 38 | }, 39 | body: JSON.stringify(body) 40 | }) 41 | .then(res => res.json()) 42 | .then(result => { 43 | next(null, result) 44 | }) 45 | .catch(err => { 46 | next(err); 47 | }); 48 | } 49 | 50 | export function get(url, qs, next) { 51 | return fetch(url, { 52 | credentials: 'same-origin', 53 | method:'get', 54 | headers: { 55 | 'Content-Type': 'application/json' 56 | } 57 | }) 58 | .then(res => res.json()) 59 | .then(result => { 60 | next(null, result) 61 | }) 62 | .catch(err => { 63 | next(err); 64 | }); 65 | } 66 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | 2 | var path = require('path') 3 | var webpack = require('webpack') 4 | var HtmlWebPackPlugin = require('html-webpack-plugin') 5 | var ExtractTextPlugin = require("extract-text-webpack-plugin"); 6 | 7 | var output = process.argv.indexOf('-p') !== -1 ? "build" : "server"; 8 | 9 | module.exports = { 10 | devtool: 'source-map', 11 | entry: { 12 | app: './client/app.js', 13 | }, 14 | output: { 15 | path: path.join(__dirname, output, 'public'), 16 | publicPath: "/", 17 | filename: '[name].js' 18 | }, 19 | module: { 20 | loaders: [ 21 | { test: /\.js$/, loaders: ['babel'], exclude: /node_modules/ }, 22 | { test: /\.woff(2)?/, loader: "url-loader?limit=10000&mimetype=application/font-woff" }, 23 | { test: /\.ttf/, loader: "file-loader" }, 24 | { test: /\.eot/, loader: "file-loader" }, 25 | { test: /\.svg/, loader: "file-loader" }, 26 | // { test: require.resolve('jquery'), loader: "expose?jQuery" }, 27 | { test: /\.less$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader") }, 28 | { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader") }, 29 | { test: /\.png$/, loader: "file-loader" }, 30 | { test: /\.gif$/, loader: "file-loader" }, 31 | {include: /\.json$/, loaders: ["json-loader"]} 32 | ] 33 | }, 34 | resolve: { 35 | extensions: ['', '.js', '.less', '.json'], 36 | modulesDirectories: ['client', 'client/routes', 'client/less', 'client/components', 'node_modules'] 37 | }, 38 | plugins: [ 39 | new webpack.EnvironmentPlugin([ 40 | 'ENVIRONMENT', 41 | ]), 42 | new HtmlWebPackPlugin({ 43 | inject: false, 44 | template: './client/templates/index.ejs', 45 | filename: '../templates/index.ejs' 46 | }), 47 | new ExtractTextPlugin("[name].css") 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /client/css/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /client/routes/home/select-host.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const selectStyle = { 4 | border: 'none', 5 | float: 'left', 6 | width: '100%', 7 | backgroundColor: 'transparent', 8 | borderBottom: '1px solid #CCC', 9 | WebkitAppearance: 'none', 10 | MozAppearance: 'none', 11 | borderRadius: '0', 12 | boxShadow: 'none', 13 | height: '40px', 14 | padding: '0 10px', 15 | }; 16 | 17 | const buttonStyle = { 18 | position: 'absolute', 19 | top: '5px', 20 | right: '0', 21 | padding: '10px', 22 | }; 23 | 24 | const SelectHost = props => { 25 | const { 26 | handleHostChange, 27 | connections, 28 | handleConnectDatabase, 29 | } = props; 30 | return ( 31 |
32 | 42 | 43 | 44 | 45 |
46 | ) 47 | } 48 | 49 | export default SelectHost; 50 | 51 | 52 | /* 53 | 54 |
55 | 65 | 66 | 67 | 68 |
69 | 70 | */ 71 | -------------------------------------------------------------------------------- /client/routes/home/connection-form.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import {reduxForm} from 'redux-form'; 4 | export const fields = [ 5 | 'name', 6 | 'url', 7 | 'port', 8 | ]; 9 | 10 | class SimpleForm extends Component { 11 | 12 | render() { 13 | const { 14 | fields: {name, url, port}, 15 | handleSubmit, 16 | resetForm, 17 | submitting, 18 | handleCancelEdit, 19 | } = this.props; 20 | return ( 21 |
22 |
23 |
24 | 25 |
26 |
27 |
28 |
29 | 30 |
31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 |
40 |
41 | {/* 42 |
43 | 46 | 49 |
50 | */} 51 | 52 | ); 53 | } 54 | } 55 | 56 | export default reduxForm({ 57 | form: 'simple', 58 | fields 59 | })(SimpleForm); 60 | -------------------------------------------------------------------------------- /client/components/modal.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes, Component } from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | 4 | const propTypes = { 5 | close: PropTypes.func.isRequired, // fired when close event is triggered 6 | id: PropTypes.string.isRequired, // id of the modal appended to dom 7 | isOpen: PropTypes.bool.isRequired, // is the modal currently open 8 | children: PropTypes.oneOfType([ 9 | PropTypes.arrayOf(PropTypes.node), 10 | PropTypes.node, 11 | ]), 12 | }; 13 | 14 | export const ModalComponent = (props) => { 15 | const { close, children, isOpen } = props; 16 | const transitionProps = { 17 | component: false, 18 | enter: { opacity: 1 }, 19 | leave: { opacity: 0 }, 20 | }; 21 | 22 | const innerHtml = ( 23 |
24 |
25 |
26 | {children} 27 | 28 |
29 |
30 | ); 31 | 32 | return ( 33 |
{isOpen && innerHtml}
34 | ); 35 | 36 | }; 37 | 38 | class Modal extends Component { 39 | constructor(props) { 40 | super(props); 41 | this.portalElement = null; 42 | } 43 | componentDidMount() { 44 | const elem = this.getElement(this.props.id); 45 | this.portalElement = elem; 46 | this.componentDidUpdate(); 47 | } 48 | componentDidUpdate() { 49 | ReactDOM.render(this.getHtml(), this.portalElement); 50 | } 51 | componentWillUnmount() { 52 | document.body.removeChild(this.portalElement); 53 | } 54 | getElement(id) { 55 | let elem = document.getElementById(id); 56 | if (elem) return elem; 57 | 58 | elem = document.createElement('div'); 59 | elem.id = id; 60 | document.body.appendChild(elem); 61 | 62 | return elem; 63 | } 64 | getHtml() { 65 | return ; 66 | } 67 | render() { 68 | return false; 69 | } 70 | } 71 | 72 | Modal.propTypes = propTypes; 73 | ModalComponent.propTypes = propTypes; 74 | export default ModalComponent; 75 | -------------------------------------------------------------------------------- /client/components/folder-list.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react'; 2 | 3 | const propTypes = { 4 | dirs: PropTypes.array, 5 | files: PropTypes.array, 6 | }; 7 | 8 | class FolderList extends Component { 9 | constructor(props) { 10 | super(props); 11 | this.state = { openFolders: {} }; 12 | } 13 | toggleFolder(index) { 14 | const openFolders = Object.assign({}, this.state.openFolders); 15 | if (openFolders[index] === true) { 16 | openFolders[index] = false; 17 | } else { 18 | openFolders[index] = true; 19 | } 20 | this.setState({ openFolders }); 21 | } 22 | render() { 23 | const { toggleFolder } = this; 24 | const { dirs, files, host, activeDb } = this.props; 25 | const { openFolders } = this.state; 26 | return ( 27 |
    28 | {dirs.map((v, index) => { 29 | const isOpen = openFolders[index] === true; 30 | const handleToggleFolder = () => toggleFolder.call(this, index); 31 | if (isOpen) { 32 | return ( 33 |
  • 34 | 35 | {v.name} 36 | 37 | 38 |
  • 39 | ); 40 | } 41 | return ( 42 |
  • 43 | {v.name} 44 |
  • 45 | ); 46 | })} 47 | {files.map((v, index) => { 48 | return ( 49 |
  • 50 | 51 | {v.name} 52 | 53 |
  • 54 | ); 55 | })} 56 |
57 | ); 58 | } 59 | } 60 | 61 | FolderList.propTypes = propTypes; 62 | 63 | export default FolderList; 64 | -------------------------------------------------------------------------------- /client/routes/home/database-container.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | export default class DatabaseContainer extends Component { 4 | render () { 5 | const { databases, activeDb, onSetActiveDb } = this.props; 6 | if (!databases) return false; 7 | return ( 8 |
9 | Databases: 10 |
11 | {databases.databases.map((db, index) => { 12 | return 13 | })} 14 |
15 |
16 | ) 17 | } 18 | } 19 | const grey = '#696969'; 20 | 21 | 22 | class Database extends Component { 23 | constructor (props) { 24 | super(props); 25 | this.state = { isOpen: false }; 26 | } 27 | render () { 28 | const { onSetActiveDb, db, activeDb } = this.props; 29 | const { isOpen } = this.state; 30 | const handleSetActive = () => { 31 | onSetActiveDb(db.name); 32 | } 33 | const toggleIsOpen = () => this.setState({ isOpen: !isOpen }); 34 | const isActive = db.name === activeDb; 35 | const className = isActive ? "dbactive" : "db-style" 36 | return ( 37 |
38 |
39 |
40 | {db.name} 41 |
42 | 43 | 44 | 45 |
46 | {isOpen && ( 47 |
48 | {db.collections.map((v, index) => { 49 | return ( 50 |
{v.name}
51 | ) 52 | })} 53 |
54 | )} 55 |
56 | ) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /client/reducers/reducer-app.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | 3 | 4 | function results (state=[], action) { 5 | switch (action.type) { 6 | case "POST_QUERY_SUCCESS": 7 | return action.payload; 8 | case "POST_QUERY_FAIL": 9 | return []; 10 | default: 11 | return state; 12 | } 13 | } 14 | 15 | function recentQueries (state=[], action) { 16 | switch (action.type) { 17 | case "SET_RECENT_QUERIES": 18 | return action.payload; 19 | default: 20 | return state; 21 | } 22 | } 23 | 24 | function activeTab (state=0, action) { 25 | switch (action.type) { 26 | case "SET_ACTIVE_TAB": 27 | return action.payload; 28 | case "POST_QUERY_SUCCESS": 29 | return 0; 30 | default: 31 | return state; 32 | } 33 | } 34 | 35 | function databases (state=null, action) { 36 | switch (action.type) { 37 | case "POST_HOST_SUCCESS": 38 | return action.payload.databases; 39 | default: 40 | return state; 41 | } 42 | } 43 | 44 | function activeHost (state=null, action) { 45 | switch (action.type) { 46 | case "POST_HOST_SUCCESS": 47 | return action.payload.host; 48 | default: 49 | return state; 50 | } 51 | } 52 | 53 | function activeDb (state=null, action) { 54 | switch (action.type) { 55 | case "SET_ACTIVE_DB": 56 | return action.payload; 57 | default: 58 | return state; 59 | } 60 | } 61 | 62 | function connections (state = [], action) { 63 | switch (action.type) { 64 | case 'GET_CONNECTIONS': 65 | case 'SET_CONNECTIONS': 66 | return action.payload ? action.payload : []; 67 | default: 68 | return state; 69 | } 70 | } 71 | 72 | function resultKey (state = null, action) { 73 | switch (action.type) { 74 | case 'POST_QUERY_SUCCESS': 75 | return new Date().getTime(); 76 | default: 77 | return state; 78 | } 79 | } 80 | 81 | function showRecentQueries(state = false, action) { 82 | switch (action.type) { 83 | case 'TOGGLE_RECENT_QUERIES': 84 | return !state; 85 | default: 86 | return state; 87 | } 88 | } 89 | 90 | export default combineReducers({results, activeTab, databases, activeDb, activeHost, connections, resultKey, recentQueries, showRecentQueries}) 91 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: @pagination-hover-color; 44 | background-color: @pagination-hover-bg; 45 | border-color: @pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: @pagination-active-color; 56 | background-color: @pagination-active-bg; 57 | border-color: @pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: @pagination-disabled-color; 70 | background-color: @pagination-disabled-bg; 71 | border-color: @pagination-disabled-border; 72 | cursor: @cursor-disabled; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /client/routes/home/recent-queries.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import Modal from 'components/modal'; 3 | import JsonInput, { JsonOverlay } from 'utils/json-input'; 4 | 5 | const style = { 6 | padding: '10px', 7 | borderBottom: '1px solid #e6e6e6', 8 | fontFamily: 'monospace', 9 | color: grey, 10 | float: 'left', 11 | width: '100%', 12 | }; 13 | 14 | const grey = '#696969'; 15 | 16 | const RecentQueries = ({ searchResults, handleOnChange, onToggleRecentQueries, showRecentQueries, search, onSearchChange }) => { 17 | return ( 18 |
19 |
20 | Recent Queries 21 |
22 | 23 |
24 |
Recent Queries
25 | 26 |
27 | {showRecentQueries && searchResults && searchResults.map((v, idx) => ( 28 |
{ 31 | handleOnChange(v.query); 32 | onToggleRecentQueries(); 33 | }} 34 | > 35 | 36 |
37 | ))} 38 |
39 |
40 |
41 |
42 | ) 43 | } 44 | 45 | class RecentQueriesComponent extends Component { 46 | constructor(props) { 47 | super(props); 48 | this.state = { search: '' }; 49 | } 50 | render() { 51 | const { props, state } = this; 52 | const onSearchChange = value => { 53 | this.setState({ search: value }); 54 | } 55 | const formatCompare = c => c.toLowerCase().replace(/ /g,'').replace(/\n/g,''); 56 | const compare = formatCompare(state.search); 57 | const searchResults = props.recentQueries.filter(v => { 58 | if (!compare) return true; 59 | if (formatCompare(v.query).indexOf(compare) !== -1) return true; 60 | return false; 61 | }) 62 | return ( 63 | 69 | ) 70 | } 71 | } 72 | 73 | export default RecentQueriesComponent; 74 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mongo-monkey", 3 | "version": "2.0.4", 4 | "description": "", 5 | "main": "index.js", 6 | "repository": "git://github.com/mbahoshy/mongo-monkey.git", 7 | "scripts": { 8 | "clean": "rm -rf build && mkdir build", 9 | "build-server": "babel -d ./build ./server -s --ignore public", 10 | "build": "npm run clean && npm run build-server && ENVIRONMENT=build webpack -p", 11 | "start": "node build/bin/index.js", 12 | "dev": "babel-node server/bin/index.js", 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "bin": { 16 | "mongo-monkey": "./build/bin/index.js" 17 | }, 18 | "keywords": [ 19 | "mongodb", 20 | "client", 21 | "macos mongodb", 22 | "windows mongodb", 23 | "mongo", 24 | "multiple queries", 25 | "gridfs", 26 | "gridfs file browser" 27 | ], 28 | "author": "", 29 | "license": "UNLICENSED", 30 | "dependencies": { 31 | "babel-runtime": "^6.6.1", 32 | "bluebird": "^3.3.4", 33 | "gridfs-stream": "^1.1.1", 34 | "koa": "^1.2.0", 35 | "koa-bodyparser": "^2.0.1", 36 | "koa-ejs": "^3.0.0", 37 | "koa-json": "^1.1.1", 38 | "koa-router": "^5.4.0", 39 | "koa-static": "^2.0.0", 40 | "mime": "^1.3.4", 41 | "mongodb": "^3.2.3" 42 | }, 43 | "devDependencies": { 44 | "babel": "^6.5.2", 45 | "babel-cli": "^6.6.5", 46 | "babel-core": "^6.7.4", 47 | "babel-loader": "^6.2.4", 48 | "babel-plugin-transform-async-to-generator": "^6.7.4", 49 | "babel-plugin-transform-es2015-modules-commonjs": "^6.7.4", 50 | "babel-plugin-transform-react-constant-elements": "^6.5.0", 51 | "babel-plugin-transform-runtime": "^6.6.0", 52 | "babel-plugin-transform-strict-mode": "^6.6.5", 53 | "babel-preset-es2015": "^6.6.0", 54 | "babel-preset-react": "^6.5.0", 55 | "css-loader": "^0.23.1", 56 | "extract-text-webpack-plugin": "^1.0.1", 57 | "file-loader": "^0.8.5", 58 | "history": "^2.0.1", 59 | "html-webpack-plugin": "^2.14.0", 60 | "isomorphic-fetch": "^2.2.1", 61 | "json-loader": "^0.5.4", 62 | "less": "^2.6.1", 63 | "less-loader": "^2.2.2", 64 | "react": "^15.0.0", 65 | "react-dom": "^15.0.1", 66 | "react-redux": "^4.4.2", 67 | "react-router": "^2.0.1", 68 | "redux": "^3.3.1", 69 | "redux-form": "^4.2.2", 70 | "redux-logger": "^2.6.1", 71 | "redux-thunk": "^2.0.1", 72 | "style-loader": "^0.13.1", 73 | "url-loader": "^0.5.7", 74 | "webpack": "^1.12.14" 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/print.less: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | // 71 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 72 | // Once fixed, we can just straight up remove this. 73 | select { 74 | background: #fff !important; 75 | } 76 | 77 | // Bootstrap components 78 | .navbar { 79 | display: none; 80 | } 81 | .btn, 82 | .dropup > .btn { 83 | > .caret { 84 | border-top-color: #000 !important; 85 | } 86 | } 87 | .label { 88 | border: 1px solid #000; 89 | } 90 | 91 | .table { 92 | border-collapse: collapse !important; 93 | 94 | td, 95 | th { 96 | background-color: #fff !important; 97 | } 98 | } 99 | .table-bordered { 100 | th, 101 | td { 102 | border: 1px solid #ddd !important; 103 | } 104 | } 105 | 106 | // Bootstrap specific changes end 107 | } 108 | -------------------------------------------------------------------------------- /client/css/bootstrap/less/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. `