Project

General

Profile

« Previous | Next » 

Revision 27035

moved some function from common js

View differences:

modules/dnet-modular-workflows-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/workflows/common/atomwf.st
28 28
				<label>
29 29
					<b>Last execution date:</b> 
30 30
					<span ng-show="currentWorkflow.lastExecutionDate">
31
						<a href="javascript:void(0)" data-toggle="modal" data-target="#journalWfModal" ng-click="updateWfJournal(currentWorkflow.wfId)"><i>{{currentWorkflow.lastExecutionDate}}</i></a>
31
						<a href="javascript:void(0)" data-toggle="modal" data-target="#journalWfModal" ng-click="updateWorkflowHistory(currentWorkflow.wfId)"><i>{{currentWorkflow.lastExecutionDate}}</i></a>
32 32
					</span>
33 33
					<span ng-show="!currentWorkflow.lastExecutionDate"><i>not yet launched</i></span>
34 34
				</label>
modules/dnet-modular-workflows-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/workflows/common/metawf.st
10 10
					<div class="btn-group">
11 11
						<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#metaWfEditModal" ng-click="prepareMetaWfEdit()">configure</button>
12 12
						<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#cloneWfModal">clone</button>
13
						<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#monitorWfModal" ng-click="updateMetaWorkflowHistory()">history</button>
13
						<button type="button" class="btn btn-default btn-sm" data-toggle="modal" ng-click="updateMetaWorkflowHistory()">history</button>
14 14
					</div>
15 15
				</form>
16 16
			</div>
modules/dnet-modular-workflows-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/workflows/common/wf_monitor.st
17 17
					</div>
18 18
					<div class="row" style="margin-top: 20px">
19 19
						<div class="col-xs-12">
20
							<div id="tableMetaWfHistory" class="control gridStyle-big" ng-grid="gridMetaWfHistory"></div>
20
							<div id="tableMetaWfHistory" class="control gridStyle-big" ng-grid="gridHistory"></div>
21 21
						</div>
22 22
					</div>
23 23
				</div>
modules/dnet-modular-workflows-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/workflows/common/wf_journal.st
1
<div id="journalWfModal" class="modal fade" tabindex="-1" role="dialog">
2
	<div class="modal-dialog">
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">{{currentWorkflow.name}}</h4>
7
			</div>
8
			<div class="modal-body">
9
				<div id="currentWfJournalTable" class="control" ng-grid="gridCurrentWfJournal" style="height:300px;"></div>
10
			</div>
11
			<div class="modal-footer">
12
				<button class="btn btn-default" data-dismiss="modal">Close</button>
13
			</div>
14
		</div>
15
	</div>
16
</div>
17

  
18 1
<div id="currentLogDetailsModal" class="modal fade" tabindex="-1" role="dialog">
19 2
	<div class="modal-dialog modal-lg">
20 3
		<div class="modal-content">
modules/dnet-modular-workflows-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/workflows/common/wf_monitor_proc.st
27 27
				</div>
28 28
			</div>
29 29
			<div class="modal-footer">
30
				<button class="btn btn-default" 
31
					data-dismiss="modal" data-toggle="modal" data-target="#monitorWfModal"
32
					ng-click="updateMetaWorkflowHistory()">Back</button>
30
				<button class="btn btn-default"	data-dismiss="modal"  ng-click="updateMetaWorkflowHistory()">Back</button>
33 31
			</div>
34 32
		</div>
35 33
	</div>
modules/dnet-modular-workflows-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/dnet_workflows.js
177 177
		});
178 178
	}
179 179
	
180
	$scope.enableCurrentWf = function(val) {
181
		$scope.showSpinner();
182
		$http.get('wf_atomic_workflow.enable?start=' + val + "&id="	+ $scope.currentWorkflow.wfId).success(function(data) {
183
			$scope.currentWorkflow.start = val;
184
			$scope.hideSpinner();
185
		}).error(function() {
186
			$scope.showError('Something really bad must have happened to our fellow hamster..');
187
			$scope.hideSpinner();
188
		});
189
	}
190

  
180 191
	$scope.showPriorityDialog = function(b) {
181 192
		var s = prompt("New workflow priority [0..100]", $scope.currentWorkflow.priority);
182 193
		if (s == null) {
......
210 221
		}
211 222
		return $scope.validParamValuesCache[func];
212 223
	}
224
	
225
	$scope.updateWorkflowHistory = function(id) {
226
		$scope.updateHistory([ id ]);
227
	}
213 228

  
214 229
	$scope.reload(true);
215 230
}
modules/dnet-modular-workflows-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/dnet_workflows_common.js
13 13
	};
14 14
	$scope.metaworkflows = [];
15 15
	$scope.currentTab = 'metawf';
16
	$scope.currentMetaWfHistory = [];
