mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
[ui] Remove simulacral allocation stat in favor of live-updating one (#23306)
* Remove simulacral allocation stat in favor of live-updating one * Tests remove dependency on job-summary as well
This commit is contained in:
3
.changelog/23306.txt
Normal file
3
.changelog/23306.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
ui: unbind job detail running allocations count from job-summary endpoint
|
||||||
|
```
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
All allocations have completed successfully
|
All allocations have completed successfully
|
||||||
{{else}}
|
{{else}}
|
||||||
<strong>
|
<strong>
|
||||||
{{@job.runningAllocs ~}}
|
{{this.runningAllocs.length ~}}
|
||||||
{{#unless this.atMostOneAllocPerNode ~}}
|
{{#unless this.atMostOneAllocPerNode ~}}
|
||||||
{{#if (eq @job.type "batch") ~}}
|
{{#if (eq @job.type "batch") ~}}
|
||||||
/{{this.totalNonCompletedAllocs}}
|
/{{this.totalNonCompletedAllocs}}
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
{{/unless}}
|
{{/unless}}
|
||||||
</strong>
|
</strong>
|
||||||
{{#if (eq @job.type "batch") ~}}Remaining{{/if}}
|
{{#if (eq @job.type "batch") ~}}Remaining{{/if}}
|
||||||
{{pluralize "Allocation" @job.runningAllocs}} Running
|
{{pluralize "Allocation" this.runningAllocs.length}} Running
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h3>
|
</h3>
|
||||||
<JobStatus::AllocationStatusRow @allocBlocks={{this.allocBlocks}} @steady={{true}} />
|
<JobStatus::AllocationStatusRow @allocBlocks={{this.allocBlocks}} @steady={{true}} />
|
||||||
|
|||||||
@@ -185,6 +185,10 @@ export default class JobStatusPanelSteadyComponent extends Component {
|
|||||||
return this.job.allocations.filter((a) => !a.isOld && a.hasBeenRestarted);
|
return this.job.allocations.filter((a) => !a.isOld && a.hasBeenRestarted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get runningAllocs() {
|
||||||
|
return this.job.allocations.filter((a) => a.clientStatus === 'running');
|
||||||
|
}
|
||||||
|
|
||||||
get completedAllocs() {
|
get completedAllocs() {
|
||||||
return this.job.allocations.filter(
|
return this.job.allocations.filter(
|
||||||
(a) => !a.isOld && a.clientStatus === 'complete'
|
(a) => !a.isOld && a.clientStatus === 'complete'
|
||||||
|
|||||||
@@ -979,19 +979,6 @@ module('Acceptance | job status panel', function (hooks) {
|
|||||||
'job',
|
'job',
|
||||||
JSON.stringify([job.id, 'default'])
|
JSON.stringify([job.id, 'default'])
|
||||||
);
|
);
|
||||||
// Weird Mirage thing: job summary factory is disconnected from its job and therefore allocations.
|
|
||||||
// So we manually create the number here.
|
|
||||||
let summary = await storedJob.get('summary');
|
|
||||||
summary
|
|
||||||
.get('taskGroupSummaries')
|
|
||||||
.objectAt(0)
|
|
||||||
.set(
|
|
||||||
'runningAllocs',
|
|
||||||
server.schema.allocations.where({
|
|
||||||
jobId: job.id,
|
|
||||||
clientStatus: 'running',
|
|
||||||
}).length
|
|
||||||
);
|
|
||||||
|
|
||||||
await settled();
|
await settled();
|
||||||
|
|
||||||
@@ -1020,17 +1007,8 @@ module('Acceptance | job status panel', function (hooks) {
|
|||||||
nodeId: newNode.id,
|
nodeId: newNode.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
summary
|
// simulate a blocking query update from /allocations
|
||||||
.get('taskGroupSummaries')
|
storedJob.allocations.reload();
|
||||||
.objectAt(0)
|
|
||||||
.set(
|
|
||||||
'runningAllocs',
|
|
||||||
server.schema.allocations.where({
|
|
||||||
jobId: job.id,
|
|
||||||
clientStatus: 'running',
|
|
||||||
}).length
|
|
||||||
);
|
|
||||||
|
|
||||||
await settled();
|
await settled();
|
||||||
|
|
||||||
assert.dom('.running-allocs-title').hasText('4 Allocations Running');
|
assert.dom('.running-allocs-title').hasText('4 Allocations Running');
|
||||||
|
|||||||
Reference in New Issue
Block a user