Project

General

Profile

« Previous | Next » 

Revision 47224

View differences:

modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/static/html/wf/wf-process-log-modal.html
1
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
2
	<div class="modal-dialog modal-lg">
3
		<div class="modal-content">
4
			<div class="modal-header">
5
				<button type="button" class="close" data-dismiss="modal">&times;</button>
6
				<h4 class="modal-title" id="logDetailsLabel">
7
					Process <i>{{entry.procId}}</i>
8
					<span class="label label-success" ng-show="entry.success">SUCCESS</span>
9
					<span class="label label-danger" ng-hide="entry.success">FAILURE</span>
10
				</h4>
11
			</div>
12
			<div class="modal-body">
13
				<div class="row">
14
					<div class="col-xs-12">
15
						<b>Started at:</b> {{entry.startDate > 0 ? (entry.startDate | date:'yyyy-MM-dd HH:mm:ss Z') : '-'}}<br/>
16
						<b>Finished at:</b> {{entry.endDate > 0 ? (entry.endDate | date:'yyyy-MM-dd HH:mm:ss Z') : '-'}}<br/>
17
						<b>Duration:</b> {{calculateDateDiff(entry.startDate, entry.endDate)}}<br/>
18
					</div>
19
				</div>
20
				<br />
21
				<table class="table table-condensed table-striped" style="table-layout: fixed; font-size: 12px;">
22
					<tr ng-repeat="p in entry.outputParams">
23
						<th class="col-xs-4"><a href="javascript:void(0)" ng-click="setCurrentParam(p)">{{p.key}}</a></th>
24
						<td style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">{{p.value}}</td>
25
					</tr>
26
				</table>
27
				<div class="well" style="font-size: 11px" ng-show="currentParam.key">
28
					<p><strong>{{currentParam.key}}</strong></p>
29
					<p>{{currentParam.value}}</p>
30
				</div>
31
			</div>
32

  
33
			<div class="modal-footer">
34
				<button class="btn btn-primary" data-dismiss="modal">Close</button>
35
			</div>
36
		</div>
37
	</div>
38
</div>
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/static/html/wf/wf-history.html
1
<wf-process-modal proc-id="currentId" visible="showModal"></wf-process-modal>
1
<wf-process-modal proc-id="currentId" visible="showGraphModal"></wf-process-modal>
2 2

  
3
<wf-process-log-modal entry="currentProc" visible="showLogModal"></wf-process-log-modal>
4

  
5

  
3 6
<form class="form-inline pull-right" style="margin-bottom: 20px;">
4 7
	<input type="text" class="form-control input-sm" ng-model="searchHistory" placeholder="Filter..."/>
5 8
	<button type="button" class="btn btn-default btn-sm" ng-click="doOnRefesh()">
......
19 22
	</thead>
20 23
	<tbody>
21 24
		<tr ng-repeat="h in filteredHistory = (ngModel | filter: searchHistory)">
22
			<td><a href="javascript:void(0)" ng-click="showProcess(h.procId)">{{h.procId}}</a></td>
25
			<td><a href="javascript:void(0)" ng-click="showProcessLog(h)">{{h.procId}}</a></td>
23 26
			<td>{{h.name}}</td>
24 27
			<td>{{h.family}}</td>
25
			<td class="text-center"><span class="label label-default" ng-class="{
26
				'label-success': h.status == 'SUCCESS',
27
				'label-danger': h.status == 'FAILURE',
28
				'label-info': h.status == 'EXECUTING'}">{{h.status}}</span></td>
29
			<td class="text-right">{{ (h.date > 0 && h.date < 9999999999999) ? (h.date | date:"yyyy-MM-dd HH:mm:ss") : "not yet started" }}</td>
28
			<td class="text-center">
29
				<span class="label label-success" ng-show="h.success">SUCCESS</span>
30
				<span class="label label-danger" ng-hide="h.success">FAILURE</span>
