-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Redesign - Node service instances tab (#8204)
* Upgrade consul-api-dobule to version 3.1.3 * Create ConsulInstaceChecks component with test * Redesign: Service Instaces tab in for a Node * Update Node tests to work with the ConsulServiceInstancesList * Style fix to the copy button in the composite-row details * Delete helper and move logic to ConsulInstanceChecks component * Delete unused component consul-node-service-list
- Loading branch information
1 parent
246fdb9
commit b78ef1f
Showing
16 changed files
with
183 additions
and
187 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,32 @@ | ||
{{#if (gt items.length 0)}} | ||
{{#if (eq healthCheck.check 'empty') }} | ||
<dl class={{healthCheck.check}}> | ||
<dt> | ||
<Tooltip> | ||
{{capitalize type}} Checks | ||
</Tooltip> | ||
</dt> | ||
<dd>No {{type}} checks</dd> | ||
</dl> | ||
{{else}} | ||
{{#if (eq healthCheck.count items.length)}} | ||
<dl class={{healthCheck.check}}> | ||
<dt> | ||
<Tooltip> | ||
{{capitalize type}} Checks | ||
</Tooltip> | ||
</dt> | ||
<dd>All {{type}} checks {{healthCheck.status}}</dd> | ||
</dl> | ||
{{else}} | ||
<dl class={{healthCheck.check}}> | ||
<dt> | ||
<Tooltip> | ||
{{capitalize type}} Checks | ||
</Tooltip> | ||
</dt> | ||
<dd>{{healthCheck.count}}/{{items.length}} {{type}} checks {{healthCheck.status}}</dd> | ||
</dl> | ||
{{/if}} | ||
{{/if}} | ||
{{/if}} |
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,52 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
|
||
export default Component.extend({ | ||
tagName: '', | ||
healthCheck: computed('items.[]', function() { | ||
let ChecksCritical = 0; | ||
let ChecksWarning = 0; | ||
let ChecksPassing = 0; | ||
|
||
this.items.forEach(item => { | ||
switch (item.Status) { | ||
case 'critical': | ||
ChecksCritical += 1; | ||
break; | ||
case 'warning': | ||
ChecksWarning += 1; | ||
break; | ||
case 'passing': | ||
ChecksPassing += 1; | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
|
||
switch (true) { | ||
case ChecksCritical !== 0: | ||
return { | ||
check: 'critical', | ||
status: 'failing', | ||
count: ChecksCritical, | ||
}; | ||
case ChecksWarning !== 0: | ||
return { | ||
check: 'warning', | ||
status: 'with warning', | ||
count: ChecksWarning, | ||
}; | ||
case ChecksPassing !== 0: | ||
return { | ||
check: 'passing', | ||
status: 'passing', | ||
count: ChecksPassing, | ||
}; | ||
default: | ||
return { | ||
check: 'empty', | ||
}; | ||
} | ||
}), | ||
}); |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
Oops, something went wrong.