Added Socket Error Modal.

This commit is contained in:
Gunther Brunner
2014-10-17 19:22:54 +09:00
parent e172457b5f
commit a59b3a6fc3
6 changed files with 28 additions and 40 deletions

View File

@@ -1,20 +1,14 @@
module.exports =
function SocketDisconnectedServiceFactory($modal, $location, $route) {
function SocketDisconnectedServiceFactory($modal, $location, $window) {
var service = {}
var ModalInstanceCtrl = function ($scope, $modalInstance) {
var ModalInstanceCtrl = function ($scope, $modalInstance, message) {
$scope.ok = function () {
$modalInstance.close(true)
$route.reload()
//$location.path('/control/' + device.serial)
$window.location.reload()
}
$scope.second = function () {
$modalInstance.dismiss()
//$location.path('/devices/')
}
$scope.message = message
$scope.cancel = function () {
$modalInstance.dismiss('cancel')
@@ -22,19 +16,21 @@ module.exports =
}
service.open = function () {
service.open = function (message) {
var modalInstance = $modal.open({
template: require('./socket-disconnected.jade'),
controller: ModalInstanceCtrl,
resolve: {}
resolve: {
message: function () {
return message
}
}
})
modalInstance.result.then(function () {
}, function () {
})
}
return service
}

View File

@@ -4,21 +4,11 @@
h4.modal-title.text-danger
i.fa.fa-warning
.button-spacer
span(translate) Socket was disconnected
span(translate) Disconnected
.modal-body
h4(translate, ng-bind='device.likelyLeaveReason | likelyLeaveReason')
br
.big-thumbnail
//.device-photo-small
// img(ng-src='/static/app/devices/icon/x120/{{ device.image || "E30HT.jpg" }}')
//.device-name(ng-bind='device.enhancedName')
//h3.device-status(ng-class='stateColor')
// span(ng-bind='device.enhancedStatePassive | translate')
nothing-to-show(message='{{ message | translate }}', icon='fa-plug fa-4x')
.modal-footer
button.btn.btn-primary-outline.pull-right(type='button', ng-click='ok()')
i.fa.fa-refresh
span(translate) Try to reconnect
//button.btn.btn-success-outline(ng-click='second()')
i.fa.fa-sitemap
span(translate) Go to Device List