mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Added error message when port forwarding fails.
Disabled port forwarding on user service for now.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
module.exports = function UserServiceFactory($http, $rootScope, socket) {
|
||||
module.exports = function UserServiceFactory($http, $rootScope, socket, $timeout) {
|
||||
var userService = {}
|
||||
|
||||
userService.user = (function () {
|
||||
@@ -8,23 +8,24 @@ module.exports = function UserServiceFactory($http, $rootScope, socket) {
|
||||
}
|
||||
})()
|
||||
|
||||
socket.on('forward.create', function(data) {
|
||||
userService.user().then(function(user) {
|
||||
$rootScope.$apply(function() {
|
||||
user.forwards.push(data)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
socket.on('forward.remove', function(data) {
|
||||
userService.user().then(function(user) {
|
||||
$rootScope.$apply(function() {
|
||||
user.forwards = user.forwards.filter(function(forward) {
|
||||
return forward.devicePort !== data.devicePort
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
// TODO: Disabled for now
|
||||
// socket.on('forward.create', function (data) {
|
||||
// userService.user().then(function (user) {
|
||||
// $timeout(function () {
|
||||
// user.forwards.push(data)
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
//
|
||||
// socket.on('forward.remove', function (data) {
|
||||
// userService.user().then(function (user) {
|
||||
// $timeout(function () {
|
||||
// user.forwards = user.forwards.filter(function (forward) {
|
||||
// return forward.devicePort !== data.devicePort
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
|
||||
return userService
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user