mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-24 02:41:01 +00:00
40 lines
849 B
JavaScript
40 lines
849 B
JavaScript
'use strict';
|
|
|
|
angular.module('app').controller("ConfigController", function($scope, $http, remotes) {
|
|
$scope.state=0;
|
|
|
|
$scope.user = remotes.get().success(function (data) {
|
|
$scope.remotes = (typeof data==="string")?[]:data;
|
|
$scope.state = 1;
|
|
|
|
// loop through the remotes and add each
|
|
// remote to the page scope.
|
|
for (remote in $scope.remotes) {
|
|
switch (remote.type) {
|
|
case 'github.com':
|
|
$scope.github = remote;
|
|
break;
|
|
|
|
case 'enterprise.github.com':
|
|
$scope.githubEnterprise = remote;
|
|
break;
|
|
|
|
case 'gitlab.com':
|
|
$scope.gitlab = remote;
|
|
break;
|
|
|
|
case 'bitbucket.org':
|
|
$scope.bitbucket = remote;
|
|
break;
|
|
|
|
case 'stash.atlassian.com':
|
|
$scope.stash = remote;
|
|
break;
|
|
}
|
|
}
|
|
})
|
|
.error(function (error) {
|
|
$scope.remotes = [];
|
|
$scope.state = 1;
|
|
});
|
|
});
|