summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <palvarez89@gmail.com>2015-10-02 16:04:04 +0200
committerPedro Alvarez <palvarez89@gmail.com>2015-10-02 16:04:04 +0200
commit26a6549436a82c09d18bf6ca5a74f3dc04e76c0a (patch)
tree7b058febaa5955f84bac57c50a8556902ef73e09
parent417790c58dabc67540402589e1a0da1f9fc3d9b0 (diff)
downloadciat-ui-26a6549436a82c09d18bf6ca5a74f3dc04e76c0a.tar.gz
Fix indentation
-rw-r--r--js/main.js156
1 files changed, 78 insertions, 78 deletions
diff --git a/js/main.js b/js/main.js
index 016332a..78ac7b0 100644
--- a/js/main.js
+++ b/js/main.js
@@ -52,92 +52,92 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval)
'/builds/' + latestBuildNumber;
$http.get(latestBuildsPath).then(function(estimationResponse) {
- var currentTime = Math.floor((new Date()).getTime() / 1000)
- var timeRunning = 0;
- if (state === 'building') {
- lastBuildID = value.cachedBuilds[value.cachedBuilds.length - 2];
- timeRunning = currentTime - estimationResponse.data.times[0];
- } else {
- lastBuildID = value.cachedBuilds[value.cachedBuilds.length - 1];
- }
-
- var buildsPath = apiBase + '/builders/' + key +
- '/builds/' + lastBuildID;
-
-
- $http.get(buildsPath).then(function(response) {
- var progress = 100;
- var previousTime = response.data.times[1] - response.data.times[0];
- var success = checkInArray(response.data.text, 'successful');
- var failed = ! success;
- var details = {
- success: success,
- failed: failed,
- steps: response.data.steps,
- sourceStamps: response.data.sourceStamps,
- number: response.data.number
- };
-
- if (key.indexOf("Integration") > -1) {
- $scope.integrations.push({
- name: key,
- lastBuild: details,
- data: value
- });
+ var currentTime = Math.floor((new Date()).getTime() / 1000)
+ var timeRunning = 0;
+ if (state === 'building') {
+ lastBuildID = value.cachedBuilds[value.cachedBuilds.length - 2];
+ timeRunning = currentTime - estimationResponse.data.times[0];
+ } else {
+ lastBuildID = value.cachedBuilds[value.cachedBuilds.length - 1];
}
- else if (key.indexOf("Build") > -1) {
- var progressStyle = "progress-bar-success progress-bar-striped"
- if (state === "building" ) {
- progressStyle = "progress-bar-warning progress-bar-striped active"
- progress = (timeRunning * 100) / previousTime;
- //alert (currentTime)
- //alert (estimationResponse.data.times[0])
- //alert (timeRunning)
- //alert (previousTime)
- if (progress > 100 ) {
- progress = 90;
+
+ var buildsPath = apiBase + '/builders/' + key +
+ '/builds/' + lastBuildID;
+
+
+ $http.get(buildsPath).then(function(response) {
+ var progress = 100;
+ var previousTime = response.data.times[1] - response.data.times[0];
+ var success = checkInArray(response.data.text, 'successful');
+ var failed = ! success;
+ var details = {
+ success: success,
+ failed: failed,
+ steps: response.data.steps,
+ sourceStamps: response.data.sourceStamps,
+ number: response.data.number
+ };
+
+ if (key.indexOf("Integration") > -1) {
+ $scope.integrations.push({
+ name: key,
+ lastBuild: details,
+ data: value
+ });
+ }
+ else if (key.indexOf("Build") > -1) {
+ var progressStyle = "progress-bar-success progress-bar-striped"
+ if (state === "building" ) {
+ progressStyle = "progress-bar-warning progress-bar-striped active"
+ progress = (timeRunning * 100) / previousTime;
+ //alert (currentTime)
+ //alert (estimationResponse.data.times[0])
+ //alert (timeRunning)
+ //alert (previousTime)
+ if (progress > 100 ) {
+ progress = 90;
+ }
}
+ $scope.builds.push({
+ name: key,
+ lastBuild: details,
+ data: value,
+ progress: progress,
+ style: progressStyle
+
+ });
+ }
+ else if(key.indexOf("Deploy") > -1) {
+ $scope.deploys.push({
+ name: key,
+ lastBuild: details,
+ data: value
+ });
+ }
+ else if(key.indexOf("Test") > -1) {
+ $scope.tests.push({
+ name: key,
+ lastBuild: details,
+ data: value
+ });
+ }
+ else if(key.indexOf("Publish") > -1) {
+ $scope.publishings.push({
+ name: key,
+ lastBuild: details,
+ data: value
+ });
}
- $scope.builds.push({
- name: key,
- lastBuild: details,
- data: value,
- progress: progress,
- style: progressStyle
-
- });
- }
- else if(key.indexOf("Deploy") > -1) {
- $scope.deploys.push({
- name: key,
- lastBuild: details,
- data: value
- });
- }
- else if(key.indexOf("Test") > -1) {
- $scope.tests.push({
- name: key,
- lastBuild: details,
- data: value
- });
- }
- else if(key.indexOf("Publish") > -1) {
- $scope.publishings.push({
- name: key,
- lastBuild: details,
- data: value
- });
- }
- $scope.builds.sort(function(a, b) {
- if(a.name < b.name) return -1;
- if(a.name > b.name) return 1;
- return 0;
+ $scope.builds.sort(function(a, b) {
+ if(a.name < b.name) return -1;
+ if(a.name > b.name) return 1;
+ return 0;
+ });
});
});
- });
});
});
}