export class CommandController {
- public static $inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ public static $inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
// From parent directive bindToController property
private index: string;
private $scope: ng.IScope,
private MyModal: services.MyModal,
private WebSocket: services.WebSocket,
- private $window: ng.IWindowService
+ private $window: ng.IWindowService,
+ private $rootScope: ng.IRootScopeService
) {
- var controller = this;
-
- // Get OptionControlFile and bind it to $scope.options
- this.APIEndPoint
- //.getOptionControlFile('mrcImageNoiseAdd')
- .getOptionControlFile(this.name)
- .$promise
- .then(function(result) {
- controller.options = result.info;
- });
-
- this.APIEndPoint
- .getDirectories()
- .$promise
- .then(function(result) {
- controller.dirs = result.info;
- });
-
- this.heading = "[" + this.index + "]: dcdFilePrint";
- this.isOpen = true;
-
- // When call add button at executeController, all accordion close.
- this.$scope.$on('close', () => {
- controller.isOpen = false;
- });
-
- this.WebSocket.on('console', function(msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if(messages[0].substr(0,6) === 'Usage:') {
- controller.messages = msg.split('\n');
- }
- });
-
- }
-
- public submit() {
- var opt = [];
- angular.forEach(this.options, (option) => {
-
- var obj = {
- name: option.option,
- arguments: []
- };
-
- angular.forEach(option.arg, (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
- };
-
- //console.log(JSON.stringify(execObj,null,'\t'));
- this.APIEndPoint
- .execute(JSON.stringify(execObj))
- .then((result) => {
- console.log(result);
- })
- }
-
- public removeMySelf(index:number) {
- this.remove()(index,this.list);
- }
-
- 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);
- }
- });
- }
-
- public debug() {
- var div = angular.element(this.$window.document).find("div");
- var consoleTag;
- var parametersTag;
- angular.forEach(div,function(v) {
- if(v.className === "panel-body console") {
- consoleTag = v;
- } else if(v.className === "row parameters-console") {
- parametersTag = v;
- }
- });
-
- // Adjust console area from CSS styling positoning information
- var consoleHeight = parseInt(parametersTag.clientHeight.toString().replace('px','')) - 150 + 'px';
- var consoleWidth = parseInt(parametersTag.clientWidth.toString().replace('px','')) / 3 * 2 - 150 + 'px';
- consoleTag.style.height = consoleHeight;
- consoleTag.style.width = consoleWidth;
- }
-
- public help() {
- this.APIEndPoint
- .help(this.name)
- .then((result) => {
- console.log(result);
- });
- }
+ var controller = this;
+
+ // Get OptionControlFile and bind it to $scope.options
+ this.APIEndPoint
+ //.getOptionControlFile('mrcImageNoiseAdd')
+ .getOptionControlFile(this.name)
+ .$promise
+ .then(function(result) {
+ controller.options = result.info;
+ });
+
+ this.APIEndPoint
+ .getDirectories()
+ .$promise
+ .then(function(result) {
+ controller.dirs = result.info;
+ });
+
+ this.heading = "[" + this.index + "]: dcdFilePrint";
+ this.isOpen = true;
+
+ // When call add button at executeController, all accordion close.
+ this.$scope.$on('close', () => {
+ controller.isOpen = false;
+ });
+
+ /** Add EventHandler
+ * ここではCommandディレクティブが受け取る可能性のあるイベントを登録する。
+ * 例えば、コマンドのヘルプやEosコマンドの実行時のCLIの出力はWebSocketサービスで受け取るので、
+ WebSocketサービスからこのCommandディレクティブに対してemitされたメッセージをこのイベントハンドラで受け取る。
+
+ イベントネームは生成されたCommandディレクティブにユニークなidをディレクティブが生成されるたびに生成し、
+ Commandディレクティブが削除されるたびにそのイベントハンドラを破棄することとする。
+ */
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
+ }
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+
+ var uuid = guid();
+
+ /*
+ this.WebSocket.add(uuid);
+ this.$rootScope.on(uuid, function(msg) {
+ console.log(msg);
+ /*
+ var messages = msg.split('\n');
+ if(messages[0].substr(0,6) === 'Usage:') {
+ controller.messages = msg.split('\n');
+ }
+ });
+ */
+ }
+
+ public submit() {
+ var opt = [];
+ angular.forEach(this.options, (option) => {
+
+ var obj = {
+ name: option.option,
+ arguments: []
+ };
+
+ angular.forEach(option.arg, (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
+ };
+
+ //console.log(JSON.stringify(execObj,null,'\t'));
+ this.APIEndPoint
+ .execute(JSON.stringify(execObj))
+ .then((result) => {
+ console.log(result);
+ })
+ }
+
+ public removeMySelf(index:number) {
+ this.$scope.$destroy();
+ this.remove()(index,this.list);
+ }
+
+ 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);
+ }
+ });
+ }
+
+ public debug() {
+ console.log(this.$rootScope);
+
+ /* Create console area
+ *
+ */
+
+ var div = angular.element(this.$window.document).find("div");
+ var consoleTag;
+ var parametersTag;
+ angular.forEach(div,function(v) {
+ if(v.className === "panel-body console") {
+ consoleTag = v;
+ } else if(v.className === "row parameters-console") {
+ parametersTag = v;
+ }
+ });
+
+ // Adjust console area from CSS styling positoning information
+ var consoleHeight = parseInt(parametersTag.clientHeight.toString().replace('px','')) - 150 + 'px';
+ var consoleWidth = parseInt(parametersTag.clientWidth.toString().replace('px','')) / 3 * 2 - 150 + 'px';
+ consoleTag.style.height = consoleHeight;
+ consoleTag.style.width = consoleWidth;
+ /* Create console area
+ *
+ */
+ }
+
+ public help() {
+ this.APIEndPoint
+ .help(this.name)
+ .then((result) => {
+ console.log(result);
+ });
+ }
}
}
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;
})();
directives.Command = Command;
var CommandController = (function () {
- function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window) {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope) {
this.APIEndPoint = APIEndPoint;
this.$scope = $scope;
this.MyModal = MyModal;
this.WebSocket = WebSocket;
this.$window = $window;
+ this.$rootScope = $rootScope;
var controller = this;
this.APIEndPoint
.getOptionControlFile(this.name)
this.$scope.$on('close', function () {
controller.isOpen = false;
});
- this.WebSocket.on('console', function (msg) {
- console.log(msg);
- var messages = msg.split('\n');
- if (messages[0].substr(0, 6) === 'Usage:') {
- controller.messages = msg.split('\n');
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
}
- });
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ var uuid = guid();
}
CommandController.prototype.submit = function () {
var opt = [];
});
};
CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
this.remove()(index, this.list);
};
CommandController.prototype.reloadFiles = function () {
});
};
CommandController.prototype.debug = function () {
+ console.log(this.$rootScope);
var div = angular.element(this.$window.document).find("div");
var consoleTag;
var parametersTag;
console.log(result);
});
};
- CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window'];
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope'];
return CommandController;
})();
directives.CommandController = CommandController;