ATLAS-109 Remove v2 Folder. Contributed by Vishal Kadam
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/37db9955 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/37db9955 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/37db9955 Branch: refs/heads/master Commit: 37db995596f5a571a148e584eaf4242381b19450 Parents: fd4ff8e Author: Venkatesh Seetharam <[email protected]> Authored: Fri Sep 11 15:07:22 2015 -0700 Committer: Venkatesh Seetharam <[email protected]> Committed: Fri Sep 11 15:07:22 2015 -0700 ---------------------------------------------------------------------- dashboard/.bowerrc | 8 + dashboard/.gitignore | 28 ++ dashboard/.jshintignore | 19 ++ dashboard/.jshintrc | 63 ++++ dashboard/README.md | 37 +++ dashboard/bower.json | 25 ++ dashboard/gruntfile.js | 187 ++++++++++++ dashboard/package.json | 62 ++++ dashboard/public/css/common.css | 125 ++++++++ dashboard/public/css/d3tip.css | 46 +++ dashboard/public/css/details.css | 21 ++ dashboard/public/css/lineage.css | 79 +++++ dashboard/public/css/sticky-footer-navbar.css | 41 +++ dashboard/public/index.html | 72 +++++ dashboard/public/js/app.js | 80 +++++ dashboard/public/js/init.js | 29 ++ dashboard/public/js/routes.js | 28 ++ .../public/modules/details/detailsController.js | 50 ++++ .../public/modules/details/detailsModule.js | 21 ++ .../public/modules/details/detailsResource.js | 34 +++ .../public/modules/details/detailsRoutes.js | 30 ++ .../public/modules/details/views/attribute.html | 29 ++ .../public/modules/details/views/details.html | 49 +++ .../public/modules/details/views/schema.html | 52 ++++ .../public/modules/home/headerController.js | 29 ++ dashboard/public/modules/home/homeModule.js | 21 ++ dashboard/public/modules/home/views/header.html | 36 +++ dashboard/public/modules/home/views/home.html | 21 ++ .../public/modules/lineage/lineageController.js | 299 +++++++++++++++++++ .../public/modules/lineage/lineageModule.js | 21 ++ .../public/modules/lineage/lineageResource.js | 23 ++ .../public/modules/lineage/views/lineage.html | 25 ++ .../modules/navigation/navigationController.js | 31 ++ .../modules/navigation/navigationModule.js | 21 ++ .../modules/navigation/navigationResource.js | 36 +++ .../modules/navigation/views/navigation.html | 24 ++ .../notification/notificationController.js | 30 ++ .../modules/notification/notificationModule.js | 30 ++ .../modules/notification/notificationService.js | 61 ++++ .../notification/views/notifications.html | 23 ++ .../public/modules/search/searchController.js | 119 ++++++++ .../public/modules/search/searchDirective.js | 34 +++ dashboard/public/modules/search/searchModule.js | 21 ++ .../public/modules/search/searchResource.js | 32 ++ dashboard/public/modules/search/searchRoutes.js | 30 ++ .../public/modules/search/views/search.html | 67 +++++ .../modules/search/views/searchResult.html | 47 +++ .../modules/search/views/types/column.html | 21 ++ .../public/modules/search/views/types/db.html | 22 ++ .../public/modules/search/views/types/guid.html | 21 ++ .../modules/search/views/types/hiveLineage.html | 19 ++ .../modules/search/views/types/hive_table.html | 19 ++ .../modules/search/views/types/loadprocess.html | 22 ++ .../modules/search/views/types/storagedesc.html | 21 ++ .../modules/search/views/types/table.html | 22 ++ dashboard/v2/.bowerrc | 8 - dashboard/v2/.gitignore | 28 -- dashboard/v2/.jshintignore | 19 -- dashboard/v2/.jshintrc | 63 ---- dashboard/v2/README.md | 37 --- dashboard/v2/bower.json | 25 -- dashboard/v2/gruntfile.js | 187 ------------ dashboard/v2/package.json | 62 ---- dashboard/v2/public/css/common.css | 125 -------- dashboard/v2/public/css/d3tip.css | 46 --- dashboard/v2/public/css/details.css | 21 -- dashboard/v2/public/css/lineage.css | 79 ----- .../v2/public/css/sticky-footer-navbar.css | 41 --- dashboard/v2/public/index.html | 72 ----- dashboard/v2/public/js/app.js | 80 ----- dashboard/v2/public/js/init.js | 29 -- dashboard/v2/public/js/routes.js | 28 -- .../public/modules/details/detailsController.js | 50 ---- .../v2/public/modules/details/detailsModule.js | 21 -- .../public/modules/details/detailsResource.js | 34 --- .../v2/public/modules/details/detailsRoutes.js | 30 -- .../public/modules/details/views/attribute.html | 29 -- .../public/modules/details/views/details.html | 49 --- .../v2/public/modules/details/views/schema.html | 52 ---- .../v2/public/modules/home/headerController.js | 29 -- dashboard/v2/public/modules/home/homeModule.js | 21 -- .../v2/public/modules/home/views/header.html | 36 --- .../v2/public/modules/home/views/home.html | 21 -- .../public/modules/lineage/lineageController.js | 299 ------------------- .../v2/public/modules/lineage/lineageModule.js | 21 -- .../public/modules/lineage/lineageResource.js | 23 -- .../public/modules/lineage/views/lineage.html | 25 -- .../modules/navigation/navigationController.js | 31 -- .../modules/navigation/navigationModule.js | 21 -- .../modules/navigation/navigationResource.js | 36 --- .../modules/navigation/views/navigation.html | 24 -- .../notification/notificationController.js | 30 -- .../modules/notification/notificationModule.js | 30 -- .../modules/notification/notificationService.js | 61 ---- .../notification/views/notifications.html | 23 -- .../public/modules/search/searchController.js | 119 -------- .../v2/public/modules/search/searchDirective.js | 34 --- .../v2/public/modules/search/searchModule.js | 21 -- .../v2/public/modules/search/searchResource.js | 32 -- .../v2/public/modules/search/searchRoutes.js | 30 -- .../v2/public/modules/search/views/search.html | 67 ----- .../modules/search/views/searchResult.html | 47 --- .../modules/search/views/types/column.html | 21 -- .../public/modules/search/views/types/db.html | 22 -- .../public/modules/search/views/types/guid.html | 21 -- .../modules/search/views/types/hiveLineage.html | 19 -- .../modules/search/views/types/hive_table.html | 19 -- .../modules/search/views/types/loadprocess.html | 22 -- .../modules/search/views/types/storagedesc.html | 21 -- .../modules/search/views/types/table.html | 22 -- distro/src/main/assemblies/src-package.xml | 10 +- pom.xml | 16 +- release-log.txt | 1 + 113 files changed, 2477 insertions(+), 2476 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/.bowerrc ---------------------------------------------------------------------- diff --git a/dashboard/.bowerrc b/dashboard/.bowerrc new file mode 100644 index 0000000..010bb05 --- /dev/null +++ b/dashboard/.bowerrc @@ -0,0 +1,8 @@ +{ + "directory": "../webapp/target/dist/lib/", + "storage": { + "packages": ".bower-cache", + "registry": ".bower-registry" + }, + "tmp": ".bower-tmp" +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/.gitignore ---------------------------------------------------------------------- diff --git a/dashboard/.gitignore b/dashboard/.gitignore new file mode 100644 index 0000000..e5ee796 --- /dev/null +++ b/dashboard/.gitignore @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +.DS_Store +.bower-*/ +.idea/ +node_modules/ +lib/ +public/lib +public/dist +*.log +*.tgz +node/ +dist/ +**/app.min.js \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/.jshintignore ---------------------------------------------------------------------- diff --git a/dashboard/.jshintignore b/dashboard/.jshintignore new file mode 100644 index 0000000..efd063f --- /dev/null +++ b/dashboard/.jshintignore @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +test/coverage/** \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/.jshintrc ---------------------------------------------------------------------- diff --git a/dashboard/.jshintrc b/dashboard/.jshintrc new file mode 100644 index 0000000..62b5e65 --- /dev/null +++ b/dashboard/.jshintrc @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "browser": true, // Standard browser globals e.g. `window`, `document`. + "bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.). + "camelcase": false, // Permit only camelcase for `var` and `object indexes`. + "curly": false, // Require {} for every new block or scope. + "devel": true, // Allow development statements e.g. `console.log();`. + "esnext": true, // Allow ES.next specific features such as `const` and `let`. + "eqeqeq": true, // Require triple equals i.e. `===`. + "immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` + "indent": false, // Specify indentation spacing + "latedef": true, // Prohibit variable use before definition. + "node": true, // Enable globals available when code is running inside of the NodeJS runtime environment. + "newcap": false, // Require capitalization of all constructor functions e.g. `new F()`. + "noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`. + "noempty": true, // Prohibit use of empty blocks. + "quotmark": false, // Define quotes to string values. + "regexp": true, // Prohibit `.` and `[^...]` in regular expressions. + "strict": true, // Require `use strict` pragma in every file. + "smarttabs": false, // Suppresses warnings about mixed tabs and spaces + "trailing": true, // Prohibit trailing whitespaces. + "undef": true, // Require all non-global variables be declared before they are used. + "unused": true, // Warn unused variables. + "globals": { // Globals variables. + "angular": true + }, + "predef": [ // Extra globals. + "define", + "require", + "exports", + "module", + "spyOn", + "describe", + "xdescribe", + "before", + "beforeEach", + "after", + "afterEach", + "jasmine", + "it", + "xit", + "inject", + "expect", + "ngGridFlexibleHeightPlugin" + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/README.md ---------------------------------------------------------------------- diff --git a/dashboard/README.md b/dashboard/README.md new file mode 100644 index 0000000..0957582 --- /dev/null +++ b/dashboard/README.md @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +# Apache Atlas + +## Instructions + +### Prerequisite +1. Nodejs (http://nodejs.org/download/) +2. ```npm install -g grunt-cli``` + +### Setup: + +``` +git clone $git-repo-url +git checkout dal +cd dashboard/v2 +npm install +grunt server +``` +Server will start at: +<http://localhost:3010/> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/bower.json ---------------------------------------------------------------------- diff --git a/dashboard/bower.json b/dashboard/bower.json new file mode 100644 index 0000000..2ffdc90 --- /dev/null +++ b/dashboard/bower.json @@ -0,0 +1,25 @@ +{ + "name": "atlas-metadata", + "description": "Apache Atlas", + "version": "1.0.0-SNAPSHOT", + "devDependencies": { + "angular": "~1.2.15", + "angular-resource": "~1.2.15", + "angular-cookies": "~1.2.15", + "angular-route": "~1.2.15", + "angular-sanitize": "~1.2.15", + "bootstrap": "~3.1.1", + "angular-bootstrap": "~0.12.0", + "angular-ui-router": "~0.2.13", + "d3": "~3.5.3", + "d3-tip": "~0.6.6", + "lodash": "~3.0.0", + "angular-ui-utils": "~0.1.1", + "font-awesome": "~4.2.0", + "closure-compiler": "https://dl.google.com/closure-compiler/compiler-20140814.zip", + "ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.3/assets/ng-closure-runner.zip" + }, + "resolutions": { + "d3": "~3.5.3" + } +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/gruntfile.js ---------------------------------------------------------------------- diff --git a/dashboard/gruntfile.js b/dashboard/gruntfile.js new file mode 100644 index 0000000..76ca84a --- /dev/null +++ b/dashboard/gruntfile.js @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +var git = require('git-rev'); + +module.exports = function(grunt) { + var classPathSep = (process.platform === "win32") ? ';' : ':', + gitHash = '', + pkg = grunt.file.readJSON('package.json'), + distPath = '../webapp/target/dist'; + + grunt.initConfig({ + watch: { + options: { + livereload: 35729 + }, + js: { + files: ['public/**/*.js', '!public/lib/**', '!public/dist/**', '!public/js/app.min.js'], + tasks: ['shell'] + }, + html: { + files: ['public/**/*.html'], + tasks: ['copy:dist'] + }, + css: { + files: ['public/**/*.css'], + tasks: ['copy:dist'] + }, + image: { + files: ['public/**/*.{ico,gif,png}'], + tasks: ['copy:dist'] + } + }, + jshint: { + all: { + src: ['gruntfile.js', 'package.json', 'server.js', 'server/**/*.js', 'public/**/*.js', '!public/lib/**', '!public/dist/**', '!public/**/app.min.js'], + options: { + jshintrc: true + } + } + }, + concurrent: { + tasks: ['watch', 'proxitserver'], + options: { + logConcurrentOutput: true + } + }, + jsbeautifier: { + 'default': { + src: ['<%= jshint.all.src %>', 'bower.json'], + options: { + js: { + preserveNewlines: true, + maxPreserveNewlines: 2 + } + } + }, + 'build': { + src: '<%= jsbeautifier.default.src %>', + options: { + mode: 'VERIFY_ONLY', + js: '<%= jsbeautifier.default.options.js%>' + } + } + }, + bower: { + install: { + options: { + verbose: true, + targetDir: '.bower-components' + } + } + }, + dist: distPath + '/js/app.min.js', + modules: grunt.file.expand( + 'public/js/app.js', + 'public/js/routes.js', + 'public/modules/**/*Module.js', + 'public/modules/**/*.js', + 'public/js/init.js' + ).join(' '), + shell: { + min: { + command: 'java ' + + '-cp ' + distPath + '/lib/closure-compiler/compiler.jar' + classPathSep + + '' + distPath + '/lib/ng-closure-runner/ngcompiler.jar ' + + 'org.angularjs.closurerunner.NgClosureRunner ' + + '--compilation_level SIMPLE_OPTIMIZATIONS ' + + //'--formatting PRETTY_PRINT ' + + '--language_in ECMASCRIPT5_STRICT ' + + '--angular_pass ' + + '--manage_closure_dependencies ' + + '--js <%= modules %> ' + + '--js_output_file <%= dist %>' + } + }, + devUpdate: { + main: { + options: { + updateType: 'force' + } + } + }, + compress: { + release: { + options: { + archive: function() { + return [pkg.name, pkg.version, gitHash].join('_') + '.tgz'; + } + }, + src: ['node_modules/**', 'package.json', 'server.js', 'server/**', 'public/**', '!public/js/**', '!public/modules/**/*.js'] + } + }, + copy: { + dist: { + expand: true, + cwd: 'public/', + src: ['**', '!js/**/*.js', '!modules/**/*.js'], + dest: distPath + } + }, + clean: { + build: [distPath], + options: { + force: true + } + }, + proxit: { + dev: { + options: { + 'port': 3010, + 'verbose': true, + 'hosts': [{ + 'hostnames': ['*'], + 'routes': { + '/': distPath, + '/api': 'http://162.249.6.50:21000/api' + } + }] + } + } + } + }); + + require('load-grunt-tasks')(grunt); + grunt.registerTask('default', ['devUpdate', 'bower', 'jshint', 'jsbeautifier:default']); + + grunt.registerTask('server', ['jshint', 'clean', 'bower', 'copy:dist', 'minify', 'concurrent']); + grunt.registerTask('build', ['copy:dist', 'minify']); + + grunt.registerTask('minify', 'Minify the all js', function() { + var done = this.async(); + grunt.task.run(['shell:min']); + done(); + }); + grunt.loadNpmTasks('proxit'); + grunt.registerTask('proxitserver', 'Proxit', function() { + var done = this.async(); + grunt.task.run(['proxit:dev']); + done(); + }); + grunt.registerTask('release', 'Create release package', function() { + var done = this.async(); + git.short(function(str) { + gitHash = str; + grunt.task.run(['minify', 'compress:release']); + done(); + }); + }); +}; http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/package.json ---------------------------------------------------------------------- diff --git a/dashboard/package.json b/dashboard/package.json new file mode 100644 index 0000000..3772654 --- /dev/null +++ b/dashboard/package.json @@ -0,0 +1,62 @@ +{ + "name": "atlas-metadata", + "description": "Apache Atlas", + "version": "0.5.0-incubating", + "private": true, + "repository": { + "type": "git", + "url": "https://git-wip-us.apache.org/repos/asf/incubator-atlas.git" + }, + "engines": { + "node": "0.10.x", + "npm": "1.3.x" + }, + "keywords": [ + "Apache", + "Atlas", + "HortonWorks" + ], + "dependencies": { + "body-parser": "^1.2.0", + "bower": "~1.3.1", + "compression": "^1.0.2", + "consolidate": "~0.10.0", + "cookie-parser": "^1.0.1", + "cookies": "~0.4.0", + "express": "~4.2.0", + "express-load": "^1.1.14", + "forever": "~0.11.1", + "lodash": "~2.4.1", + "method-override": "^1.0.0", + "morgan": "^1.0.1", + "path-extra": "~0.1.1", + "proxit": "^0.6.0", + "q": "~1.0.1", + "rc": "~0.3.4", + "serve-favicon": "^2.0.0", + "static-favicon": "^2.0.0-alpha", + "superagent": "^0.20.0", + "swig": "~1.3.2", + "view-helpers": "~0.1.4", + "grunt-contrib-clean": "~0.6.0" + }, + "devDependencies": { + "git-rev": "^0.2.1", + "grunt": "~0.4.2", + "grunt-bower-task": "~0.4.0", + "grunt-cli": "~0.1.11", + "grunt-concurrent": "^1.0.0", + "grunt-contrib-compress": "^0.13.0", + "grunt-contrib-jshint": "^0.11.0", + "grunt-contrib-watch": "^0.6.0", + "grunt-dev-update": "^1.0.2", + "grunt-jsbeautifier": "^0.2.6", + "grunt-nodemon": "^0.4.0", + "grunt-shell": "^1.1.1", + "load-grunt-tasks": "^3.1.0", + "grunt-nginx": "~0.2.2", + "grunt-contrib-copy": "~0.8.0", + "grunt-contrib-clean": "~0.6.0", + "proxit": "~0.6.4" + } +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/css/common.css ---------------------------------------------------------------------- diff --git a/dashboard/public/css/common.css b/dashboard/public/css/common.css new file mode 100644 index 0000000..c6af853 --- /dev/null +++ b/dashboard/public/css/common.css @@ -0,0 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +div.separator { + position: relative; + font-size: 18px; + color: #aaa; + margin-top: 10px; + margin-bottom: 10px; + padding-top: 10px; + padding-bottom: 10px; +} + +span.separator { + display: block; + position: absolute; + left: 50%; + top: -2px; + margin-left: -25px; + background-color: #fff; + width: 50px; + text-align: center; +} + +hr.separator { + background-color: #cdcdcd; + height: 1px; + margin-top: 0px !important; + margin-bottom: 0px !important; +} + +.pointer { + cursor: pointer; +} + +.form-control { + border-color: #5cbb5a; + border-width: 2px; +} + +.small-txt { + color: #999999; + padding-left: 14px; +} + +/* Header background */ +header.navbar-top { + background-color: #fafafa; + border-bottom: solid 4px #5cbb5a; + margin-bottom: 0px; +} + +header .container { + padding: 12px; +} + +/* Footer */ +footer.navbar-bottom { + background-color: #fafafa; + border-top: solid 4px #5cbb5a; +} + +footer.navbar-bottom p { + color: #333333; + margin: 23px 10px 10px; +} + +footer.navbar-bottom img { + padding-left: 5px; + margin-top: -21px; +} + +.searchresults { + border: 1px solid #ddd; + padding: 10px; +} + +.mt10px { + margin-top: 10px; +} + +.mt20px { + margin-top: 20px; +} + +.searchresults:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} + +.searchresults:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.searchresults hr { + margin: 0; + border: 0; +} +.searchresults .well { + background-color: #fff; + border: 0; + box-shadow: none; + height: auto; + min-height: 0; + padding: 5px 5px 5px 0; +} +.search-spinner { + text-align: center; +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/css/d3tip.css ---------------------------------------------------------------------- diff --git a/dashboard/public/css/d3tip.css b/dashboard/public/css/d3tip.css new file mode 100644 index 0000000..11e12b2 --- /dev/null +++ b/dashboard/public/css/d3tip.css @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.d3-tip { + line-height: 1; + font-weight: bold; + padding: 12px; + background: rgba(0, 0, 0, 0.8); + color: #fff; + border-radius: 2px; +} + +/* Creates a small triangle extender for the tooltip */ +.d3-tip:after { + box-sizing: border-box; + display: inline; + font-size: 10px; + width: 100%; + line-height: 1; + color: rgba(0, 0, 0, 0.8); + content: "\25BC"; + position: absolute; + text-align: center; +} + +/* Style northward tooltips differently */ +.d3-tip.n:after { + margin: -1px 0 0 0; + top: 100%; + left: 0; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/css/details.css ---------------------------------------------------------------------- diff --git a/dashboard/public/css/details.css b/dashboard/public/css/details.css new file mode 100644 index 0000000..156d5f6 --- /dev/null +++ b/dashboard/public/css/details.css @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.tab-content .table-bordered { + border-top: none; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/css/lineage.css ---------------------------------------------------------------------- diff --git a/dashboard/public/css/lineage.css b/dashboard/public/css/lineage.css new file mode 100644 index 0000000..fddc0b0 --- /dev/null +++ b/dashboard/public/css/lineage.css @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*g circle {*/ + /*cursor: pointer;*/ + /*stroke: green;*/ + /*stroke-width: 2px;*/ + /*fill: url(#process-image);*/ +/*}*/ + +/*g circle.empty {*/ + /*fill: #90ef96;*/ +/*}*/ + +.link { + fill: none; + stroke: green; + stroke-width: 2px; + +} + +g text { + pointer-events: none; + text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff; + text-align: center; +} + +.d3-tip pre { + max-width: 400px; +} + +div.lineage { + border-bottom: 2px solid #006600; + +} + +/*.node rect {*/ + /*stroke: #333;*/ + /*fill: #fff;*/ +/*}*/ + +.edgePath path { + stroke: #333; + fill: #333; + stroke-width: 1.5px; +} + +/*.node rect,*/ +/*.node circle {*/ + /*stroke: #333;*/ + /*fill: #fff;*/ + /*stroke-width: 1.5px;*/ +/*}*/ + +.lineage-viz { + margin: 0 auto; + overflow: auto; + /*border: 1px solid #ddd; + border-top: none;*/ + +} +/*.images {*/ + /*background-image: url("../img/process.png");*/ +/*}â*/ http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/css/sticky-footer-navbar.css ---------------------------------------------------------------------- diff --git a/dashboard/public/css/sticky-footer-navbar.css b/dashboard/public/css/sticky-footer-navbar.css new file mode 100644 index 0000000..3a2444b --- /dev/null +++ b/dashboard/public/css/sticky-footer-navbar.css @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Sticky footer styles +-------------------------------------------------- */ +html { + position: relative; + min-height: 100%; +} +body { + /* Margin bottom by footer height */ + margin-bottom: 60px; +} + +.content { + padding-bottom: 90px; +} + +.footer { + position: absolute; + bottom: 0; + width: 100%; + /* Set the fixed height of the footer here */ + height: 60px; + background-color: #f5f5f5; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/index.html ---------------------------------------------------------------------- diff --git a/dashboard/public/index.html b/dashboard/public/index.html new file mode 100644 index 0000000..5ce839d --- /dev/null +++ b/dashboard/public/index.html @@ -0,0 +1,72 @@ +<!doctype html> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<html lang="en" xmlns="http://www.w3.org/1999/xhtml" itemscope="itemscope" itemtype="http://schema.org/Product"> +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <title>Apache Atlas</title> + <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> + + + <link href="img/favicon.ico" rel="shortcut icon" type="image/x-icon"> + + <link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css"> + <link rel="stylesheet" href="/css/sticky-footer-navbar.css"> + <link rel="stylesheet" href="/css/common.css"> + <link rel="stylesheet" href="/css/details.css"> + <link rel="stylesheet" href="/css/lineage.css"> + <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> + </head> + + +<link href="img/favicon.ico" rel="shortcut icon" type="image/x-icon"> +<body> +<header class="navbar navbar-static-top navbar-top" data-role="navigation"> + <div class="container" data-ng-include="'/modules/home/views/header.html'"></div> +</header> +<div class="content"> + <div data-ng-include="'/modules/notification/views/notifications.html'"></div> + <div data-ui-view class="container"></div> +</div> +<footer class="footer navbar-bottom"> + <div class="container"> + <!--<p align="right">Powered by<img src="modules/home/img/logo-green.png"></p>--> + </div> +</footer> + +<script src="lib/jquery/dist/jquery.js"></script> +<script src="lib/angular/angular.js"></script> +<script src="lib/bootstrap/dist/js/bootstrap.js"></script> +<script src="lib/angular-bootstrap/ui-bootstrap-tpls.js"></script> +<script src="lib/angular-cookies/angular-cookies.js"></script> +<script src="lib/angular-resource/angular-resource.js"></script> +<script src="lib/angular-route/angular-route.js"></script> +<script src="lib/angular-sanitize/angular-sanitize.js"></script> +<script src="lib/angular-ui-router/release/angular-ui-router.js"></script> +<script src="lib/angular-ui-utils/ui-utils.js"></script> +<script src="lib/lodash/lodash.js"></script> +<script src="/lib/d3/d3.js"></script> +<script src="/lib/d3-tip/index.js"></script> + +<script src="js/app.min.js"></script> +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/js/app.js ---------------------------------------------------------------------- diff --git a/dashboard/public/js/app.js b/dashboard/public/js/app.js new file mode 100644 index 0000000..1bdb316 --- /dev/null +++ b/dashboard/public/js/app.js @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc', ['ngCookies', + 'ngResource', + 'ui.bootstrap', + 'ui.router', + 'dgc.system', + 'dgc.home', + 'dgc.search', + 'dgc.navigation' +]); + +angular.module('dgc.system', ['dgc.system.notification']); + +angular.module('dgc').factory('lodash', ['$window', + function($window) { + return $window._; + } +]).factory('d3', ['$window', + function($window) { + return $window.d3; + } +]).factory('Global', ['$window', '$location', + function($window, $location) { + return { + user: $location.search()['user.name'], + authenticated: !!$window.user, + renderErrors: $window.renderErrors + }; + } +]).factory('HttpInterceptor', ['Global', function(Global) { + return { + 'request': function(config) { + if (config.url && (config.url.indexOf('api/atlas/') === 0 || config.url.indexOf('/api/atlas/') === 0)) { + config.params = config.params || {}; + config.params['user.name'] = Global.user; + } + return config; + } + }; +}]).config(['$httpProvider', function($httpProvider) { + $httpProvider.interceptors.push('HttpInterceptor'); +}]).run(['$rootScope', 'Global', 'NotificationService', 'lodash', 'd3', function($rootScope, Global, NotificationService, lodash, d3) { + var errors = Global.renderErrors; + if (angular.isArray(errors) || angular.isObject(errors)) { + lodash.forEach(errors, function(err) { + err = angular.isObject(err) ? err : { + message: err + }; + err.timeout = false; + NotificationService.error(err); + }); + } else { + if (errors) { + errors.timeout = false; + NotificationService.error(errors); + } + } + $rootScope.$on('$stateChangeStart', function() { + d3.selectAll('.d3-tip').remove(); + }); +}]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/js/init.js ---------------------------------------------------------------------- diff --git a/dashboard/public/js/init.js b/dashboard/public/js/init.js new file mode 100644 index 0000000..aa99935 --- /dev/null +++ b/dashboard/public/js/init.js @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.element(document).ready(function() { + /* Fixing facebook bug with redirect */ + if (window.location.hash === '#_=_') window.location.hash = '#!'; + + //Then init the app + angular.bootstrap(document, ['dgc'], { + strictDi: true + }); +}); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/js/routes.js ---------------------------------------------------------------------- diff --git a/dashboard/public/js/routes.js b/dashboard/public/js/routes.js new file mode 100644 index 0000000..8d0a3ac --- /dev/null +++ b/dashboard/public/js/routes.js @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +//Setting up route +angular.module('dgc').config(['$locationProvider', '$urlRouterProvider', + function($locationProvider, $urlRouterProvider) { + $locationProvider.hashPrefix('!'); + // For unmatched routes: + $urlRouterProvider.otherwise('/search'); + } +]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/details/detailsController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/detailsController.js b/dashboard/public/modules/details/detailsController.js new file mode 100644 index 0000000..0e96d42 --- /dev/null +++ b/dashboard/public/modules/details/detailsController.js @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.details').controller('DetailsController', ['$window', '$scope', '$stateParams', 'DetailsResource', + function($window, $scope, $stateParams, DetailsResource) { + + $scope.tableName = false; + $scope.isTable = false; + + DetailsResource.get({ + id: $stateParams.id + }, function(data) { + $scope.details = data; + $scope.schemas = data; + $scope.tableName = data.values.name; + $scope.isTable = data.typeName === 'Table'; + }); + + $scope.isString = angular.isString; + + $scope.onActivate = function tabActivate(tabname) { + $scope.$broadcast('render-lineage', { + type: tabname, + tableName: $scope.tableName + }); + }; + + $scope.goBack = function() { + $window.history.back(); + }; + + } +]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/details/detailsModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/detailsModule.js b/dashboard/public/modules/details/detailsModule.js new file mode 100644 index 0000000..987750a --- /dev/null +++ b/dashboard/public/modules/details/detailsModule.js @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.details', ['dgc.lineage']); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/details/detailsResource.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/detailsResource.js b/dashboard/public/modules/details/detailsResource.js new file mode 100644 index 0000000..af2f249 --- /dev/null +++ b/dashboard/public/modules/details/detailsResource.js @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.details').factory('DetailsResource', ['$resource', function($resource) { + return $resource('/api/atlas/entities/:id', {}, { + get: { + method: 'GET', + transformResponse: function(data) { + if (data) { + return angular.fromJson(data.definition); + } + }, + responseType: 'json' + } + }); + +}]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/details/detailsRoutes.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/detailsRoutes.js b/dashboard/public/modules/details/detailsRoutes.js new file mode 100644 index 0000000..17e32fa --- /dev/null +++ b/dashboard/public/modules/details/detailsRoutes.js @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.details').config(['$stateProvider', + function($stateProvider) { + + // states for my app + $stateProvider.state('details', { + url: '/details/:id', + templateUrl: '/modules/details/views/details.html' + }); + } +]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/details/views/attribute.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/views/attribute.html b/dashboard/public/modules/details/views/attribute.html new file mode 100644 index 0000000..89fa067 --- /dev/null +++ b/dashboard/public/modules/details/views/attribute.html @@ -0,0 +1,29 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<!--<div>--> +<!--{{key}}:--> + +<!--{{value}}--> +<!--</div>--> + +<div class="row" data-ng-repeat="(key1, value1) in value" ng-if="value1"> + <div class="col-md-6" data-ng-if="!isString(value1)" data-ng-repeat="(key2, value2) in value1 track by $index"></div> + <div data-ng-if="isString(value2)" data-ng-repeat="(key3, value3) in value2"> {{key3}}: {{value3}}</div> + <div class="col-md-6" data-ng-if="isString(value1)"> {{key1}} : {{value1 | date:'medium'}}</div> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/details/views/details.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/views/details.html b/dashboard/public/modules/details/views/details.html new file mode 100644 index 0000000..19f0ce0 --- /dev/null +++ b/dashboard/public/modules/details/views/details.html @@ -0,0 +1,49 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<div class="row" data-ng-controller="DetailsController"> + <ul class="breadcrumb"> + <li><button class="btn btn-link" data-ng-click="goBack()">Back To Result</button> </li> + </ul> + <div role="tabpanel" class="col-lg-12"> + <h2>Name: {{details.values.name}}</h2> + <h4>Description: {{details.values.description}}</h4> + <tabset> + <tab heading="Details"> + <table class="table table-bordered"> + <thead> + <tr> + <th>Key</th> + <th>Value</th> + </tr> + </thead> + <tbody> + <tr data-ng-repeat="(key,value) in details.values" ng-if="value && !(key==='columns') && !(key==='name') && !(key==='description')"> + <td>{{key}}</td> + <td data-ng-if="!isString(value)" data-ng-include="'/modules/details/views/attribute.html'"></td> + <td data-ng-if="isString(value)">{{value | date:'medium'}}</td> + </tr> + </tbody> + </table> + </tab> + <tab data-heading="Schema" data-ng-if="isTable"><ng-include src="'/modules/details/views/schema.html'"/></tab> + <tab data-heading="Output" data-ng-if="isTable" data-disable="!tableName" data-select="onActivate('outputs')"><ng-include data-table-type="outputs" src="'/modules/lineage/views/lineage.html'"/></tab> + <tab data-heading="Input" data-ng-if="isTable" data-disable="!tableName" data-select="onActivate('inputs')"><ng-include data-table-type="inputs" src="'/modules/lineage/views/lineage.html'"/></tab> + </tabset> + </div> +</div> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/details/views/schema.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/views/schema.html b/dashboard/public/modules/details/views/schema.html new file mode 100644 index 0000000..1aaf96d --- /dev/null +++ b/dashboard/public/modules/details/views/schema.html @@ -0,0 +1,52 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<table class="table table-bordered"> + <thead> + <tr> + <th>Name</th> + <th>Comment</th> + <th>DataType</th> + </tr> + </thead> + <tbody> + <tr> + <td> {{details.values.columns[0].values.name}}</td> + <td>{{details.values.columns[0].values.comment}}</td> + <td> {{details.values.columns[0].values.dataType}}</td> + + </tr> + <tr> + + <td> {{details.values.columns[1].values.name}}</td> + <td>{{details.values.columns[1].values.comment}}</td> + <td> {{details.values.columns[1].values.dataType}}</td> + </tr> + <tr> + + <td> {{details.values.columns[2].values.name}}</td> + <td>{{details.values.columns[2].values.comment}}</td> + <td> {{details.values.columns[2].values.dataType}}</td> + </tr> + <tr> + + <td> {{details.values.columns[3].values.name}}</td> + <td>{{details.values.columns[3].values.comment}}</td> + <td> {{details.values.columns[3].values.dataType}}</td> + </tr> + </tbody> +</table> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/home/headerController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/home/headerController.js b/dashboard/public/modules/home/headerController.js new file mode 100644 index 0000000..a8d1411 --- /dev/null +++ b/dashboard/public/modules/home/headerController.js @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.home').controller('HeaderController', ['$scope', function($scope) { + + $scope.menu = []; + + $scope.isCollapsed = true; + $scope.isLoggedIn = function() { + return true; + }; +}]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/home/homeModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/home/homeModule.js b/dashboard/public/modules/home/homeModule.js new file mode 100644 index 0000000..017811c --- /dev/null +++ b/dashboard/public/modules/home/homeModule.js @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.home', []); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/home/views/header.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/home/views/header.html b/dashboard/public/modules/home/views/header.html new file mode 100644 index 0000000..85c5f4d --- /dev/null +++ b/dashboard/public/modules/home/views/header.html @@ -0,0 +1,36 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<div data-ng-controller="HeaderController" class="row"> + <div class="navbar-header"> + <button class="navbar-toggle" type="button" data-ng-click="isCollapsed = !isCollapsed"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a data-ui-sref="search({ query: '' })" data-ui-sref-active="active"><img src="../img/ApacheAtlasLogo.png" /></a> + </div> + <nav class="collapse navbar-collapse" data-collapse="isCollapsed" data-role="navigation"> + <ul class="navbar-nav nav" data-ng-if="isLoggedIn()"> + <li data-ng-repeat="item in menu" data-ui-sref-active="active"> + <a data-ui-sref="{{item.state}}">{{item.title}}</a> + </li> + </ul> + </nav> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/home/views/home.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/home/views/home.html b/dashboard/public/modules/home/views/home.html new file mode 100644 index 0000000..4e93782 --- /dev/null +++ b/dashboard/public/modules/home/views/home.html @@ -0,0 +1,21 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<section class="text-center"> + <img data-ui-sref="search" class="pointer" src="modules/home/img/splash.png"/> +</section> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/lineage/lineageController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/lineage/lineageController.js b/dashboard/public/modules/lineage/lineageController.js new file mode 100644 index 0000000..b8bd09c --- /dev/null +++ b/dashboard/public/modules/lineage/lineageController.js @@ -0,0 +1,299 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * 'License'); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.lineage').controller('LineageController', ['$element', '$scope', '$state', '$stateParams', 'lodash', 'LineageResource', 'd3', 'DetailsResource', '$q', + function($element, $scope, $state, $stateParams, _, LineageResource, d3, DetailsResource, $q) { + var guidsList = []; + + function getLineageData(tableData, callRender) { + LineageResource.get({ + tableName: tableData.tableName, + type: tableData.type + }, function lineageSuccess(response) { + if (!_.isEmpty(response.results.values.vertices)) { + var allGuids = loadProcess(response.results.values.edges, response.results.values.vertices); + allGuids.then(function(res) { + guidsList = res; + $scope.lineageData = transformData(response.results); + if (callRender) { + render(); + } + }); + } + $scope.requested = false; + }); + } + + function loadProcess(edges, vertices) { + + var urlCalls = []; + var deferred = $q.defer(); + for (var guid in edges) { + if (!vertices.hasOwnProperty(guid)) { + urlCalls.push(DetailsResource.get({ + id: guid + }).$promise); + } + + } + $q.all(urlCalls) + .then(function(results) { + deferred.resolve(results); + }); + return deferred.promise; + } + + $scope.type = $element.parent().attr('data-table-type'); + $scope.requested = false; + + function render() { + renderGraph($scope.lineageData, { + element: $element[0], + height: $element[0].offsetHeight, + width: $element[0].offsetWidth + }); + $scope.rendered = true; + } + + $scope.$on('render-lineage', function(event, lineageData) { + if (lineageData.type === $scope.type) { + if (!$scope.lineageData) { + if (!$scope.requested) { + getLineageData(lineageData, true); + $scope.requested = true; + } + } else { + render(); + } + } + }); + + function transformData(metaData) { + var edges = metaData.values.edges, + vertices = metaData.values.vertices, + nodes = {}; + + function getNode(guid) { + var name, type, tip; + if (vertices.hasOwnProperty(guid)) { + name = vertices[guid].values.name; + type = vertices[guid].values.vertexId.values.typeName; + } else { + var loadProcess = getLoadProcessTypes(guid); + if (typeof loadProcess !== "undefined") { + name = loadProcess.name; + type = loadProcess.typeName; + tip = loadProcess.tip; + } else { + name = 'Load Process'; + type = 'Load Process'; + } + } + var vertex = { + guid: guid, + name: name, + type: type, + tip: tip + }; + if (!nodes.hasOwnProperty(guid)) { + nodes[guid] = vertex; + } + return nodes[guid]; + } + + function getLoadProcessTypes(guid) { + var procesRes = []; + angular.forEach(guidsList, function(value) { + if (value.id.id === guid) { + procesRes.name = value.values.name; + procesRes.typeName = value.typeName; + procesRes.tip = value.values.queryText; + } + }); + return procesRes; + } + + function attachParent(edge, node) { + edge.forEach(function eachPoint(childGuid) { + var childNode = getNode(childGuid); + node.children = node.children || []; + node.children.push(childNode); + childNode.parent = node.guid; + }); + } + + /* Loop through all edges and attach them to correct parent */ + for (var guid in edges) { + var edge = edges[guid], + node = getNode(guid); + + /* Attach parent to each endpoint of edge */ + attachParent(edge, node); + } + + /* Return the first node w/o parent, this is root node*/ + return _.find(nodes, function(node) { + return !node.hasOwnProperty('parent'); + }); + } + + function renderGraph(data, container) { + // ************** Generate the tree diagram ***************** + var element = d3.select(container.element), + width = Math.max(container.width, 960), + height = Math.max(container.height, 350); + + var margin = { + top: 100, + right: 80, + bottom: 30, + left: 80 + }; + width = width - margin.right - margin.left; + height = height - margin.top - margin.bottom; + + var i = 0; + + var tree = d3.layout.tree() + .size([height, width]); + + var diagonal = d3.svg.diagonal() + .projection(function(d) { + return [d.y, d.x]; + }); + + /* Initialize tooltip */ + var tooltip = d3.tip() + .attr('class', 'd3-tip') + .html(function(d) { + return '<pre class="alert alert-success">' + d.tip + '</pre>'; + }); + + var svg = element.select('svg') + .attr('width', width + margin.right + margin.left) + .attr('height', height + margin.top + margin.bottom) + /* Invoke the tip in the context of your visualization */ + .call(tooltip) + .select('g') + .attr('transform', + 'translate(' + margin.left + ',' + margin.right + ')'); + //arrow + svg.append("svg:defs").append("svg:marker").attr("id", "arrow").attr("viewBox", "0 0 10 10").attr("refX", 26).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 6).attr("markerHeight", 9).attr("orient", "auto").append("svg:path").attr("d", "M 0 0 L 10 5 L 0 10 z"); + + //marker for input type graph + svg.append("svg:defs") + .append("svg:marker") + .attr("id", "input-arrow") + .attr("viewBox", "0 0 10 10") + .attr("refX", -15) + .attr("refY", 5) + .attr("markerUnits", "strokeWidth") + .attr("markerWidth", 6) + .attr("markerHeight", 9) + .attr("orient", "auto") + .append("svg:path") + .attr("d", "M -2 5 L 8 0 L 8 10 z"); + + var root = data; + + function update(source) { + + // Compute the new tree layout. + var nodes = tree.nodes(source).reverse(), + links = tree.links(nodes); + + // Normalize for fixed-depth. + nodes.forEach(function(d) { + d.y = d.depth * 180; + }); + + // Declare the nodes⦠+ var node = svg.selectAll('g.node') + .data(nodes, function(d) { + return d.id || (d.id = ++i); + }); + + // Enter the nodes. + var nodeEnter = node.enter().append('g') + .attr('class', 'node') + .attr('transform', function(d) { + return 'translate(' + d.y + ',' + d.x + ')'; + }); + + nodeEnter.append("image") + .attr("xlink:href", function(d) { + //return d.icon; + return d.type === 'Table' ? '../img/tableicon.png' : '../img/process.png'; + }) + .on('mouseover', function(d) { + if (d.type === 'LoadProcess') { + tooltip.show(d); + } + }) + .on('mouseout', function(d) { + if (d.type === 'LoadProcess') { + tooltip.hide(d); + } + }) + .attr("x", "-18px") + .attr("y", "-18px") + .attr("width", "34px") + .attr("height", "34px"); + + nodeEnter.append('text') + .attr('x', function(d) { + return d.children || d._children ? + (5) * -1 : +15; + }) + .attr('dy', '-1.75em') + .attr('text-anchor', function(d) { + return d.children || d._children ? 'middle' : 'middle'; + }) + .text(function(d) { + return d.name; + }) + + .style('fill-opacity', 1); + + // Declare the links⦠+ var link = svg.selectAll('path.link') + .data(links, function(d) { + return d.target.id; + }); + + link.enter().insert('path', 'g') + .attr('class', 'link') + //.style('stroke', function(d) { return d.target.level; }) + .style('stroke', 'green') + .attr('d', diagonal); + + if ($scope.type === 'inputs') { + link.attr("marker-start", "url(#input-arrow)"); //if input + } else { + link.attr("marker-end", "url(#arrow)"); //if input + } + + } + + update(root); + } + + } +]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/lineage/lineageModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/lineage/lineageModule.js b/dashboard/public/modules/lineage/lineageModule.js new file mode 100644 index 0000000..4fda24d --- /dev/null +++ b/dashboard/public/modules/lineage/lineageModule.js @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.lineage', []); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/lineage/lineageResource.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/lineage/lineageResource.js b/dashboard/public/modules/lineage/lineageResource.js new file mode 100644 index 0000000..e729a35 --- /dev/null +++ b/dashboard/public/modules/lineage/lineageResource.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.lineage').factory('LineageResource', ['$resource', function($resource) { + return $resource('/api/atlas/lineage/hive/table/:tableName/:type/graph', {}); +}]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/lineage/views/lineage.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/lineage/views/lineage.html b/dashboard/public/modules/lineage/views/lineage.html new file mode 100644 index 0000000..e2e9ebd --- /dev/null +++ b/dashboard/public/modules/lineage/views/lineage.html @@ -0,0 +1,25 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<div class="lineage-viz" data-ng-controller="LineageController"> + <h4 data-ng-if="!requested && !lineageData">No lineage data found</h4> + <i data-ng-if="requested" class="fa fa-spinner fa-spin fa-5x"></i> + <svg > + <g/> + </svg> +</div> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/navigation/navigationController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/navigation/navigationController.js b/dashboard/public/modules/navigation/navigationController.js new file mode 100644 index 0000000..a012885 --- /dev/null +++ b/dashboard/public/modules/navigation/navigationController.js @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.navigation').controller('NavigationController', ['$scope', 'NavigationResource', + function($scope, NavigationResource) { + + $scope.leftnav = NavigationResource.get(); + $scope.updateVar = function(event) { + $scope.$$prevSibling.query = angular.element(event.target).text(); + + }; + + } +]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/navigation/navigationModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/navigation/navigationModule.js b/dashboard/public/modules/navigation/navigationModule.js new file mode 100644 index 0000000..504eb1f --- /dev/null +++ b/dashboard/public/modules/navigation/navigationModule.js @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.navigation', []); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/navigation/navigationResource.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/navigation/navigationResource.js b/dashboard/public/modules/navigation/navigationResource.js new file mode 100644 index 0000000..3d9797d --- /dev/null +++ b/dashboard/public/modules/navigation/navigationResource.js @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.navigation').factory('NavigationResource', ['$resource', function($resource) { + return $resource('/api/atlas/types?type=TRAIT', {}, { + get: { + 'method': 'GET', + 'responseType': 'json', + 'isArray': true, + 'transformResponse': function(data) { + var results = []; + angular.forEach(data && data.results, function(val) { + results.push(val); + }); + return results; + } + } + }); +}]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/navigation/views/navigation.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/navigation/views/navigation.html b/dashboard/public/modules/navigation/views/navigation.html new file mode 100644 index 0000000..1c94671 --- /dev/null +++ b/dashboard/public/modules/navigation/views/navigation.html @@ -0,0 +1,24 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<div data-ng-controller="NavigationController"> + <h4>Tags</h4> + <div class="list-group"> + <a ng-repeat="nav in leftnav" ui-sref="search({ query: nav })" class="list-group-item">{{nav}} </a> + </div> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/37db9955/dashboard/public/modules/notification/notificationController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/notification/notificationController.js b/dashboard/public/modules/notification/notificationController.js new file mode 100644 index 0000000..ac36b0f --- /dev/null +++ b/dashboard/public/modules/notification/notificationController.js @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +angular.module('dgc.system.notification').controller('NotificationController', ['$scope', 'NotificationService', + function($scope, NotificationService) { + + $scope.getNotifications = NotificationService.getAll; + + $scope.close = function(notification) { + NotificationService.close(notification); + }; + } +]);
