Skip to content

Commit

Permalink
Merge pull request #707 from knownasilya/fix-builds-icon
Browse files Browse the repository at this point in the history
Fix past builds status icons
  • Loading branch information
Ilya Radchenko committed Jan 27, 2015
2 parents bbe0243 + ea670da commit ce61228
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
10 changes: 2 additions & 8 deletions client/dashboard/controllers/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@

var $ = require('jquery');
var _ = require('lodash');
var JobMonitor = require('../../utils/job-monitor');
var io = require('socket.io-client');
var statusClasses = {
passed: 'fa-check-circle success-text',
failed: 'fa-exclamation-circle failure-text',
running: 'fa-cog fa-spin',
submitted: 'fa-clock-o waiting-text',
errored: 'fa-minus-circle error-text'
};
var JobMonitor = require('../../utils/job-monitor');
var statusClasses = require('../../utils/status-classes');

module.exports = function ($scope, $element) {
var socket = io.connect();
Expand Down
24 changes: 10 additions & 14 deletions client/job-status/controllers/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ var io = require('socket.io-client');
var JobDataMonitor = require('../../utils/job-data-monitor');
var PHASES = require('../../utils/phases');
var SKELS = require('../../utils/skels');
var statusClasses = require('../../utils/status-classes');
var outputConsole;
var runtime = null;
var job = global.job;

module.exports = function ($scope, $route, $location, $filter) {
var params = $route.current ? $route.current.params : {}
, project = global.project
, jobid = params.id || (global.job && global.job._id)
, socket = io.connect()
, lastRoute = $route.current
, jobman = new BuildPage(socket, project.name, $scope.$digest.bind($scope), $scope, global.jobs, global.job)
var project = global.project;
var jobid = params.id || (global.job && global.job._id);
var socket = io.connect();
var lastRoute = $route.current;
var jobman = new BuildPage(socket, project.name, $scope.$digest.bind($scope), $scope, global.jobs, global.job);

outputConsole = global.document.querySelector('.console-output');

$scope.statusClasses = statusClasses;
$scope.phases = ['environment', 'prepare', 'test', 'deploy', 'cleanup'];
$scope.project = project;
$scope.jobs = global.jobs;
$scope.job = global.job;
$scope.canAdminProject = global.canAdminProject
$scope.canAdminProject = global.canAdminProject;
$scope.showStatus = global.showStatus;

if ($scope.job && $scope.job.phases.test.commands.length) {
if (job.phases.environment) {
job.phases.environment.collapsed = true;
Expand All @@ -38,14 +42,6 @@ module.exports = function ($scope, $route, $location, $filter) {
}
}

/*
var now = new Date().getTime()
$scope.sortDate = function (item) {
if (!item.finished) return new Date().getTime();
return new Date(item.finished).getTime();
};
*/

$scope.toggleErrorDetails = function () {
if ($scope.showErrorDetails) {
$scope.showErrorDetails = false;
Expand Down
9 changes: 9 additions & 0 deletions client/utils/status-classes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = {
passed: 'fa-check-circle success-text',
failed: 'fa-exclamation-circle failure-text',
running: 'fa-cog fa-spin',
submitted: 'fa-clock-o waiting-text',
errored: 'fa-minus-circle error-text'
};

0 comments on commit ce61228

Please sign in to comment.