Show only first label of hostname

This commit is contained in:
Vincent Fiduccia 2017-09-19 12:17:10 -07:00
parent e8ef022974
commit ccecfa112e
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
1 changed files with 11 additions and 1 deletions

View File

@ -91,7 +91,17 @@ var Host = Resource.extend(StateCounts,{
displayIp: Ember.computed.alias('agentIpAddress'), displayIp: Ember.computed.alias('agentIpAddress'),
displayName: function() { displayName: function() {
return this.get('name') || this.get('hostname') || '('+this.get('id')+')'; let name = this.get('name');
if ( name ) {
return name;
}
name = this.get('hostname');
if ( name ) {
return name.replace(/\..*$/,'');
}
return '('+this.get('id')+')';
}.property('name','hostname','id'), }.property('name','hostname','id'),
osBlurb: function() { osBlurb: function() {