-
Notifications
You must be signed in to change notification settings - Fork 118
/
streams.component.html
190 lines (178 loc) · 8.02 KB
/
streams.component.html
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<app-page *ngIf="streamDefinitions">
<app-page-head>
<app-page-head-title><strong>Streams</strong></app-page-head-title>
<app-page-head-actions [dataflowAppRoles]="['ROLE_CREATE']">
<ng-container *ngIf="appsState$ | async as appsState;">
<button class="btn btn-primary btn-fa" (click)="createStream()" *ngIf="appsState.streams > 0">
<span class="fa fa-plus"></span>
Create stream(s)
</button>
<button name="stream-grafana" type="button" *ngIf="grafanaEnabled"
(click)="grafanaDashboard()" class="btn btn-primary btn-fa" title="Grafana Dashboard">
<span class="icon-custom icon-custom-grafana white"></span>
Grafana Dashboard
</button>
</ng-container>
</app-page-head-actions>
</app-page-head>
<div dataflowLayoutType type="full">
<p>This section lists all the stream definitions and provides the ability to deploy/undeploy or destroy streams.</p>
<app-list-bar [params]="params" [page]="streamDefinitions" [countSelected]="countSelected()" #listBar
(refresh)="refresh()" (search)="search($event)" [actions]="streamsActions()"
(action)="applyAction($event.action)">
</app-list-bar>
<table *ngIf="streamDefinitions?.items && streamDefinitions.items.length > 0"
class="table table-hover table-checkbox" id="streamDefinitionsTable">
<thead>
<tr>
<th style="width: 30px" [dataflowAppRoles]="['ROLE_CREATE']">
<app-master-checkbox (change)="changeCheckboxes()" *ngIf="form?.checkboxes"
[items]="form.checkboxes"></app-master-checkbox>
</th>
<th style="width: 70px">
<app-sort id="sort-name" (change)="applySort($event)" [value]="'name'" [sort]="params">
Name
</app-sort>
<th>
<div class="head-dsl">
<div class="dropdown" dropdown>
<a dropdownToggle class="btn-dropdown" data-toggle="dropdown">
<span class="fa fa-chevron-down"></span>
<span class="fa fa-chevron-right"></span>
</a>
<ul *dropdownMenu class="dropdown-menu">
<li><a style="cursor: pointer" (click)="expandPage()">Expand All</a></li>
<li><a style="cursor: pointer" (click)="collapsePage()">Collapse All</a></li>
</ul>
</div>
<app-sort id="sort-dsl" (change)="applySort($event)" [value]="'dslText'" [sort]="params">
Definitions
</app-sort>
</div>
</th>
<th nowrap="" style="width: 120px">
Status
<a #childPopover="bs-popover" [popover]="popTemplate" placement="left" [outsideClick]="true"
title="Available Deployment Statuses" style="cursor: pointer">
<span class="fa fa-question-circle"></span></a>
</th>
<th> </th>
</tr>
</thead>
<tbody>
<ng-container
*ngFor="let item of streamDefinitions.items | paginate: streamDefinitions.getPaginationInstance(); index as i">
<tr>
<td class="cell-checkbox" [dataflowAppRoles]="['ROLE_CREATE']">
<input [dataflowAppRoles]="['ROLE_CREATE']" type="checkbox" (change)="changeCheckboxes()"
[(ngModel)]="form.checkboxes[i]"/>
</td>
<td>
<a style="cursor:pointer" (click)="details(item)">{{ item.name }}</a>
</td>
<td>
<a (click)="toggleExpand(i)" class="link-expand">
<span *ngIf="form.checkboxesExpand[i]" class="fa fa-chevron-down" tooltip="Hide graph" delay="500"></span>
<span *ngIf="!form.checkboxesExpand[i]" class="fa fa-chevron-right" tooltip="Show graph"
delay="500"></span>
<app-stream-dsl>{{ item.dslText | truncate: 120 }}</app-stream-dsl>
</a>
</td>
<td *ngIf="canShowDeploymentInfo(item); else deployment_status_only_content">
<a href="" class="stream-info-toggle" (click)="false" [popover]="stream_info" placement="left"
triggers="focus"
containerClass="deployment-info-popup">
<span class="ico fa fa-info-circle"></span>
<app-stream-status [streamDefinition]="item"></app-stream-status>
</a>
</td>
<ng-template #deployment_status_only_content>
<td>
<app-stream-status [streamDefinition]="item"></app-stream-status>
</td>
</ng-template>
<ng-template #stream_info>
<app-stream-deployment-properties-info [streamDefinition]="item"></app-stream-deployment-properties-info>
</ng-template>
<td class="table-actions" width="10px" nowrap="">
<app-list-row-actions [actions]="streamActions(item, i)" (action)="applyAction($event.action, $event.args)"
[item]="item">
</app-list-row-actions>
</td>
</tr>
<tr *ngIf="form.checkboxesExpand[i]">
<td colspan="5" class="graph" style="padding:0">
<app-stream-graph-definition [stream]="item" [metrics]="metricsForStream(item.name)">
</app-stream-graph-definition>
</td>
</tr>
</ng-container>
</tbody>
</table>
<app-list-pagination [page]="streamDefinitions" [params]="params" (changed)="changePaginationPager($event)"
[item]="'stream definition'" [items]="'stream definitions'">
</app-list-pagination>
<app-list-empty [page]="streamDefinitions" [filters]="[params.q]">
<p>There is <strong>no stream registered</strong>, yet.</p>
<div *ngIf="appsState$ | async as appsState">
<p *ngIf="appsState.streams > 0" [dataflowAppRoles]="['ROLE_CREATE']">
You can <a (click)="createStream()">Create Streams(s)</a> or <a (click)="refresh()">Refresh</a> the page
</p>
<p *ngIf="appsState.streams == 0" [dataflowAppRoles]="['ROLE_CREATE']">
To create stream(s), you have to <a (click)="registerApps()">register Apps</a> first.<br/>
You can <a (click)="refresh()">Refresh</a> the page.
</p>
</div>
</app-list-empty>
<app-list-no-result [page]="streamDefinitions" [filters]="[params.q]">
<p>
No results found for
<strong>'{{ params.q }}'</strong>
</p>
<p>
You can <a (click)="listBar.clearSearch()">Clear the search</a> or <a (click)="refresh()">Refresh</a> the page.
</p>
</app-list-no-result>
<ng-template #popTemplate>
<div class="status-help-content">
<table class="table-condensed status-help-content-table">
<tbody>
<tr>
<td>
<app-stream-status [streamDefinition]="{ status : 'deploying' }"></app-stream-status>
</td>
<td>Deployment has been initiated</td>
</tr>
<tr>
<td>
<app-stream-status [streamDefinition]="{ status : 'deployed' }"></app-stream-status>
</td>
<td>Fully deployed based on each of the stream's apps' count properties</td>
</tr>
<tr>
<td>
<app-stream-status [streamDefinition]="{ status : 'incomplete' }"></app-stream-status>
</td>
<td>At least 1 of each app, but 1 or more of them not at requested capacity</td>
</tr>
<tr>
<td>
<app-stream-status [streamDefinition]="{ status : 'failed' }"></app-stream-status>
</td>
<td>1 or more of the apps does not have even a single instance deployed</td>
</tr>
<tr>
<td>
<app-stream-status [streamDefinition]="{ status : 'undeployed' }"></app-stream-status>
</td>
<td>Intentionally undeployed, or created but not yet deployed</td>
</tr>
</tbody>
</table>
</div>
</ng-template>
</div>
</app-page>
<div *ngIf="!streamDefinitions">
<app-loader></app-loader>
</div>