diff --git a/res/app/components/stf/common-ui/refresh-page/refresh-page-directive.js b/res/app/components/stf/common-ui/refresh-page/refresh-page-directive.js index 67c88228..084091cb 100644 --- a/res/app/components/stf/common-ui/refresh-page/refresh-page-directive.js +++ b/res/app/components/stf/common-ui/refresh-page/refresh-page-directive.js @@ -1,11 +1,15 @@ -module.exports = function refreshPageDirective() { +module.exports = function refreshPageDirective($window) { return { restrict: 'E', replace: true, scope: { }, template: require('./refresh-page.jade'), - link: function () { + link: function (scope) { + scope.reloadWindow = function () { + $window.location.reload() + } + // TODO: reload with $route.reload() } } diff --git a/res/app/components/stf/common-ui/refresh-page/refresh-page.jade b/res/app/components/stf/common-ui/refresh-page/refresh-page.jade index beed086b..182ed539 100644 --- a/res/app/components/stf/common-ui/refresh-page/refresh-page.jade +++ b/res/app/components/stf/common-ui/refresh-page/refresh-page.jade @@ -1,3 +1,3 @@ -button.btn.btn-sm.btn-primary-outline(ng-click='window.location.reload()') +button.btn.btn-sm.btn-primary-outline(ng-click='reloadWindow()') i.fa.fa-refresh - span(translate) Refresh \ No newline at end of file + span(translate) Refresh diff --git a/res/app/control-panes/activity/activity-controller.js b/res/app/control-panes/activity/activity-controller.js new file mode 100644 index 00000000..0185db8e --- /dev/null +++ b/res/app/control-panes/activity/activity-controller.js @@ -0,0 +1,3 @@ +module.exports = function ActivityCtrl($scope) { + +} diff --git a/res/app/control-panes/activity/activity-spec.js b/res/app/control-panes/activity/activity-spec.js new file mode 100644 index 00000000..e8a4e1de --- /dev/null +++ b/res/app/control-panes/activity/activity-spec.js @@ -0,0 +1,17 @@ +describe('ActivityCtrl', function () { + + beforeEach(module('stf.activity')); + + var scope, ctrl; + + beforeEach(inject(function ($rootScope, $controller) { + scope = $rootScope.$new(); + ctrl = $controller('ActivityCtrl', {$scope: scope}); + })); + + it('should ...', inject(function () { + expect(1).toEqual(1); + + })); + +}); \ No newline at end of file diff --git a/res/app/control-panes/activity/activity.css b/res/app/control-panes/activity/activity.css new file mode 100644 index 00000000..4f6ce510 --- /dev/null +++ b/res/app/control-panes/activity/activity.css @@ -0,0 +1,19 @@ +.stf-activity .activity-list .activity-date, +.stf-activity .activity-list .activity-buttons { + opacity: 0; + transition: opacity 0.25s ease-in-out; +} + +.stf-activity .activity-list li:hover .activity-date, +.stf-activity .activity-list li:hover .activity-buttons { + opacity: 1; +} + +.stf-activity .activity-title { + display: inline-block; +} + +.stf-activity .activity-icon { + width: 30px; + height: 30px; +} diff --git a/res/app/control-panes/activity/activity.jade b/res/app/control-panes/activity/activity.jade new file mode 100644 index 00000000..4671a3dc --- /dev/null +++ b/res/app/control-panes/activity/activity.jade @@ -0,0 +1,31 @@ +.widget-container.scrollableX.list.rating-widget.stf-activity(ng-controller='ActivityCtrl') + //.heading + i.fa + span(translate) Activity + .widget-content.padded + ul.activity-list + li + .reviewer-info + i.fa.fa-exclamation-triangle.fa-2x.activity-icon + //img(width='30', height='30', src='images/avatar-male.jpg') + h5.activity-title WebSocket Disconnected + em.activity-date.pull-right 2014/04/30 18:33:22 + .review-text + p.pull-left Socket connection was lost, try again reloading the page. + .activity-buttons.pull-right + refresh-page + .clearfix + li + .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 + + .clearfix + diff --git a/res/app/control-panes/activity/index.js b/res/app/control-panes/activity/index.js new file mode 100644 index 00000000..be1cea09 --- /dev/null +++ b/res/app/control-panes/activity/index.js @@ -0,0 +1,11 @@ +require('./activity.css') + +module.exports = angular.module('stf.activity', [ + require('stf/common-ui').name +]) + .run(["$templateCache", function ($templateCache) { + $templateCache.put('control-panes/activity/activity.jade', + require('./activity.jade') + ) + }]) + .controller('ActivityCtrl', require('./activity-controller')) diff --git a/res/app/control-panes/control-panes-controller.js b/res/app/control-panes/control-panes-controller.js index 661451ca..db2347d4 100644 --- a/res/app/control-panes/control-panes-controller.js +++ b/res/app/control-panes/control-panes-controller.js @@ -43,6 +43,12 @@ module.exports = function ($scope, gettext, $routeParams, $location, DeviceServi ].concat(angular.copy(sharedTabs)) $scope.belowTabs = [ + { + title: gettext('Activity'), + icon: 'fa-clock-o', + templateUrl: 'control-panes/activity/activity.jade', + filters: ['native', 'web'] + }, { title: gettext('Logs'), icon: 'fa-list-alt', diff --git a/res/app/control-panes/index.js b/res/app/control-panes/index.js index 48fb4035..24b5ad9c 100644 --- a/res/app/control-panes/index.js +++ b/res/app/control-panes/index.js @@ -11,6 +11,7 @@ module.exports = angular.module('control-panes', [ require('./cpu').name, require('./dashboard').name, require('./inspect').name, + require('./activity').name, require('./logs').name, require('./resources').name, require('./screenshots').name