Commit 8f1ed83f authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Added skeleton for EE resources tab and refactoring

parent 938cfe7e
......@@ -29,7 +29,7 @@ import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.AVGOperationDirectoryPanel;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
import org.apache.syncope.client.console.widgets.LabeledDoughnutChartData;
import org.apache.wicket.markup.html.WebMarkupContainer;
......
......@@ -31,7 +31,7 @@ import org.apache.syncope.client.console.panels.AVGCDDirectoryPanel;
import org.apache.syncope.client.console.panels.AVGServiceDirectoryPanel;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
import org.apache.syncope.client.console.widgets.LabeledDoughnutChartData;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
......
......@@ -27,7 +27,7 @@ import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.AVGOperationDirectoryPanel;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
......
......@@ -30,7 +30,7 @@ import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.panels.OperationDirectoryPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
import org.apache.syncope.client.console.widgets.LabeledDoughnutChartData;
import org.apache.wicket.markup.html.WebMarkupContainer;
......
......@@ -22,6 +22,7 @@ import java.util.List;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.ChoreographyOverviewPanel;
import org.apache.syncope.client.console.panels.ChoreographyServiceDirectoryPanel;
import org.apache.syncope.client.console.panels.EEResourcesPanel;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.syncope.client.console.panels.InstancesOverviewPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
......@@ -81,6 +82,13 @@ public class ChoreographyDetailPage extends BaseExtPage {
}
});
tabs.add(new AbstractTab(new ResourceModel("eeResources")) {
@Override
public WebMarkupContainer getPanel(final String panelId) {
return new EEResourcesPanel(panelId, choreography);
}
});
tabs.add(new AbstractTab(new ResourceModel("instances")) {
@Override
public WebMarkupContainer getPanel(final String panelId) {
......
......@@ -32,7 +32,7 @@ import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.panels.ChoreographyActionsPanel;
import org.apache.syncope.client.console.panels.InstanceServiceDirectoryPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
import org.apache.syncope.client.console.widgets.LabeledDoughnutChartData;
import org.apache.wicket.ajax.AjaxRequestTarget;
......
......@@ -27,7 +27,7 @@ import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.panels.OperationDirectoryPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
......
......@@ -135,3 +135,38 @@ public class ChoreographyServiceDirectoryPanel extends DirectoryPanel<
}
}
}
// New panel which lists all services defined for a choreography
/*public class ChoreographyServiceDirectoryPanel extends AnyObjectDirectoryPanel {
private static final long serialVersionUID = 7303610381539502741L;
public ChoreographyServiceDirectoryPanel(final String id,
final PageReference pageRef,
final String choreographyId) {
super(id, new Builder(AnyTypeKind.ANY_OBJECT.name(), pageRef), false);
this.fiql = new AnyObjectFiqlSearchConditionBuilder("SERVICE").inGroups(choreographyId).query();
dataProvider.setFIQL(fiql);
}
@Override
protected String paginatorRowsKey() {
return ChoreographyPage.PREF_CHOREOGRAPHY_PAGINATOR_ROWS;
}
@Override
protected List<IColumn<AnyObjectTO, String>> getColumns() {
return super.getColumns();
}
public static class Builder extends AnyObjectDirectoryPanel.Builder {
private static final long serialVersionUID = 1903764789236792302L;
public Builder(final String type, final PageReference pageRef) {
super(new ArrayList<>(), type, pageRef);
setFiltered(true);
setShowResultPage(true);
}
}
}*/
/*
* Copyright 2016 The CHOReVOLUTION project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.syncope.client.console.panels;
import eu.chorevolution.idm.common.to.ChoreographyTO;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widgets.ResourceWidget;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.RepeatingView;
public class EEResourcesPanel extends Panel {
private final ChoreographyRestClient restClient;
private final AnyObjectTO enactmentEngine;
public EEResourcesPanel(final String id, final ChoreographyTO choreography) {
super(id);
this.restClient = new ChoreographyRestClient();
enactmentEngine = restClient.getChoreographyEE(choreography.getId());
add(new Label("eeName", getString("enactmentEngine") + " " + enactmentEngine.getName()));
RepeatingView resourcesOverview = new RepeatingView("resourceWidget");
resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(), "bg-yellow", 2, "Virtual Machines", "glyphicons glyphicons-server"));
resourcesOverview.add(new ResourceWidget(resourcesOverview.newChildId(), "bg-red", 8, "CPU", "fa fa-cloud"));
resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(), "bg-green", 4096, "RAM", "MB", "fa fa-cloud"));
resourcesOverview.add(new ResourceWidget(
resourcesOverview.newChildId(), "bg-aqua", 8, "Storage", "fa fa-database"));
add(resourcesOverview);
add(new EmptyPanel("virtualMachinesList"));
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.console.widgets;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
public class ResourceWidget extends BaseWidget {
private static final long serialVersionUID = -816175678514035085L;
public ResourceWidget(
final String id,
final String bg,
final int number,
final String label,
final String unit,
final String icon) {
super(id);
setOutputMarkupId(true);
WebMarkupContainer box = new WebMarkupContainer("box");
box.add(new AttributeAppender("class", " " + bg));
add(box);
box.add(new Label("number", number));
box.add(new Label("label", label));
box.add(new Label("unit", unit));
Label iconLabel = new Label("icon");
iconLabel.add(new AttributeAppender("class", icon));
box.add(iconLabel);
}
public ResourceWidget(
final String id,
final String bg,
final int number,
final String label,
final String icon) {
this(id, bg, number, label, "", icon);
}
}
......@@ -13,9 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.syncope.client.console.widget;
import org.apache.syncope.client.console.widgets.BaseWidget;
package org.apache.syncope.client.console.widgets;
public abstract class StatsWidget extends BaseWidget {
......
......@@ -20,3 +20,4 @@ choreography=Choreography
choreographies=Choreographies
overview=Overview
services=Services
eeResources=EE Resources
......@@ -20,3 +20,4 @@ choreography=Coreografia
choreographies=Coreografie
overview=Panoramica
services=Servizi
eeResources=EE Resources
......@@ -20,3 +20,4 @@ choreography=Coreografia
choreographies=Coreografias
overview=Visao geral
services=Servi\u00e7os
eeResources=EE Resources
<!DOCTYPE html>
<!--
Copyright 2016 The CHOReVOLUTION project.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<h3><span wicket:id="eeName"/></h3>
<div class="row">
<span wicket:id="resourceWidget"/>
</div>
<div wicket:id="virtualMachinesList"/>
</wicket:panel>
</html>
#
# Copyright 2016 The CHOReVOLUTION project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
enactmentEngine=Enactment Engine
#
# Copyright 2016 The CHOReVOLUTION project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
enactmentEngine=Enactment Engine
#
# Copyright 2016 The CHOReVOLUTION project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
enactmentEngine=Enactment Engine
<!DOCTYPE html>
<!--
Copyright 2016 The CHOReVOLUTION project.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="col-lg-3 col-xs-6">
<div wicket:id="box" class="small-box">
<div class="inner">
<h3><span wicket:id="number"/><span wicket:id="unit"/></h3>
<p><span wicket:id="label"/></p>
</div>
<div class="icon" style="cursor: pointer;">
<i wicket:id="icon"></i>
</div>
</div>
</div>
</wicket:panel>
</html>
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