OSDN Git Service

[Develop] WebSocket is connected. v0.3.0p0048
authorhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 17 Feb 2016 13:15:04 +0000 (22:15 +0900)
committerhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 17 Feb 2016 13:15:04 +0000 (22:15 +0900)
13 files changed:
front-end/app/index.html
front-end/app/scripts/App.ts
front-end/app/scripts/declares.ts
front-end/app/scripts/directives/Command.ts
front-end/app/scripts/entry.ts
front-end/app/scripts/reference.ts
front-end/app/scripts/services/WebSocket.ts [new file with mode: 0644]
front-end/dist/bundle.js
front-end/dist/index.html
server/api/v1/all/workspace/directory/index.js
server/class/DB.js
server/class/Eos.js
server/ws/index.js

index 7176574..83c4ccc 100644 (file)
@@ -7,6 +7,7 @@
   </head>
   <body ng-app="zephyr">
       <ui-view></ui-view>
+    <script src="/socket.io/socket.io.js"></script>
     <script src="./bundle.js"></script>
   </body>
 </html>
index d267df8..1390c7b 100644 (file)
@@ -36,12 +36,14 @@ namespace app {
     });
 
     zephyr.service('APIEndPoint', services.APIEndPoint);
+    zephyr.service('MyModal', services.MyModal);
+    zephyr.service('WebSocket', services.WebSocket);
+
 
     zephyr.filter('Tag', filters.Tag);
     zephyr.controller('selectCommandController', controllers.SelectCommand);
     zephyr.controller('previewController', controllers.Preview);
 
-    zephyr.service('MyModal', services.MyModal);
 
     zephyr.controller('executionController', controllers.Execution);
     zephyr.controller('workspaceController', controllers.Workspace);
index 05e9def..b928b38 100644 (file)
@@ -19,12 +19,12 @@ namespace app.declares {
     }        
 
     export interface IOption {
-       option: string;
-       fullOption: string;
-       optionName: string;
-       optionProperties: boolean;
-       optionNumber: number;
-       arg: IArg[];
+        option: string;
+        fullOption: string;
+        optionName: string;
+        optionProperties: boolean;
+        optionNumber: number;
+        arg: IArg[];
     }
 
     export interface IFileInfo {
@@ -70,3 +70,11 @@ namespace app.declares {
     }
 
 }
