mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
33 lines
605 B
JavaScript
33 lines
605 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
|
|
})
|
|
|
|
}
|
|
|
|
|
|
}, true)
|
|
}
|