Showing
2 changed files
with
3 additions
and
0 deletions
| 1 | import { Http } from '@angular/http'; | 1 | import { Http } from '@angular/http'; |
| 2 | import { DeviceInfo } from './../api/device-info'; | 2 | import { DeviceInfo } from './../api/device-info'; |
| 3 | import { Node } from './../api/node'; | 3 | import { Node } from './../api/node'; |
| 4 | +import 'rxjs/add/operator/timeout'; | ||
| 4 | export declare const ERROR_CODE_UNAUTHORIZED: string; | 5 | export declare const ERROR_CODE_UNAUTHORIZED: string; |
| 5 | export declare const ERROR_CODE_NOT_FOUND: string; | 6 | export declare const ERROR_CODE_NOT_FOUND: string; |
| 6 | export declare const ERROR_CODE_SERVER_ERROR: string; | 7 | export declare const ERROR_CODE_SERVER_ERROR: string; | ... | ... |
| ... | @@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { | ... | @@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { |
| 10 | }; | 10 | }; |
| 11 | var core_1 = require("@angular/core"); | 11 | var core_1 = require("@angular/core"); |
| 12 | var http_1 = require("@angular/http"); | 12 | var http_1 = require("@angular/http"); |
| 13 | +require("rxjs/add/operator/timeout"); | ||
| 13 | exports.ERROR_CODE_UNAUTHORIZED = "unauthorized"; | 14 | exports.ERROR_CODE_UNAUTHORIZED = "unauthorized"; |
| 14 | exports.ERROR_CODE_NOT_FOUND = "not-found"; | 15 | exports.ERROR_CODE_NOT_FOUND = "not-found"; |
| 15 | exports.ERROR_CODE_SERVER_ERROR = "server-error"; | 16 | exports.ERROR_CODE_SERVER_ERROR = "server-error"; |
| ... | @@ -93,6 +94,7 @@ var Rest = Rest_1 = (function () { | ... | @@ -93,6 +94,7 @@ var Rest = Rest_1 = (function () { |
| 93 | return new Promise(function (resolve, reject) { | 94 | return new Promise(function (resolve, reject) { |
| 94 | if (node && node.IP) { | 95 | if (node && node.IP) { |
| 95 | _this.http.get("http://" + node.IP + ":" + Rest_1.localWebPort + "/device") | 96 | _this.http.get("http://" + node.IP + ":" + Rest_1.localWebPort + "/device") |
| 97 | + .timeout(2000) | ||
| 96 | .subscribe(function (response) { | 98 | .subscribe(function (response) { |
| 97 | try { | 99 | try { |
| 98 | var body = response.json(); | 100 | var body = response.json(); | ... | ... |
-
Please register or login to post a comment