+declare var io : {
+    connect(): Socket;
+}
+interface Socket {
+    on(event: string, callback: (data: any) => void );
+    emit(event: string, data: any);
+}
+
index 2516980..c9ff0ba 100644 (file)
@@ -36,7 +36,7 @@ namespace app.directives {
          */
         public static Factory(): ng.IDirectiveFactory {
             var directive = () => {
-            return new Command();
+                return new Command();
             };
             directive.$inject = [];
             return directive;
@@ -45,7 +45,7 @@ namespace app.directives {
 
     export class CommandController {
 
-        public static $inject = ['APIEndPoint', '$scope', 'MyModal'];
+        public static $inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
 
         // From parent directive bindToController property
         private index: string;
@@ -63,30 +63,34 @@ namespace app.directives {
         private options: declares.IOption[];
         private dirs: any;
 
-        constructor(private APIEndPoint: services.APIEndPoint, private $scope: ng.IScope, private MyModal: services.MyModal) {
+        constructor(private APIEndPoint: services.APIEndPoint, private $scope: ng.IScope, private MyModal: services.MyModal, private WebSocket: services.WebSocket) {
             var controller = this;
 
             // Get OptionControlFile and bind it to $scope.options
             this.APIEndPoint
-                .getOptionControlFile('mrcImageNoiseAdd')
-                .$promise
-                .then(function(result) {
-                    controller.options = result.info;
-                });
+            .getOptionControlFile('mrcImageNoiseAdd')
+            .$promise
+            .then(function(result) {
+                controller.options = result.info;
+            });
 
             this.APIEndPoint
-                .getDirectories()
-                .$promise
-                .then(function(result) {
-                    controller.dirs = result.info;
-                });
+            .getDirectories()
+            .$promise
+            .then(function(result) {
+                controller.dirs = result.info;
+            });
 
             this.heading = "[" + this.index + "]: dcdFilePring";
             this.isOpen = true;
 
             // When call add button at executeController, all accordion close.
             this.$scope.$on('close', () => {
-               controller.isOpen = false;
+                controller.isOpen = false;
+            });
+
+            this.WebSocket.on('test', function(data) {
+                console.log("HOGEHOGEHOGEHOHGOEHGOH");
             });
         }
 
@@ -110,7 +114,7 @@ namespace app.directives {
                 });
 
                 if(obj.arguments.length > 0) {
-                   opt.push(obj);
+                    opt.push(obj);
                 }
             });
 
@@ -122,10 +126,10 @@ namespace app.directives {
 
             //console.log(JSON.stringify(execObj,null,'\t'));
             this.APIEndPoint
-                .execute(JSON.stringify(execObj))
-                .then((result) => {
-                    console.log(result);
-                })
+            .execute(JSON.stringify(execObj))
+            .then((result) => {
+                console.log(result);
+            })
         }
 
         public removeMySelf(index:number) {
@@ -135,20 +139,22 @@ namespace app.directives {
         private reloadFiles() {
             var fileId = this.workspace.fileId;
             this.APIEndPoint
-                .getFiles(fileId)
-                .$promise
-                .then((result) => { 
-                    var status = result.status;
-                    if(status === 'success') {
-                        this.files = result.info;
-                    } else {
-                        console.log(result.message);
-                    }
-                });
+            .getFiles(fileId)
+            .$promise
+            .then((result) => { 
+                var status = result.status;
+                if(status === 'success') {
+                    this.files = result.info;
+                } else {
+                    console.log(result.message);
+                }
+            });
         }
 
         public debug() {
             this.MyModal.preview();
         }
+
+        
     } 
 }
index 8e4fd24..c91ec98 100644 (file)
@@ -10,6 +10,7 @@ import './declares.ts';
 // services
 import './services/APIEndPoint.ts';
 import './services/MyModal.ts';
+import './services/WebSocket.ts';
 
 // directives
 import './directives/Option.ts';
index bd92bcc..0536f4d 100644 (file)
@@ -2,8 +2,10 @@
 
 /// <reference path="./declares.ts" />
 
+
 /// <reference path="./services/APIEndPoint.ts" />
 /// <reference path="./services/MyModal.ts" />
+/// <reference path="./services/WebSocket.ts" />
 
 /// <reference path="./directives/Command.ts" />
 /// <reference path="./directives/HeaderMenu.ts" />
diff --git a/front-end/app/scripts/services/WebSocket.ts b/front-end/app/scripts/services/WebSocket.ts
new file mode 100644 (file)
index 0000000..f4ee4ab
--- /dev/null
@@ -0,0 +1,36 @@
+namespace app.services{
+    export class WebSocket {
+        private socket: any;
+
+        //public static $inject = ['$rootScope'];
+
+        constructor(private $rootScope: ng.IRootScopeService) {
+            this.socket = io.connect();
+        }
+
+        public on(eventName, callback) {
+            var socket = this.socket;
+            var rootScope = this.$rootScope;
+
+            socket.on(eventName, function() {
+                var args = arguments
+                rootScope.$apply(function() {
+                    callback.apply(socket, args)
+                });
+            });
+        }
+
+        public emit(eventName, data, callback) {
+            var socket = this.socket;
+            var rootScope = this.$rootScope;
+
+            this.socket.emit(eventName, data, function() {
+                var args = arguments
+                rootScope.$apply(function() {
+                    if(callback) 
+                        callback.apply(socket, args)
+                });
+            });
+        }
+    }
+}
index e96a9f9..ec923c4 100644 (file)
@@ -61,6 +61,7 @@
        __webpack_require__(18);
        __webpack_require__(19);
        __webpack_require__(20);
+       __webpack_require__(21);
 
 
 /***/ },
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
-           app.zephyr.service('MyModal', app.services.MyModal);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
        })(app || (app = {}));
        var app;
        (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var directives;
            (function (directives) {
                var Command = (function () {
                })();
                directives.Command = Command;
                var CommandController = (function () {
-                   function CommandController(APIEndPoint, $scope, MyModal) {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
                        var controller = this;
                        this.APIEndPoint
                            .getOptionControlFile('mrcImageNoiseAdd')
                        this.$scope.$on('close', function () {
                            controller.isOpen = false;
                        });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
                    }
                    CommandController.prototype.submit = function () {
                        var opt = [];
                    CommandController.prototype.debug = function () {
                        this.MyModal.preview();
                    };
-                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal'];
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
                    return CommandController;
                })();
                directives.CommandController = CommandController;
                });
            });
            app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
            app.zephyr.filter('Tag', filters.Tag);
            app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
            app.zephyr.controller('previewController', app.controllers.Preview);
