Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bedrin committed Nov 15, 2015
2 parents 5cd21cb + 7669959 commit efdcbbb
Show file tree
Hide file tree
Showing 19 changed files with 482 additions and 138 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ node_modules

bower_components

dist
build

.idea

COMMIT_MSG
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "4.1"
before_install: npm install -g grunt-cli
install: npm install && bower install
63 changes: 37 additions & 26 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,29 @@ module.exports = function (grunt) {
' Licensed <%= pkg.license %> */\n',
// Task configuration
copy: {
dist: {
mock: {
expand: true,
cwd: 'dist/',
src: '**',
src: ['jdbcsniffer.js','jdbcsniffer.min.js'],
dest: 'mock/'
},
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
src: ['src/jdbcsniffer.js'],
dest: 'dist/jdbcsniffer.js'
}
},
includereplace: {
dist: {
options: {
prefix: '//@@',
suffix: ''
suffix: '',
processIncludeContents: function(includeContents, localVars, filePath) {
return filePath.endsWith('.js') ? includeContents :
includeContents.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, " ");
}
},
src: 'dist/jdbcsniffer.js',
src: 'src/jdbcsniffer.js',
dest: 'dist/jdbcsniffer.js'
},
iframe: {
src: 'src/jdbcsniffer.iframe.html',
dest: 'build/jdbcsniffer.iframe.html'
}
},
uglify: {
Expand Down Expand Up @@ -79,7 +77,7 @@ module.exports = function (grunt) {
},
dist: {
files: {
"dist/jdbcsniffer.css": "src/jdbcsniffer.less" // destination file and source file
"build/jdbcsniffer.css": "src/jdbcsniffer.less"
}
}
},
Expand All @@ -90,29 +88,41 @@ module.exports = function (grunt) {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true
},
files: {
'dist/jdbcsniffer.html': 'src/jdbcsniffer.html',
'build/jdbcsniffer.iframe.html': 'build/jdbcsniffer.iframe.html'
}
}
},
imageEmbed: {
dist: {
src: [ "bower_components/bootstrap/dist/css/bootstrap.min.css" ],
dest: "build/bootstrap.embedded.css",
options: {
deleteAfterEncoding : false,
preEncodeCallback: function () { return true; }
}
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
tasks: ['jshint:gruntfile', 'includereplace:iframe', 'htmlmin', 'less', 'jshint', 'includereplace:dist', 'uglify', 'copy']
},
htmlmin: {
files: 'src/*.html',
tasks: ['htmlmin:dist','jshint:dist','concat:dist','includereplace:dist','uglify:dist','copy:dist']
tasks: ['includereplace:iframe','htmlmin:dist','jshint:dist','includereplace:dist','uglify:dist','copy:mock']
},
src: {
files: 'src/*.js',
tasks: ['jshint:dist','concat:dist','includereplace:dist','uglify:dist','copy:dist']
tasks: ['jshint:dist','includereplace:dist','uglify:dist','copy:mock']
},
styles: {
files: ['src/*.less'], // which files to watch
tasks: ['less:dist','copy:dist'/*,'replace:dist'*/],
files: ['src/*.less'],
tasks: ['less:dist','copy:mock'],
options: {
nospawn: true
}
Expand All @@ -121,17 +131,18 @@ module.exports = function (grunt) {
});

// These plugins provide necessary tasks
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-include-replace');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks("grunt-image-embed");

// Default task
grunt.registerTask('default', ['concat', 'htmlmin', 'less', 'jshint', /*'qunit',*/ 'includereplace', 'uglify', 'copy']);
grunt.registerTask('default', ['imageEmbed', 'includereplace:iframe', 'htmlmin', 'less', 'jshint', 'includereplace:dist', 'uglify', 'copy']);
grunt.registerTask('travis', ['default']);
};

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# jdbc-sniffer-ui
UI for JDBC Sniffer
[![Build Status](https://travis-ci.org/sniffy/sniffy-ui.svg?branch=develop)](https://travis-ci.org/sniffy/sniffy-ui)
[![Dependency Status](https://david-dm.org/sniffy/sniffy-ui.svg)](https://david-dm.org/sniffy/sniffy-ui)
[![devDependency Status](https://david-dm.org/sniffyii/dev-status.svg)](https://david-dm.org/sniffy/sniffy-ui#info=devDependencies)

# sniffy-ui
Sniffy UI

## Building

Expand All @@ -21,4 +25,4 @@ grunt watch
node index.js
```

Now open [http://localhost:3000/dist/mock.html](http://localhost:3000/dist/mock.html) in your browser and have fun!
Now open [http://localhost:3000/mock/mock.html](http://localhost:3000/mock/mock.html) in your browser and have fun!
19 changes: 13 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"name": "jdbc-sniffer-ui",
"version": "1.1.0",
"homepage": "https://github.com/bedrin/jdbc-sniffer-ui",
"name": "sniffy",
"homepage": "http://sniffy.io",
"repository": {
"type": "git",
"url": "git@github.com:sniffy/sniffy-ui.git"
},
"authors": [
"bedrin <Dmitry.Bedrin@gmail.com>"
],
"description": "UI for JDBC Sniffer",
"main": "jdbcsniffer.js",
"description": "Sniffy - next generation profiler",
"keywords": "profiler, monitoring, jdbc",
"main": "./dist/jdbcsniffer.js",
"license": "BSD-3-Clause",
"moduleType": "globals",
"ignore": [
"**/.*",
"node_modules",
Expand All @@ -17,6 +22,8 @@
],
"dependencies": {
"minified": "~2015.1.1",
"bootstrap": "~3.3.5"
"bootstrap": "~3.3.5",
"highlightjs": "~8.9.1",
"clipboard": "~1.5.5"
}
}
5 changes: 5 additions & 0 deletions dist/jdbcsniffer.iframe.html

Large diffs are not rendered by default.

209 changes: 209 additions & 0 deletions dist/jdbcsniffer.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/jdbcsniffer.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ var counter = 1000;

app.get('/mock/ajax.json', function (req, res) {
res.header('X-Sql-Queries' , 2 );
res.header('X-Request-Id' , 'a54b32e7-b94b-450b-b145-0cf62270d32a' );
//res.header('X-Request-Id' , 'a54b32e7-b94b-450b-b145-0cf62270d32a' );
res.header('X-Request-Details' , '/mock/request/a54b32e7-b94b-450b-b145-0cf62270d32a' );

res.send('{"foo":"bar","baz":42}');
});

Expand Down
3 changes: 3 additions & 0 deletions mock/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jdbcsniffer.js

jdbcsniffer.min.js
3 changes: 2 additions & 1 deletion mock/frame.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script id="jdbc-sniffer-header" type="application/javascript" src="/mock/jdbcsniffer.min.js" data-request-id="a54b32e7-b94b-450b-b145-0cf62270d32a"></script>
<title>JDBC Sniffer Integration</title>
</head>
<body>
<h1>Invisible IFrame</h1>
<data id="jdbc-sniffer" data-sql-queries="2" ></script>
</body>
</html>
<script id="jdbc-sniffer" data-sql-queries="0" data-request-id="b43a32e7-b94b-450b-b145-0cf62270d32a" type="application/javascript" src="/mock/jdbcsniffer.min.js"></script>
20 changes: 19 additions & 1 deletion mock/mock.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script id="jdbc-sniffer-header" type="application/javascript" src="/mock/jdbcsniffer.js" data-request-id="a54b32e7-b94b-450b-b145-0cf62270d32a"></script>
<title>JDBC Sniffer Integration</title>
<script>

Expand All @@ -15,13 +16,30 @@

}

doAjax();

</script>
</head>
<body>
<h1>JDBC Sniffer Integration</h1>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<iframe id="frame" src="frame.html" style="position: absolute; width: 1px; height: 1px; left: -9999px; display: none;"></iframe>
<div id="result"></div>
<button id="button" onclick="doAjax()">Click me!</button>
<data id="jdbc-sniffer" data-sql-queries="2" ></script>
</body>
</html>
<script id="jdbc-sniffer" data-sql-queries="2" data-request-id="a54b32e7-b94b-450b-b145-0cf62270d32a" type="application/javascript" src="/mock/jdbcsniffer.min.js"></script>
2 changes: 1 addition & 1 deletion mock/request/a54b32e7-b94b-450b-b145-0cf62270d32a
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
{"query":"SELECT 1 FROM DUAL","time":300},
{"query":"select distinct owner0_.id as id1_0_0_, pets1_.id as id1_1_1_, owner0_.first_name as first_na2_0_0_, owner0_.last_name as last_nam3_0_0_, owner0_.address as address4_0_0_, owner0_.city as city5_0_0_, owner0_.telephone as telephon6_0_0_, pets1_.name as name2_1_1_, pets1_.birth_date as birth_da3_1_1_, pets1_.owner_id as owner_id4_1_1_, pets1_.type_id as type_id5_1_1_, pets1_.owner_id as owner_id4_0_0__, pets1_.id as id1_1_0__ from owners owner0_ left outer join pets pets1_ on owner0_.id=pets1_.owner_id where owner0_.last_name like ?","time":300},
{"query":"SELECT 1 FROM DUAL","time":300}
]
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
"title": "UI for JDBC Sniffer",
"author": "bedrin <Dmitry.Bedrin@gmail.com>",
"license": "BSD-3-Clause",
"version": "1.1.0",
"version": "1.2.0",
"repository": {
"type": "git",
"url": "https://github.com/bedrin/jdbc-sniffer-ui.git"
},
"scripts": {
"test": "grunt travis"
},
"dependencies": {
"express": "^4.13.3"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-concat": "~0.3.0",
"bower": "^1.5.3",
"grunt": "^0.4.5",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-htmlmin": "^0.4.0",
"grunt-contrib-jshint": "~0.7.2",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-qunit": "*",
"grunt-contrib-uglify": "~0.9.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-include-replace": "^3.0.0"
"grunt-include-replace": "^3.0.0",
"grunt-notify": "^0.4.1",
"grunt-image-embed": "^0.3.3"
}
}
47 changes: 0 additions & 47 deletions src/jdbcsniffer.html

This file was deleted.

Loading

0 comments on commit efdcbbb

Please sign in to comment.