Revision 54970
Added by Michele Artini about 5 years ago
wfs.js | ||
---|---|---|
26 | 26 |
}).when('/ds/:repoId*/api/:ifaceId*', { |
27 | 27 |
controller: 'repoApiCtrl', |
28 | 28 |
templateUrl: function (params) { |
29 |
return '/page/datasource_api?dsId=' + params.repoId + "&ifaceId=" + params.ifaceId + '&dt=' + new Date().getTime();
|
|
29 |
return '/html/datasources/api.html';
|
|
30 | 30 |
} |
31 | 31 |
}) |
32 | 32 |
.otherwise({redirectTo: '/'}); |
... | ... | |
307 | 307 |
$scope.selectedRepoHiWf = {}; |
308 | 308 |
$scope.selectedMsroWorker = {}; |
309 | 309 |
|
310 |
$scope.currentDsId = $routeParams.repoId; |
|
311 |
$scope.currentIfaceId = $routeParams.ifaceId; |
|
312 |
|
|
313 |
$scope.ds = {}; |
|
314 |
$scope.api = {}; |
|
315 |
$scope.wfs = []; |
|
316 |
$scope.overrideCompliance = ''; |
|
317 |
$scope.compatibilityLevels = getCompatibilityLevels(); |
|
318 |
|
|
310 | 319 |
$scope.refresh = function () { |
311 |
$route.reload(); |
|
320 |
showSpinner(); |
|
321 |
$http.get('/ajax/apis/ds?id=' + $scope.currentDsId).success(function (data) { |
|
322 |
hideSpinner(); |
|
323 |
$scope.ds = data; |
|
324 |
for(var i=0; i<data.interfaces.length; i++) { |
|
325 |
if (data.interfaces[i].id == $scope.currentIfaceId) { |
|
326 |
$scope.api = data.interfaces[i]; |
|
327 |
if ($scope.api.extraFields['overriding_compliance']) { |
|
328 |
$scope.overrideCompliance = $scope.api.extraFields['overriding_compliance']; |
|
329 |
} |
|
330 |
} |
|
331 |
} |
|
332 |
}).error(function (err) { |
|
333 |
hideSpinner(); |
|
334 |
show_notification('error', 'Error getting datasource'); |
|
335 |
}); |
|
336 |
|
|
337 |
$http.get('/ajax/wfs/forApi?dsId=' + $scope.currentDsId + "&ifaceId=" + $scope.currentIfaceId).success(function (data) { |
|
338 |
hideSpinner(); |
|
339 |
$scope.wfs = data; |
|
340 |
}).error(function (err) { |
|
341 |
hideSpinner(); |
|
342 |
show_notification('error', 'Error getting wfs'); |
|
343 |
}); |
|
312 | 344 |
}; |
313 |
|
|
345 |
|
|
314 | 346 |
$scope.editAccessParams = function () { |
315 | 347 |
$scope.showAccessParamsModal = true; |
316 | 348 |
}; |
... | ... | |
319 | 351 |
$scope.showRepoHiModal = true; |
320 | 352 |
}; |
321 | 353 |
|
322 |
$scope.updateCompatibilityLevel = function(dsId, ifaceId, level) {
|
|
354 |
$scope.updateCompatibilityLevel = function(level) { |
|
323 | 355 |
var url = ''; |
324 |
if (level) { url = '/ajax/wfs/ds/compliance/override/' + level + '?dsId=' + dsId + '&ifaceId=' + ifaceId }
|
|
325 |
else { url = '/ajax/wfs/ds/compliance/reset?dsId=' + dsId + '&ifaceId=' + ifaceId }
|
|
356 |
if (level) { url = '/ajax/wfs/ds/compliance/override/' + level + '?dsId=' + $scope.currentDsId + '&ifaceId=' + $scope.currentIfaceId }
|
|
357 |
else { url = '/ajax/wfs/ds/compliance/reset?dsId=' + $scope.currentDsId + '&ifaceId=' + $scope.currentIfaceId }
|
|
326 | 358 |
|
327 | 359 |
showSpinner(); |
328 | 360 |
$http.get(url).success(function (data) { |
... | ... | |
335 | 367 |
}); |
336 | 368 |
}; |
337 | 369 |
|
338 |
|
|
339 |
|
|
340 |
$scope.newRepoWorkflow = function (repoId, ifaceId) { |
|
370 |
$scope.newRepoWorkflow = function() { |
|
341 | 371 |
showSpinner(); |
342 | 372 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
343 | 373 |
$http.post('/ajax/apis/repohi/start', $.param({ |
344 |
'dsId' : repoId,
|
|
345 |
'iface' : ifaceId,
|
|
374 |
'dsId' : $scope.currentDsId,
|
|
375 |
'iface' : $scope.currentIfaceId,
|
|
346 | 376 |
'wfId' : $scope.selectedRepoHiWf.id, |
347 | 377 |
'workerId' : $scope.selectedMsroWorker.serviceId |
348 | 378 |
})).success(function (data) { |
... | ... | |
366 | 396 |
show_notification('error', 'Error starting REPO_BYE workflow:' + err.message); |
367 | 397 |
}); |
368 | 398 |
}; |
399 |
|
|
400 |
$scope.refresh(); |
|
369 | 401 |
}); |
370 | 402 |
|
Also available in: Unified diff