mirror of
https://github.com/status-im/consul.git
synced 2025-01-12 06:44:41 +00:00
6589cbbd0d
* ui: Add the most basic workspace root in /ui * We already have a LICENSE file in the repository root * Change directory path in build scripts ui-v2 -> ui * Make yarn install flags configurable from elsewhere * Minimal workspace root makefile * Call the new docker specific target * Update yarn in the docker build image * Reconfigure the netlify target and move to the higher makefile * Move ui-v2 -> ui/packages/consul-ui * Change repo root to refleect new folder structure * Temporarily don't hoist consul-api-double * Fixup CI configuration * Fixup lint errors * Fixup Netlify target
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
import Model from 'ember-data/model';
|
|
import attr from 'ember-data/attr';
|
|
import { computed } from '@ember/object';
|
|
|
|
export const PRIMARY_KEY = 'uid';
|
|
export const SLUG_KEY = 'ID';
|
|
|
|
export default Model.extend({
|
|
[PRIMARY_KEY]: attr('string'),
|
|
[SLUG_KEY]: attr('string'),
|
|
Address: attr('string'),
|
|
Node: attr('string'),
|
|
Meta: attr(),
|
|
Services: attr(),
|
|
Checks: attr(),
|
|
CreateIndex: attr('number'),
|
|
ModifyIndex: attr('number'),
|
|
TaggedAddresses: attr(),
|
|
Datacenter: attr('string'),
|
|
Segment: attr(),
|
|
Coord: attr(),
|
|
SyncTime: attr('number'),
|
|
meta: attr(),
|
|
Status: computed('Checks.[]', 'ChecksCritical', 'ChecksPassing', 'ChecksWarning', function() {
|
|
switch (true) {
|
|
case this.ChecksCritical !== 0:
|
|
return 'critical';
|
|
case this.ChecksWarning !== 0:
|
|
return 'warning';
|
|
case this.ChecksPassing !== 0:
|
|
return 'passing';
|
|
default:
|
|
return 'empty';
|
|
}
|
|
}),
|
|
ChecksCritical: computed('Checks.[]', function() {
|
|
return this.Checks.filter(item => item.Status === 'critical').length;
|
|
}),
|
|
ChecksPassing: computed('Checks.[]', function() {
|
|
return this.Checks.filter(item => item.Status === 'passing').length;
|
|
}),
|
|
ChecksWarning: computed('Checks.[]', function() {
|
|
return this.Checks.filter(item => item.Status === 'warning').length;
|
|
}),
|
|
});
|