-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy pathindex.hbs
131 lines (126 loc) · 4.25 KB
/
index.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{{task-subnav task=model}}
<section class="section">
{{#if error}}
<div data-test-inline-error class="notification is-danger">
<div class="columns">
<div class="column">
<h3 data-test-inline-error-title class="title is-4">{{error.title}}</h3>
<p data-test-inline-error-body>{{error.description}}</p>
</div>
<div class="column is-centered is-minimum">
<button data-test-inline-error-close class="button is-danger" onclick={{action onDismiss}}>Okay</button>
</div>
</div>
</div>
{{/if}}
<h1 class="title" data-test-title>
{{model.name}}
<span class="bumper-left tag {{model.stateClass}}" data-test-state>{{model.state}}</span>
{{#if model.isRunning}}
{{two-step-button
data-test-restart
idleText="Restart"
cancelText="Cancel"
confirmText="Yes, Restart"
confirmationMessage="Are you sure? This will restart the task in-place."
awaitingConfirmation=restartTask.isRunning
disabled=restartTask.isRunning
onConfirm=(perform restartTask)}}
{{/if}}
</h1>
<div class="boxed-section is-small">
<div class="boxed-section-body inline-definitions">
<span class="label">Task Details</span>
<span class="pair" data-test-started-at>
<span class="term">Started At</span>
{{format-ts model.startedAt}}
</span>
{{#if model.finishedAt}}
<span class="pair">
<span class="term">Finished At</span>
{{format-ts model.finishedAt}}
</span>
{{/if}}
<span class="pair">
<span class="term">Driver</span>
{{model.task.driver}}
</span>
</div>
</div>
<div class="boxed-section">
<div class="boxed-section-head is-hollow">
Resource Utilization
</div>
<div class="boxed-section-body">
{{#if model.isRunning}}
<div class="columns">
<div class="column">
{{primary-metric resource=model metric="cpu"}}
</div>
<div class="column">
{{primary-metric resource=model metric="memory"}}
</div>
</div>
{{else}}
<div data-test-resource-error class="empty-message">
<h3 data-test-resource-error-headline class="empty-message-headline">Task isn't running</h3>
<p class="empty-message-body">Only running tasks utilize resources.</p>
</div>
{{/if}}
</div>
</div>
{{#if ports.length}}
<div class="boxed-section" data-test-task-addresses>
<div class="boxed-section-head">
Addresses
</div>
<div class="boxed-section-body is-full-bleed">
{{#list-table source=ports as |t|}}
{{#t.head}}
<th class="is-1">Dynamic?</th>
<th class="is-2">Name</th>
<th>Address</th>
{{/t.head}}
{{#t.body as |row|}}
<tr data-test-task-address>
<td data-test-task-address-is-dynamic>{{if row.model.isDynamic "Yes" "No"}}</td>
<td data-test-task-address-name>{{row.model.name}}</td>
<td data-test-task-address-address>
<a href="http://{{network.ip}}:{{row.model.port}}" target="_blank" rel="noopener noreferrer">
{{network.ip}}:{{row.model.port}}
</a>
</td>
</tr>
{{/t.body}}
{{/list-table}}
</div>
</div>
{{/if}}
<div class="boxed-section">
<div class="boxed-section-head">
Recent Events
</div>
<div class="boxed-section-body is-full-bleed">
{{#list-table source=(reverse model.events) class="is-striped" as |t|}}
{{#t.head}}
<th class="is-3">Time</th>
<th class="is-1">Type</th>
<th>Description</th>
{{/t.head}}
{{#t.body as |row|}}
<tr data-test-task-event>
<td data-test-task-event-time>{{format-ts row.model.time}}</td>
<td data-test-task-event-type>{{row.model.type}}</td>
<td data-test-task-event-message>
{{#if row.model.message}}
{{row.model.message}}
{{else}}
<em>No message</em>
{{/if}}
</td>
</tr>
{{/t.body}}
{{/list-table}}
</div>
</div>
</section>