Skip to content

Commit

Permalink
Fragment and init
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed May 15, 2024
1 parent c9fd93c commit 159dd5f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ui/app/models/task-schedule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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 TaskScheduleModel extends Fragment {
@fragmentOwner('task') task;
@attr() cron;
}
2 changes: 2 additions & 0 deletions ui/app/models/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default class Task extends Fragment {

@attr() meta;

@fragment('task-schedule') schedule;

@computed('taskGroup.mergedMeta', 'meta')
get mergedMeta() {
return {
Expand Down
12 changes: 11 additions & 1 deletion ui/app/templates/allocations/allocation/task/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@
{{/if}}
</PH.Actions>
</Hds::PageHeader>
{{#if this.model.task.schedule}}
<Hds::Alert @type="inline" @icon="delay" @color="highlight" as |A|>
<A.Title>This task has a defined schedule</A.Title>
<A.Description>This job is currently following a predefined schedule. You can unschedule the task to manage it manually or reschedule it to follow the defined schedule again.</A.Description>
<A.Button @text="Force Pause" @color="secondary" />
<A.Button @text="Remove from Schedule" @color="secondary" />
</Hds::Alert>
<Hds::Separator />
{{/if}}

<div class="boxed-section is-small">
<div class="boxed-section-body inline-definitions">
<span class="label">
Expand Down Expand Up @@ -258,4 +268,4 @@
</ListTable>
</div>
</div>
</section>
</section>

0 comments on commit 159dd5f

Please sign in to comment.