17
	$scope.currentWorkflowJournal = [];
16
	$scope.currentHistory = [];
17

  
18 18
	$scope.currentLogDetails = [];
19 19
	$scope.validParamValuesCache = {};
20 20

  
......
22 22
		filterText : ''
23 23
	};
24 24

  
25
	$scope.gridCurrentWfJournal = {
26
		data : 'currentWorkflowJournal',
27
		enableCellSelection : false,
28
		enableRowSelection : false,
29
		enableCellEditOnFocus : false,
30
		enablePaging : false,
31
		sortInfo : {
32
			fields : [ 'date' ],
33
			directions : [ 'desc' ]
34
		},
35
		columnDefs : [
36
				{
37
					field : 'date',
38
					width : '70%',
39
					displayName : 'Date',
40
					cellTemplate : '<div class="ngCellText"><a href="#" ng-click="showProcess(row.getProperty(\'procId\'), row.getProperty(\'prettyDate\'))">{{row.getProperty("prettyDate")}}</a></div>'
41
				},
42
				{
43
					field : 'status',
44
					displayName : 'Status',
45
					headerClass : 'text-center',
46
					cellTemplate : '<div class="ngCellText text-center"><span class="label label-default" ng-class="{ \'label-success\': row.getProperty(col.field) == \'SUCCESS\', \'label-danger\': row.getProperty(col.field) == \'FAILURE\', \'label-info\': row.getProperty(col.field) == \'EXECUTING\'}">{{row.getProperty(col.field)}}</span></div>'
47
				} ]
48
	};
49

  
50 25
	$scope.gridCurrentLogDetails = {
51 26
		data : 'currentLogDetails',
52 27
		enableCellSelection : false,
......
89 64

  
90 65
	initSpinner();
91 66

  
92
	$scope.gridMetaWfHistory = {
93
		data : 'currentMetaWfHistory',
67
	$scope.gridHistory = {
68
		data : 'currentHistory',
94 69
		enableCellEditOnFocus : false,
95 70
		enablePaging : false,
96 71
		enableHighlighting : true,
......
147 122
	}
148 123

  
149 124
	$scope.updateMetaWorkflowHistory = function() {
150
		$scope.currentMetaWfHistory = [];
125
		$scope.updateHistory($scope.currentMetaWorkflow.innerWfs);
126
	};
127
	
128
	
129
	$scope.updateHistory = function(ids) {
130
		$scope.currentHistory = [];
151 131
		$scope.showSpinner();
152 132
		$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
153
		$http
154
				.post('wf_journal.find', $.param({
155
					'wfs' : JSON.stringify($scope.currentMetaWorkflow.innerWfs)
156
				}))
157
				.success(function(data) {
158
					$scope.hideSpinner();
159
					$scope.currentMetaWfHistory = data;
160
				})
161
				.error(
162
						function() {
163
							$scope.hideSpinner();
164
							$scope
165
									.showError('Something really bad must have happened to our fellow hamster..');
166
						});
133
		$http.post('wf_journal.find', $.param({
134
			'wfs' : JSON.stringify(ids)
135
		})).success(function(data) {
136
			$scope.hideSpinner();
137
			$scope.currentHistory = data;
138
			$('#monitorWfModal').modal('show')
139
		}).error(function() {
140
			$scope.hideSpinner();
141
			$scope.showError('Something really bad must have happened to our fellow hamster..');
142
		});
167 143
	};
168 144

  
169 145
	$scope.showProcess = function(id, date) {
......
225 201
		}
226 202
	}
227 203

  
228
	$scope.enableCurrentWf = function(val) {
229
		$scope.showSpinner();
230
		$http
231
				.get(
232
						'wf_atomic_workflow.enable?start=' + val + "&id="
233
								+ $scope.currentWorkflow.wfId)
234
				.success(function(data) {
235
					$scope.currentWorkflow.start = val;
236
					$scope.hideSpinner();
237
				})
238
				.error(
239
						function() {
240
							$scope
241
									.showError('Something really bad must have happened to our fellow hamster..');
242
							$scope.hideSpinner();
243
						});
244
	}
245

  
246
	$scope.updateWfJournal = function(id) {
247
		$scope.currentWorkflowJournal = [];
248

  
249
		$scope.showSpinner();
250
		$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
251
		$http
252
				.post('wf_journal.find', $.param({
253
					'wfs' : JSON.stringify([ id ])
254
				}))
255
				.success(function(data) {
256
					$scope.currentWorkflowJournal = data;
257
					$scope.hideSpinner();
258
				})
259
				.error(
260
						function() {
261
							$scope
262
									.showError('Something really bad must have happened to our fellow hamster..');
263
							$scope.hideSpinner();
264
						});
265
	}
266

  
267 204
	$scope.showSpinner();
268 205
}

Also available in: Unified diff