-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8f3afb
commit ce339cb
Showing
8 changed files
with
90 additions
and
72 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
// @ts-check | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import config from 'nomad-ui/config/environment'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class JobStatusPanelComponent extends Component { | ||
|
||
allocTypes = [ | ||
"runningAllocs", | ||
"failedAllocs", | ||
"unknownAllocs", | ||
"queuedAllocs", | ||
"completeAllocs", | ||
"startingAllocs", | ||
"lostAllocs" | ||
] | ||
/** | ||
* @type {('current'|'historical')} | ||
*/ | ||
@tracked mode = 'current'; // can be either "current" or "historical" | ||
|
||
// TODO: TEMP | ||
// Convenience UI for manipulating number of allocations. Temporary and mirage only. | ||
get showDataFaker() { | ||
return config['ember-cli-mirage']; | ||
} | ||
|
||
// TODO: eventually we will want this from a new property on a job. | ||
get totalAllocs() { | ||
return +(+this.args.job.runningAllocs + +this.args.job.failedAllocs + +this.args.job.unknownAllocs); | ||
return this.allocTypes.reduce((sum, type) => sum + this.args.job[type], 0); | ||
} | ||
|
||
@action | ||
modifyMockAllocs(type, { target: { value } }) { | ||
this.args.job[type] = +value; | ||
} | ||
} |
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