This repository is for zephyr, which is implemented for a GUI of Eos.
Revision | afac53c58743329dbcc41e6f804fdaf001b0cce6 (tree) |
---|---|
Time | 2016-02-18 22:04:29 |
Author | himetani_cafe <fumifumi@yasu...> |
Commiter | himetani_cafe |
[Develop] /api/v1/debug for debugging websocket messaging
@@ -89,11 +89,8 @@ namespace app.directives { | ||
89 | 89 | controller.isOpen = false; |
90 | 90 | }); |
91 | 91 | |
92 | - this.WebSocket.on('connect', function(msg) { | |
93 | - console.log(msg); | |
94 | - }); | |
95 | - | |
96 | - this.WebSocket.on('test', function(msg) { | |
92 | + this.WebSocket.on('console', function(msg) { | |
93 | + console.log('CONSOLE!!!'); | |
97 | 94 | console.log(msg); |
98 | 95 | }); |
99 | 96 |
@@ -157,9 +154,12 @@ namespace app.directives { | ||
157 | 154 | } |
158 | 155 | |
159 | 156 | public debug() { |
160 | - this.MyModal.preview(); | |
157 | + this.APIEndPoint | |
158 | + .debug() | |
159 | + .then((result) => { | |
160 | + console.log(result); | |
161 | + }); | |
161 | 162 | } |
162 | - | |
163 | 163 | |
164 | 164 | } |
165 | 165 | } |
@@ -57,7 +57,6 @@ namespace app.services { | ||
57 | 57 | return this.resource(endPoint, {}).get(); |
58 | 58 | } |
59 | 59 | |
60 | - | |
61 | 60 | public execute(data: any): ng.IHttpPromise<{}> { |
62 | 61 | var endPoint = '/api/v1/execution'; |
63 | 62 | var fd = new FormData() |
@@ -69,5 +68,10 @@ namespace app.services { | ||
69 | 68 | transformRequest: angular.identity |
70 | 69 | }); |
71 | 70 | } |
71 | + | |
72 | + public debug(): ng.IHttpPromise<string> { | |
73 | + var endPoint = '/api/v1/debug'; | |
74 | + return this.$http.get(endPoint); | |
75 | + } | |
72 | 76 | } |
73 | 77 | } |
@@ -41066,6 +41066,10 @@ | ||
41066 | 41066 | transformRequest: angular.identity |
41067 | 41067 | }); |
41068 | 41068 | }; |
41069 | + APIEndPoint.prototype.debug = function () { | |
41070 | + var endPoint = '/api/v1/debug'; | |
41071 | + return this.$http.get(endPoint); | |
41072 | + }; | |
41069 | 41073 | return APIEndPoint; |
41070 | 41074 | })(); |
41071 | 41075 | services.APIEndPoint = APIEndPoint; |
@@ -41200,10 +41204,8 @@ | ||
41200 | 41204 | this.$scope.$on('close', function () { |
41201 | 41205 | controller.isOpen = false; |
41202 | 41206 | }); |
41203 | - this.WebSocket.on('connect', function (msg) { | |
41204 | - console.log(msg); | |
41205 | - }); | |
41206 | - this.WebSocket.on('test', function (msg) { | |
41207 | + this.WebSocket.on('console', function (msg) { | |
41208 | + console.log('CONSOLE!!!'); | |
41207 | 41209 | console.log(msg); |
41208 | 41210 | }); |
41209 | 41211 | } |
@@ -41259,7 +41261,11 @@ | ||
41259 | 41261 | }); |
41260 | 41262 | }; |
41261 | 41263 | CommandController.prototype.debug = function () { |
41262 | - this.MyModal.preview(); | |
41264 | + this.APIEndPoint | |
41265 | + .debug() | |
41266 | + .then(function (result) { | |
41267 | + console.log(result); | |
41268 | + }); | |
41263 | 41269 | }; |
41264 | 41270 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
41265 | 41271 | return CommandController; |
@@ -41669,6 +41675,10 @@ | ||
41669 | 41675 | transformRequest: angular.identity |
41670 | 41676 | }); |
41671 | 41677 | }; |
41678 | + APIEndPoint.prototype.debug = function () { | |
41679 | + var endPoint = '/api/v1/debug'; | |
41680 | + return this.$http.get(endPoint); | |
41681 | + }; | |
41672 | 41682 | return APIEndPoint; |
41673 | 41683 | })(); |
41674 | 41684 | services.APIEndPoint = APIEndPoint; |
@@ -41803,10 +41813,8 @@ | ||
41803 | 41813 | this.$scope.$on('close', function () { |
41804 | 41814 | controller.isOpen = false; |
41805 | 41815 | }); |
41806 | - this.WebSocket.on('connect', function (msg) { | |
41807 | - console.log(msg); | |
41808 | - }); | |
41809 | - this.WebSocket.on('test', function (msg) { | |
41816 | + this.WebSocket.on('console', function (msg) { | |
41817 | + console.log('CONSOLE!!!'); | |
41810 | 41818 | console.log(msg); |
41811 | 41819 | }); |
41812 | 41820 | } |
@@ -41862,7 +41870,11 @@ | ||
41862 | 41870 | }); |
41863 | 41871 | }; |
41864 | 41872 | CommandController.prototype.debug = function () { |
41865 | - this.MyModal.preview(); | |
41873 | + this.APIEndPoint | |
41874 | + .debug() | |
41875 | + .then(function (result) { | |
41876 | + console.log(result); | |
41877 | + }); | |
41866 | 41878 | }; |
41867 | 41879 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
41868 | 41880 | return CommandController; |
@@ -42272,6 +42284,10 @@ | ||
42272 | 42284 | transformRequest: angular.identity |
42273 | 42285 | }); |
42274 | 42286 | }; |
42287 | + APIEndPoint.prototype.debug = function () { | |
42288 | + var endPoint = '/api/v1/debug'; | |
42289 | + return this.$http.get(endPoint); | |
42290 | + }; | |
42275 | 42291 | return APIEndPoint; |
42276 | 42292 | })(); |
42277 | 42293 | services.APIEndPoint = APIEndPoint; |
@@ -42406,10 +42422,8 @@ | ||
42406 | 42422 | this.$scope.$on('close', function () { |
42407 | 42423 | controller.isOpen = false; |
42408 | 42424 | }); |
42409 | - this.WebSocket.on('connect', function (msg) { | |
42410 | - console.log(msg); | |
42411 | - }); | |
42412 | - this.WebSocket.on('test', function (msg) { | |
42425 | + this.WebSocket.on('console', function (msg) { | |
42426 | + console.log('CONSOLE!!!'); | |
42413 | 42427 | console.log(msg); |
42414 | 42428 | }); |
42415 | 42429 | } |
@@ -42465,7 +42479,11 @@ | ||
42465 | 42479 | }); |
42466 | 42480 | }; |
42467 | 42481 | CommandController.prototype.debug = function () { |
42468 | - this.MyModal.preview(); | |
42482 | + this.APIEndPoint | |
42483 | + .debug() | |
42484 | + .then(function (result) { | |
42485 | + console.log(result); | |
42486 | + }); | |
42469 | 42487 | }; |
42470 | 42488 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
42471 | 42489 | return CommandController; |
@@ -42875,6 +42893,10 @@ | ||
42875 | 42893 | transformRequest: angular.identity |
42876 | 42894 | }); |
42877 | 42895 | }; |
42896 | + APIEndPoint.prototype.debug = function () { | |
42897 | + var endPoint = '/api/v1/debug'; | |
42898 | + return this.$http.get(endPoint); | |
42899 | + }; | |
42878 | 42900 | return APIEndPoint; |
42879 | 42901 | })(); |
42880 | 42902 | services.APIEndPoint = APIEndPoint; |
@@ -43009,10 +43031,8 @@ | ||
43009 | 43031 | this.$scope.$on('close', function () { |
43010 | 43032 | controller.isOpen = false; |
43011 | 43033 | }); |
43012 | - this.WebSocket.on('connect', function (msg) { | |
43013 | - console.log(msg); | |
43014 | - }); | |
43015 | - this.WebSocket.on('test', function (msg) { | |
43034 | + this.WebSocket.on('console', function (msg) { | |
43035 | + console.log('CONSOLE!!!'); | |
43016 | 43036 | console.log(msg); |
43017 | 43037 | }); |
43018 | 43038 | } |
@@ -43068,7 +43088,11 @@ | ||
43068 | 43088 | }); |
43069 | 43089 | }; |
43070 | 43090 | CommandController.prototype.debug = function () { |
43071 | - this.MyModal.preview(); | |
43091 | + this.APIEndPoint | |
43092 | + .debug() | |
43093 | + .then(function (result) { | |
43094 | + console.log(result); | |
43095 | + }); | |
43072 | 43096 | }; |
43073 | 43097 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
43074 | 43098 | return CommandController; |
@@ -43478,6 +43502,10 @@ | ||
43478 | 43502 | transformRequest: angular.identity |
43479 | 43503 | }); |
43480 | 43504 | }; |
43505 | + APIEndPoint.prototype.debug = function () { | |
43506 | + var endPoint = '/api/v1/debug'; | |
43507 | + return this.$http.get(endPoint); | |
43508 | + }; | |
43481 | 43509 | return APIEndPoint; |
43482 | 43510 | })(); |
43483 | 43511 | services.APIEndPoint = APIEndPoint; |
@@ -43612,10 +43640,8 @@ | ||
43612 | 43640 | this.$scope.$on('close', function () { |
43613 | 43641 | controller.isOpen = false; |
43614 | 43642 | }); |
43615 | - this.WebSocket.on('connect', function (msg) { | |
43616 | - console.log(msg); | |
43617 | - }); | |
43618 | - this.WebSocket.on('test', function (msg) { | |
43643 | + this.WebSocket.on('console', function (msg) { | |
43644 | + console.log('CONSOLE!!!'); | |
43619 | 43645 | console.log(msg); |
43620 | 43646 | }); |
43621 | 43647 | } |
@@ -43671,7 +43697,11 @@ | ||
43671 | 43697 | }); |
43672 | 43698 | }; |
43673 | 43699 | CommandController.prototype.debug = function () { |
43674 | - this.MyModal.preview(); | |
43700 | + this.APIEndPoint | |
43701 | + .debug() | |
43702 | + .then(function (result) { | |
43703 | + console.log(result); | |
43704 | + }); | |
43675 | 43705 | }; |
43676 | 43706 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
43677 | 43707 | return CommandController; |
@@ -44081,6 +44111,10 @@ | ||
44081 | 44111 | transformRequest: angular.identity |
44082 | 44112 | }); |
44083 | 44113 | }; |
44114 | + APIEndPoint.prototype.debug = function () { | |
44115 | + var endPoint = '/api/v1/debug'; | |
44116 | + return this.$http.get(endPoint); | |
44117 | + }; | |
44084 | 44118 | return APIEndPoint; |
44085 | 44119 | })(); |
44086 | 44120 | services.APIEndPoint = APIEndPoint; |
@@ -44215,10 +44249,8 @@ | ||
44215 | 44249 | this.$scope.$on('close', function () { |
44216 | 44250 | controller.isOpen = false; |
44217 | 44251 | }); |
44218 | - this.WebSocket.on('connect', function (msg) { | |
44219 | - console.log(msg); | |
44220 | - }); | |
44221 | - this.WebSocket.on('test', function (msg) { | |
44252 | + this.WebSocket.on('console', function (msg) { | |
44253 | + console.log('CONSOLE!!!'); | |
44222 | 44254 | console.log(msg); |
44223 | 44255 | }); |
44224 | 44256 | } |
@@ -44274,7 +44306,11 @@ | ||
44274 | 44306 | }); |
44275 | 44307 | }; |
44276 | 44308 | CommandController.prototype.debug = function () { |
44277 | - this.MyModal.preview(); | |
44309 | + this.APIEndPoint | |
44310 | + .debug() | |
44311 | + .then(function (result) { | |
44312 | + console.log(result); | |
44313 | + }); | |
44278 | 44314 | }; |
44279 | 44315 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
44280 | 44316 | return CommandController; |
@@ -44684,6 +44720,10 @@ | ||
44684 | 44720 | transformRequest: angular.identity |
44685 | 44721 | }); |
44686 | 44722 | }; |
44723 | + APIEndPoint.prototype.debug = function () { | |
44724 | + var endPoint = '/api/v1/debug'; | |
44725 | + return this.$http.get(endPoint); | |
44726 | + }; | |
44687 | 44727 | return APIEndPoint; |
44688 | 44728 | })(); |
44689 | 44729 | services.APIEndPoint = APIEndPoint; |
@@ -44818,10 +44858,8 @@ | ||
44818 | 44858 | this.$scope.$on('close', function () { |
44819 | 44859 | controller.isOpen = false; |
44820 | 44860 | }); |
44821 | - this.WebSocket.on('connect', function (msg) { | |
44822 | - console.log(msg); | |
44823 | - }); | |
44824 | - this.WebSocket.on('test', function (msg) { | |
44861 | + this.WebSocket.on('console', function (msg) { | |
44862 | + console.log('CONSOLE!!!'); | |
44825 | 44863 | console.log(msg); |
44826 | 44864 | }); |
44827 | 44865 | } |
@@ -44877,7 +44915,11 @@ | ||
44877 | 44915 | }); |
44878 | 44916 | }; |
44879 | 44917 | CommandController.prototype.debug = function () { |
44880 | - this.MyModal.preview(); | |
44918 | + this.APIEndPoint | |
44919 | + .debug() | |
44920 | + .then(function (result) { | |
44921 | + console.log(result); | |
44922 | + }); | |
44881 | 44923 | }; |
44882 | 44924 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
44883 | 44925 | return CommandController; |
@@ -45287,6 +45329,10 @@ | ||
45287 | 45329 | transformRequest: angular.identity |
45288 | 45330 | }); |
45289 | 45331 | }; |
45332 | + APIEndPoint.prototype.debug = function () { | |
45333 | + var endPoint = '/api/v1/debug'; | |
45334 | + return this.$http.get(endPoint); | |
45335 | + }; | |
45290 | 45336 | return APIEndPoint; |
45291 | 45337 | })(); |
45292 | 45338 | services.APIEndPoint = APIEndPoint; |
@@ -45421,10 +45467,8 @@ | ||
45421 | 45467 | this.$scope.$on('close', function () { |
45422 | 45468 | controller.isOpen = false; |
45423 | 45469 | }); |
45424 | - this.WebSocket.on('connect', function (msg) { | |
45425 | - console.log(msg); | |
45426 | - }); | |
45427 | - this.WebSocket.on('test', function (msg) { | |
45470 | + this.WebSocket.on('console', function (msg) { | |
45471 | + console.log('CONSOLE!!!'); | |
45428 | 45472 | console.log(msg); |
45429 | 45473 | }); |
45430 | 45474 | } |
@@ -45480,7 +45524,11 @@ | ||
45480 | 45524 | }); |
45481 | 45525 | }; |
45482 | 45526 | CommandController.prototype.debug = function () { |
45483 | - this.MyModal.preview(); | |
45527 | + this.APIEndPoint | |
45528 | + .debug() | |
45529 | + .then(function (result) { | |
45530 | + console.log(result); | |
45531 | + }); | |
45484 | 45532 | }; |
45485 | 45533 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
45486 | 45534 | return CommandController; |
@@ -45890,6 +45938,10 @@ | ||
45890 | 45938 | transformRequest: angular.identity |
45891 | 45939 | }); |
45892 | 45940 | }; |
45941 | + APIEndPoint.prototype.debug = function () { | |
45942 | + var endPoint = '/api/v1/debug'; | |
45943 | + return this.$http.get(endPoint); | |
45944 | + }; | |
45893 | 45945 | return APIEndPoint; |
45894 | 45946 | })(); |
45895 | 45947 | services.APIEndPoint = APIEndPoint; |
@@ -46024,10 +46076,8 @@ | ||
46024 | 46076 | this.$scope.$on('close', function () { |
46025 | 46077 | controller.isOpen = false; |
46026 | 46078 | }); |
46027 | - this.WebSocket.on('connect', function (msg) { | |
46028 | - console.log(msg); | |
46029 | - }); | |
46030 | - this.WebSocket.on('test', function (msg) { | |
46079 | + this.WebSocket.on('console', function (msg) { | |
46080 | + console.log('CONSOLE!!!'); | |
46031 | 46081 | console.log(msg); |
46032 | 46082 | }); |
46033 | 46083 | } |
@@ -46083,7 +46133,11 @@ | ||
46083 | 46133 | }); |
46084 | 46134 | }; |
46085 | 46135 | CommandController.prototype.debug = function () { |
46086 | - this.MyModal.preview(); | |
46136 | + this.APIEndPoint | |
46137 | + .debug() | |
46138 | + .then(function (result) { | |
46139 | + console.log(result); | |
46140 | + }); | |
46087 | 46141 | }; |
46088 | 46142 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
46089 | 46143 | return CommandController; |
@@ -46493,6 +46547,10 @@ | ||
46493 | 46547 | transformRequest: angular.identity |
46494 | 46548 | }); |
46495 | 46549 | }; |
46550 | + APIEndPoint.prototype.debug = function () { | |
46551 | + var endPoint = '/api/v1/debug'; | |
46552 | + return this.$http.get(endPoint); | |
46553 | + }; | |
46496 | 46554 | return APIEndPoint; |
46497 | 46555 | })(); |
46498 | 46556 | services.APIEndPoint = APIEndPoint; |
@@ -46627,10 +46685,8 @@ | ||
46627 | 46685 | this.$scope.$on('close', function () { |
46628 | 46686 | controller.isOpen = false; |
46629 | 46687 | }); |
46630 | - this.WebSocket.on('connect', function (msg) { | |
46631 | - console.log(msg); | |
46632 | - }); | |
46633 | - this.WebSocket.on('test', function (msg) { | |
46688 | + this.WebSocket.on('console', function (msg) { | |
46689 | + console.log('CONSOLE!!!'); | |
46634 | 46690 | console.log(msg); |
46635 | 46691 | }); |
46636 | 46692 | } |
@@ -46686,7 +46742,11 @@ | ||
46686 | 46742 | }); |
46687 | 46743 | }; |
46688 | 46744 | CommandController.prototype.debug = function () { |
46689 | - this.MyModal.preview(); | |
46745 | + this.APIEndPoint | |
46746 | + .debug() | |
46747 | + .then(function (result) { | |
46748 | + console.log(result); | |
46749 | + }); | |
46690 | 46750 | }; |
46691 | 46751 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
46692 | 46752 | return CommandController; |
@@ -47096,6 +47156,10 @@ | ||
47096 | 47156 | transformRequest: angular.identity |
47097 | 47157 | }); |
47098 | 47158 | }; |
47159 | + APIEndPoint.prototype.debug = function () { | |
47160 | + var endPoint = '/api/v1/debug'; | |
47161 | + return this.$http.get(endPoint); | |
47162 | + }; | |
47099 | 47163 | return APIEndPoint; |
47100 | 47164 | })(); |
47101 | 47165 | services.APIEndPoint = APIEndPoint; |
@@ -47230,10 +47294,8 @@ | ||
47230 | 47294 | this.$scope.$on('close', function () { |
47231 | 47295 | controller.isOpen = false; |
47232 | 47296 | }); |
47233 | - this.WebSocket.on('connect', function (msg) { | |
47234 | - console.log(msg); | |
47235 | - }); | |
47236 | - this.WebSocket.on('test', function (msg) { | |
47297 | + this.WebSocket.on('console', function (msg) { | |
47298 | + console.log('CONSOLE!!!'); | |
47237 | 47299 | console.log(msg); |
47238 | 47300 | }); |
47239 | 47301 | } |
@@ -47289,7 +47351,11 @@ | ||
47289 | 47351 | }); |
47290 | 47352 | }; |
47291 | 47353 | CommandController.prototype.debug = function () { |
47292 | - this.MyModal.preview(); | |
47354 | + this.APIEndPoint | |
47355 | + .debug() | |
47356 | + .then(function (result) { | |
47357 | + console.log(result); | |
47358 | + }); | |
47293 | 47359 | }; |
47294 | 47360 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
47295 | 47361 | return CommandController; |
@@ -47699,6 +47765,10 @@ | ||
47699 | 47765 | transformRequest: angular.identity |
47700 | 47766 | }); |
47701 | 47767 | }; |
47768 | + APIEndPoint.prototype.debug = function () { | |
47769 | + var endPoint = '/api/v1/debug'; | |
47770 | + return this.$http.get(endPoint); | |
47771 | + }; | |
47702 | 47772 | return APIEndPoint; |
47703 | 47773 | })(); |
47704 | 47774 | services.APIEndPoint = APIEndPoint; |
@@ -47833,10 +47903,8 @@ | ||
47833 | 47903 | this.$scope.$on('close', function () { |
47834 | 47904 | controller.isOpen = false; |
47835 | 47905 | }); |
47836 | - this.WebSocket.on('connect', function (msg) { | |
47837 | - console.log(msg); | |
47838 | - }); | |
47839 | - this.WebSocket.on('test', function (msg) { | |
47906 | + this.WebSocket.on('console', function (msg) { | |
47907 | + console.log('CONSOLE!!!'); | |
47840 | 47908 | console.log(msg); |
47841 | 47909 | }); |
47842 | 47910 | } |
@@ -47892,7 +47960,11 @@ | ||
47892 | 47960 | }); |
47893 | 47961 | }; |
47894 | 47962 | CommandController.prototype.debug = function () { |
47895 | - this.MyModal.preview(); | |
47963 | + this.APIEndPoint | |
47964 | + .debug() | |
47965 | + .then(function (result) { | |
47966 | + console.log(result); | |
47967 | + }); | |
47896 | 47968 | }; |
47897 | 47969 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
47898 | 47970 | return CommandController; |
@@ -48302,6 +48374,10 @@ | ||
48302 | 48374 | transformRequest: angular.identity |
48303 | 48375 | }); |
48304 | 48376 | }; |
48377 | + APIEndPoint.prototype.debug = function () { | |
48378 | + var endPoint = '/api/v1/debug'; | |
48379 | + return this.$http.get(endPoint); | |
48380 | + }; | |
48305 | 48381 | return APIEndPoint; |
48306 | 48382 | })(); |
48307 | 48383 | services.APIEndPoint = APIEndPoint; |
@@ -48436,10 +48512,8 @@ | ||
48436 | 48512 | this.$scope.$on('close', function () { |
48437 | 48513 | controller.isOpen = false; |
48438 | 48514 | }); |
48439 | - this.WebSocket.on('connect', function (msg) { | |
48440 | - console.log(msg); | |
48441 | - }); | |
48442 | - this.WebSocket.on('test', function (msg) { | |
48515 | + this.WebSocket.on('console', function (msg) { | |
48516 | + console.log('CONSOLE!!!'); | |
48443 | 48517 | console.log(msg); |
48444 | 48518 | }); |
48445 | 48519 | } |
@@ -48495,7 +48569,11 @@ | ||
48495 | 48569 | }); |
48496 | 48570 | }; |
48497 | 48571 | CommandController.prototype.debug = function () { |
48498 | - this.MyModal.preview(); | |
48572 | + this.APIEndPoint | |
48573 | + .debug() | |
48574 | + .then(function (result) { | |
48575 | + console.log(result); | |
48576 | + }); | |
48499 | 48577 | }; |
48500 | 48578 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
48501 | 48579 | return CommandController; |
@@ -48905,6 +48983,10 @@ | ||
48905 | 48983 | transformRequest: angular.identity |
48906 | 48984 | }); |
48907 | 48985 | }; |
48986 | + APIEndPoint.prototype.debug = function () { | |
48987 | + var endPoint = '/api/v1/debug'; | |
48988 | + return this.$http.get(endPoint); | |
48989 | + }; | |
48908 | 48990 | return APIEndPoint; |
48909 | 48991 | })(); |
48910 | 48992 | services.APIEndPoint = APIEndPoint; |
@@ -49039,10 +49121,8 @@ | ||
49039 | 49121 | this.$scope.$on('close', function () { |
49040 | 49122 | controller.isOpen = false; |
49041 | 49123 | }); |
49042 | - this.WebSocket.on('connect', function (msg) { | |
49043 | - console.log(msg); | |
49044 | - }); | |
49045 | - this.WebSocket.on('test', function (msg) { | |
49124 | + this.WebSocket.on('console', function (msg) { | |
49125 | + console.log('CONSOLE!!!'); | |
49046 | 49126 | console.log(msg); |
49047 | 49127 | }); |
49048 | 49128 | } |
@@ -49098,7 +49178,11 @@ | ||
49098 | 49178 | }); |
49099 | 49179 | }; |
49100 | 49180 | CommandController.prototype.debug = function () { |
49101 | - this.MyModal.preview(); | |
49181 | + this.APIEndPoint | |
49182 | + .debug() | |
49183 | + .then(function (result) { | |
49184 | + console.log(result); | |
49185 | + }); | |
49102 | 49186 | }; |
49103 | 49187 | CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket']; |
49104 | 49188 | return CommandController; |
@@ -0,0 +1,28 @@ | ||
1 | +'use strict'; | |
2 | + | |
3 | +var express = require('express'); | |
4 | +var router = express.Router() | |
5 | +var path = require('path') | |
6 | +var ws = require(__dirname + '/../../../../server/class/WebSocket').instance; | |
7 | +var spawn = require('child_process').spawn; | |
8 | + | |
9 | +var config = { | |
10 | + cwd: '' | |
11 | +}; | |
12 | + | |
13 | +router.get('/', function(req, res) { | |
14 | + | |
15 | + | |
16 | + var runner = spawn('tree',['-L', 2],config); | |
17 | + | |
18 | + runner.stdout.on('data', (data) => { | |
19 | + ws.emit('console', data.toString()); | |
20 | + }); | |
21 | + | |
22 | + runner.on('close', function() { | |
23 | + res.send('success'); | |
24 | + }); | |
25 | + | |
26 | +}); | |
27 | + | |
28 | +module.exports = router; |
@@ -6,7 +6,7 @@ var path = require('path') | ||
6 | 6 | var formidable = require('formidable') |
7 | 7 | var db = require(__dirname + '/../../../../server/class/DB').instance; |
8 | 8 | var eos = require(__dirname + '/../../../../server/class/Eos').instance; |
9 | -var ws = require(__dirname + '/../../../../server/ws').instance; | |
9 | +var ws = require(__dirname + '/../../../../server/class/WebSocket').instance; | |
10 | 10 | |
11 | 11 | router.post('/', function(req, res) { |
12 | 12 |
@@ -9,7 +9,7 @@ var EventEmitter = require('events').EventEmitter; | ||
9 | 9 | var emitter = new EventEmitter; |
10 | 10 | var server = require('http').Server(app) |
11 | 11 | var ioServer = require('socket.io'); |
12 | -var ws = require('./ws').instance; | |
12 | +var ws = require('./class/WebSocket').instance; | |
13 | 13 | |
14 | 14 | require('./express')(app); |
15 | 15 | require('./routes')(app); |
@@ -11,8 +11,8 @@ var instance = { | ||
11 | 11 | socket.emit('connect', 'connected'); |
12 | 12 | }); |
13 | 13 | }, |
14 | - emit: function() { | |
15 | - socket.emit('test','outer test'); | |
14 | + emit: function(event, data) { | |
15 | + socket.emit(event, data); | |
16 | 16 | } |
17 | 17 | /* |
18 | 18 | array include obj |
@@ -24,6 +24,7 @@ module.exports = function(app) { | ||
24 | 24 | app.use('/api/v1/optionControlFile', require(__dirname + '/api/v1/optionControlFile')); |
25 | 25 | app.use('/api/v1/tagList', require(__dirname + '/api/v1/tagList')); |
26 | 26 | app.use('/api/v1/commandList', require(__dirname + '/api/v1/commandList')); |
27 | + app.use('/api/v1/debug', require(__dirname + '/api/v1/debug')); | |
27 | 28 | |
28 | 29 | app.route('/*') |
29 | 30 | .get(function(req, res) { |