mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
This doesn’t include Ember Data, as we are still back on 3.12. Most changes are deprecation updates, linting fixes, and dependencies. It can be read commit-by-commit, though many of them are mechanical and skimmable. For the new linting exclusions, I’ve added them to the Tech Debt list. The decrease in test count is because linting is no longer included in ember test. There’s a new deprecation warning in the logs that can be fixed by updating Ember Power Select but when I tried that it caused it to render incorrectly, so I decided to ignore it for now and address it separately.
41 lines
1007 B
JavaScript
41 lines
1007 B
JavaScript
import { computed } from '@ember/object';
|
|
import Fragment from 'ember-data-model-fragments/fragment';
|
|
import { attr } from '@ember-data/model';
|
|
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
|
|
|
|
export default class ScaleEvent extends Fragment {
|
|
@fragmentOwner() taskGroupScale;
|
|
|
|
@attr('number') count;
|
|
@attr('number') previousCount;
|
|
@attr('boolean') error;
|
|
@attr('string') evalId;
|
|
|
|
@computed('count', function() {
|
|
return this.count != null;
|
|
})
|
|
hasCount;
|
|
|
|
@computed('count', 'previousCount', function() {
|
|
return this.count > this.previousCount;
|
|
})
|
|
increased;
|
|
|
|
@attr('date') time;
|
|
@attr('number') timeNanos;
|
|
|
|
@attr('string') message;
|
|
@attr() meta;
|
|
|
|
@computed('meta', function() {
|
|
return Object.keys(this.meta).length > 0;
|
|
})
|
|
hasMeta;
|
|
|
|
// Since scale events don't have proper IDs, this UID is a compromise
|
|
@computed('time', 'timeNanos', 'message', function() {
|
|
return `${+this.time}${this.timeNanos}_${this.message}`;
|
|
})
|
|
uid;
|
|
}
|