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 {
private final PageReference pageRef;
private final WebMarkupContainer content;
private WebMarkupContainer content;
private final BaseModal<Serializable> utilityModal = new BaseModal<>("resizeEEModal");
......@@ -71,14 +71,41 @@ public class ChoreographyEEResourcesPanel extends Panel {
this.pageRef = pageRef;
this.content = new WebMarkupContainer("eeDetails");
content.add(buildResorucesOverviewPanel());
content.add(new ChoreographyVMDirectoryPanel(
"virtualMachinesList", pageRef, enactmentEngine.getKey(), choreography.getKey()));
content.add(buildActionsPanel());
content.setOutputMarkupId(true);
WebMarkupContainer message;
try {
content.add(buildResorucesOverviewPanel());
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(content);
add(message);
add(utilityModal);
setOutputMarkupId(true);
}
......
......@@ -26,6 +26,9 @@ limitations under the License.
<h3><wicket:message key="virtualMachines"/></h3>
<div wicket:id="virtualMachinesList"/>
</div>
<div wicket:id="message">
<label><wicket:message key="not_available"/></label>
</div>
<div wicket:id="resizeEEModal"/>
</wicket:panel>
</html>
......@@ -16,3 +16,4 @@
enactmentEngine=Enactment Engine
virtualMachines=Virtual Machines
actions=Actions
not_available=Resources info not available for the EE currently associated to this choreography
......@@ -16,3 +16,4 @@
enactmentEngine=Enactment Engine
virtualMachines=Macchine Virtuali
actions=Azioni
not_available=Le informazioni sulle risorse dell'Enacment Engine associato a questa coreografia non sono disponibili
......@@ -16,3 +16,4 @@
enactmentEngine=Enactment Engine
virtualMachines=M\u00e1quinas virtuais
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 {
EnactmentEngineRestClient enactmentEngineRestClient = new EnactmentEngineRestClient();
EnactmentEngineStatusTO ee = enactmentEngineRestClient.getEEStatus(enactmentEngineKey);
// Set page title
body.add(new Label("header", getString("ee") + " " + enactmentEngine.getName()));
......@@ -56,30 +54,55 @@ public class EnactmentEngineDetailPage extends BaseExtPage {
body.add(BookmarkablePageLinkBuilder.build("enactmentEnginesBr", EnactmentEnginePage.class));
body.add(new Label("enactmentEngineName", enactmentEngine.getName()));
WebMarkupContainer content = new WebMarkupContainer("content");
content.add(new Label("enactmentEngineDetailsPageContent", "PAGE CONTENT"));
content.setOutputMarkupId(true);
double ramPercentage = (ee.getRamUsage() / Float.valueOf(ee.getRamTotal())) * 100;
double storagePercentage = (ee.getStorageUsage() / Float.valueOf(ee.getStorageTotal())) * 100;
RepeatingView resourcesOverview = new RepeatingView("resourceWidget");
resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(),
"bg-yellow", ee.getVirtualMachinesCount(), "Virtual Machines", "fa fa-cube"));
resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(), "bg-red", "CPU utilization", ee.getCpuUsageRatio(), "fa fa-cogs"));
resourcesOverview.add(new ResourceWidget(resourcesOverview.newChildId(), "bg-green",
ee.getRamUsage(), ee.getRamTotal(), "RAM utilization", ramPercentage, "MB", ""));
resourcesOverview.add(new ResourceWidget(
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));
try {
EnactmentEngineStatusTO ee = enactmentEngineRestClient.getEEStatus(enactmentEngineKey);
WebMarkupContainer content = new WebMarkupContainer("content");
content.add(new Label("enactmentEngineDetailsPageContent", "PAGE CONTENT"));
content.setOutputMarkupId(true);
double ramPercentage = (ee.getRamUsage() / Float.valueOf(ee.getRamTotal())) * 100;
double storagePercentage = (ee.getStorageUsage() / Float.valueOf(ee.getStorageTotal())) * 100;
RepeatingView resourcesOverview = new RepeatingView("resourceWidget");
resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(),
"bg-yellow", ee.getVirtualMachinesCount(), "Virtual Machines", "fa fa-cube"));
resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(), "bg-red", "CPU utilization", ee.getCpuUsageRatio(), "fa fa-cogs"));
resourcesOverview.add(new ResourceWidget(resourcesOverview.newChildId(), "bg-green",
ee.getRamUsage(), ee.getRamTotal(), "RAM utilization", ramPercentage, "MB", ""));
resourcesOverview.add(new ResourceWidget(
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
//MetaDataRoleAuthorizationStrategy.authorize(content, ENABLE, CamelEntitlement.ROUTE_LIST);
body.add(content);
}
}
......@@ -34,14 +34,17 @@ limitations under the License.
</ol>
</section>
<section class="content" wicket:id="content">
<div class="box box-body">
<section class="content">
<div class="box box-body" wicket:id="content">
<div class="row">
<span wicket:id="resourceWidget"/>
</div>
<h3><wicket:message key="virtualMachines"/></h3>
<div wicket:id="virtualMachinesList"/>
</div>
<div class="box box-body" wicket:id="message">
<label><wicket:message key="not_available"/></label>
</div>
</section>
</wicket:extend>
</html>
\ No newline at end of file
......@@ -16,3 +16,4 @@
ee=Enactment Engine
enactmentEngines=Enactment Engines
virtualMachines=Virtual Machines
not_available=Informations not available for this EE
......@@ -16,3 +16,4 @@
ee=Enactment Engine
enactmentEngines=Enactment Engines
virtualMachines=Macchine Virtuali
not_available=Informazioni non disponibili per questo EE
......@@ -16,3 +16,4 @@
ee=Enactment Engine
enactmentEngines=Enactment Engines
virtualMachines=M\u00e1quinas virtuais
not_available=Informa\u00e7\u00f5es n\u00e3o dispon\u00edveis para esto EE
Markdown is supported
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