FS-8247 [verto_communicator] Waiting for server reconnection.
This commit is contained in:
parent
38abf36609
commit
6df703fc40
|
@ -109,6 +109,7 @@
|
||||||
<script type="text/javascript" src="src/vertoControllers/controllers/MainController.js"></script>
|
<script type="text/javascript" src="src/vertoControllers/controllers/MainController.js"></script>
|
||||||
<script type="text/javascript" src="src/vertoControllers/controllers/MenuController.js"></script>
|
<script type="text/javascript" src="src/vertoControllers/controllers/MenuController.js"></script>
|
||||||
<script type="text/javascript" src="src/vertoControllers/controllers/ModalDialpadController.js"></script>
|
<script type="text/javascript" src="src/vertoControllers/controllers/ModalDialpadController.js"></script>
|
||||||
|
<script type="text/javascript" src="src/vertoControllers/controllers/ModalWsReconnectController.js"></script>
|
||||||
<script type="text/javascript" src="src/vertoControllers/controllers/ModalLoginInformationController.js"></script>
|
<script type="text/javascript" src="src/vertoControllers/controllers/ModalLoginInformationController.js"></script>
|
||||||
<script type="text/javascript" src="src/vertoControllers/controllers/ModalSettingsController.js"></script>
|
<script type="text/javascript" src="src/vertoControllers/controllers/ModalSettingsController.js"></script>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-title">Waiting for server reconnection.</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
</div>
|
||||||
|
|
|
@ -128,12 +128,16 @@
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.openModal = function(templateUrl, controller) {
|
$rootScope.openModal = function(templateUrl, controller, _options) {
|
||||||
var modalInstance = $modal.open({
|
var options = {
|
||||||
animation: $scope.animationsEnabled,
|
animation: $scope.animationsEnabled,
|
||||||
templateUrl: templateUrl,
|
templateUrl: templateUrl,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
angular.extend(options, _options);
|
||||||
|
|
||||||
|
var modalInstance = $modal.open(options);
|
||||||
|
|
||||||
modalInstance.result.then(
|
modalInstance.result.then(
|
||||||
function(result) {
|
function(result) {
|
||||||
|
@ -149,7 +153,33 @@
|
||||||
jQuery.material.init();
|
jQuery.material.init();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return modalInstance;
|
||||||
|
};
|
||||||
|
|
||||||
|
$rootScope.$on('ws.close', onWSClose);
|
||||||
|
$rootScope.$on('ws.login', onWSLogin);
|
||||||
|
|
||||||
|
var ws_modalInstance;
|
||||||
|
|
||||||
|
function onWSClose(ev, data) {
|
||||||
|
if(ws_modalInstance) {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
var options = {
|
||||||
|
backdrop: 'static',
|
||||||
|
keyboard: false
|
||||||
|
};
|
||||||
|
ws_modalInstance = $scope.openModal('partials/ws_reconnect.html', 'ModalWsReconnectController', options);
|
||||||
|
};
|
||||||
|
|
||||||
|
function onWSLogin(ev, data) {
|
||||||
|
if(!ws_modalInstance) {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
ws_modalInstance.close();
|
||||||
|
ws_modalInstance = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.showAbout = function() {
|
$scope.showAbout = function() {
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular
|
||||||
|
.module('vertoControllers')
|
||||||
|
.controller('ModalWsReconnectController', ModalWsReconnectController);
|
||||||
|
|
||||||
|
ModalWsReconnectController.$inject = ['$scope', 'storage', 'verto'];
|
||||||
|
|
||||||
|
function ModalWsReconnectController($scope, storage, verto) {
|
||||||
|
console.debug('Executing ModalWsReconnectController');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
})();
|
|
@ -449,6 +449,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
||||||
var callbacks = {
|
var callbacks = {
|
||||||
onWSLogin: function(v, success) {
|
onWSLogin: function(v, success) {
|
||||||
data.connected = success;
|
data.connected = success;
|
||||||
|
$rootScope.$emit('ws.login', success);
|
||||||
console.debug('Connected to verto server:', success);
|
console.debug('Connected to verto server:', success);
|
||||||
|
|
||||||
if (angular.isFunction(callback)) {
|
if (angular.isFunction(callback)) {
|
||||||
|
@ -539,6 +540,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
||||||
|
|
||||||
onWSClose: function(v, success) {
|
onWSClose: function(v, success) {
|
||||||
console.debug('onWSClose:', success);
|
console.debug('onWSClose:', success);
|
||||||
|
|
||||||
|
$rootScope.$emit('ws.close', success);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEvent: function(v, e) {
|
onEvent: function(v, e) {
|
||||||
|
|
Loading…
Reference in New Issue