summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Brandys <Szymon.Brandys@pl.ibm.com>2014-07-28 17:43:17 +0200
committerSzymon Brandys <Szymon.Brandys@pl.ibm.com>2014-07-28 17:44:42 +0200
commit5a38a6e2bcb749097ab5f3a4ec6c143bbfb2dfb6 (patch)
tree0f22a4004135c2daabdfe10195ddfbefd1b7c714
parent85c95e23c510db98014b5f0a6a11b700e7da669d (diff)
downloadorg.eclipse.orion.client-origin/stable_20140728.zip
org.eclipse.orion.client-origin/stable_20140728.tar.gz
org.eclipse.orion.client-origin/stable_20140728.tar.bz2
Bug 440541 - Add 'Map' and 'Unmap' actions to CF App UIorigin/stable_20140728
-rw-r--r--bundles/org.eclipse.orion.client.cf/web/cfui/apps.js16
-rw-r--r--bundles/org.eclipse.orion.client.cf/web/cfui/cfCommands.js25
2 files changed, 25 insertions, 16 deletions
diff --git a/bundles/org.eclipse.orion.client.cf/web/cfui/apps.js b/bundles/org.eclipse.orion.client.cf/web/cfui/apps.js
index 02ed2ee..9c85f6f 100644
--- a/bundles/org.eclipse.orion.client.cf/web/cfui/apps.js
+++ b/bundles/org.eclipse.orion.client.cf/web/cfui/apps.js
@@ -84,8 +84,10 @@ mBootstrap.startup().then(function(core) {
function displayOrgsAndSpaces(){
+ lib.empty(orgsNode);
+
progressService.showWhile(mCfUtil.getTarget(preferences), "Checking for Cloud Foundry settings").then(function(target){
- progressService.showWhile(cFService.getOrgs(target), "Listing organizations").then(function(result){
+ progressService.showWhile(cFService.getOrgs(target), "Loading ...").then(function(result){
var table = document.createElement("table");
table.className = "centerTable";
@@ -180,8 +182,8 @@ mBootstrap.startup().then(function(core) {
explorerParent.id = "applicationsSectionParent";
var explorer = new mCfExplorer.ApplicationsExplorer(serviceRegistry, selection, commandRegistry, explorerParent);
- mCfCommands.createCfCommands(serviceRegistry, commandRegistry, explorer);
- mCfCommands.createRoutesCommands(serviceRegistry, commandRegistry, explorer);
+ mCfCommands.createCfCommands(serviceRegistry, commandRegistry, explorer, displayOrgsAndSpaces);
+ mCfCommands.createRoutesCommands(serviceRegistry, commandRegistry, explorer, displayOrgsAndSpaces);
function displayApplications(target){
@@ -210,7 +212,7 @@ mBootstrap.startup().then(function(core) {
}
});
- progressService.showWhile(cFService.getApps(target), "Listing applications").then(function(apps){
+ progressService.showWhile(cFService.getApps(target), "Loading ...").then(function(apps){
explorer.destroyListeters();
applicationsSection.embedExplorer(explorer);
@@ -218,7 +220,7 @@ mBootstrap.startup().then(function(core) {
explorer.addListeters(cfEventDispatcher);
- progressService.showWhile(cFService.getRoutes(target), "Loading routes").then(function(routes){
+ progressService.showWhile(cFService.getRoutes(target), "Loading ...").then(function(routes){
displayOrphanRoutes(routes, apps, target);
@@ -234,7 +236,7 @@ mBootstrap.startup().then(function(core) {
var routesSelection = new mSelection.Selection(serviceRegistry, "orion.Routes.selection");
var routesExplorer = new mCfExplorer.OrphanRoutesExplorer(serviceRegistry, routesSelection, commandRegistry, routesParent);
- mCfCommands.createRoutesCommands(serviceRegistry, commandRegistry, routesExplorer);
+ mCfCommands.createRoutesCommands(serviceRegistry, commandRegistry, routesExplorer, displayOrgsAndSpaces);
function displayOrphanRoutes(routes, apps, target){
@@ -242,7 +244,7 @@ mBootstrap.startup().then(function(core) {
var orphanRoutesSection = new mSection.Section(orphanRoutesNode, {
id: "orphanRoutes", //$NON-NLS-0$
- title: "Orphan Routes",
+ title: "Unmapped Routes",
slideout: true,
canHide: false,
preferenceService: preferences,
diff --git a/bundles/org.eclipse.orion.client.cf/web/cfui/cfCommands.js b/bundles/org.eclipse.orion.client.cf/web/cfui/cfCommands.js
index 9db39c2..129dbee 100644
--- a/bundles/org.eclipse.orion.client.cf/web/cfui/cfCommands.js
+++ b/bundles/org.eclipse.orion.client.cf/web/cfui/cfCommands.js
@@ -59,7 +59,7 @@ define(['orion/Deferred', 'orion/commands', 'orion/commandRegistry', 'orion/Even
commandService.addCommand(stopAppCommand);
},
- createRoutesCommands: function(serviceRegistry, commandService, explorer){
+ createRoutesCommands: function(serviceRegistry, commandService, explorer, refreshFunc){
var progressService = serviceRegistry.getService("orion.page.progress");
var cfClient = serviceRegistry.getService("orion.cf.service");
@@ -109,7 +109,7 @@ define(['orion/Deferred', 'orion/commands', 'orion/commandRegistry', 'orion/Even
progressService.showWhile(cfClient.deleteOrphanedRoutes(target),
"Deleteing all unmapped routes...").then(
function(jazzResp) {
- explorer.changedItem();
+ refreshFunc();
}, function (error) {
exports.handleError(error, progressService);
}
@@ -207,9 +207,12 @@ define(['orion/Deferred', 'orion/commands', 'orion/commandRegistry', 'orion/Even
progressService.showWhile(cfClient.mapRoute(target, app.guid,
route.Guid), "Mapping route to an app ...").then(
function(jazzResp) {
- if(sharedEventDispatcher){
- sharedEventDispatcher.dispatchEvent({type: "delete", oldValue: route });
- }
+ refreshFunc();
+// if(sharedEventDispatcher){
+// var appRoutes = app.routes;
+// app.routes.push(route);
+// sharedEventDispatcher.dispatchEvent({type: "update", newValue: app });
+// }
}, function (error) {
exports.handleError(error, progressService);
}
@@ -244,10 +247,14 @@ define(['orion/Deferred', 'orion/commands', 'orion/commandRegistry', 'orion/Even
progressService.showWhile(cfClient.unmapRoute(target, app.guid,
route.guid), "Removing route from an app ...").then(
- function(jazzResp) {
- if(sharedEventDispatcher){
- sharedEventDispatcher.dispatchEvent({type: "create", newValue: route });
- }
+ function(resp) {
+ refreshFunc();
+// if(sharedEventDispatcher){
+// var appRoutes = app.routes;
+// app.routes = [];
+//
+// sharedEventDispatcher.dispatchEvent({type: "update", newValue: app });
+// }
}, function (error) {
exports.handleError(error, progressService);
}