ui/models: jshint

This commit is contained in:
Jack Pearkes 2014-08-21 11:31:58 -07:00
parent ab0c397439
commit bcff0c6700

View File

@ -8,14 +8,14 @@ App.Service = Ember.Object.extend({
failingChecks: function() { failingChecks: function() {
// If the service was returned from `/v1/internal/ui/services` // If the service was returned from `/v1/internal/ui/services`
// then we have a aggregated value which we can just grab // then we have a aggregated value which we can just grab
if (this.get('ChecksCritical') != undefined) { if (this.get('ChecksCritical') !== undefined) {
return (this.get('ChecksCritical') + this.get('ChecksWarning')) return (this.get('ChecksCritical') + this.get('ChecksWarning'));
// Otherwise, we need to filter the child checks by both failing // Otherwise, we need to filter the child checks by both failing
// states // states
} else { } else {
var checks = this.get('Checks'); var checks = this.get('Checks');
return (checks.filterBy('Status', 'critical').get('length') + return (checks.filterBy('Status', 'critical').get('length') +
checks.filterBy('Status', 'warning').get('length')) checks.filterBy('Status', 'warning').get('length'));
} }
}.property('Checks'), }.property('Checks'),
@ -25,8 +25,8 @@ App.Service = Ember.Object.extend({
passingChecks: function() { passingChecks: function() {
// If the service was returned from `/v1/internal/ui/services` // If the service was returned from `/v1/internal/ui/services`
// then we have a aggregated value which we can just grab // then we have a aggregated value which we can just grab
if (this.get('ChecksPassing') != undefined) { if (this.get('ChecksPassing') !== undefined) {
return this.get('ChecksPassing') return this.get('ChecksPassing');
// Otherwise, we need to filter the child checks by both failing // Otherwise, we need to filter the child checks by both failing
// states // states
} else { } else {
@ -47,7 +47,7 @@ App.Service = Ember.Object.extend({
}.property('Checks'), }.property('Checks'),
nodes: function() { nodes: function() {
return (this.get('Nodes')) return (this.get('Nodes'));
}.property('Nodes'), }.property('Nodes'),
// //
@ -63,7 +63,7 @@ App.Service = Ember.Object.extend({
// searching // searching
// //
filterKey: function() { filterKey: function() {
return this.get('Name') return this.get('Name');
}.property('Name'), }.property('Name'),
}); });
@ -78,7 +78,7 @@ App.Node = Ember.Object.extend({
var checks = this.get('Checks'); var checks = this.get('Checks');
// We view both warning and critical as failing // We view both warning and critical as failing
return (checks.filterBy('Status', 'critical').get('length') + return (checks.filterBy('Status', 'critical').get('length') +
checks.filterBy('Status', 'warning').get('length')) checks.filterBy('Status', 'warning').get('length'));
}.property('Checks'), }.property('Checks'),
// //
@ -112,17 +112,17 @@ App.Node = Ember.Object.extend({
// The number of services on the node // The number of services on the node
// //
numServices: function() { numServices: function() {
return (this.get('Services').length) return (this.get('Services').length);
}.property('Services'), }.property('Services'),
// The number of services on the node // The number of services on the node
// //
services: function() { services: function() {
return (this.get('Services')) return (this.get('Services'));
}.property('Services'), }.property('Services'),
filterKey: function() { filterKey: function() {
return this.get('Node') return this.get('Node');
}.property('Node') }.property('Node')
}); });
@ -153,8 +153,8 @@ App.Key = Ember.Object.extend(Ember.Validations.Mixin, {
isFolder: function() { isFolder: function() {
if (this.get('Key') === undefined) { if (this.get('Key') === undefined) {
return false; return false;
}; }
return (this.get('Key').slice(-1) === '/') return (this.get('Key').slice(-1) === '/');
}.property('Key'), }.property('Key'),
// Boolean if the key is locked or now // Boolean if the key is locked or now
@ -170,9 +170,9 @@ App.Key = Ember.Object.extend(Ember.Validations.Mixin, {
// it will link to kv.show. Otherwise, kv.edit // it will link to kv.show. Otherwise, kv.edit
linkToRoute: function() { linkToRoute: function() {
if (this.get('Key').slice(-1) === '/') { if (this.get('Key').slice(-1) === '/') {
return 'kv.show' return 'kv.show';
} else { } else {
return 'kv.edit' return 'kv.edit';
} }
}.property('Key'), }.property('Key'),