This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from pdehaan/loadsv2api
Convert from V1 to V2 API
- Loading branch information
Showing
16 changed files
with
58 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
client/bower_components | ||
client/bower_components/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
'use strict'; | ||
|
||
angular.module('LoadsApp', ['ngRoute', 'ngSanitize']); | ||
angular.module('LoadsApp', ['ngRoute', 'ngSanitize', 'angularMoment']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,11 @@ | ||
'use strict'; | ||
|
||
angular.module('LoadsApp') | ||
.factory('RunsService', function ($rootScope, WEBSOCKET_URL) { | ||
var cleanData = function (arr) { | ||
return arr.map(function (result) { | ||
var data = { | ||
date: result[0], | ||
name: result[1], | ||
runId: result[2], | ||
details: result[3] | ||
}; | ||
data.success = (data.details.metadata.style === 'green'); | ||
data.cssClass = (data.success) ? 'success' : 'danger'; | ||
data.iconClass = (data.success) ? 'checkmark' : 'remove'; | ||
return data; | ||
}); | ||
}; | ||
.factory('RunsService', function ($rootScope, $http) { | ||
|
||
var ws = new WebSocket(WEBSOCKET_URL); | ||
ws.onopen = function () { | ||
console.log('Socket has been opened to %s', WEBSOCKET_URL); // eslint-disable-line no-console | ||
}; | ||
ws.onmessage = function (message) { | ||
$rootScope.$apply(function () { | ||
try { | ||
var data = angular.fromJson(message.data); | ||
$rootScope.runs = { | ||
active: cleanData(data.active), | ||
inactive: cleanData(data.inactive), | ||
hasActive: (data.active.length !== 0), | ||
hasInactive: (data.inactive.length !== 0), | ||
lastSync: new Date() | ||
}; | ||
} catch (err) { | ||
console.error(err); // eslint-disable-line no-console | ||
console.log(message); // eslint-disable-line no-console | ||
} | ||
return $http.get('/api') | ||
.then(function (res) { | ||
$rootScope.runs = res.data.runs; | ||
$rootScope.lastSync = Date.now(); | ||
}); | ||
}; | ||
|
||
return ws; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
client/static/assets/views/_partials/runs-active-table.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
<!-- | ||
<td><i class="foundicon-{{ run.iconClass }} {{ run.cssClass }}-text"></i> <a ng-href="{{ ROUTES.RUN_DETAIL }}/{{ run.runId }}" class="run-link">{{ run.name }}</a></td> | ||
<td class="elapsed" ng-bind="run.details.counts.elapsed"></td> | ||
<td class="finished"><time ng-bind="run.details.counts.finished"></time> ago</td> | ||
<td><a ng-href="mailto:{{ run.details.metadata.user_id }}@mozilla.com" ng-bind="run.details.metadata.user_id" ng-show="run.details.metadata.user_id"></a></td> | ||
--> | ||
<td><div class="run-result result-{{ run.iconClass }}"> | ||
<i class="run-result-icon foundicon-{{ run.iconClass }} {{ run.cssClass }}-text"></i> | ||
<a ng-href="{{ ROUTES.RUN_DETAIL }}/{{ run.runId }}" class="run-link">{{ run.name }}</a> | ||
<div class="elapsed" ng-bind="run.details.counts.elapsed" title="Duration"></div> | ||
<div class="time"><time ng-bind="run.details.counts.finished"></time> ago</div> | ||
<div class="user"><a ng-href="mailto:{{ run.details.metadata.user_id }}@mozilla.com" ng-bind="run.details.metadata.user_id" ng-show="run.details.metadata.user_id"></a></div> | ||
</div></td> | ||
<td class="run-result"> | ||
<a ng-href="{{ ROUTES.RUN_DETAIL + '/' + run.uuid }}" class="run-link">{{ run.uuid }}</a> | ||
<ul> | ||
<li><code>aborted</code>: <span ng-bind="run.aborted"></span></li> | ||
<li><code>state</code>: <span ng-bind="run.state | statusToText"></span></li> | ||
|
||
<li><code>id</code>: <span ng-bind="run.id"></span></li> | ||
<li><code>plan_id</code>: <span ng-bind="run.plan_id"></span></li> | ||
<li><code>uuid</code>: <span ng-bind="run.uuid"></span></li> | ||
|
||
<li><code>created_at</code>: <span ng-bind="run.created_at | date:'medium'"></span> (<span am-time-ago="run.created_at"></span>)</li> | ||
<li><code>started_at</code>: <span ng-bind="run.started_at | date:'medium'"></span></li> | ||
<li><code>completed_at</code>: <span ng-bind="run.completed_at | date:'medium'"></span></li> | ||
|
||
<li>duration: <span>{{ run.started_at | amDifference: run.completed_at : 'minutes'}} minutes</span></li> | ||
</ul> | ||
</td> |
32 changes: 0 additions & 32 deletions
32
client/static/assets/views/_partials/runs-finished-table.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
<th>Run</th><!-- | ||
<th class="elapsed">Duration</th> | ||
<th class="finished">Finished</th> | ||
<th>User</th>--> | ||
<th>Run</th> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters