Skip to content

Commit

Permalink
Integration temporary hawkular-charts
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Jul 11, 2017
1 parent cddc1f5 commit 5e3bf1c
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 9 deletions.
6 changes: 5 additions & 1 deletion ui/src/main/ngapp/.angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
"../node_modules/patternfly/dist/css/patternfly-additions.min.css",
"styles.css"
],
"scripts": [],
"scripts": [
"../node_modules/d3/d3.min.js",
"../node_modules/d3-tip/index.js",
"../node_modules/moment/moment.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
Expand Down
6 changes: 5 additions & 1 deletion ui/src/main/ngapp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hawkular-ui",
"version": "0.0.0",
"license": "MIT",
"license": "Apache-2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -23,6 +23,10 @@
"@angular/router": "^4.0.0",
"angular-patternfly": "^4.0.0",
"core-js": "^2.4.1",
"d3": "^3.5.0",
"d3-tip": "0.6.7",
"moment": "^2.9.0",
"hawkular-charts": "file:///work/angular-library-starter/hawkular-charts-2.0.0-alpha.tgz",
"patternfly": "^3.25.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/ngapp/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, Inject } from '@angular/core';

@Component({
selector: 'app-root',
Expand Down
9 changes: 6 additions & 3 deletions ui/src/main/ngapp/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { HttpModule } from '@angular/http';

import { HawkularChartsModule } from 'hawkular-charts';

import { AppComponent } from './app.component';
import { MetricsPageComponent } from './metrics-page.component';
Expand All @@ -20,6 +22,7 @@ import { ChartComponent } from './chart.component';
BrowserModule,
FormsModule,
HttpModule,
HawkularChartsModule,
RouterModule.forRoot([{
path: '',
redirectTo: '/metrics',
Expand Down
4 changes: 4 additions & 0 deletions ui/src/main/ngapp/src/app/chart.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
float: left;
margin-bottom: 20px;
}

.chart {
min-height: 400px;
}
8 changes: 7 additions & 1 deletion ui/src/main/ngapp/src/app/chart.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ <h3>{{notice}}</h3>
<option value='30d'>Last month</option>
</select>
</div>
<div id="line-chart" class="line-chart-pf"></div>
<hk-metric-chart *ngIf="metric &amp;&amp; tenant &amp;&amp; type"
metricUrl="http://localhost:8080/hawkular/metrics"
[metricId]="metric"
[metricTenantId]="tenant"
[metricType]="type"
chartType="line">
</hk-metric-chart>
</div>
4 changes: 2 additions & 2 deletions ui/src/main/ngapp/src/app/chart.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { MetricChartComponent } from 'hawkular-charts';

@Component({
selector: 'chart',
Expand All @@ -14,7 +15,6 @@ export class ChartComponent implements OnInit {
type: string;
metric: string;
loading = false;

constructor(private route: ActivatedRoute) {
}

Expand Down

0 comments on commit 5e3bf1c

Please sign in to comment.