31
			</td>
32
			<td class="text-right">{{ (h.endDate > 0 && h.endDate < 9999999999999) ? (h.endDate | date:"yyyy-MM-dd HH:mm:ss") : "-" }}</td>
30 33
		</tr>
31 34
	<tr ng-show="filteredHistory.length == 0">
32 35
		<td colspan="5">No entry</td>
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/static/js/wfs/wf_process_viewer.js
148 148
		}
149 149
	}
150 150
});
151

  
152
wfProcessViewer.directive("wfProcessLogModal", function () {
153
	return {
154
		restrict: 'E',
155
		transclude: true,
156
		replace:true,
157
		scope: {
158
	        'entry'   : '=',
159
	        'visible' : '='
160
		},
161
		templateUrl: '/html/wf/wf-process-log-modal.html',
162
		
163
		link: function (scope, element, attrs, ctrl) {
164
			
165
			scope.currentParam = {};
166
			
167
			$(element).modal({'show': false});
168
		
169
			scope.$watch(function() {
170
				return scope.visible;
171
			}, function(value) {
172
				if (value == true && scope.entry && scope.entry.procId) { 
173
					$(element).modal('show');
174
					scope.visible = false;
175
					scope.currentParam = {};
176
				}
177
			});
178
						
179
			scope.to_trusted = function (html_code) {
180
				return $sce.trustAsHtml(html_code);
181
			};
182
		
183
			scope.calculateDateDiff = function (start, end) {
184
				if (start <= 0 || end <= 0) {
185
					return '-';
186
				}
187
				var seconds = 0;
188
				var minutes = 0;
189
				var hours = 0;
190
				var days = 0;
191
	
192
				if (end > start) {
193
					seconds = Math.round((end - start) / 1000);
194
	
195
					if (seconds > 60) {
196
						minutes = Math.floor(seconds / 60);
197
						seconds = seconds % 60;
198
						if (minutes > 60) {
199
							hours = Math.floor(minutes / 60);
200
							minutes = minutes % 60;
201
							if (hours > 24) {
202
								days = Math.floor(hours / 24);
203
								hours = hours % 24;
204
							}
205
						}
206
					}
207
				}
208
	
209
				var res = '';
210
				if (days > 0) {
211
					if (res) {
212
						res += ', ';
213
					}
214
					res += days + " day(s)"
215
				}
216
				if (hours > 0) {
217
					if (res) {
218
						res += ', ';
219
					}
220
					res += hours + " hour(s)"
221
				}
222
				if (minutes > 0) {
223
					if (res) {
224
						res += ', ';
225
					}
226
					res += minutes + " minute(s)"
227
				}
228
				if (seconds > 0) {
229
					if (res) {
230
						res += ', ';
231
					}
232
					res += seconds + " second(s)"
233
				}
234
	
235
				if (!res) {
236
					res = '0 seconds';
237
				}
238
	
239
				return res;
240
			}
241
			
242
			scope.setCurrentParam  = function (p) {
243
				scope.currentParam = p;
244
			}
245
			
246
		}
247
	}
248
});
249

  
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/static/js/wfs/wfs.js
191 191
		},
192 192
		link: function (scope) {
193 193
			scope.currentId = '';
194
			scope.showModal = false;
195

  
194
			scope.currentProc = {};
195
			
196
			scope.showGraphModal = false;
197
			scope.showLogModal = false;
198
			
196 199
			scope.doOnRefesh = function () {
197 200
				scope.onRefresh();
198 201
			}
199 202
			scope.showProcess = function (procId) {
200 203
				scope.currentId = procId;
201
				scope.showModal = true;
204
				scope.showGraphModal = true;
202 205
			}
206
			scope.showProcessLog = function (proc) {
207
				scope.currentProc = proc;
208
				scope.showLogModal = true;
209
			}
203 210
		}
204 211
	}
205 212
});

Also available in: Unified diff