mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Starting to add Timeline notifications.
This commit is contained in:
@@ -1,3 +1,39 @@
|
||||
module.exports = function ActivityCtrl($scope) {
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user