github.com/hernad/nomad@v1.6.112/ui/app/templates/components/job-diff.hbs (about) 1 {{! 2 Copyright (c) HashiCorp, Inc. 3 SPDX-License-Identifier: MPL-2.0 4 ~}} 5 6 {{! Job heading }} 7 {{! template-lint-disable simple-unless }} 8 <div 9 data-test-diff-section-label="job" 10 data-test-diff-field="{{lowercase this.diff.Type}}" 11 class="{{if 12 this.diff.Type 13 (concat 'diff-section-label is-' (lowercase this.diff.Type)) 14 }}" 15 > 16 <span class="marker {{concat 'is-' (lowercase this.diff.Type)}}"> 17 {{#if (eq (lowercase this.diff.Type) "added")}} 18 + 19 {{else if (eq (lowercase this.diff.Type) "deleted")}} 20 - 21 {{else if (eq (lowercase this.diff.Type) "edited")}} 22 +/- 23 {{/if}} 24 </span> 25 <span class="diff-section-bold">Job: "{{this.diff.ID}}"</span> 26 </div> 27 28 {{! Show job field and object diffs if the job is edited }} 29 {{#if (or this.verbose (eq (lowercase this.diff.Type) "edited"))}} 30 <div data-test-diff-section-label="job-diff" class="diff-section-label"> 31 <JobDiffFieldsAndObjects 32 @fields={{this.diff.Fields}} 33 @objects={{this.diff.Objects}} 34 /> 35 </div> 36 {{/if}} 37 38 {{! Each task group }} 39 {{#each this.diff.TaskGroups as |group|}} 40 <div 41 data-test-diff-section-label="task-group" 42 class="{{if 43 group.Type 44 (concat 'diff-section-label is-' (lowercase group.Type)) 45 }}" 46 > 47 <span class="marker {{concat 'is-' (lowercase group.Type)}}"> 48 {{#if (eq (lowercase group.Type) "added")}} 49 + 50 {{else if (eq (lowercase group.Type) "deleted")}} 51 - 52 {{else if (eq (lowercase group.Type) "edited")}} 53 +/- 54 {{/if}} 55 </span> 56 <span class="diff-section-bold">Task Group: "{{group.Name}}"</span> 57 {{#if group.Updates}} 58 ({{#each-in group.Updates as |updateType count|}} 59 <span class="job-diff-update-count {{css-class updateType}}">{{count}} 60 {{updateType}}</span> 61 {{/each-in}}) 62 {{/if}} 63 64 {{! Show task group field and object diffs if the task group is edited }} 65 {{#if (or (eq (lowercase group.Type) "edited") this.verbose)}} 66 <div 67 data-test-diff-section-label="task-group-diff" 68 class="diff-section-label" 69 > 70 <JobDiffFieldsAndObjects 71 @fields={{group.Fields}} 72 @objects={{group.Objects}} 73 /> 74 </div> 75 {{/if}} 76 77 {{! Each task }} 78 {{#each group.Tasks as |task|}} 79 <div 80 data-test-diff-section-label="task" 81 data-test-diff-field="{{lowercase task.Type}}" 82 class="{{if 83 task.Type 84 (concat 'diff-section-label is-' (lowercase task.Type)) 85 }}" 86 > 87 <span class="marker {{concat 'is-' (lowercase task.Type)}}"> 88 {{#if (eq (lowercase task.Type) "added")}} 89 + 90 {{else if (eq (lowercase task.Type) "deleted")}} 91 - 92 {{else if (eq (lowercase task.Type) "edited")}} 93 +/- 94 {{/if}} 95 </span> 96 Task: "{{task.Name}}" 97 {{#if task.Annotations}} 98 ({{~#each task.Annotations as |annotation index|}} 99 <span class="{{css-class annotation}}">{{annotation}}</span> 100 {{#unless (eq index (dec task.Annotations.length))}},{{/unless}} 101 {{/each~}}) 102 {{/if}} 103 {{#if (or this.verbose (eq (lowercase task.Type) "edited"))}} 104 <JobDiffFieldsAndObjects 105 @fields={{task.Fields}} 106 @objects={{task.Objects}} 107 /> 108 {{/if}} 109 </div> 110 {{/each}} 111 </div> 112 {{/each}}