.config(function ($routeProvider, $locationProvider) {
$routeProvider
.otherwise({
- redirectTo: '/'
+ redirectTo: '/home'
})
$locationProvider.html5Mode(true);
-})
-.value('directivePath',{
- 'navbar':'app/directive/navbar/navbar.html'
-}
-);
+});
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+.controller('MenubarCtrl', function MenubarCtrl($scope, createFileModal) {
+ $scope.chDir = function(dir) {
+ $scope.setDir(dir);
+ };
+ $scope.showDir = function(dir) {
+ $scope.setDirMode = true;
+ };
+ $scope.openFileModal = function() {
+ createFileModal.open($scope);
+ };
+
+});
+
+
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+.directive('menubar', function () {
+ return {
+ templateUrl: 'app/directive/menubar/menubar.html',
+ controller: 'MenubarCtrl',
+ restrict: 'EA',
+ link: function (scope, element, attrs, controller) {
+ }
+ };
+});
--- /dev/null
+<ul class="nav navbar-nav navbar-left">
+ <li class="dropdown">
+ <a class="dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a>{{curDir}}</a></li>
+ <li class="divider"></li>
+ <li ng-repeat="dir in dirs"><a ng-click="chDir(dir)">{{dir}}</a></li>
+ </ul>
+ </li>
+ <li><a popover="Goto {{curDir}} " popover-trigger="mouseenter" ng-click="showDir(curDir)">{{curDir}}</a></li>
+ <li popover-trigger="mouseenter" popover="upload file" ><a ng-click="openFileModal();toggleExe();"><i class="icon-createfile"></i></a></li>
+ <li popover-trigger="mouseenter" popover="select command" ><a ng-click="openCommandModal()"><i class="icon-fullborders"></i></a></li>
+</ul>
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+.controller('MyDirectoryCtrl', function DirectoryCtrl($scope, api) {
+ $scope.$watch("curDir", $scope.update, true);
+});
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+.directive('myDirectory', function () {
+ return {
+ controller: 'MyDirectoryCtrl',
+ templateUrl: 'app/directive/my-directory/my-directory.html',
+ restrict: 'EA',
+ link: function (scope, element, attrs, controller) {
+ }
+ };
+});
--- /dev/null
+<div class="row">
+ <div class="table-responsive">
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th class="col-md-5">Name</th>
+ <th class="col-md-2">Size</th>
+ <th class="col-md-5">Accessed Time</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="row in tableRows">
+ <td>{{row.name}}</td>
+ <td>{{row.size}}</td>
+ <td>{{row.atime}}</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+.controller('MyExeCtrl', function DirectoryCtrl($scope, api) {
+
+});
--- /dev/null
+<div class="page-header">
+ <h1>{{selectedCommand}}</h1>
+</div>
+<div class="row">
+ <div ng-repeat="(i, opt) in opts">
+ <div class="col-md-5">
+ <my-panel ng-if="$even" i="{{i}}"></my-panel>
+ </div>
+ <div class="col-md-2"></div>
+ <div class="col-md-5">
+ <my-panel ng-if="$odd" i="{{i}}"></my-panel>
+ </div>
+ </div>
+</div>
+<div class="row">
+ <div class="col-md-8">
+ </div>
+ <div class="col-md-4">
+ <button>Execute</button>
+ </div>
+</div>
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+.directive('myExe', function () {
+ return {
+ controller: 'MyExeCtrl',
+ templateUrl: 'app/directive/my-exe/my-exe.html',
+ restrict: 'EA',
+ link: function (scope, element, attrs, controller) {
+ }
+ };
+});
.directive('myForm', function ($compile) {
return {
template:"<div></div>",
- scope:{
- argIndex: '@j'
- },
- replace: true,
- restrict: 'EA',
- link: function (scope, element, attrs) {
- element.append($compile("<div class=\"col-md-6\"><my-"+scope.arg.formType+"><my-"+scope.arg.formType+"/></div>")(scope));
- },
- controller: function($scope){
- var argIndex = parseInt($scope.argIndex);
- $scope.arg = $scope.$parent.opt.arg[argIndex];
- }
+ scope:{
+ argIndex: '@j'
+ },
+ replace: true,
+ restrict: 'EA',
+ link: function (scope, element, attrs) {
+ element.append($compile("<div class=\"col-md-6\"><my-"+scope.arg.formType+"><my-"+scope.arg.formType+"/></div>")(scope));
+ },
+ controller: function($scope){
+ var argIndex = parseInt($scope.argIndex);
+ $scope.arg = $scope.$parent.opt.arg[argIndex];
+ }
};
});
.directive('myNumber', function () {
return {
templateUrl: 'app/directive/my-number/my-number.html',
- scope: { }, // This Directive has has Isolated Scope
- restrict: 'EA',
- link: angular.noop,
- controller: function($scope){
- // Receive "arg" and "opt" From $parent Scope
- // $parent Scope is my-form Directive
- var arg = $scope.$parent.arg;
- var opt = $scope.$parent.$parent.opt;
+ scope: { }, // This Directive has has Isolated Scope
+ restrict: 'EA',
+ link: angular.noop,
+ controller: function($scope){
+ // Receive "arg" and "opt" From $parent Scope
+ // $parent Scope is my-form Directive
+ var arg = $scope.$parent.arg;
+ var opt = $scope.$parent.$parent.opt;
- $scope.argName = arg.argName;
- $scope.optionName = opt.optionName;
- }
+ $scope.argName = arg.argName;
+ $scope.optionName = opt.optionName;
+ }
};
});
<label for="argName" class="control-label">{{argName}}</label>
<input type="number" class="form-control">
-
-
angular.module('zephyrApp')
.controller('NavbarCtrl', function NavbarCtrl($scope, api) {
-
- var dirs = [
- "fumifumi",
- "tacyas",
- "himetani"
- ];
-
- $scope.curDir = dirs[1];
-
- $scope.chDir = function(dir) {
- $scope.curDir = dir;
- $scope.dirs = filterDir(dirs);
- };
-
- $scope.dirs = filterDir(dirs);
-
- function isNotCurDir(dir){
- return !(dir === $scope.curDir);
- };
-
- function filterDir(dirs) {
- return dirs.filter(isNotCurDir);
- }
});
controller: 'NavbarCtrl',
templateUrl: 'app/directive/navbar/navbar.html',
restrict: 'EA',
- transclude: true,
link: function (scope, element, attrs, controller) {
}
};
+++ /dev/null
-'use strict';
-
-describe('Directive: navbar', function () {
-
- // load the directive's module and view
- beforeEach(module('zephyrApp'));
- beforeEach(module('app/directive/navbar/navbar.html'));
-
- var element, scope;
-
- beforeEach(inject(function ($rootScope) {
- scope = $rootScope.$new();
- }));
-
- it('should make hidden element visible', inject(function ($compile) {
- element = angular.element('<navbar></navbar>');
- element = $compile(element)(scope);
- scope.$apply();
- expect(element.text()).toBe('this is the navbar directive');
- }));
-});
\ No newline at end of file
<div class="navbar navbar-default">
<div class="navbar-header">
- <a class="navbar-brand" href="#">Zephyr</a>
+ <a class="navbar-brand" href="">Zephyr</a>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
- <li class="active"><a href="#">Home</a></li>
- <li><a href="#">Directory</a></li>
- <li><a href="#">Activity Log</a></li>
+ <li class="active"><a href="/">Home</a></li>
+ <li><a href="workspace">Workspace</a></li>
+ <li><a href="log">Activity Log</a></li>
</ul>
<form class="navbar-form navbar-left">
<input type="text" class="form-control col-lg-8" placeholder="Search">
</form>
- <ul class="nav navbar-nav navbar-right">
- <li popover-trigger="mouseenter" popover="Upload File" ><a href="" ng-click="openFileModal()"><i class="icon-createfile"></i></a></li>
- <li><a href="#"><i class="icon-enteralt"></i></a></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{curDir}} <b class="caret"></b></a>
- <ul class="dropdown-menu">
- <li><a href="#">{{curDir}}</a></li>
- <li class="divider"></li>
- <li ng-repeat="dir in dirs"><a href="#" ng-click="chDir(dir)">{{dir}}</a></li>
- </ul>
- </li>
- </ul>
- <!--
- -->
</div>
</div>
+++ /dev/null
-'use strict';
-
-angular.module('zephyrApp')
- .controller('LogpageCtrl', function ($scope,directivePath) {
- $scope.navbar = directivePath.navbar;
- });
+++ /dev/null
-'use strict';
-
-describe('Controller: LogpageCtrl', function () {
-
- // load the controller's module
- beforeEach(module('zephyrApp'));
-
- var LogpageCtrl, scope;
-
- // Initialize the controller and a mock scope
- beforeEach(inject(function ($controller, $rootScope) {
- scope = $rootScope.$new();
- LogpageCtrl = $controller('LogpageCtrl', {
- $scope: scope
- });
- }));
-
- it('should ...', function () {
- expect(1).toEqual(1);
- });
-});
+++ /dev/null
-'use strict';
-
-angular.module('zephyrApp')
- .config(function ($routeProvider) {
- $routeProvider
- .when('/activityLogPage', {
- templateUrl: 'app/route/activityLogPage/activityLogPage.html',
- controller: 'LogpageCtrl'
- });
- });
+++ /dev/null
-'use strict';
-
-angular.module('zephyrApp')
-.controller('CommandCtrl', function ($scope,directivePath,api) {
- $scope.navbar = directivePath.navbar;
-
- $scope.commands = api('commandList');
- $scope.tags = api('tagList');
- $scope.tag = "all";
-
- $scope.changeTag = function(tag){
- $scope.tag = tag;
- };
-
-});
+++ /dev/null
-'use strict';
-
-describe('Controller: CommandCtrl', function () {
-
- // load the controller's module
- beforeEach(module('zephyrApp'));
-
- var CommandCtrl, scope;
-
- // Initialize the controller and a mock scope
- beforeEach(inject(function ($controller, $rootScope) {
- scope = $rootScope.$new();
- CommandCtrl = $controller('CommandCtrl', {
- $scope: scope
- });
- }));
-
- it('should ...', function () {
- expect(1).toEqual(1);
- });
-});
+++ /dev/null
-<div ng-include="navbar"></div>
-
-<div id="page-wrapper">
- <div class="page-header">
- <div class="row">
- <div class="col-lg-12">
- <h1>Command</h1>
- </div>
- <!-- /.col-lg-12 -->
- </div>
- <div class="row">
- <div class="col-md-8">
- <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>
- </div>
- </div>
- <div class="col-md-4">
- <div class="input-group custom-search-form">
- <input type="text" class="form-control" placeholder="Search..." ng-model="searchText">
- <span class="input-group-btn">
- <button class="btn btn-default" type="button">
- <i class="fa fa-search"></i>
- </button>
- </span>
- </div>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div ng-repeat="command in commands | filter:searchText |tagFilter:tag">
- <div class="col-md-4">
- <a href="executionPage/{{command.name}}" target="_blank" ng-if="$index%3==0">{{command.name}}</a>
- </div>
- <div class="col-md-4">
- <a href="executionPage/{{command.name}}" target="_blank" ng-if="$index%3==1">{{command.name}}</a>
- </div>
- <div class="col-md-4">
- <a href="executionPage/{{command.name}}" target="_blank" ng-if="$index%3==2">{{command.name}}</a>
- </div>
- </div>
- </div>
-</div>
-<!-- /#page-wrapper -->
-
+++ /dev/null
-'use strict';
-
-angular.module('zephyrApp')
- .config(function ($routeProvider) {
- $routeProvider
- .when('/commandPage', {
- templateUrl: 'app/route/commandPage/commandPage.html',
- controller: 'CommandCtrl'
- });
- });
+++ /dev/null
-'use strict';
-
-angular.module('zephyrApp')
-.controller('RouteCtrl', function ($scope, $location, commandModal, api) {
- $scope.workspaces = api('workspace/read');
-
- $scope.workspaceIsActive = false;
- $scope.onWorkspace = function() {
- $scope.workspaceIsActive = true;
- };
- $scope.openCommandModal = function() {
- commandModal.open();
- }
-});
+++ /dev/null
-'use strict';
-
-describe('Controller: RouteCtrl', function () {
-
- // load the controller's module
- beforeEach(module('zephyrApp'));
-
- var RouteCtrl, scope;
-
- // Initialize the controller and a mock scope
- beforeEach(inject(function ($controller, $rootScope) {
- scope = $rootScope.$new();
- RouteCtrl = $controller('RouteCtrl', {
- $scope: scope
- });
- }));
-
- it('should ...', function () {
- expect(1).toEqual(1);
- });
-});
+++ /dev/null
-<navbar></navbar>
-<div class="container">
- <div class="row">
- <ul class="nav navbar-nav navbar-left">
- <li><a popover="Goto {{curDir}} " popover-trigger="mouseenter" href="#">{{curDir}}</a></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></a>
- <ul class="dropdown-menu">
- <li><a>{{curDir}}</a></li>
- <li class="divider"></li>
- <li ng-repeat="dir in dirs"><a href="#" ng-click="chDir(dir)">{{dir}}</a></li>
- </ul>
- </li>
- <li popover-trigger="mouseenter" popover="upload file" ><a href="" ng-click="openFileModal()"><i class="icon-createfile"></i></a></li>
- <li popover-trigger="mouseenter" popover="select command" ><a href="" ng-click="openCommandModal()"><i class="icon-fullborders"></i></a></li>
- </ul>
- </div>
- <div class="col-md-8">
- <div class="well well-lg">
- <directory></directory>
- </div>
- </div>
-</div>
+++ /dev/null
-'use strict';
-
-angular.module('zephyrApp')
-.controller('ExecutionpageCtrl', function ($scope, $location, api) {
- var command = $location.path().replace("/executionPage/","");
- $scope.opts = api('option/'+command);
- $scope.command = command;
-});
+++ /dev/null
-'use strict';
-
-describe('Controller: ExecutionpageCtrl', function () {
-
- // load the controller's module
- beforeEach(module('zephyrApp'));
-
- var ExecutionpageCtrl, scope;
-
- // Initialize the controller and a mock scope
- beforeEach(inject(function ($controller, $rootScope) {
- scope = $rootScope.$new();
- ExecutionpageCtrl = $controller('ExecutionpageCtrl', {
- $scope: scope
- });
- }));
-
- it('should ...', function () {
- expect(1).toEqual(1);
- });
-});
+++ /dev/null
-<div class="container">
- <div class="row">
- <div class="page-header">
- <h1>{{command}}</h1>
- </div>
- <div ng-repeat="(i, opt) in opts">
- <div class="col-md-5">
- <my-panel ng-if="$even" i="{{i}}"></my-panel>
- </div>
- <div class="col-md-2"></div>
- <div class="col-md-5">
- <my-panel ng-if="$odd" i="{{i}}"></my-panel>
- </div>
- </div>
- </div>
-</div>
+++ /dev/null
-'use strict';
-
-angular.module('zephyrApp')
- .config(function ($routeProvider) {
- $routeProvider
- .when('/executionPage/:id', {
- templateUrl: 'app/route/executionPage/executionPage.html',
- controller: 'ExecutionpageCtrl'
- });
- });
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+.controller('RouteHomeCtrl', function ($scope, $location, commandModal, api, createFileModal) {
+ // For menubar directive
+ var dirs = [
+ "fumifumi",
+ "tacyas",
+ "himetani"
+ ];
+ $scope.curDir = dirs[0];
+ $scope.dirs = filterDir(dirs);
+ $scope.setDir = function(dir) {
+ $scope.curDir = dir;
+ $scope.dirs = filterDir(dirs);
+ };
+ function isNotCurDir(dir){
+ return !(dir === $scope.curDir);
+ };
+ function filterDir(dirs) {
+ return dirs.filter(isNotCurDir);
+ };
+ // For commandModal service
+ $scope.openCommandModal = function() {
+ commandModal.open($scope);
+ };
+ $scope.selectCommand = function(selectedCommand) {
+ $scope.selectedCommand = selectedCommand;
+ showOpts();
+ };
+ function showOpts() {
+ if ($scope.selectedCommand)
+ $scope.opts = api('option/'+$scope.selectedCommand);
+ };
+ // For my-directory directive
+ $scope.isDirMode = true;
+ $scope.update = function () {
+ $scope.tableRows = api('workspaces/' + $scope.curDir);
+ };
+ $scope.setMode2True = function () {
+ $scope.isDirMode = true;
+ };
+ $scope.setMode2False = function () {
+ $scope.isDirMode = false;
+ };
+});
--- /dev/null
+<navbar></navbar>
+<div class="container">
+ <div class="row">
+ <menubar></menubar>
+ </div>
+ <div class="col-md-8">
+ <div ng-if="!isDirMode">
+ <my-exe></my-exe>
+ </div>
+ <div ng-if="isDirMode">
+ <my-directory></my-directory>
+ </div>
+ </div>
+</div>
angular.module('zephyrApp')
.config(function ($routeProvider) {
$routeProvider
- .when('/', {
- templateUrl: 'app/route/dashboard/dashboard.html',
- controller: 'RouteCtrl'
+ .when('/home', {
+ templateUrl: 'app/route/home/home.html',
+ controller: 'RouteHomeCtrl'
});
});
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+ .controller('RouteLogCtrl', function ($scope,directivePath) {
+ });
-<div ng-include="navbar"></div>
+<navbar></navbar>
<div id="page-wrapper">
<div class="page-header">
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+ .config(function ($routeProvider) {
+ $routeProvider
+ .when('/log', {
+ templateUrl: 'app/route/log/log.html',
+ controller: 'RouteLogCtrl'
+ });
+ });
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+ .controller('RouteWorkspaceCtrl', function ($scope,directivePath) {
+ });
--- /dev/null
+<navbar></navbar>
+
+<div id="page-wrapper">
+ <div class="page-header">
+ <div class="row">
+ <div class="col-lg-12">
+ <h1>Workspace</h1>
+ </div>
+ <!-- /.col-lg-12 -->
+ </div>
+ <div class="row">
+ へっだーだよ!
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-md-12">
+ Workspaceだよ!
+ </div>
+ </div>
+</div>
+<!-- /#page-wrapper -->
+
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+ .config(function ($routeProvider) {
+ $routeProvider
+ .when('/workspace', {
+ templateUrl: 'app/route/workspace/workspace.html',
+ controller: 'RouteWorkspaceCtrl'
+ });
+ });
<div id="wrapper">
<navbar></navbar>
<div id="page-wrapper">
- <div ng-controller="WorkspacepageCtrl">
-
- <div class="container-fluid">
-
- <div class="row page-header">
- <ol class="breadcrumb">
- <li>
- <a href="/">Dashboard</a>
- </li>
- <li ng-class="{active: isAll}">
- <a ng-if="isChild" href="/workspacePage/all">All Workspace</a>
- <span ng-if="isAll">All Workspace</span>
- </li>
- <li ng-if="isChild" class="active">
- {{path}}
- </li>
- </ol>
- </div>
+ <div class="container-fluid">
+
+ <div class="row page-header">
+ <ol class="breadcrumb">
+ <li>
+ <a href="/">Dashboard</a>
+ </li>
+ <li ng-class="{active: isAll}">
+ <a ng-if="isChild" href="/workspacePage/all">All Workspace</a>
+ <span ng-if="isAll">All Workspace</span>
+ </li>
+ <li ng-if="isChild" class="active">
+ {{path}}
+ </li>
+ </ol>
+ </div>
- <div class="row">
- <div class="collapse navbar-collapse">
- <h3 class="pull-left" style="display:inline">{{path}}</h3>
- <form class="navbar-form navbar-right" role="search">
- <div class="form-group">
- <input type="text" class="form-control" placeholder="Search">
- </div>
- </form>
- <ul class="nav navbar-nav navbar-right">
- <li ng-if="isAll" popover-trigger="mouseenter" popover="Create Workspace"><a href="" ng-click="openDirModal()"><i class="icon-addfolderalt"></i></a></li>
- <li ng-if="isChild" popover-trigger="mouseenter" popover="Upload File" ><a href="" ng-click="openFileModal()"><i class="icon-createfile"></i></a></li>
- </ul>
- </div>
+ <div class="row">
+ <div class="collapse navbar-collapse">
+ <h3 class="pull-left" style="display:inline">{{path}}</h3>
+ <form class="navbar-form navbar-right" role="search">
+ <div class="form-group">
+ <input type="text" class="form-control" placeholder="Search">
+ </div>
+ </form>
+ <ul class="nav navbar-nav navbar-right">
+ <li ng-if="isAll" popover-trigger="mouseenter" popover="Create Workspace"><a href="" ng-click="openDirModal()"><i class="icon-addfolderalt"></i></a></li>
+ <li ng-if="isChild" popover-trigger="mouseenter" popover="Upload File" ><a href="" ng-click="openFileModal()"><i class="icon-createfile"></i></a></li>
+ </ul>
</div>
+ </div>
- <div class="row">
- <div class="table-responsive">
- <table class="table table-hover">
- <thead>
- <tr>
- <th>#</th>
- <th>Name</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="row in tableRows" ng-click="move(row)">
- <td>{{$index+1}}</td>
- <td>{{row}}</td>
- </tr>
- </tbody>
- </table>
- </div>
+ <div class="row">
+ <div class="table-responsive">
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Name</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="row in tableRows" ng-click="move(row)">
+ <td>{{$index+1}}</td>
+ <td>{{row}}</td>
+ </tr>
+ </tbody>
+ </table>
</div>
-
</div>
- <!-- WorkspacepageCtrl -->
-
- </div>
- <!-- .containeri -->
-
- </div>
- <!-- /#page-wrapper -->
-
+ </div><!-- .container -->
+ </div><!-- /#page-wrapper -->
</div>
--- /dev/null
+angular.module('zephyrApp')
+.controller('CommandModalCtrl', function ($scope, $modalInstance, api) {
+ $scope.commands = api('commandList');
+ $scope.tags = api('tagList');
+ $scope.tag = "all";
+ $scope.changeTag = function(tag) {
+ $scope.tag = tag;
+ };
+ $scope.chCommand = function(selectedCommand) {
+ $scope.selectCommand(selectedCommand);
+ $scope.setMode2False();
+ $modalInstance.close();
+ };
+});
--- /dev/null
+<div class="modal-header">
+ <h3>Select Command</h3>
+</div>
+
+<div class="modal-body">
+ <div class="row">
+ <div class="col-md-8">
+ <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>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="input-group custom-search-form">
+ <input type="text" class="form-control" placeholder="Search..." ng-model="searchText">
+ <span class="input-group-btn">
+ <button class="btn btn-default" type="button">
+ <i class="fa fa-search"></i>
+ </button>
+ </span>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="modal-footer">
+ <div class="row">
+ <div ng-repeat="command in commands | filter:searchText |tagFilter:tag">
+ <div class="col-md-6">
+ <a class="pull-left" ng-click="chCommand(command.name)" ng-if="$even">{{command.name}}</a>
+ </div>
+ <div class="col-md-6">
+ <a class="pull-left" ng-click="chCommand(command.name)" ng-if="$odd">{{command.name}}</a>
+ </div>
+ </div>
+ </div>
+</div>
--- /dev/null
+'use strict';
+
+angular.module('zephyrApp')
+ .service('commandModal', function ($modal) {
+ var openModal = function (scope) {
+ $modal.open({
+ templateUrl: 'app/service/commandModal/commandModal.html',
+ controller : 'CommandModalCtrl',
+ badkdrop: true,
+ scope: scope,
+ size: 'lg'
+ });
+ };
+
+ return {
+ open: openModal
+ }
+
+ });
$scope.submit = function() {
if ($scope.files) {
- console.log($scope.files);
+ angular.forEach($scope.files, function (file) {
+ $upload.upload({
+ url: 'api/workspaces/' + $scope.curDir,
+ method: 'POST',
+ headers: {'Authorization': 'xxx'}, // only for html5
+ withCredentials: true,
+ file: file
+ }).progress(function(evt) {
+ console.log('progress: ' + parseInt(100.0 * evt.loaded / evt.total) + '% file :'+ evt.config.file.name);
+ }).success(function(data, status, headers, config) {
+ console.log('file ' + config.file.name + 'is uploaded successfully. Response: ' + data);
+ });
+ var name = $scope.curDir;
+ $scope.update();
+ $modalInstance.close();
+ });
+
} else {
alert("Select Files.");
}
- angular.forEach($scope.files, function (file) {
- $upload.upload({
- url: 'api/upload/create/' + dir,
- method: 'POST',
- headers: {'Authorization': 'xxx'}, // only for html5
- withCredentials: true,
- file: file
- }).progress(function(evt) {
- console.log('progress: ' + parseInt(100.0 * evt.loaded / evt.total) + '% file :'+ evt.config.file.name);
- }).success(function(data, status, headers, config) {
- console.log('file ' + config.file.name + 'is uploaded successfully. Response: ' + data);
- });
- });
-
- $scope.update();
- $modalInstance.close();
};
});
scope: scope
});
};
-
return {
open: openModal
}
-
});
+++ /dev/null
-'use strict';
-
-describe('Service: createFileModal', function () {
-
- // load the service's module
- beforeEach(module('zephyrApp'));
-
- // instantiate service
- var createFileModal;
- beforeEach(inject(function (_createFileModal_) {
- createFileModal = _createFileModal_;
- }));
-
- it('should do something', function () {
- expect(!!createFileModal).toBe(true);
- });
-
-});
<script src="app/app.js"></script>
<!-- injector:js -->
<script src="app/directive/fileupload/fileupload.directive.js"></script>
+ <script src="app/directive/menubar/menubar.controller.js"></script>
+ <script src="app/directive/menubar/menubar.directive.js"></script>
+ <script src="app/directive/my-directory/my-directory.controller.js"></script>
+ <script src="app/directive/my-directory/my-directory.directive.js"></script>
+ <script src="app/directive/my-exe/my-exe.controller.js"></script>
+ <script src="app/directive/my-exe/my-exe.js"></script>
<script src="app/directive/my-form/my-form.directive.js"></script>
<script src="app/directive/my-number/my-number.directive.js"></script>
<script src="app/directive/my-panel/my-panel.directive.js"></script>
<script src="app/factory/api/api.service.js"></script>
<script src="app/filter/argFilter/argFilter.filter.js"></script>
<script src="app/filter/tagFilter/tagFilter.filter.js"></script>
- <script src="app/route/activityLogPage/activityLogPage.controller.js"></script>
- <script src="app/route/activityLogPage/activityLogPage.js"></script>
- <script src="app/route/commandPage/commandPage.controller.js"></script>
- <script src="app/route/commandPage/commandPage.js"></script>
- <script src="app/route/dashboard/dashboard.controller.js"></script>
- <script src="app/route/dashboard/dashboard.js"></script>
- <script src="app/route/executionPage/executionPage.controller.js"></script>
- <script src="app/route/executionPage/executionPage.js"></script>
+ <script src="app/route/home/home.controller.js"></script>
+ <script src="app/route/home/home.js"></script>
+ <script src="app/route/log/log.controller.js"></script>
+ <script src="app/route/log/log.js"></script>
+ <script src="app/route/workspace/workspace.controller.js"></script>
+ <script src="app/route/workspace/workspace.js"></script>
<script src="app/route/workspacePage/workspacePage.controller.js"></script>
<script src="app/route/workspacePage/workspacePage.js"></script>
+ <script src="app/service/commandModal/commandModal.controller.js"></script>
+ <script src="app/service/commandModal/commandModal.service.js"></script>
<script src="app/service/createDirModal/createDirModal.controller.js"></script>
<script src="app/service/createDirModal/createDirModal.service.js"></script>
<script src="app/service/createFileModal/createFileModal.controller.js"></script>
--- /dev/null
+'use strict';
+
+var express = require('express');
+var controller = require('./workspaces.controller');
+
+var router = express.Router();
+
+router.post('/:name', controller.create);
+router.get('/:name', controller.read);
+router.put('/:name', controller.update);
+router.get('/delete/:name/:file', controller.delete)
+
+module.exports = router;
--- /dev/null
+'use strict';
+
+var _ = require('lodash');
+var fs = require('fs');
+
+exports.create = function (req, res) {
+ var options = setOptions(req.params.name);
+ var uploader = require('blueimp-file-upload-expressjs')(options);
+ uploader.post(req, res, function (obj) {
+ res.send(JSON.stringify(obj));
+ });
+};
+
+exports.read = function (req, res) {
+ var path = "./server/workspace/" + req.params.name + "/files/";
+ fs.readdir(path ,function(err, files){
+ var filesinfo = files.map(function(file) {
+ return cutStat(file, fs.statSync(path+file));
+ });
+ res.send(filesinfo);
+ });
+};
+
+exports.update = function (req, res) {
+ res.send('updated');
+};
+exports.delete = function (req, res) {
+ fs.unlinkSync("./server/workspace/" + req.params.name + "/files/" + req.params.file);
+ res.send('succeeded');
+};
+
+function setOptions(name) {
+ var options = {
+ tmpDir : "./server/workspace/" + name + "/tmp",
+ uploadDir : "./server/workspace/" + name + "/files",
+ uploadUrl : "./server/workspace/" + name + "/files/",
+ strage : {
+ type : 'local'
+ }
+ }
+ return options;
+};
+
+function cutStat(name, stat) {
+ var cutStat = {
+ name : name,
+ size : stat.size,
+ atime: stat.atime
+ };
+ return cutStat;
+}
+
// Insert routes below
app.use('/api/upload', require('./api/upload'));
app.use('/api/workspace', require('./api/workspace'));
+
+ //app.use('/api/allworkspaces', require('./api/allworkspaces'));
+ app.use('/api/workspaces', require('./api/workspaces'));
+
app.use('/api/option', require('./api/option'));
app.use('/api/tagList', require('./api/tagList'));
app.use('/api/commandList', require('./api/commandList'));