This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial hawkular ui project checkin using hawt.io 2 (https://github.c…
- Loading branch information
Showing
36 changed files
with
724 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
README.adoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory" : "libs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
libs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "hawkular-alerts", | ||
"version": "0.1.0", | ||
"keywords": [ | ||
"hawtio" | ||
], | ||
"main": [ | ||
"dist/hawkular-alerts.js" | ||
], | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"libs", | ||
"test", | ||
"tests", | ||
"plugins" | ||
], | ||
"dependencies": { | ||
"hawtio-core": "~2.0.0", | ||
"hawtio-core-navigation": "~2.0.0", | ||
"hawtio-utilities": "~2.0.0" | ||
}, | ||
"devDependencies": { | ||
"bootstrap": "~3.3.1", | ||
"patternfly": "~1.1.2", | ||
"hawtio-core-dts": "~2.0.0", | ||
"angular-mocks": "~1.3.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// <reference path="alertsPlugin.d.ts" /> | ||
declare module HawkularAlerts { | ||
var AlertsController: ng.IModule; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// <reference path="../../includes.d.ts" /> | ||
declare module HawkularAlerts { | ||
var pluginName: string; | ||
var log: Logging.Logger; | ||
var templatePath: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference path="../../includes.d.ts" /> | ||
/// <reference path="alertsGlobals.d.ts" /> | ||
declare module HawkularAlerts { | ||
var _module: ng.IModule; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference path="../libs/hawtio-utilities/defs.d.ts" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// <reference path="d.ts/includes.d.ts"/> | ||
/// <reference path="d.ts/alerts/ts/alertsGlobals.d.ts"/> | ||
/// <reference path="d.ts/alerts/ts/alertsPlugin.d.ts"/> | ||
/// <reference path="d.ts/alerts/ts/alerts.d.ts"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/// <reference path="../libs/hawtio-utilities/defs.d.ts"/> | ||
|
||
/// <reference path="../../includes.ts"/> | ||
var HawkularAlerts; | ||
(function (HawkularAlerts) { | ||
HawkularAlerts.pluginName = "hawtio-assembly"; | ||
HawkularAlerts.log = Logger.get(HawkularAlerts.pluginName); | ||
HawkularAlerts.templatePath = "plugins/alerts/html"; | ||
})(HawkularAlerts || (HawkularAlerts = {})); | ||
|
||
/// <reference path="../../includes.ts"/> | ||
/// <reference path="alertsGlobals.ts"/> | ||
var HawkularAlerts; | ||
(function (HawkularAlerts) { | ||
HawkularAlerts._module = angular.module(HawkularAlerts.pluginName, []); | ||
var tab = undefined; | ||
HawkularAlerts._module.config(['$locationProvider', '$routeProvider', 'HawtioNavBuilderProvider', function ($locationProvider, $routeProvider, builder) { | ||
tab = builder.create().id(HawkularAlerts.pluginName).title(function () { return "Alerts"; }).href(function () { return "/alerts"; }).subPath("Alerts", "alerts", builder.join(HawkularAlerts.templatePath, 'alerts.html')).build(); | ||
builder.configureRouting($routeProvider, tab); | ||
$locationProvider.html5Mode(true); | ||
}]); | ||
HawkularAlerts._module.run(['HawtioNav', function (HawtioNav) { | ||
HawtioNav.add(tab); | ||
//log.debug("loaded"); | ||
}]); | ||
hawtioPluginLoader.addModule(HawkularAlerts.pluginName); | ||
})(HawkularAlerts || (HawkularAlerts = {})); | ||
|
||
/// <reference path="alertsPlugin.ts"/> | ||
var HawkularAlerts; | ||
(function (HawkularAlerts) { | ||
HawkularAlerts.AlertsController = HawkularAlerts._module.controller("HawkularAlerts.AlertsController", ['$scope', function ($scope) { | ||
$scope.target = "World!"; | ||
}]); | ||
})(HawkularAlerts || (HawkularAlerts = {})); | ||
|
||
angular.module("hawkular-alerts-templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("plugins/alerts/html/alerts.html","<div class=\"row\">\n <div class=\"col-md-12\" ng-controller=\"HawkularAlerts.AlertsController\">\n <h1>Alerts</h1>\n <p>Hello {{target}}</p>\n </div>\n</div>\n");}]); hawtioPluginLoader.addModule("hawkular-alerts-templates"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
var gulp = require('gulp'), | ||
wiredep = require('wiredep').stream, | ||
eventStream = require('event-stream'), | ||
gulpLoadPlugins = require('gulp-load-plugins'), | ||
map = require('vinyl-map'), | ||
fs = require('fs'), | ||
path = require('path'), | ||
s = require('underscore.string'); | ||
|
||
var plugins = gulpLoadPlugins({}); | ||
var pkg = require('./package.json'); | ||
|
||
var config = { | ||
main: '.', | ||
ts: ['plugins/**/*.ts'], | ||
templates: ['plugins/**/*.html'], | ||
templateModule: pkg.name + '-templates', | ||
dist: './dist/', | ||
js: pkg.name + '.js', | ||
tsProject: plugins.typescript.createProject({ | ||
target: 'ES5', | ||
module: 'commonjs', | ||
declarationFiles: true, | ||
noExternalResolve: false | ||
}) | ||
}; | ||
|
||
gulp.task('bower', function() { | ||
gulp.src('index.html') | ||
.pipe(wiredep({})) | ||
.pipe(gulp.dest('.')); | ||
}); | ||
|
||
/** Adjust the reference path of any typescript-built plugin this project depends on */ | ||
gulp.task('path-adjust', function() { | ||
gulp.src('libs/**/includes.d.ts') | ||
.pipe(map(function(buf, filename) { | ||
var textContent = buf.toString(); | ||
var newTextContent = textContent.replace(/"\.\.\/libs/gm, '"../../../libs'); | ||
// console.log("Filename: ", filename, " old: ", textContent, " new:", newTextContent); | ||
return newTextContent; | ||
})) | ||
.pipe(gulp.dest('libs')); | ||
}); | ||
|
||
gulp.task('clean-defs', function() { | ||
return gulp.src('defs.d.ts', { read: false }) | ||
.pipe(plugins.clean()); | ||
}); | ||
|
||
gulp.task('tsc', ['clean-defs'], function() { | ||
var cwd = process.cwd(); | ||
var tsResult = gulp.src(config.ts) | ||
.pipe(plugins.typescript(config.tsProject)) | ||
.on('error', plugins.notify.onError({ | ||
message: '#{ error.message }', | ||
title: 'Typescript compilation error' | ||
})); | ||
|
||
return eventStream.merge( | ||
tsResult.js | ||
.pipe(plugins.concat('compiled.js')) | ||
.pipe(gulp.dest('.')), | ||
tsResult.dts | ||
.pipe(gulp.dest('d.ts'))) | ||
.pipe(map(function(buf, filename) { | ||
if (!s.endsWith(filename, 'd.ts')) { | ||
return buf; | ||
} | ||
var relative = path.relative(cwd, filename); | ||
fs.appendFileSync('defs.d.ts', '/// <reference path="' + relative + '"/>\n'); | ||
return buf; | ||
})); | ||
}); | ||
|
||
gulp.task('template', ['tsc'], function() { | ||
return gulp.src(config.templates) | ||
.pipe(plugins.angularTemplatecache({ | ||
filename: 'templates.js', | ||
root: 'plugins/', | ||
standalone: true, | ||
module: config.templateModule, | ||
templateFooter: '}]); hawtioPluginLoader.addModule("' + config.templateModule + '");' | ||
})) | ||
.pipe(gulp.dest('.')); | ||
}); | ||
|
||
gulp.task('concat', ['template'], function() { | ||
return gulp.src(['compiled.js', 'templates.js']) | ||
.pipe(plugins.concat(config.js)) | ||
.pipe(gulp.dest(config.dist)); | ||
}); | ||
|
||
gulp.task('clean', ['concat'], function() { | ||
return gulp.src(['templates.js', 'compiled.js'], { read: false }) | ||
.pipe(plugins.clean()); | ||
}); | ||
|
||
gulp.task('watch', ['build'], function() { | ||
plugins.watch(['libs/**/*.js', 'libs/**/*.css', 'index.html', config.dist + '/' + config.js], function() { | ||
gulp.start('reload'); | ||
}); | ||
plugins.watch(['libs/**/*.d.ts', config.ts, config.templates], function() { | ||
gulp.start(['tsc', 'template', 'concat', 'clean']); | ||
}); | ||
}); | ||
|
||
gulp.task('connect', ['watch'], function() { | ||
plugins.connect.server({ | ||
root: '.', | ||
livereload: true, | ||
port: 2772, | ||
fallback: 'index.html' | ||
}); | ||
}); | ||
|
||
gulp.task('reload', function() { | ||
gulp.src('.') | ||
.pipe(plugins.connect.reload()); | ||
}); | ||
|
||
gulp.task('build', ['bower', 'path-adjust', 'tsc', 'template', 'concat', 'clean']); | ||
|
||
gulp.task('default', ['connect']); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>hawkular-alerts</title> | ||
<base href='/'></base> | ||
<meta charset="UTF8"> | ||
|
||
|
||
<link rel="stylesheet" href="libs/bootstrap/dist/css/bootstrap.css" /> | ||
<link rel="stylesheet" href="libs/patternfly/dist/css/patternfly.css" /> | ||
|
||
<!-- bower:css --> | ||
<!-- endbower --> | ||
|
||
<!-- ES6/ES6 shim --> | ||
<!--[if IE 8]> | ||
<script src="libs/es5-dom-shim/__COMIPLE/a.ie8.js"></script> | ||
<![endif]--> | ||
<script src="libs/es5-dom-shim/__COMPILE/a.js"></script> | ||
|
||
<!-- bower:js --> | ||
<script src="libs/jquery/dist/jquery.js"></script> | ||
<script src="libs/angular/angular.js"></script> | ||
<script src="libs/angular-sanitize/angular-sanitize.js"></script> | ||
<script src="libs/js-logger/src/logger.js"></script> | ||
<script src="libs/hawtio-core/hawtio-core.js"></script> | ||
<script src="libs/lodash/dist/lodash.compat.js"></script> | ||
<script src="libs/angular-route/angular-route.js"></script> | ||
<script src="libs/hawtio-core-navigation/dist/hawtio-core-navigation.js"></script> | ||
<script src="libs/uri.js/src/URI.js"></script> | ||
<script src="libs/uri.js/src/IPv6.js"></script> | ||
<script src="libs/uri.js/src/SecondLevelDomains.js"></script> | ||
<script src="libs/uri.js/src/punycode.js"></script> | ||
<script src="libs/uri.js/src/URITemplate.js"></script> | ||
<script src="libs/uri.js/src/jquery.URI.js"></script> | ||
<script src="libs/uri.js/src/URI.min.js"></script> | ||
<script src="libs/uri.js/src/jquery.URI.min.js"></script> | ||
<script src="libs/uri.js/src/URI.fragmentQuery.js"></script> | ||
<script src="libs/uri.js/src/URI.fragmentURI.js"></script> | ||
<script src="libs/hawtio-utilities/dist/sugar.js"></script> | ||
<script src="libs/hawtio-utilities/dist/angular-file-upload.js"></script> | ||
<script src="libs/hawtio-utilities/dist/hawtio-utilities.js"></script> | ||
<!-- endbower --> | ||
|
||
<script src="libs/bootstrap/dist/js/bootstrap.js"></script> | ||
<script src="libs/patternfly/dist/js/patternfly.js"></script> | ||
|
||
</head> | ||
|
||
<body> | ||
<nav class="navbar navbar-default navbar-pf" role="navigation"> | ||
<ul class="nav navbar-nav navbar-primary" hawtio-main-nav></ul> | ||
<ul class="nav navbar-nav" hawtio-sub-tabs></ul> | ||
</nav> | ||
|
||
<div id="main" class="container-fluid ng-cloak" ng-controller="HawtioNav.ViewController"> | ||
<div ng-include src="viewPartial"></div> | ||
</div> | ||
|
||
<!-- add any scripts under dist/ here --> | ||
<script src="dist/hawkular-alerts.js"></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "hawkular-alerts", | ||
"version": "0.1.0", | ||
"devDependencies": { | ||
"bower": "^1.3.12", | ||
"event-stream": "^3.1.7", | ||
"gulp": "^3.8.10", | ||
"gulp-angular-templatecache": "^1.5.0", | ||
"gulp-clean": "^0.3.1", | ||
"gulp-concat": "^2.4.2", | ||
"gulp-connect": "^2.2.0", | ||
"gulp-load-plugins": "^0.8.0", | ||
"gulp-notify": "^2.1.0", | ||
"gulp-typescript": "^2.3.0", | ||
"gulp-watch": "^3.0.0", | ||
"through2": "^0.6.3", | ||
"underscore.string": "^2.4.0", | ||
"vinyl-map": "^1.0.1", | ||
"which": "^1.0.8", | ||
"wiredep": "^2.2.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="row"> | ||
<div class="col-md-12" ng-controller="HawkularAlerts.AlertsController"> | ||
<h1>Alerts</h1> | ||
<p>Hello {{target}}</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// <reference path="alertsPlugin.ts"/> | ||
module HawkularAlerts { | ||
|
||
export var AlertsController = _module.controller("HawkularAlerts.AlertsController", ['$scope', ($scope) => { | ||
$scope.target = "World!"; | ||
}]); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference path="../../includes.ts"/> | ||
module HawkularAlerts { | ||
|
||
export var pluginName = "hawtio-assembly"; | ||
|
||
export var log:Logging.Logger = Logger.get(pluginName); | ||
|
||
export var templatePath = "plugins/alerts/html"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/// <reference path="../../includes.ts"/> | ||
/// <reference path="alertsGlobals.ts"/> | ||
module HawkularAlerts { | ||
|
||
export var _module = angular.module(HawkularAlerts.pluginName, []); | ||
|
||
var tab:any = undefined; | ||
|
||
_module.config(['$locationProvider', '$routeProvider', 'HawtioNavBuilderProvider', ($locationProvider, $routeProvider:ng.route.IRouteProvider, builder:HawtioMainNav.BuilderFactory) => { | ||
tab = builder.create() | ||
.id(HawkularAlerts.pluginName) | ||
.title(() => "Alerts") | ||
.href(() => "/alerts") | ||
.subPath("Alerts", "alerts", builder.join(HawkularAlerts.templatePath, 'alerts.html')) | ||
.build(); | ||
builder.configureRouting($routeProvider, tab); | ||
$locationProvider.html5Mode(true); | ||
}]); | ||
|
||
_module.run(['HawtioNav', (HawtioNav:HawtioMainNav.Registry) => { | ||
HawtioNav.add(tab); | ||
//log.debug("loaded"); | ||
}]); | ||
|
||
|
||
hawtioPluginLoader.addModule(HawkularAlerts.pluginName); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference path="../libs/hawtio-utilities/defs.d.ts"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory" : "libs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
libs/ | ||
|
Oops, something went wrong.