github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/templates/allocations/allocation/task/index.hbs (about) 1 {{page-title "Task " this.model.name}} 2 <TaskSubnav @task={{this.model}} /> 3 <section class="section"> 4 {{#if this.error}} 5 <div data-test-inline-error class="notification is-danger"> 6 <div class="columns"> 7 <div class="column"> 8 <h3 data-test-inline-error-title class="title is-4"> 9 {{this.error.title}} 10 </h3> 11 <p data-test-inline-error-body> 12 {{this.error.description}} 13 </p> 14 </div> 15 <div class="column is-centered is-minimum"> 16 <button 17 data-test-inline-error-close 18 class="button is-danger" 19 onclick={{action this.onDismiss}} 20 type="button" 21 > 22 Okay 23 </button> 24 </div> 25 </div> 26 </div> 27 {{/if}} 28 <h1 class="title with-flex" data-test-title> 29 <div> 30 {{this.model.name}} 31 {{#if this.model.isConnectProxy}} 32 <ProxyTag @class="bumper-left" /> 33 {{/if}} 34 <span 35 class="{{unless this.model.isConnectProxy "bumper-left"}} 36 tag 37 {{this.model.stateClass}}" 38 data-test-state 39 > 40 {{this.model.state}} 41 </span> 42 </div> 43 <div> 44 {{#if this.model.isRunning}} 45 <div class="two-step-button"> 46 <Exec::OpenButton 47 @job={{this.model.task.taskGroup.job}} 48 @taskGroup={{this.model.task.taskGroup}} 49 @allocation={{this.model.allocation}} 50 @task={{this.model.task}} 51 /> 52 </div> 53 <TwoStepButton 54 data-test-restart 55 @alignRight={{true}} 56 @idleText="Restart Task" 57 @cancelText="Cancel" 58 @confirmText="Yes, Restart Task" 59 @confirmationMessage="Are you sure? This will restart the task in-place." 60 @awaitingConfirmation={{this.restartTask.isRunning}} 61 @disabled={{this.restartTask.isRunning}} 62 @onConfirm={{perform this.restartTask}} 63 /> 64 {{/if}} 65 </div> 66 </h1> 67 <div class="boxed-section is-small"> 68 <div class="boxed-section-body inline-definitions"> 69 <span class="label"> 70 Task Details 71 </span> 72 <span class="pair" data-test-started-at> 73 <span class="term"> 74 Started At 75 </span> 76 {{format-ts this.model.startedAt}} 77 </span> 78 {{#if this.model.finishedAt}} 79 <span class="pair"> 80 <span class="term"> 81 Finished At 82 </span> 83 {{format-ts this.model.finishedAt}} 84 </span> 85 {{/if}} 86 <span class="pair"> 87 <span class="term"> 88 Driver 89 </span> 90 {{this.model.task.driver}} 91 </span> 92 <span class="pair"> 93 <span class="term"> 94 Lifecycle 95 </span> 96 <span data-test-lifecycle> 97 {{this.model.task.lifecycleName}} 98 </span> 99 </span> 100 <span class="pair"> 101 <span class="term"> 102 Namespace 103 </span> 104 <span> 105 {{this.model.allocation.job.namespace.name}} 106 </span> 107 </span> 108 109 {{#if (and (can "list variables") this.model.task.pathLinkedVariable)}} 110 <span class="pair" data-test-task-stat="variables"> 111 <LinkTo @route="variables.variable" @model={{this.model.task.pathLinkedVariable.id}}>Variables</LinkTo> 112 </span> 113 {{/if}} 114 115 </div> 116 </div> 117 <div class="boxed-section"> 118 <div class="boxed-section-head is-hollow"> 119 Resource Utilization 120 </div> 121 <div class="boxed-section-body"> 122 {{#if this.model.isRunning}} 123 <div class="columns"> 124 <div class="column"> 125 <PrimaryMetric::Task @taskState={{this.model}} @metric="cpu" /> 126 </div> 127 <div class="column"> 128 <PrimaryMetric::Task @taskState={{this.model}} @metric="memory" /> 129 </div> 130 </div> 131 {{else}} 132 <div data-test-resource-error class="empty-message"> 133 <h3 data-test-resource-error-headline class="empty-message-headline"> 134 Task isn't running 135 </h3> 136 <p class="empty-message-body"> 137 Only running tasks utilize resources. 138 </p> 139 </div> 140 {{/if}} 141 </div> 142 </div> 143 {{#if this.model.task.volumeMounts.length}} 144 <div data-test-volumes class="boxed-section"> 145 <div class="boxed-section-head"> 146 Volumes 147 </div> 148 <div class="boxed-section-body is-full-bleed"> 149 <ListTable @source={{this.model.task.volumeMounts}} as |t|> 150 <t.head> 151 <th> 152 Name 153 </th> 154 <th> 155 Destination 156 </th> 157 <th> 158 Permissions 159 </th> 160 <th> 161 Client Source 162 </th> 163 </t.head> 164 <t.body as |row|> 165 <tr data-test-volume> 166 <td data-test-volume-name> 167 {{row.model.volume}} 168 </td> 169 <td data-test-volume-destination> 170 <code> 171 {{row.model.destination}} 172 </code> 173 </td> 174 <td data-test-volume-permissions> 175 {{if row.model.readOnly "Read" "Read/Write"}} 176 </td> 177 <td data-test-volume-client-source> 178 {{#if row.model.isCSI}} 179 <LinkTo 180 @route="csi.volumes.volume" 181 @model={{concat 182 (format-volume-name 183 source=row.model.source 184 isPerAlloc=row.model.volumeDeclaration.perAlloc 185 volumeExtension=this.model.allocation.volumeExtension) 186 "@" 187 row.model.namespace.id 188 }} 189 > 190 {{format-volume-name 191 source=row.model.source 192 isPerAlloc=row.model.volumeDeclaration.perAlloc 193 volumeExtension=this.model.allocation.volumeExtension}} 194 </LinkTo> 195 {{else}} 196 {{row.model.source}} 197 {{/if}} 198 </td> 199 </tr> 200 </t.body> 201 </ListTable> 202 </div> 203 </div> 204 {{/if}} 205 <div class="boxed-section"> 206 <div class="boxed-section-head"> 207 Recent Events 208 </div> 209 <div class="boxed-section-body is-full-bleed"> 210 <ListTable 211 @source={{reverse this.model.events}} 212 @class="is-striped" as |t| 213 > 214 <t.head> 215 <th class="is-3"> 216 Time 217 </th> 218 <th class="is-1"> 219 Type 220 </th> 221 <th> 222 Description 223 </th> 224 </t.head> 225 <t.body as |row|> 226 <tr data-test-task-event> 227 <td data-test-task-event-time> 228 {{format-ts row.model.time}} 229 </td> 230 <td data-test-task-event-type> 231 {{row.model.type}} 232 </td> 233 <td data-test-task-event-message> 234 {{#if row.model.message}} 235 {{row.model.message}} 236 {{else}} 237 <em> 238 No message 239 </em> 240 {{/if}} 241 </td> 242 </tr> 243 </t.body> 244 </ListTable> 245 </div> 246 </div> 247 </section>