OSDN Git Service

[Develop and manual test] /api/v1/commandList v0.3.0p0044
authorhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Mon, 8 Feb 2016 08:11:20 +0000 (17:11 +0900)
committerhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Mon, 8 Feb 2016 08:11:20 +0000 (17:11 +0900)
 On branch master
 Changes to be committed:
modified:   front-end/app/scripts/controllers/SelectCommand.ts
modified:   front-end/app/scripts/services/APIEndPoint.ts
modified:   front-end/app/templates/select-command.html
modified:   front-end/dist/bundle.js
modified:   front-end/dist/templates/select-command.html
new file:   server/api/v1/commandList/index.js
modified:   server/routes.js

front-end/app/scripts/controllers/SelectCommand.ts
front-end/app/scripts/services/APIEndPoint.ts
front-end/app/templates/select-command.html
front-end/dist/bundle.js
front-end/dist/templates/select-command.html
server/api/v1/commandList/index.js [new file with mode: 0644]
server/routes.js

index 9f770e8..b6cfee7 100644 (file)
@@ -3,6 +3,7 @@ namespace app.controllers {
 
         public static $inject = ['$scope', 'APIEndPoint'];
         private tags: string[];
+        private commands: string[];
 
         constructor($scope: ng.IScope, private APIEndPoint: services.APIEndPoint) {
             var controller = this;
@@ -12,6 +13,12 @@ namespace app.controllers {
                    controller.tags = result.info; 
                 });
 
+            this.APIEndPoint
+                .getCommands()
+                .$promise.then((result) => {
+                   controller.commands = result.info; 
+                });
+
         } 
     }
 }
index 76b1732..4f680cf 100644 (file)
@@ -52,6 +52,12 @@ namespace app.services {
             return this.resource(endPoint, {}).get();
         }
 
+        public getCommands(): ng.resource.IResource<declares.IResponse> {
+            var endPoint = '/api/v1/commandList';
+            return this.resource(endPoint, {}).get();
+        }
+
+
         public execute(data: any): ng.IHttpPromise<{}> {
             var endPoint = '/api/v1/execution';
             var fd = new FormData()
index 0278295..6271362 100644 (file)
@@ -5,7 +5,7 @@
 <div class="modal-body">
     <div class="row">
         <div class="col-md-8">
-            <p ng-repeat="tag in c.tags">{{tag}}</p>
+            <p ng-repeat="command in c.commands">{{command}}</p>
             <!--
             <div class="btn-group"ng-repeat="tag in tags">
                 <button type="button" class="btn btn-default btn-xs" ng-click="changeTag(tag)"><span class="glyphicon glyphicon-tag"></span>{{tag}}</button>
index 3a80e17..f46514e 100644 (file)
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
                        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();
                            .$promise.then(function (result) {
                            controller.tags = result.info;
                        });
+                       this.APIEndPoint
+                           .getCommands()
+                           .$promise.then(function (result) {
+                           controller.commands = result.info;
+                       });
                    }
                    SelectCommand.$inject = ['$scope', 'APIEndPoint'];
                    return SelectCommand;
index 0278295..6271362 100644 (file)
@@ -5,7 +5,7 @@
 <div class="modal-body">
     <div class="row">
         <div class="col-md-8">
-            <p ng-repeat="tag in c.tags">{{tag}}</p>
+            <p ng-repeat="command in c.commands">{{command}}</p>
             <!--
             <div class="btn-group"ng-repeat="tag in tags">
                 <button type="button" class="btn btn-default btn-xs" ng-click="changeTag(tag)"><span class="glyphicon glyphicon-tag"></span>{{tag}}</button>
diff --git a/server/api/v1/commandList/index.js b/server/api/v1/commandList/index.js
new file mode 100644 (file)
index 0000000..1eb846d
--- /dev/null
@@ -0,0 +1,15 @@
+'use strict';
+
+var express = require('express');
+var router  = express.Router();
+
+router.get('/', function(req, res) {
+   var commandList = require(__dirname + '/../../../../user-specific-files/OptionControlFile/command_list');
+    var info = {
+       status: 'success',
+       info: commandList 
+   };
+   res.send(info);
+});
+
+module.exports = router;
index f71234b..443bb9a 100644 (file)
@@ -23,6 +23,7 @@ module.exports = function(app) {
     app.use('/api/v1/all/workspace/directory', require(__dirname + '/api/v1/all/workspace/directory'));
     app.use('/api/v1/optionControlFile', require(__dirname + '/api/v1/optionControlFile'));
     app.use('/api/v1/tagList', require(__dirname + '/api/v1/tagList'));
+    app.use('/api/v1/commandList', require(__dirname + '/api/v1/commandList'));
 
     app.route('/*')
     .get(function(req, res) {