Skip to content

Commit

Permalink
dump all the monitoring code
Browse files Browse the repository at this point in the history
  • Loading branch information
peh committed Mar 25, 2017
1 parent 175e731 commit 0ad3c32
Show file tree
Hide file tree
Showing 47 changed files with 126 additions and 1,507 deletions.
2 changes: 0 additions & 2 deletions grails-app/assets/javascripts/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import UserService from "./services/user-service";
import ApplicationService from "./services/application-service";
import ErrorService from "./services/error-service";
import DeploymentService from "./services/deployment-service";
import MonitoringService from "./services/monitoring-service";
import SettingsService from "./services/settings-service";

const EventEmitter = require('events').EventEmitter;
Expand Down Expand Up @@ -37,7 +36,6 @@ export default class App {
this.applicationService = new ApplicationService(this.emitter, this.baseUrl);
this.errorService = new ErrorService(this.emitter, this.baseUrl);
this.deploymentService = new DeploymentService(this.emitter, this.baseUrl);
this.monitoringService = new MonitoringService(this.emitter, this.baseUrl);
this.settingsService = new SettingsService(this.emitter, this.baseUrl);

this.emitter.on(AppEvents.PAUSE_STATE_CHANGED, (paused) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import BaseComponent from "../tools/base-component";
import {LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer, CartesianGrid} from "recharts";
import LoadingHero from "../tools/loading-hero";
import Hero from "../tools/hero";
const moment = require('moment');
export default class EntryHistogram extends BaseComponent {

Expand All @@ -10,14 +11,15 @@ export default class EntryHistogram extends BaseComponent {

this.state = {
data: [],
first: true
first: true,
loading: true
};
this._bindThis('loadObjectsFromServer')
}

loadObjectsFromServer() {
this.getErrorService().histogram(this.props.entryGroup).then(json => {
this.updateState({data: json.data, first: false})
this.updateState({data: json.data, first: false, loading: false})
});
}

Expand All @@ -31,21 +33,24 @@ export default class EntryHistogram extends BaseComponent {
}

render() {
const {data, first} = this.state;
if (data.length == 0) {
const {data, first, loading} = this.state;
if (loading) {
return <LoadingHero />
} else if (data.length == 0) {
return <Hero><h2>No Data found</h2></Hero>
} else {
return (
<ResponsiveContainer width={"100%"} height={400}>
<LineChart data={data}>
<Line dataKey="value" animationDuration={500} isAnimationActive={first}/>
<XAxis tick={<CustomizedTick data={data}/>}/>
<YAxis />
<Tooltip isAnimationActive={false} content={<CustomTooltip/>}/>
<CartesianGrid vertical={false}/>
</LineChart>
</ResponsiveContainer>
)
}
return (
<ResponsiveContainer width={"100%"} height={400}>
<LineChart data={data}>
<Line dataKey="value" animationDuration={500} isAnimationActive={first}/>
<XAxis tick={<CustomizedTick data={data}/>}/>
<YAxis />
<Tooltip isAnimationActive={false} content={<CustomTooltip/>}/>
<CartesianGrid vertical={false}/>
</LineChart>
</ResponsiveContainer>
)

}

Expand Down
32 changes: 1 addition & 31 deletions grails-app/assets/javascripts/app/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const AppEvents = require('../events/application-events');
// const EntryDetails = require('./entry-groups/entry-details.jsx');
import React from "react";
import AppSettings from "./settings/settings";
import MonitoringDetails from "./monitorings/monitoring-details";
import MonitoringAdd from "./monitorings/monitoring-add";
import MonitoringList from "./monitorings/monitoring-list";
import EntryDetails from "./errors/entry-details";
import ErrorList from "./errors/error-list";
import AppSettingsForm from "./application/application-settings";
Expand Down Expand Up @@ -53,11 +50,7 @@ var Main = React.createClass({
'/applications/:id': 'applicationDetails',
'/users/': 'listUser',
'/users/add': 'addUser',
'/users/:id': 'userDetails',
'/monitorings/add/:type': 'monitoringsAddType',
'/monitorings/add': 'monitoringsAdd',
'/monitorings/:id': 'monitoringsDetails',
'/monitorings': 'monitoringList',
'/users/:id': 'userDetails'
},


Expand Down Expand Up @@ -131,29 +124,6 @@ var Main = React.createClass({
return <ErrorList urlParameters={this.getUrlParameters()} errbuddyApp={this.props.app}/>;
},

monitoringList: function () {
this.setAction('monitorings');
return <MonitoringList urlParameters={this.getUrlParameters()} errbuddyApp={this.props.app}/>;
},

monitoringsAdd: function () {
this.setAction('monitorings');
return <MonitoringAdd urlParameters={this.getUrlParameters()} errbuddyApp={this.props.app}/>;
},

monitoringsAddType: function (type) {
this.setAction('monitorings');
if (type !== 'server' && type !== 'service') {
return ('404');
}
return <MonitoringDetails id={-1} type={type} errbuddyApp={this.props.app}/>
},

monitoringsDetails: function (id) {
this.setAction('monitorings');
return <MonitoringDetails id={this.parsePage(id)} errbuddyApp={this.props.app}/>
},

login: function () {
this.setAction('login');
return <LoginView onUserLoggedIn={this.userLoggedIn} urlParameters={this.getUrlParameters()} errbuddyApp={this.props.app}/>;
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions grails-app/assets/javascripts/app/components/monitorings/icon.jsx

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0ad3c32

Please sign in to comment.