mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
40 lines
781 B
JavaScript
40 lines
781 B
JavaScript
module.exports = function ActivityCtrl($scope, gettext, TimelineService) {
|
|
$scope.timeline = TimelineService
|
|
|
|
$scope.$watch('device.state', function (newValue, oldValue) {
|
|
|
|
if (newValue !== oldValue) {
|
|
|
|
var title = ''
|
|
var message = ''
|
|
|
|
if (oldValue === 'using') {
|
|
|
|
title = newValue
|
|
message = 'Device is now ' + newValue
|
|
|
|
|
|
} else {
|
|
title = newValue
|
|
message = '!Device is now ' + newValue
|
|
}
|
|
|
|
$scope.timeline.info({
|
|
title: title,
|
|
message: message,
|
|
serial: $scope.device.serial
|
|
})
|
|
|
|
// $scope.timeline.push({
|
|
// title: title,
|
|
// message: message,
|
|
// serial: angular.copy($scope.device.serial),
|
|
// time: Date.now()
|
|
// })
|
|
|
|
}
|
|
|
|
|
|
}, true)
|
|
}
|