aboutsummaryrefslogtreecommitdiffstats
path: root/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_execution_popups.html
blob: 7fa380cd22f315eaae1ab16096883b75f00a8398 (plain)
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<script type="text/ng-template" id="inventory_execution_view_popup.html">
	<div class="b2b-modal-header ng-scope">
		<h2 id="myModalLabel" style="margin-left: 200px;" modal-title="">{{ecdapp.label}}</h2>
		<div class="corner-button in">
			<button type="button" class="close" aria-label="Close"
				ng-click="$dismiss('cancel')"></button>
		</div>
		<div style="position: absolute;">
		<label for="show-menu" class="show-menu" title="click to view more info">&#9776;</label>
		<input type="checkbox" id="show-menu" />
		<div class="menu" ng-hide="ecdapp.errMsg">
			<!--<div class="row-nowrap" style="margin-bottom:10px;"> -->
				<div class="span12" style="margin-bottom:10px;">
					<label for="deploymentRef">Deployment Ref</label>
					<!--not editable-->
					<input id="deploymentRef" class="span6" type="text" data-ng-model="ecdapp.deplRef"/>
				</div>
				<div class="span12" style="margin-bottom:10px;">
					<label for="tenant">Tenant</label>
					<!--not editable-->
					<input id="tenant" class="span6" type="text" data-ng-model="ecdapp.ui_tenant"/>
				</div>
				<!-- <button ng-click="ecdapp.toggleStatusDefinitions()" class="btn btn-alt btn-small">Click to view status definitions</button> -->
 					<div>
						<div b2b-table id="status-table" class="b2b-table-div">
							<table id="status-definition-table">
								<thead b2b-table-row type="header">
									<tr id="th-header-row">
										<th b2b-table-header key="status">Status</th>
										<th b2b-table-header key="definition">Definition</th>
									</tr>
								</thead>
								<tbody b2b-table-row type="body">
									<tr>
										<td>waiting to start</td>
										<td>The execution is waiting for a worker to start it</td>
									</tr>
									<tr>
										<td>in progress</td>
										<td>The execution is currently running.</td>
									</tr>
									<tr>
										<td>cancel in progress</td>
										<td>The execution is currently being cancelled.</td>
									</tr>
									<tr>
										<td>force-cancelling in progress</td>
										<td>The execution is currently being force-cancelled.</td>
									</tr>
									<tr>
										<td>cancelled</td>
										<td>The execution has been cancelled.</td>
									</tr>
									<tr>
										<td>successful</td>
										<td>The execution has terminated successfully.</td>
									</tr>
									<tr>
										<td>failed</td>
										<td>The execution has failed. Click on the button in the error column to view the error details.</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
		</div>
	</div>
	</div>

	<div class="b2b-modal-body ng-scope ng-isolate-scope" tabindex="0"
		role="region" aria-label="Modal body content">

		<!--<h1 class="heading-page" id="executions-page">Executions</h1> -->

	 	<!-- show progress indicator -->
		<div ng-show="ecdapp.isDataLoading">
			<div class="span" style="margin-bottom:20px;">
    			<i class="icon-spinner small" role="img" aria-label="Please wait while the content loads"></i>
	    		Please wait while the content loads.
	    	</div>
		</div>
		<div ng-show="ecdapp.isCancelOn">
			<div class="span" style="margin-bottom:20px;">
    			<i class="icon-spinner small" role="img" aria-label="Cancel in progress"></i>
	    		Cancel in progress
	    	</div>
		</div>
		<div ng-show="ecdapp.errMsg">
			<span class="ecd-error-message">{{ecdapp.errMsg}}</span>
		</div>
		<div ng-show="ecdapp.evtErrMsg">
			<span class="ecd-error-message">{{ecdapp.evtErrMsg}}</span>
		</div>

    <div class="form-row" style="margin-top:0px;">
		<div style="float: left; width: 200px; margin-left: 30px;" title="switch to enable/disable screen refresh">
        	<label for="refresh_switch" class="btn-switch-label" ng-class="{'b2b-disabled-label':allDisabled}">
            <span aria-hidden="true">Auto-refresh</span>
            <input type="button" aria-pressed="{{ecdapp.refresh_switch.value}}" id="refresh_switch" b2b-switches ng-model="ecdapp.refresh_switch.value" ng-disabled="allDisabled" aria-disabled="{{allDisabled}}" aria-label="Auto-refresh is {{ecdapp.refresh_switch.value?'On':'Off'}}. {{allDisabled?'Disabled. Explanation why it is disabled':''}}">
        	</label>
		</div>
        <div style="float: right;" title="Checkbox to view latest execution workflow only">
        	<label for="checkbox1" class="checkbox">
                    <input id="checkbox1" type="checkbox" ng-model="ecdapp.isLastExecution"><i class="skin"></i><span>Last execution</span>
            </label>
    	</div>
    </div>

		<div ng-hide="ecdapp.errMsg">
			<div 
	    		b2b-table 
	    		id="executions-table"
	    		class="b2b-table-div" 
	    		table-data="ecdapp.tableData" 
	    		search-string="ecdapp.searchString" 
	    		current-page="ecdapp.currentPageIgnored"
	    		next-sort="ecdapp.nextSortIgnored">

		        <table>
		            <thead b2b-table-row type="header">	
						<tr id="th-header-row">
							<th b2b-table-header key="created_at">Created Date</th>
							<th b2b-table-header key="workflow_id">Workflow ID</th>
							<th b2b-table-header key="id">ID</th>
							<th b2b-table-header key="status">Status</th>
							<th b2b-table-header sortable="false"><i class="icon-controls-gear ecd-icon-display"></i></th>
						</tr>
					</thead>
					
		            <tbody b2b-table-row type="body" row-repeat="rowData in ecdapp.tableData">
						<tr id="tr-rowData">
							<td b2b-table-body
								ng-bind="rowData.created_at"/>
							<td b2b-table-body
								ng-bind="rowData.workflow_id"/>
							<td b2b-table-body
								ng-bind="rowData.id"/>
							<td b2b-table-body ng-if="rowData.status == 'pending'">
								waiting to start
							</td>
							<td b2b-table-body ng-if="rowData.status == 'started'">
						    	<div ng-click="ecdapp.getExecutionLogs(rowData.id, ecdapp.ui_tenant);">
						    		<a href="" title="View execution logs" class="tooltip">in progress</a>
						    	</div>
							</td>
							<td b2b-table-body ng-if="rowData.status == 'cancelling'">
						    	<div ng-click="ecdapp.getExecutionLogs(rowData.id, ecdapp.ui_tenant);">
						    		<a href="" title="View execution logs" class="tooltip">cancel in progress</a>
						    	</div>	
							</td>
							<td b2b-table-body ng-if="rowData.status == 'force_cancelling'">
								<div ng-click="ecdapp.getExecutionLogs(rowData.id, ecdapp.ui_tenant);">
						    		<a href="" title="View execution logs" class="tooltip">force-cancelling in progress</a>
						    	</div>				
							</td>
							<td b2b-table-body ng-if="rowData.status == 'cancelled'">
								<div ng-click="ecdapp.getExecutionLogs(rowData.id, ecdapp.ui_tenant);">
						    		<a href="" title="View execution logs" class="tooltip">cancelled</a>
						    	</div>
							</td>
							<td b2b-table-body ng-if="rowData.status == 'terminated'">
						    	<div ng-click="ecdapp.getExecutionLogs(rowData.id, ecdapp.ui_tenant);">
						    		<a href="" title="View execution logs" class="tooltip">successful</a>
						    	</div>
							</td>
							<td b2b-table-body ng-if="rowData.status == 'failed'">
						    	<div ng-click="ecdapp.getExecutionLogs(rowData.id, ecdapp.ui_tenant);">
						    		<a href="" title="View execution logs" class="tooltip">failed</a>
						    	</div>
							</td>
							<td b2b-table-body ng-if="rowData.status == 'failed'">
						    	<div ng-show="rowData.error" ng-click="ecdapp.viewErrorModalPopup(rowData);">
						    		<a href="" title="View error details" class="icon-people-preview ecd-icon-action"></a>
						    	</div>
					     	</td>
							<td b2b-table-body ng-if="rowData.status == 'started'"> 
						    	<div ng-click="ecdapp.cancelExecutionModalPopup(rowData, ecdapp.ui_tenant);">
									<a href="" title="Cancel execution" class="icon-controls-stop ecd-icon-action"></a>
						    	</div>
					     	</td>
						</tr>
					</tbody>
				</table>
			</div> 
			<!-- <div b2b-pagination="" total-pages="ecdapp.totalPages" 
						current-page="ecdapp.currentPageNum" click-handler="pageChangeHandler"
						role="navigation">
			</div> -->
			</div>
			<div ng-show="ecdapp.isEventLogQuery">
				<div style="float: left;">
					<h3>Events/Logs </h3>
					<h4>execution id: {{ecdapp.executionId}} </h4>
				</div>
        		<div style="float: right;" title="Checkbox to Include log type events">
        			<label for="checkbox2" class="checkbox">
                    <input id="checkbox2" type="checkbox" ng-model="ecdapp.isLogType"><i class="skin"></i><span>Include Logs</span>
            		</label>
				</div>

				<div 
	    		b2b-table 
	    		id="logs-table"
	    		class="b2b-table-div" 
	    		table-data="ecdapp.logTableData"
	    		current-page="ecdapp.currentPageIgnored"
	    		next-sort="ecdapp.nextSortIgnored">
		        <table>
		            <thead b2b-table-row type="header">	
						<tr id="th-header-row">
							<th b2b-table-header key="reported_timestamp">Reported Timestamp</th>
							<th b2b-table-header key="timestamp">Type</th>
							<th b2b-table-header key="event_type">Event Type</th>
							<th b2b-table-header key="message">Message</th>
							<th b2b-table-header key="node_name">Node name</th>
							<th b2b-table-header key="node_instance_id">Node Instance</th>
							<th b2b-table-header key="error_causes">Error Causes</th>
						</tr>
					</thead>			
		            <tbody b2b-table-row type="body" row-repeat="rowData in ecdapp.logTableData">
						<tr id="tr-rowData" ng-class="{ 'red-background' : rowData.message.toLowerCase().contains("error") }">
							<td b2b-table-body
								ng-bind="rowData.reported_timestamp"/>
							<td b2b-table-body
								ng-bind="rowData.type"/>
							<td b2b-table-body
								ng-bind="rowData.event_type"/>
							<td b2b-table-body
								ng-bind="rowData.message"/>
							<td b2b-table-body
								ng-bind="rowData.node_name"/>
							<td b2b-table-body
								ng-bind="rowData.node_instance_id"/>
							<td b2b-table-body
								ng-bind="rowData.error_causes[0].traceback"/>
						</tr>
					</tbody>
			</table>
			</div>
			<div b2b-pagination="" total-pages="ecdapp.totalLogPages" 
						current-page="ecdapp.currentLogPageNum" click-handler="pageChangeHandler"
						role="navigation">
			</div>
		</div>

	<div class="b2b-modal-footer ng-scope ng-isolate-scope">
		<div class="cta-button-group in">
			<button class="btn btn-alt btn-small" type="button"
					ng-click="$dismiss('cancel');">
				Close
			</button>
		</div>
	</div>

</script>