diff options
author | Mark Macdonald <mamacdon@gmail.com> | 2014-08-07 17:55:25 -0400 |
---|---|---|
committer | Mark Macdonald <mamacdon@gmail.com> | 2014-08-07 18:05:09 -0400 |
commit | 67eefabebda13ebf4ae73675847919ff18b3a78c (patch) | |
tree | a5d05fbda8c4f33ca3f68b2836b00a941d8cccde | |
parent | 2a3d3cc7739c364d14d5efa34611240677a0f468 (diff) | |
download | org.eclipse.orion.client-origin/launcher_cfo.zip org.eclipse.orion.client-origin/launcher_cfo.tar.gz org.eclipse.orion.client-origin/launcher_cfo.tar.bz2 |
FIXME add 'cfo debug remove', 'cfo debug ?'origin/launcher_cfo
-rw-r--r-- | bundles/org.eclipse.orion.client.cf/web/cfui/plugins/cFPlugin.js | 45 |
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) { |