Stefan Huber

new rel

import { Http } from '@angular/http';
import { DeviceInfo } from './../api/device-info';
import { Node } from './../api/node';
import 'rxjs/add/operator/timeout';
export declare const ERROR_CODE_UNAUTHORIZED: string;
export declare const ERROR_CODE_NOT_FOUND: string;
export declare const ERROR_CODE_SERVER_ERROR: string;
......
......@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
};
var core_1 = require("@angular/core");
var http_1 = require("@angular/http");
require("rxjs/add/operator/timeout");
exports.ERROR_CODE_UNAUTHORIZED = "unauthorized";
exports.ERROR_CODE_NOT_FOUND = "not-found";
exports.ERROR_CODE_SERVER_ERROR = "server-error";
......@@ -93,6 +94,7 @@ var Rest = Rest_1 = (function () {
return new Promise(function (resolve, reject) {
if (node && node.IP) {
_this.http.get("http://" + node.IP + ":" + Rest_1.localWebPort + "/device")
.timeout(2000)
.subscribe(function (response) {
try {
var body = response.json();
......