+           app.zephyr.controller('executionController', app.controllers.Execution);
+           app.zephyr.controller('workspaceController', app.controllers.Workspace);
+           app.zephyr.controller('historyController', app.controllers.History);
+           app.zephyr.controller('commandController', app.directives.CommandController);
+           app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
+           app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
+           app.zephyr.directive('command', app.directives.Command.Factory());
+           app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
+       })(app || (app = {}));
+
+
+/***/ },
+/* 21 */
+/***/ function(module, exports) {
+
+       var app;
+       (function (app) {
+           var declares;
+           (function (declares) {
+               var CommandInfo = (function () {
+                   function CommandInfo(name) {
+                       this.name = name;
+                   }
+                   return CommandInfo;
+               })();
+               declares.CommandInfo = CommandInfo;
+           })(declares = app.declares || (app.declares = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var services;
+           (function (services) {
+               var APIEndPoint = (function () {
+                   function APIEndPoint($resource, $http) {
+                       this.$resource = $resource;
+                       this.$http = $http;
+                   }
+                   APIEndPoint.prototype.resource = function (endPoint, data) {
+                       var customAction = {
+                           method: 'GET',
+                           isArray: false
+                       };
+                       var execute = {
+                           method: 'POST',
+                           headers: { 'Content-Type': undefined, enctype: 'multipart/form-data' }
+                       };
+                       return this.$resource(endPoint, {}, { execute: execute });
+                   };
+                   APIEndPoint.prototype.getOptionControlFile = function (command) {
+                       var endPoint = '/api/v1/optionControlFile/' + command;
+                       return this.resource(endPoint, {}).get();
+                   };
+                   APIEndPoint.prototype.getFiles = function (fileId) {
+                       var endPoint = '/api/v1/workspace';
+                       if (fileId) {
+                           endPoint += '/' + fileId;
+                       }
+                       return this.resource(endPoint, {}).get();
+                   };
+                   APIEndPoint.prototype.getDirectories = function () {
+                       var endPoint = '/api/v1/all/workspace/directory';
+                       return this.resource(endPoint, {}).get();
+                   };
+                   APIEndPoint.prototype.getTags = function () {
+                       var endPoint = '/api/v1/tagList';
+                       return this.resource(endPoint, {}).get();
+                   };
+                   APIEndPoint.prototype.getCommands = function () {
+                       var endPoint = '/api/v1/commandList';
+                       return this.resource(endPoint, {}).get();
+                   };
+                   APIEndPoint.prototype.execute = function (data) {
+                       var endPoint = '/api/v1/execution';
+                       var fd = new FormData();
+                       fd.append('data', data);
+                       return this.$http.post(endPoint, fd, {
+                           headers: { 'Content-Type': undefined },
+                           transformRequest: angular.identity
+                       });
+                   };
+                   return APIEndPoint;
+               })();
+               services.APIEndPoint = APIEndPoint;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var services;
+           (function (services) {
+               var MyModal = (function () {
+                   function MyModal($uibModal) {
+                       this.$uibModal = $uibModal;
+                       this.modalOption = {
+                           backdrop: true,
+                           controller: null,
+                           templateUrl: null,
+                           size: null
+                       };
+                   }
+                   MyModal.prototype.open = function (modalName) {
+                       if (modalName === 'SelectCommand') {
+                           this.modalOption.templateUrl = 'templates/select-command.html';
+                           this.modalOption.size = 'lg';
+                       }
+                       return this.$uibModal.open(this.modalOption);
+                   };
+                   MyModal.prototype.selectCommand = function () {
+                       this.modalOption.templateUrl = 'templates/select-command.html';
+                       this.modalOption.controller = 'selectCommandController';
+                       this.modalOption.controllerAs = 'c';
+                       this.modalOption.size = 'lg';
+                       return this.$uibModal.open(this.modalOption);
+                   };
+                   MyModal.prototype.preview = function () {
+                       this.modalOption.templateUrl = 'templates/preview.html';
+                       this.modalOption.controller = 'previewController';
+                       this.modalOption.controllerAs = 'c';
+                       this.modalOption.size = 'lg';
+                       return this.$uibModal.open(this.modalOption);
+                   };
+                   MyModal.$inject = ['$uibModal'];
+                   return MyModal;
+               })();
+               services.MyModal = MyModal;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var services;
+           (function (services) {
+               var WebSocket = (function () {
+                   function WebSocket($rootScope) {
+                       this.$rootScope = $rootScope;
+                       this.socket = io.connect();
+                   }
+                   WebSocket.prototype.on = function (eventName, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       socket.on(eventName, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   WebSocket.prototype.emit = function (eventName, data, callback) {
+                       var socket = this.socket;
+                       var rootScope = this.$rootScope;
+                       this.socket.emit(eventName, data, function () {
+                           var args = arguments;
+                           rootScope.$apply(function () {
+                               if (callback)
+                                   callback.apply(socket, args);
+                           });
+                       });
+                   };
+                   return WebSocket;
+               })();
+               services.WebSocket = WebSocket;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var Command = (function () {
+                   function Command() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.scope = true;
+                       this.controller = 'commandController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           index: '=',
+                           name: '=',
+                           remove: '&',
+                           list: '='
+                       };
+                       this.templateUrl = 'templates/command.html';
+                   }
+                   Command.Factory = function () {
+                       var directive = function () {
+                           return new Command();
+                       };
+                       directive.$inject = [];
+                       return directive;
+                   };
+                   return Command;
+               })();
+               directives.Command = Command;
+               var CommandController = (function () {
+                   function CommandController(APIEndPoint, $scope, MyModal, WebSocket) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       this.MyModal = MyModal;
+                       this.WebSocket = WebSocket;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getOptionControlFile('mrcImageNoiseAdd')
+                           .$promise
+                           .then(function (result) {
+                           controller.options = result.info;
+                       });
+                       this.APIEndPoint
+                           .getDirectories()
+                           .$promise
+                           .then(function (result) {
+                           controller.dirs = result.info;
+                       });
+                       this.heading = "[" + this.index + "]: dcdFilePring";
+                       this.isOpen = true;
+                       this.$scope.$on('close', function () {
+                           controller.isOpen = false;
+                       });
+                       this.WebSocket.on('test', function (data) {
+                           console.log("HOGEHOGEHOGEHOHGOEHGOH");
+                       });
+                   }
+                   CommandController.prototype.submit = function () {
+                       var opt = [];
+                       angular.forEach(this.options, function (option) {
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
+                           angular.forEach(option.arg, function (arg) {
+                               if (arg.input) {
+                                   if (typeof arg.input === 'object') {
+                                       obj.arguments.push(arg.input.name);
+                                   }
+                                   else {
+                                       obj.arguments.push(arg.input);
+                                   }
+                               }
+                           });
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
+                           }
+                       });
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           options: opt
+                       };
+                       this.APIEndPoint
+                           .execute(JSON.stringify(execObj))
+                           .then(function (result) {
+                           console.log(result);
+                       });
+                   };
+                   CommandController.prototype.removeMySelf = function (index) {
+                       this.remove()(index, this.list);
+                   };
+                   CommandController.prototype.reloadFiles = function () {
+                       var _this = this;
+                       var fileId = this.workspace.fileId;
+                       this.APIEndPoint
+                           .getFiles(fileId)
+                           .$promise
+                           .then(function (result) {
+                           var status = result.status;
+                           if (status === 'success') {
+                               _this.files = result.info;
+                           }
+                           else {
+                               console.log(result.message);
+                           }
+                       });
+                   };
+                   CommandController.prototype.debug = function () {
+                       this.MyModal.preview();
+                   };
+                   CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket'];
+                   return CommandController;
+               })();
+               directives.CommandController = CommandController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var HeaderMenu = (function () {
+                   function HeaderMenu() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.templateUrl = 'templates/header-menu.html';
+                   }
+                   HeaderMenu.Factory = function () {
+                       var directive = function () {
+                           return new HeaderMenu();
+                       };
+                       return directive;
+                   };
+                   return HeaderMenu;
+               })();
+               directives.HeaderMenu = HeaderMenu;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var Option = (function () {
+                   function Option() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'optionController';
+                       this.bindToController = {
+                           info: '=',
+                           files: '='
+                       };
+                       this.scope = true;
+                       this.templateUrl = 'templates/option.html';
+                       this.controllerAs = 'ctrl';
+                   }
+                   Option.Factory = function () {
+                       var directive = function () {
+                           return new Option();
+                       };
+                       directive.$inject = [];
+                       return directive;
+                   };
+                   return Option;
+               })();
+               directives.Option = Option;
+               var OptionController = (function () {
+                   function OptionController() {
+                       var controller = this;
+                       angular.forEach(controller.info.arg, function (arg) {
+                           if (arg.initialValue) {
+                               if (arg.formType === 'number') {
+                                   arg.input = parseInt(arg.initialValue);
+                               }
+                               else {
+                                   arg.input = arg.initialValue;
+                               }
+                           }
+                       });
+                   }
+                   OptionController.$inject = [];
+                   return OptionController;
+               })();
+               directives.OptionController = OptionController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var Execution = (function () {
+                   function Execution(MyModal, $scope) {
+                       this.MyModal = MyModal;
+                       this.$scope = $scope;
+                       this.commandInfoList = [];
+                   }
+                   ;
+                   Execution.prototype.add = function () {
+                       this.$scope.$broadcast('close');
+                       var commandInfoList = this.commandInfoList;
+                       var commandInstance = this.MyModal.selectCommand();
+                       commandInstance
+                           .result
+                           .then(function (command) {
+                           commandInfoList.push(new app.declares.CommandInfo(command));
+                       });
+                   };
+                   Execution.prototype.open = function () {
+                       var result = this.MyModal.open('SelectCommand');
+                       console.log(result);
+                   };
+                   Execution.prototype.remove = function (index, list) {
+                       list.splice(index, 1);
+                   };
+                   Execution.prototype.close = function () {
+                       console.log("close");
+                   };
+                   Execution.$inject = ['MyModal', '$scope'];
+                   return Execution;
+               })();
+               controllers.Execution = Execution;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var Workspace = (function () {
+                   function Workspace($scope, APIEndPoint, MyModal) {
+                       this.$scope = $scope;
+                       this.APIEndPoint = APIEndPoint;
+                       this.MyModal = MyModal;
+                       this.directoryList = [];
+                       var controller = this;
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
+                   }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
+                   Workspace.prototype.debug = function () {
+                       this.MyModal.preview();
+                   };
+                   Workspace.$inject = ['$scope', 'APIEndPoint', 'MyModal'];
+                   return Workspace;
+               })();
+               controllers.Workspace = Workspace;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var History = (function () {
+                   function History($scope) {
+                       this.page = "History";
+                   }
+                   History.$inject = ['$scope'];
+                   return History;
+               })();
+               controllers.History = History;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var SelectCommand = (function () {
+                   function SelectCommand($scope, APIEndPoint, $modalInstance) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$modalInstance = $modalInstance;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getTags()
+                           .$promise.then(function (result) {
+                           controller.tags = result.info;
+                       });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
+                       this.currentTag = 'all';
+                   }
+                   SelectCommand.prototype.changeTag = function (tag) {
+                       this.currentTag = tag;
+                   };
+                   SelectCommand.prototype.selectCommand = function (command) {
+                       this.$modalInstance.close(command);
+                   };
+                   SelectCommand.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+                   return SelectCommand;
+               })();
+               controllers.SelectCommand = SelectCommand;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var Preview = (function () {
+                   function Preview($scope, APIEndPoint, $modalInstance) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$modalInstance = $modalInstance;
+                       var controller = this;
+                       console.log('preview');
+                   }
+                   Preview.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+                   return Preview;
+               })();
+               controllers.Preview = Preview;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var filters;
+       (function (filters) {
+           function Tag() {
+               return function (commands, tag) {
+                   var result = [];
+                   angular.forEach(commands, function (command) {
+                       var flag = false;
+                       angular.forEach(command.tags, function (value) {
+                           if (tag === value)
+                               flag = true;
+                       });
+                       if (flag)
+                           result.push(command);
+                   });
+                   return result;
+               };
+           }
+           filters.Tag = Tag;
+       })(filters || (filters = {}));
+       var app;
+       (function (app) {
+           'use strict';
+           var appName = 'zephyr';
+           app.zephyr = angular.module(appName, ['ui.router', 'ngResource', 'ui.bootstrap']);
+           app.zephyr.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
+               $urlRouterProvider.otherwise('/execution');
+               $locationProvider.html5Mode({
+                   enabled: true,
+                   requireBase: false
+               });
+               $stateProvider
+                   .state('execution', {
+                   url: '/execution',
+                   templateUrl: 'templates/execution.html',
+                   controller: 'executionController',
+                   controllerAs: 'c'
+               })
+                   .state('workspace', {
+                   url: '/workspace',
+                   templateUrl: 'templates/workspace.html',
+                   controller: 'workspaceController',
+                   controllerAs: 'c'
+               })
+                   .state('history', {
+                   url: '/history',
+                   templateUrl: 'templates/history.html',
+                   controller: 'historyController',
+                   controllerAs: 'c'
+               });
+           });
+           app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
            app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.service('WebSocket', app.services.WebSocket);
+           app.zephyr.filter('Tag', filters.Tag);
+           app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
+           app.zephyr.controller('previewController', app.controllers.Preview);
            app.zephyr.controller('executionController', app.controllers.Execution);
            app.zephyr.controller('workspaceController', app.controllers.Workspace);
            app.zephyr.controller('historyController', app.controllers.History);
index 7176574..83c4ccc 100644 (file)
@@ -7,6 +7,7 @@
   </head>
   <body ng-app="zephyr">
       <ui-view></ui-view>
+    <script src="/socket.io/socket.io.js"></script>
     <script src="./bundle.js"></script>
   </body>
 </html>
index 901eec3..262b11d 100644 (file)
@@ -7,7 +7,6 @@ var formidable = require('formidable')
 var db = require(__dirname + '/../../../../../../server/class/DB').instance;
 
 router.get('/', function(req, res) {
-    console.log('hogehoge');
     db.getDirectories()
     .then(function(dirs) {
         var info = {
index d5ba29f..d0a3e42 100644 (file)
@@ -266,7 +266,6 @@ function getFiles(fileId) {
  */
 function getDirectories() {
     return new Promise(function(resolve, reject) {
-        console.log("GETDIRECTORIES");
         var q = {
             where: {
                 fileType: 0
index c3cc07b..10aff92 100644 (file)
@@ -349,7 +349,6 @@ function getUUIDs(fileId) {
             var uuids = {};
             r.forEach(function(v) {
                 uuids[v.dataValues.name] = v.dataValues.fileId;
-                //console.log(uuids);
             });
             resolve(uuids);
         });
index 4a7d5f7..321267f 100644 (file)
@@ -1,10 +1,12 @@
 'use strict'
 
 var fs = require('fs')
+var socket;
 
 module.exports = function(io) {
     io.on('connection', function(socket) {
         console.log("websocket was connected")
+        socket.emit('test', 'testtesttest');
         /*
             array include obj
             {