mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-24 17:55:13 +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)
|
||||
}
|
||||
|
||||
@@ -4,41 +4,47 @@
|
||||
span(translate) Activity
|
||||
.widget-content.padded
|
||||
|
||||
ul.timeline.activity-list
|
||||
li.active
|
||||
.timeline-time
|
||||
strong Oct 3
|
||||
span 4:53 PM
|
||||
.timeline-icon
|
||||
.bg-primary
|
||||
i.fa.fa-exclamation-circle.fa-1x
|
||||
.timeline-content
|
||||
h2 WebSocket Disconnected
|
||||
p Socket connection was lost, try again reloading the page.
|
||||
div
|
||||
refresh-page
|
||||
ul(ng-repeat='line in timeline.lines')
|
||||
li
|
||||
h3 {{line.title}}
|
||||
p {{line.message}}
|
||||
|
||||
|
||||
//a(href='/')
|
||||
.status.unread
|
||||
//i.fa.fa-exclamation-triangle.fa-2x.activity-icon
|
||||
h2.activity-title WebSocket Disconnected
|
||||
span.activity-date 2014/04/30 18:33:22
|
||||
|
||||
p.pull-left Socket connection was lost, try again reloading the page.
|
||||
.activity-buttons.pull-right
|
||||
refresh-page
|
||||
.clearfix
|
||||
//li.list-group-item
|
||||
.reviewer-info
|
||||
i.fa.fa-mobile.fa-2x.activity-icon
|
||||
h5.activity-title 'Nexus 5' Disconnected
|
||||
em.activity-date.pull-right 2014/04/30 15:33:22
|
||||
.review-text
|
||||
p.pull-left Device was disconnected because it timed out.
|
||||
.activity-buttons.pull-right
|
||||
button.btn.btn-sm.btn-primary-outline(ng-click='')
|
||||
i.fa.fa-refresh
|
||||
span(translate) Reconnect device
|
||||
ul.timeline.activity-list
|
||||
li.active
|
||||
.timeline-time
|
||||
strong Oct 3
|
||||
span 4:53 PM
|
||||
.timeline-icon
|
||||
.bg-primary
|
||||
i.fa.fa-exclamation-circle.fa-1x
|
||||
.timeline-content
|
||||
h2 WebSocket Disconnected
|
||||
p Socket connection was lost, try again reloading the page.
|
||||
div
|
||||
refresh-page
|
||||
|
||||
|
||||
//a(href='/')
|
||||
.status.unread
|
||||
//i.fa.fa-exclamation-triangle.fa-2x.activity-icon
|
||||
h2.activity-title WebSocket Disconnected
|
||||
span.activity-date 2014/04/30 18:33:22
|
||||
|
||||
p.pull-left Socket connection was lost, try again reloading the page.
|
||||
.activity-buttons.pull-right
|
||||
refresh-page
|
||||
.clearfix
|
||||
//li.list-group-item
|
||||
.reviewer-info
|
||||
i.fa.fa-mobile.fa-2x.activity-icon
|
||||
h5.activity-title 'Nexus 5' Disconnected
|
||||
em.activity-date.pull-right 2014/04/30 15:33:22
|
||||
.review-text
|
||||
p.pull-left Device was disconnected because it timed out.
|
||||
.activity-buttons.pull-right
|
||||
button.btn.btn-sm.btn-primary-outline(ng-click='')
|
||||
i.fa.fa-refresh
|
||||
span(translate) Reconnect device
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
require('./activity.css')
|
||||
|
||||
module.exports = angular.module('stf.activity', [
|
||||
require('stf/common-ui').name
|
||||
require('stf/common-ui').name,
|
||||
require('stf/timeline').name
|
||||
])
|
||||
.run(["$templateCache", function ($templateCache) {
|
||||
$templateCache.put('control-panes/activity/activity.jade',
|
||||
|
||||
Reference in New Issue
Block a user