mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Added Socket Error Modal.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user