Commit 705a7429 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Resolving error message on EE details page if EE URL it is not found

parent 5c31dce5
...@@ -53,7 +53,7 @@ public class ChoreographyEEResourcesPanel extends Panel { ...@@ -53,7 +53,7 @@ public class ChoreographyEEResourcesPanel extends Panel {
private final PageReference pageRef; private final PageReference pageRef;
private final WebMarkupContainer content; private WebMarkupContainer content;
private final BaseModal<Serializable> utilityModal = new BaseModal<>("resizeEEModal"); private final BaseModal<Serializable> utilityModal = new BaseModal<>("resizeEEModal");
...@@ -71,14 +71,41 @@ public class ChoreographyEEResourcesPanel extends Panel { ...@@ -71,14 +71,41 @@ public class ChoreographyEEResourcesPanel extends Panel {
this.pageRef = pageRef; this.pageRef = pageRef;
this.content = new WebMarkupContainer("eeDetails"); this.content = new WebMarkupContainer("eeDetails");
content.add(buildResorucesOverviewPanel()); WebMarkupContainer message;
content.add(new ChoreographyVMDirectoryPanel(
"virtualMachinesList", pageRef, enactmentEngine.getKey(), choreography.getKey())); try {
content.add(buildActionsPanel()); content.add(buildResorucesOverviewPanel());
content.setOutputMarkupId(true); content.add(new ChoreographyVMDirectoryPanel(
"virtualMachinesList", pageRef, enactmentEngine.getKey(), choreography.getKey()));
content.add(buildActionsPanel());
content.setOutputMarkupId(true);
message = new WebMarkupContainer("message") {
private static final long serialVersionUID = 9169935715713553356L;
@Override
public boolean isVisible() {
return false;
}
};
} catch (RuntimeException e) {
this.content = new WebMarkupContainer("eeDetails") {
private static final long serialVersionUID = 9169935715713553356L;
@Override
public boolean isVisible() {
return false;
}
};
this.content.setVisible(true);
message = new WebMarkupContainer("message");
}
add(new Label("eeName", enactmentEngine.getName())); add(new Label("eeName", enactmentEngine.getName()));
add(content); add(content);
add(message);
add(utilityModal); add(utilityModal);
setOutputMarkupId(true); setOutputMarkupId(true);
} }
......
...@@ -26,6 +26,9 @@ limitations under the License. ...@@ -26,6 +26,9 @@ limitations under the License.
<h3><wicket:message key="virtualMachines"/></h3> <h3><wicket:message key="virtualMachines"/></h3>
<div wicket:id="virtualMachinesList"/> <div wicket:id="virtualMachinesList"/>
</div> </div>
<div wicket:id="message">
<label><wicket:message key="not_available"/></label>
</div>
<div wicket:id="resizeEEModal"/> <div wicket:id="resizeEEModal"/>
</wicket:panel> </wicket:panel>
</html> </html>
...@@ -16,3 +16,4 @@ ...@@ -16,3 +16,4 @@
enactmentEngine=Enactment Engine enactmentEngine=Enactment Engine
virtualMachines=Virtual Machines virtualMachines=Virtual Machines
actions=Actions actions=Actions
not_available=Resources info not available for the EE currently associated to this choreography
...@@ -16,3 +16,4 @@ ...@@ -16,3 +16,4 @@
enactmentEngine=Enactment Engine enactmentEngine=Enactment Engine
virtualMachines=Macchine Virtuali virtualMachines=Macchine Virtuali
actions=Azioni actions=Azioni
not_available=Le informazioni sulle risorse dell'Enacment Engine associato a questa coreografia non sono disponibili
...@@ -16,3 +16,4 @@ ...@@ -16,3 +16,4 @@
enactmentEngine=Enactment Engine enactmentEngine=Enactment Engine
virtualMachines=M\u00e1quinas virtuais virtualMachines=M\u00e1quinas virtuais
actions=Actions actions=Actions
not_available=Informa\u00e7\u00f5es sobre recursos do Motor dell'Enacment associados a este coreografia n\u00e3o est\u00e3o dispon\u00edveis
...@@ -47,8 +47,6 @@ public class EnactmentEngineDetailPage extends BaseExtPage { ...@@ -47,8 +47,6 @@ public class EnactmentEngineDetailPage extends BaseExtPage {
EnactmentEngineRestClient enactmentEngineRestClient = new EnactmentEngineRestClient(); EnactmentEngineRestClient enactmentEngineRestClient = new EnactmentEngineRestClient();
EnactmentEngineStatusTO ee = enactmentEngineRestClient.getEEStatus(enactmentEngineKey);
// Set page title // Set page title
body.add(new Label("header", getString("ee") + " " + enactmentEngine.getName())); body.add(new Label("header", getString("ee") + " " + enactmentEngine.getName()));
...@@ -56,30 +54,55 @@ public class EnactmentEngineDetailPage extends BaseExtPage { ...@@ -56,30 +54,55 @@ public class EnactmentEngineDetailPage extends BaseExtPage {
body.add(BookmarkablePageLinkBuilder.build("enactmentEnginesBr", EnactmentEnginePage.class)); body.add(BookmarkablePageLinkBuilder.build("enactmentEnginesBr", EnactmentEnginePage.class));
body.add(new Label("enactmentEngineName", enactmentEngine.getName())); body.add(new Label("enactmentEngineName", enactmentEngine.getName()));
WebMarkupContainer content = new WebMarkupContainer("content"); try {
content.add(new Label("enactmentEngineDetailsPageContent", "PAGE CONTENT"));
content.setOutputMarkupId(true); EnactmentEngineStatusTO ee = enactmentEngineRestClient.getEEStatus(enactmentEngineKey);
double ramPercentage = (ee.getRamUsage() / Float.valueOf(ee.getRamTotal())) * 100; WebMarkupContainer content = new WebMarkupContainer("content");
double storagePercentage = (ee.getStorageUsage() / Float.valueOf(ee.getStorageTotal())) * 100; content.add(new Label("enactmentEngineDetailsPageContent", "PAGE CONTENT"));
content.setOutputMarkupId(true);
RepeatingView resourcesOverview = new RepeatingView("resourceWidget");
resourcesOverview.add(new ResourceWidget( double ramPercentage = (ee.getRamUsage() / Float.valueOf(ee.getRamTotal())) * 100;
resourcesOverview.newChildId(), double storagePercentage = (ee.getStorageUsage() / Float.valueOf(ee.getStorageTotal())) * 100;
"bg-yellow", ee.getVirtualMachinesCount(), "Virtual Machines", "fa fa-cube"));
resourcesOverview.add(new ResourceWidget( RepeatingView resourcesOverview = new RepeatingView("resourceWidget");
resourcesOverview.newChildId(), "bg-red", "CPU utilization", ee.getCpuUsageRatio(), "fa fa-cogs")); resourcesOverview.add(new ResourceWidget(
resourcesOverview.add(new ResourceWidget(resourcesOverview.newChildId(), "bg-green", resourcesOverview.newChildId(),
ee.getRamUsage(), ee.getRamTotal(), "RAM utilization", ramPercentage, "MB", "")); "bg-yellow", ee.getVirtualMachinesCount(), "Virtual Machines", "fa fa-cube"));
resourcesOverview.add(new ResourceWidget( resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(), "bg-aqua", ee.getStorageUsage(), ee.getStorageTotal(), resourcesOverview.newChildId(), "bg-red", "CPU utilization", ee.getCpuUsageRatio(), "fa fa-cogs"));
"Storage occupancy", storagePercentage, "GB", "fa fa-database")); resourcesOverview.add(new ResourceWidget(resourcesOverview.newChildId(), "bg-green",
content.add(resourcesOverview); ee.getRamUsage(), ee.getRamTotal(), "RAM utilization", ramPercentage, "MB", ""));
resourcesOverview.add(new ResourceWidget(
content.add(new EEVMDirectoryPanel("virtualMachinesList", getPageReference(), enactmentEngineKey)); resourcesOverview.newChildId(), "bg-aqua", ee.getStorageUsage(), ee.getStorageTotal(),
"Storage occupancy", storagePercentage, "GB", "fa fa-database"));
content.add(resourcesOverview);
content.add(new EEVMDirectoryPanel("virtualMachinesList", getPageReference(), enactmentEngineKey));
body.add(content);
body.add(new WebMarkupContainer("message") {
private static final long serialVersionUID = 9169935715713553356L;
@Override
public boolean isVisible() {
return false;
}
});
} catch (RuntimeException e) {
body.add(new WebMarkupContainer("message"));
body.add(new WebMarkupContainer("content") {
private static final long serialVersionUID = 9169935715713553356L;
@Override
public boolean isVisible() {
return false;
}
});
}
// Re-enable when entilements for this service will be defined // Re-enable when entilements for this service will be defined
//MetaDataRoleAuthorizationStrategy.authorize(content, ENABLE, CamelEntitlement.ROUTE_LIST); //MetaDataRoleAuthorizationStrategy.authorize(content, ENABLE, CamelEntitlement.ROUTE_LIST);
body.add(content);
} }
} }
...@@ -34,14 +34,17 @@ limitations under the License. ...@@ -34,14 +34,17 @@ limitations under the License.
</ol> </ol>
</section> </section>
<section class="content" wicket:id="content"> <section class="content">
<div class="box box-body"> <div class="box box-body" wicket:id="content">
<div class="row"> <div class="row">
<span wicket:id="resourceWidget"/> <span wicket:id="resourceWidget"/>
</div> </div>
<h3><wicket:message key="virtualMachines"/></h3> <h3><wicket:message key="virtualMachines"/></h3>
<div wicket:id="virtualMachinesList"/> <div wicket:id="virtualMachinesList"/>
</div> </div>
<div class="box box-body" wicket:id="message">
<label><wicket:message key="not_available"/></label>
</div>
</section> </section>
</wicket:extend> </wicket:extend>
</html> </html>
\ No newline at end of file
...@@ -16,3 +16,4 @@ ...@@ -16,3 +16,4 @@
ee=Enactment Engine ee=Enactment Engine
enactmentEngines=Enactment Engines enactmentEngines=Enactment Engines
virtualMachines=Virtual Machines virtualMachines=Virtual Machines
not_available=Informations not available for this EE
...@@ -16,3 +16,4 @@ ...@@ -16,3 +16,4 @@
ee=Enactment Engine ee=Enactment Engine
enactmentEngines=Enactment Engines enactmentEngines=Enactment Engines
virtualMachines=Macchine Virtuali virtualMachines=Macchine Virtuali
not_available=Informazioni non disponibili per questo EE
...@@ -16,3 +16,4 @@ ...@@ -16,3 +16,4 @@
ee=Enactment Engine ee=Enactment Engine
enactmentEngines=Enactment Engines enactmentEngines=Enactment Engines
virtualMachines=M\u00e1quinas virtuais virtualMachines=M\u00e1quinas virtuais
not_available=Informa\u00e7\u00f5es n\u00e3o dispon\u00edveis para esto EE
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment