summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.orion.client.cf/web/cfui/plugins/cFPlugin.js45
1 files changed, 42 insertions, 3 deletions
diff --git a/bundles/org.eclipse.orion.client.cf/web/cfui/plugins/cFPlugin.js b/bundles/org.eclipse.orion.client.cf/web/cfui/plugins/cFPlugin.js
index 2460f39..16f4223 100644
--- a/bundles/org.eclipse.orion.client.cf/web/cfui/plugins/cFPlugin.js
+++ b/bundles/org.eclipse.orion.client.cf/web/cfui/plugins/cFPlugin.js
@@ -11,8 +11,8 @@
/*eslint-env browser,amd*/
-define(['i18n!cfui/nls/messages', 'orion/xhr', 'orion/plugin', 'orion/cfui/cFClient', 'orion/serviceregistry', 'domReady!'],
- function(messages, xhr, PluginProvider, CFClient, ServiceRegistry) {
+define(['i18n!cfui/nls/messages', 'orion/Deferred', 'orion/xhr', 'orion/plugin', 'orion/cfui/cFClient', 'orion/serviceregistry', 'domReady!'],
+ function(messages, Deferred, xhr, PluginProvider, CFClient, ServiceRegistry) {
var temp = document.createElement('a');
var login = temp.href;
@@ -603,7 +603,10 @@ define(['i18n!cfui/nls/messages', 'orion/xhr', 'orion/plugin', 'orion/cfui/cFCli
}
);
- /* Debug commands */
+ /* ================================================================
+ * Debug commands
+ * ================================================================
+ */
provider.registerService(
"orion.shell.command",
{}, {
@@ -638,6 +641,42 @@ define(['i18n!cfui/nls/messages', 'orion/xhr', 'orion/plugin', 'orion/cfui/cFCli
}
);
+ /* Add cf debug remove command */
+ provider.registerService(
+ "orion.shell.command", {
+ callback: function(args, context) {
+ return cFService.removeDebug(decodeURIComponent(args.cwd)).then(function(result) {
+ if (result.App)
+ return "Debugging disabled for app " + result.Name; //whatever
+ return result;
+ });
+ }
+ }, {
+ name: "cfo debug remove",
+ description: "Remove CF debugging support from a Node.js application",
+ parameters: [],
+ }
+ );
+
+ /* Add cf debug remove command */
+ provider.registerService(
+ "orion.shell.command", {
+ callback: function(args, context) {
+ return cFService.getDebug(decodeURIComponent(args.cwd)).then(function(result) {
+ return "\u2714 Debug support has been added";
+ }, function(err) {
+ if (err && err.HttpCode === 404)
+ return "\u2716 Debug support has not been added";
+ return new Deferred().reject(err);
+ });
+ }
+ }, {
+ name: "cfo debug ?",
+ description: "Check if debugging support has been added to a Node.js application",
+ parameters: [],
+ }
+ );
+
/** Add cf map-route command **/
// var mapRouteImpl = {
// callback: function(args, context) {