Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix past builds status icons #707

Merged
merged 1 commit into from
Jan 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
};