Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
- Loading branch information
Pierre Tardy
committed
Mar 20, 2015
1 parent
824d75e
commit 10c325e
Showing
6 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
www/base/src/app/common/directives/connectionstatus/connectionstatus.directive.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class connectionstatus extends Directive('common') | ||
constructor: (RecursionHelper) -> | ||
return { | ||
replace: true | ||
restrict: 'E' | ||
scope: {data:'='} | ||
templateUrl: 'views/connectionstatus.html' | ||
compile: RecursionHelper.compile | ||
controller: '_connectionstatusController' | ||
} | ||
|
||
class _connectionstatus extends Controller('common') | ||
constructor: ($scope, $timeout) -> | ||
$scope.alertenabled = false | ||
$scope.connectionlost = false | ||
$scope.$on "mq.lost_connection", -> | ||
$scope.connectionlost = true | ||
$scope.alertenabled = true | ||
|
||
$scope.$on "mq.restored_connection", -> | ||
$scope.connectionlost = false | ||
$scope.alertenabled = true | ||
$timeout -> | ||
$scope.alertenabled = false | ||
, 4000 |
13 changes: 13 additions & 0 deletions
13
www/base/src/app/common/directives/connectionstatus/connectionstatus.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.connectionstatus | ||
{ | ||
z-index: 1000; | ||
width: 100%; | ||
position: absolute; | ||
top: 20px; | ||
.alert { | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 300px; | ||
text-align: center; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
www/base/src/app/common/directives/connectionstatus/connectionstatus.tpl.jade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.connectionstatus.anim-fade(ng-show="alertenabled") | ||
.alert.alert-warning(ng-show="connectionlost") | ||
i.fa.fa-spin.fa-spinner | ||
| Connection Lost. Retrying... | ||
.alert.alert-success(ng-hide="connectionlost") | ||
| Connection restored! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ block content | |
gl-topbar | ||
gl-topbar-contextual-actions | ||
loginbar | ||
connectionstatus | ||
ui-view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters