log
This commit is contained in:
parent
7798189414
commit
79455741f4
23 changed files with 795 additions and 114 deletions
|
|
@ -2,22 +2,36 @@ package org.chtijbug.drools.console;
|
|||
|
||||
|
||||
import org.chtijbug.drools.console.service.util.ApplicationContextProvider;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.transport.client.PreBuiltTransportClient;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.annotation.*;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
|
||||
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
|
||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Configuration
|
||||
@SpringBootApplication
|
||||
@ComponentScan("org.chtijbug.drools.proxy.persistence")
|
||||
@ComponentScan({"org.chtijbug.drools.proxy.persistence","org.chtijbug.drools.indexer"})
|
||||
@EnableMongoRepositories("org.chtijbug.drools.proxy.persistence.repository")
|
||||
@EnableElasticsearchRepositories(basePackages = "org.chtijbug.drools.indexer.persistence.repository")
|
||||
@PropertySource("classpath:application.properties")
|
||||
@ImportResource("classpath:applicationContext.xml")
|
||||
public class DroolsSpringBootConsoleApplication extends SpringBootServletInitializer {
|
||||
|
||||
@Bean
|
||||
public ApplicationContextProvider getAppplicationContext() {
|
||||
ApplicationContextProvider applicationContextProvider = new ApplicationContextProvider();
|
||||
return applicationContextProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(DroolsSpringBootConsoleApplication.class);
|
||||
|
|
@ -27,11 +41,6 @@ public class DroolsSpringBootConsoleApplication extends SpringBootServletInitial
|
|||
SpringApplication.run(DroolsSpringBootConsoleApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ApplicationContextProvider getAppplicationContext() {
|
||||
ApplicationContextProvider applicationContextProvider = new ApplicationContextProvider();
|
||||
return applicationContextProvider;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package org.chtijbug.drools.console.service;
|
||||
|
||||
import org.chtijbug.drools.indexer.persistence.repository.BusinessTransactionActionRepository;
|
||||
import org.chtijbug.drools.indexer.persistence.repository.BusinessTransactionPersistenceRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class IndexerService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BusinessTransactionPersistenceRepository businessTransactionPersistenceRepository;
|
||||
|
||||
@Autowired
|
||||
private BusinessTransactionActionRepository businessTransactionActionRepository;
|
||||
|
||||
public BusinessTransactionPersistenceRepository getBusinessTransactionPersistenceRepository() {
|
||||
return businessTransactionPersistenceRepository;
|
||||
}
|
||||
|
||||
public void setBusinessTransactionPersistenceRepository(BusinessTransactionPersistenceRepository businessTransactionPersistenceRepository) {
|
||||
this.businessTransactionPersistenceRepository = businessTransactionPersistenceRepository;
|
||||
}
|
||||
|
||||
public BusinessTransactionActionRepository getBusinessTransactionActionRepository() {
|
||||
return businessTransactionActionRepository;
|
||||
}
|
||||
|
||||
public void setBusinessTransactionActionRepository(BusinessTransactionActionRepository businessTransactionActionRepository) {
|
||||
this.businessTransactionActionRepository = businessTransactionActionRepository;
|
||||
}
|
||||
}
|
||||
|
|
@ -42,8 +42,6 @@ public class ProjectPersistService {
|
|||
private KieServerRepositoryService kieServerRepositoryService;
|
||||
|
||||
|
||||
|
||||
|
||||
public ProjectPersistService(){
|
||||
this.config = AppContext.getApplicationContext().getBean(KieConfigurationData.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.ComponentPerso;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.dialog.Dialog;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
|
||||
@StyleSheet("css/composantperso/dialog.css")
|
||||
public class DialogPerso extends Dialog {
|
||||
|
||||
public DialogPerso(){
|
||||
HorizontalLayout bar = new HorizontalLayout();
|
||||
Button close = new Button();
|
||||
close.setIcon(VaadinIcon.CLOSE.create());
|
||||
close.addClassName("DialogClose");
|
||||
bar.addClassName("DialogBar");
|
||||
bar.add(close);
|
||||
add(bar);
|
||||
setCloseOnEsc(false);
|
||||
setCloseOnOutsideClick(false);
|
||||
|
||||
close.addClickListener(buttonClickEvent -> close());
|
||||
}
|
||||
}
|
||||
|
|
@ -27,6 +27,8 @@ public class SqueletteComposant extends VerticalLayout {
|
|||
|
||||
private MenuSecondaireRuntime menuSecondaireRuntime;
|
||||
|
||||
private MenuSecondaireLogging menuSecondaireLogging;
|
||||
|
||||
private VerticalLayout content;
|
||||
|
||||
private VerticalLayout infoPage;
|
||||
|
|
@ -69,6 +71,9 @@ public class SqueletteComposant extends VerticalLayout {
|
|||
menuSecondaireRuntime=new MenuSecondaireRuntime(this);
|
||||
tmp.add(menuSecondaireRuntime);
|
||||
|
||||
menuSecondaireLogging=new MenuSecondaireLogging(this);
|
||||
tmp.add(menuSecondaireLogging);
|
||||
|
||||
infoPage = new VerticalLayout();
|
||||
infoPage.setClassName("squelette-component-infoPage");
|
||||
content.add(infoPage);
|
||||
|
|
@ -172,6 +177,14 @@ public class SqueletteComposant extends VerticalLayout {
|
|||
this.userConnectedService = userConnectedService;
|
||||
}
|
||||
|
||||
public MenuSecondaireLogging getMenuSecondaireLogging() {
|
||||
return menuSecondaireLogging;
|
||||
}
|
||||
|
||||
public void setMenuSecondaireLogging(MenuSecondaireLogging menuSecondaireLogging) {
|
||||
this.menuSecondaireLogging = menuSecondaireLogging;
|
||||
}
|
||||
|
||||
public ConsoleDeploy getConsoleDeploy() {
|
||||
return consoleDeploy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,151 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
|
||||
import com.vaadin.flow.component.grid.Grid;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.component.textfield.TextField;
|
||||
import com.vaadin.flow.data.provider.ConfigurableFilterDataProvider;
|
||||
import com.vaadin.flow.data.provider.ListDataProvider;
|
||||
import com.vaadin.flow.data.renderer.ComponentRenderer;
|
||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||
import com.vaadin.flow.function.SerializablePredicate;
|
||||
import org.chtijbug.drools.console.service.IndexerService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.indexer.persistence.model.BusinessTransactionAction;
|
||||
import org.chtijbug.drools.indexer.persistence.model.BusinessTransactionPersistence;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
||||
|
||||
private TextField eventType;
|
||||
|
||||
private TextField positionExecution;
|
||||
|
||||
private TextField ruleName;
|
||||
|
||||
private TextField packageName;
|
||||
|
||||
|
||||
|
||||
private String strEventType ="EventType";
|
||||
|
||||
private String strPositionExecution ="Position";
|
||||
|
||||
private String strRuleName ="RuleName";
|
||||
|
||||
private String strPackageName ="Package";
|
||||
|
||||
|
||||
private ListDataProvider<BusinessTransactionAction> dataProvider;
|
||||
private ConfigurableFilterDataProvider<BusinessTransactionAction,Void,SerializablePredicate<BusinessTransactionAction>> filterDataProvider;
|
||||
|
||||
private IndexerService indexerService;
|
||||
|
||||
public GridActionLogging(String idRequest){
|
||||
|
||||
indexerService = AppContext.getApplicationContext().getBean(IndexerService.class);
|
||||
|
||||
setClassName("action-log-grid-perso");
|
||||
setSelectionMode(Grid.SelectionMode.SINGLE);
|
||||
|
||||
|
||||
addColumn(new ComponentRenderer<>(runtimePersist -> {
|
||||
|
||||
VerticalLayout verticalLayout=new VerticalLayout();
|
||||
|
||||
if(runtimePersist.getRuleExecution()!=null) {
|
||||
Label label = new Label("Starting ->" + runtimePersist.getRuleExecution().getStartDate());
|
||||
verticalLayout.add(label);
|
||||
Label label2 = new Label("Ending ->" + runtimePersist.getRuleExecution().getEndDate());
|
||||
verticalLayout.add(label2);
|
||||
}
|
||||
return verticalLayout;
|
||||
})).setHeader("Date");
|
||||
|
||||
|
||||
Grid.Column<BusinessTransactionAction> enventTypeC=addColumn(runtimePersist -> runtimePersist.getEventType());
|
||||
this.eventType =new TextField(strEventType);
|
||||
this.eventType.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
this.eventType.addValueChangeListener(e -> {
|
||||
refreshtGrid(this.eventType.getValue(), strEventType);
|
||||
});
|
||||
enventTypeC.setHeader(this.eventType);
|
||||
|
||||
Grid.Column<BusinessTransactionAction> positionC=addColumn(runtimePersist -> runtimePersist.getEventNumber())
|
||||
.setSortable(true);
|
||||
|
||||
positionExecution =new TextField(strPositionExecution);
|
||||
positionExecution.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
positionExecution.addValueChangeListener(e -> {
|
||||
refreshtGrid(positionExecution.getValue(), strPositionExecution);
|
||||
});
|
||||
positionC.setHeader(positionExecution);
|
||||
|
||||
Grid.Column<BusinessTransactionAction> ruleNameC=addColumn(runtimePersist -> runtimePersist.getRuleExecution()!=null?runtimePersist.getRuleExecution().getRuleName():"");
|
||||
ruleName =new TextField(strRuleName);
|
||||
ruleName.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
ruleName.addValueChangeListener(e -> {
|
||||
refreshtGrid(ruleName.getValue(), strRuleName);
|
||||
});
|
||||
ruleNameC.setHeader(ruleName);
|
||||
|
||||
Grid.Column<BusinessTransactionAction> versionC=addColumn(runtimePersist -> runtimePersist.getRuleExecution()!=null?runtimePersist.getRuleExecution().getPackageName():"");
|
||||
packageName =new TextField(strPackageName);
|
||||
packageName.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
packageName.addValueChangeListener(e -> {
|
||||
refreshtGrid(packageName.getValue(), strPackageName);
|
||||
});
|
||||
versionC.setHeader(packageName);
|
||||
|
||||
setDataProvider(idRequest);
|
||||
}
|
||||
private void refreshtGrid(String value,String type){
|
||||
|
||||
filterDataProvider.setFilter(filterGrid(value.toUpperCase(),type));
|
||||
getDataProvider().refreshAll();
|
||||
}
|
||||
private SerializablePredicate<BusinessTransactionAction> filterGrid(String value, String type){
|
||||
SerializablePredicate<BusinessTransactionAction> columnPredicate = null;
|
||||
if(value.equals(" ")||type.equals(" ")){
|
||||
columnPredicate = runtimePersist -> (true);
|
||||
}else {
|
||||
if (type.equals(strPositionExecution)) {
|
||||
columnPredicate = runtimePersist -> (String.valueOf(runtimePersist.getEventNumber()).equals(value));
|
||||
|
||||
} else if (type.equals(strEventType)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getEventType()!=null&&runtimePersist.getEventType().toString().toUpperCase().contains(value));
|
||||
|
||||
} else if (type.equals(strRuleName)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getRuleExecution()!=null&&runtimePersist.getRuleExecution().getRuleName()!=null&&runtimePersist.getRuleExecution().getRuleName().toUpperCase().contains(value));
|
||||
}
|
||||
else if (type.equals(strPackageName)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getRuleExecution()!=null&&runtimePersist.getRuleExecution().getPackageName()!=null&&runtimePersist.getRuleExecution().getPackageName().toUpperCase().contains(value));
|
||||
}
|
||||
}
|
||||
return columnPredicate;
|
||||
}
|
||||
|
||||
public void setDataProvider(String id){
|
||||
|
||||
List<BusinessTransactionAction> businessTransactionPersistences = indexerService.getBusinessTransactionActionRepository().findByBusinessTransactionId(id);
|
||||
|
||||
if(businessTransactionPersistences!=null) {
|
||||
dataProvider = new ListDataProvider<>(businessTransactionPersistences);
|
||||
|
||||
filterDataProvider = dataProvider.withConfigurableFilter();
|
||||
setDataProvider(filterDataProvider);
|
||||
|
||||
reinitFilter();
|
||||
|
||||
}
|
||||
}
|
||||
public void reinitFilter(){
|
||||
positionExecution.setValue("");
|
||||
ruleName.setValue("");
|
||||
eventType.setValue("");
|
||||
packageName.setValue("");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
|
||||
import com.vaadin.flow.component.grid.Grid;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.textfield.TextField;
|
||||
import com.vaadin.flow.data.provider.ConfigurableFilterDataProvider;
|
||||
import com.vaadin.flow.data.provider.ListDataProvider;
|
||||
import com.vaadin.flow.data.renderer.ComponentRenderer;
|
||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||
import com.vaadin.flow.function.SerializablePredicate;
|
||||
import org.chtijbug.drools.console.service.IndexerService;
|
||||
import org.chtijbug.drools.console.service.ProjectPersistService;
|
||||
import org.chtijbug.drools.console.service.RuntimeService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.indexer.persistence.model.BusinessTransactionPersistence;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ProjectPersist;
|
||||
import org.chtijbug.drools.proxy.persistence.model.RuntimePersist;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GridLogging extends Grid<BusinessTransactionPersistence> {
|
||||
|
||||
private TextField transactionId;
|
||||
|
||||
private TextField groupeId;
|
||||
|
||||
private TextField artefactId;
|
||||
|
||||
private TextField version;
|
||||
|
||||
private TextField containerId;
|
||||
|
||||
private TextField serverName;
|
||||
|
||||
|
||||
|
||||
private String strTransactionId ="transactiondId";
|
||||
|
||||
private String strGroupeId ="groupeId";
|
||||
|
||||
private String strArtefactId ="artefactId";
|
||||
|
||||
private String strVersion ="version";
|
||||
|
||||
private String strContainerId ="containerId";
|
||||
|
||||
private String strServerName ="serverName";
|
||||
|
||||
private ListDataProvider<BusinessTransactionPersistence> dataProvider;
|
||||
private ConfigurableFilterDataProvider<BusinessTransactionPersistence,Void,SerializablePredicate<BusinessTransactionPersistence>> filterDataProvider;
|
||||
|
||||
private IndexerService indexerService;
|
||||
|
||||
public GridLogging(){
|
||||
|
||||
indexerService = AppContext.getApplicationContext().getBean(IndexerService.class);
|
||||
|
||||
setClassName("deployment-grid-perso");
|
||||
setSelectionMode(Grid.SelectionMode.SINGLE);
|
||||
|
||||
|
||||
addColumn(new ComponentRenderer<>(runtimePersist -> {
|
||||
|
||||
Label label=new Label(runtimePersist.getHour()+":"+runtimePersist.getMinute()+":"+runtimePersist.getMillis()+" ->"+runtimePersist.getDay()+"/"+runtimePersist.getMonth()+"/"+runtimePersist.getYear());
|
||||
|
||||
return label;
|
||||
})).setHeader("Date");
|
||||
|
||||
|
||||
Grid.Column<BusinessTransactionPersistence> transactionIdC=addColumn(runtimePersist -> runtimePersist.getTransactionId());
|
||||
this.transactionId =new TextField(strTransactionId);
|
||||
this.transactionId.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
this.transactionId.addValueChangeListener(e -> {
|
||||
refreshtGrid(this.transactionId.getValue(), strTransactionId);
|
||||
});
|
||||
transactionIdC.setHeader(this.transactionId);
|
||||
|
||||
Grid.Column<BusinessTransactionPersistence> groupIdC=addColumn(runtimePersist -> runtimePersist.getGroupID());
|
||||
groupeId =new TextField(strGroupeId);
|
||||
groupeId.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
groupeId.addValueChangeListener(e -> {
|
||||
refreshtGrid(groupeId.getValue(), strGroupeId);
|
||||
});
|
||||
groupIdC.setHeader(groupeId);
|
||||
|
||||
Grid.Column<BusinessTransactionPersistence> artefactIdC=addColumn(runtimePersist -> runtimePersist.getArtefactID());
|
||||
artefactId =new TextField(strArtefactId);
|
||||
artefactId.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
artefactId.addValueChangeListener(e -> {
|
||||
refreshtGrid(artefactId.getValue(), strArtefactId);
|
||||
});
|
||||
artefactIdC.setHeader(artefactId);
|
||||
|
||||
Grid.Column<BusinessTransactionPersistence> containerIdC=addColumn(runtimePersist -> runtimePersist.getContainerId());
|
||||
containerId =new TextField(strContainerId);
|
||||
containerId.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
containerId.addValueChangeListener(e -> {
|
||||
refreshtGrid(containerId.getValue(), strContainerId);
|
||||
});
|
||||
containerIdC.setHeader(containerId);
|
||||
|
||||
Grid.Column<BusinessTransactionPersistence> versionC=addColumn(runtimePersist -> runtimePersist.getVersion());
|
||||
version =new TextField(strVersion);
|
||||
version.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
version.addValueChangeListener(e -> {
|
||||
refreshtGrid(version.getValue(), strVersion);
|
||||
});
|
||||
versionC.setHeader(version);
|
||||
|
||||
Grid.Column<BusinessTransactionPersistence> serverNameC=addColumn(runtimePersist -> runtimePersist.getServerName());
|
||||
serverName =new TextField(strServerName);
|
||||
serverName.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
serverName.addValueChangeListener(e -> {
|
||||
refreshtGrid(serverName.getValue(), strServerName);
|
||||
});
|
||||
serverNameC.setHeader(serverName);
|
||||
|
||||
setDataProvider();
|
||||
}
|
||||
private void refreshtGrid(String value,String type){
|
||||
|
||||
filterDataProvider.setFilter(filterGrid(value.toUpperCase(),type));
|
||||
getDataProvider().refreshAll();
|
||||
}
|
||||
private SerializablePredicate<BusinessTransactionPersistence> filterGrid(String value, String type){
|
||||
SerializablePredicate<BusinessTransactionPersistence> columnPredicate = null;
|
||||
if(value.equals(" ")||type.equals(" ")){
|
||||
columnPredicate = runtimePersist -> (true);
|
||||
}else {
|
||||
if (type.equals(strGroupeId)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getGroupID()!=null&&runtimePersist.getGroupID().toUpperCase().contains(value));
|
||||
|
||||
} else if (type.equals(strTransactionId)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getTransactionId()!=null&&runtimePersist.getTransactionId().toUpperCase().contains(value));
|
||||
|
||||
} else if (type.equals(strArtefactId)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getArtefactID()!=null&&runtimePersist.getArtefactID().toUpperCase().contains(value));
|
||||
}else if (type.equals(strServerName)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getServerName()!=null&&runtimePersist.getServerName().toUpperCase().contains(value));
|
||||
}else if (type.equals(strVersion)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getVersion()!=null&&runtimePersist.getVersion().toUpperCase().contains(value));
|
||||
}else if (type.equals(strContainerId)) {
|
||||
columnPredicate = runtimePersist -> (runtimePersist.getContainerId()!=null&&runtimePersist.getContainerId().toUpperCase().contains(value));
|
||||
}
|
||||
}
|
||||
return columnPredicate;
|
||||
}
|
||||
|
||||
public void setDataProvider(){
|
||||
|
||||
List<BusinessTransactionPersistence> businessTransactionPersistences = new ArrayList<>();
|
||||
indexerService.getBusinessTransactionPersistenceRepository().findAll().forEach(businessTransactionPersistences::add);
|
||||
|
||||
if(businessTransactionPersistences!=null) {
|
||||
dataProvider = new ListDataProvider<>(businessTransactionPersistences);
|
||||
|
||||
filterDataProvider = dataProvider.withConfigurableFilter();
|
||||
setDataProvider(filterDataProvider);
|
||||
|
||||
reinitFilter();
|
||||
|
||||
}
|
||||
}
|
||||
public void reinitFilter(){
|
||||
groupeId.setValue("");
|
||||
artefactId.setValue("");
|
||||
transactionId.setValue("");
|
||||
version.setValue("");
|
||||
containerId.setValue("");
|
||||
serverName.setValue("");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.leftMenu.Action;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dialog.Dialog;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AddRuntime;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.DefineProject;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.GridActionLogging;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.GridLogging;
|
||||
import org.chtijbug.drools.console.view.LoggingView;
|
||||
import org.chtijbug.drools.indexer.persistence.model.BusinessTransactionPersistence;
|
||||
|
||||
public class ActionLogging extends VerticalLayout {
|
||||
|
||||
private Button viewAction;
|
||||
|
||||
|
||||
public ActionLogging(LoggingView loggingView){
|
||||
|
||||
setClassName("leftMenu-global-action");
|
||||
|
||||
|
||||
viewAction =new Button("View Details", VaadinIcon.INFO.create());
|
||||
viewAction.setClassName("leftMenu-global-button");
|
||||
viewAction.setEnabled(false);
|
||||
|
||||
add(viewAction);
|
||||
|
||||
viewAction.addClickListener(buttonClickEvent -> {
|
||||
active(viewAction);
|
||||
|
||||
BusinessTransactionPersistence b=loggingView.getGridLogging().getSelectedItems().stream().findFirst().get();
|
||||
|
||||
if(b!=null) {
|
||||
DialogPerso dialog = new DialogPerso();
|
||||
dialog.add(new Label(b.getTransactionId()));
|
||||
dialog.add(new GridActionLogging(b.getId()));
|
||||
dialog.open();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
private boolean isActive(Button button){
|
||||
return button.getClassNames().contains("active");
|
||||
}
|
||||
private void removeActive(Button button) {
|
||||
|
||||
if(button.getClassNames().contains("active")){
|
||||
button.getClassNames().remove("active");
|
||||
}
|
||||
}
|
||||
private void active(Button button){
|
||||
removeActive(viewAction);
|
||||
button.getClassNames().add("active");
|
||||
}
|
||||
|
||||
public Button getViewAction() {
|
||||
return viewAction;
|
||||
}
|
||||
|
||||
public void setViewAction(Button viewAction) {
|
||||
this.viewAction = viewAction;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import com.vaadin.flow.component.icon.VaadinIcon;
|
|||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.service.ProjectPersistService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AssociateProjectKie;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.DefineProject;
|
||||
|
|
@ -39,7 +40,7 @@ public class DeploymentAction extends VerticalLayout {
|
|||
ProjectPersist projectPersist=deploymentView.getProjectPersistGrid().getSelectedItems().stream().findFirst().get();
|
||||
|
||||
if(projectPersist!=null) {
|
||||
Dialog dialog = new Dialog();
|
||||
DialogPerso dialog = new DialogPerso();
|
||||
dialog.add(new DefineProject(deploymentView,dialog,projectPersist));
|
||||
dialog.open();
|
||||
}
|
||||
|
|
@ -55,7 +56,7 @@ public class DeploymentAction extends VerticalLayout {
|
|||
ProjectPersist projectPersist=deploymentView.getProjectPersistGrid().getSelectedItems().stream().findFirst().get();
|
||||
|
||||
if(projectPersist!=null) {
|
||||
Dialog dialog = new Dialog();
|
||||
DialogPerso dialog = new DialogPerso();
|
||||
dialog.add(new AssociateProjectKie(deploymentView,dialog,projectPersist));
|
||||
dialog.open();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.vaadin.flow.component.button.Button;
|
|||
import com.vaadin.flow.component.dialog.Dialog;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AddRuntime;
|
||||
|
||||
|
|
@ -21,7 +22,7 @@ public class RuntimesAction extends VerticalLayout {
|
|||
addRuntime.setClassName("leftMenu-global-button");
|
||||
add(addRuntime);
|
||||
|
||||
Dialog dialog=new Dialog();
|
||||
DialogPerso dialog=new DialogPerso();
|
||||
dialog.add(new AddRuntime(dialog,squeletteComposant));
|
||||
|
||||
addRuntime.addClickListener(buttonClickEvent -> {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
|
||||
private Button hamburger;
|
||||
|
||||
private Button logging;
|
||||
|
||||
//METIER
|
||||
|
||||
private UserConnectedService userConnectedService;
|
||||
|
|
@ -83,11 +85,15 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
}else {
|
||||
removeActive(deployement);
|
||||
squeletteComposant.getMenuScondaireDeployement().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
}
|
||||
});
|
||||
|
|
@ -102,12 +108,16 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
squeletteComposant.getMenuScondaireDeployement().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(true);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
|
||||
}else {
|
||||
removeActive(assets);
|
||||
squeletteComposant.getMenuScondaireDeployement().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
}
|
||||
|
|
@ -123,6 +133,8 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
squeletteComposant.getMenuScondaireDeployement().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(true);
|
||||
}else {
|
||||
removeActive(runtimes);
|
||||
|
|
@ -130,6 +142,32 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
logging=new Button("Logging");
|
||||
logging.setClassName("menu-principal-button");
|
||||
add(logging);
|
||||
logging.addClickListener(buttonClickEvent -> {
|
||||
|
||||
if(!isActive(logging)) {
|
||||
active(logging);
|
||||
squeletteComposant.getMenuScondaireDeployement().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(true);
|
||||
|
||||
}else {
|
||||
removeActive(logging);
|
||||
squeletteComposant.getMenuScondaireDeployement().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -144,7 +182,7 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(true);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
}else {
|
||||
removeActive(infoUser);
|
||||
|
|
@ -152,6 +190,7 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
squeletteComposant.getMenuSecondaireInfoUser().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireAssets().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireRuntime().setVisible(false);
|
||||
squeletteComposant.getMenuSecondaireLogging().setVisible(false);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -174,6 +213,7 @@ public class MenuPrincipal extends HorizontalLayout {
|
|||
removeActive(deployement);
|
||||
removeActive(assets);
|
||||
removeActive(runtimes);
|
||||
removeActive(logging);
|
||||
|
||||
button.getClassNames().add("active");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.menu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.ActionLogging;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.RuntimesAction;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
import org.chtijbug.drools.console.view.LoggingView;
|
||||
import org.chtijbug.drools.console.view.RuntimesView;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class MenuSecondaireLogging extends HorizontalLayout {
|
||||
|
||||
private Button logging;
|
||||
|
||||
public MenuSecondaireLogging(SqueletteComposant squeletteComposant){
|
||||
setVisible(false);
|
||||
|
||||
setClassName("menu-secondaire-content");
|
||||
|
||||
|
||||
logging =new Button("Gestion-logging", VaadinIcon.OFFICE.create());
|
||||
logging.setClassName("menu-secondaire-button");
|
||||
add(logging);
|
||||
logging.addClickListener(buttonClickEvent -> {
|
||||
if(!isActive(logging)) {
|
||||
active(logging);
|
||||
}
|
||||
LoggingView loggingView=new LoggingView();
|
||||
|
||||
ActionLogging actionLogging=new ActionLogging(loggingView);
|
||||
loggingView.setActionLogging(actionLogging);
|
||||
squeletteComposant.navigate(loggingView,LoggingView.pageName,actionLogging);
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isActive(Button button){
|
||||
return button.getClassNames().contains("active");
|
||||
}
|
||||
private void removeActive(Button button) {
|
||||
|
||||
if(button.getClassNames().contains("active")){
|
||||
button.getClassNames().remove("active");
|
||||
}
|
||||
}
|
||||
private void active(Button button){
|
||||
removeActive(logging);
|
||||
|
||||
button.getClassNames().add("active");
|
||||
}
|
||||
|
||||
public Button getLogging() {
|
||||
return logging;
|
||||
}
|
||||
|
||||
public void setLogging(Button logging) {
|
||||
this.logging = logging;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package org.chtijbug.drools.console.view;
|
||||
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.GridLogging;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.GridRuntime;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.ActionLogging;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class LoggingView extends VerticalLayout {
|
||||
|
||||
public static final String pageName="Logging";
|
||||
|
||||
private GridLogging gridLogging;
|
||||
|
||||
private ActionLogging actionLogging;
|
||||
|
||||
public LoggingView(){
|
||||
|
||||
add(new Label("Logging"));
|
||||
|
||||
gridLogging=new GridLogging();
|
||||
|
||||
add(gridLogging);
|
||||
|
||||
|
||||
gridLogging.addSelectionListener(selectionEvent -> {
|
||||
|
||||
if(selectionEvent.getFirstSelectedItem()!=null&&selectionEvent.getFirstSelectedItem().isPresent()) {
|
||||
actionLogging.getViewAction().setEnabled(true);
|
||||
}else {
|
||||
actionLogging.getViewAction().setEnabled(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static String getPageName() {
|
||||
return pageName;
|
||||
}
|
||||
|
||||
public GridLogging getGridLogging() {
|
||||
return gridLogging;
|
||||
}
|
||||
|
||||
public void setGridLogging(GridLogging gridLogging) {
|
||||
this.gridLogging = gridLogging;
|
||||
}
|
||||
|
||||
public ActionLogging getActionLogging() {
|
||||
return actionLogging;
|
||||
}
|
||||
|
||||
public void setActionLogging(ActionLogging actionLogging) {
|
||||
this.actionLogging = actionLogging;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
.DialogClose {
|
||||
position: relative;
|
||||
left: calc(100% - 20px);
|
||||
background-color: #ff402bc4;
|
||||
height: 15px;
|
||||
min-width: 15px !important;
|
||||
width: 3px !important;
|
||||
border-radius: 50%;
|
||||
box-sizing: unset;
|
||||
font-size: 9px;
|
||||
padding: 0 !important;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.DialogBar {
|
||||
width: calc(100% + 49px);
|
||||
position: relative;
|
||||
top: -25px;
|
||||
right: 25px;
|
||||
background-color: lightgrey;
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
@import "addRuntime.css";
|
||||
@import "template.css";
|
||||
@import "assedit.css";
|
||||
@import "deployment.css";
|
||||
@import "deployment.css";
|
||||
@import "log.css";
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
.action-log-grid-perso{
|
||||
position: relative;
|
||||
width: 93vw!important;
|
||||
height: 37vw
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ kie-wb.password=admin
|
|||
#kie-wb.kieserverUrl=http://localhost:20080/services/rest/server
|
||||
kie-wb.kieserverUrl=http://localhost:8090/api/server/containers
|
||||
|
||||
spring.data.elasticsearch.cluster-nodes=localhost:9300
|
||||
|
||||
kie-wb.kieserverUserName=kieserver
|
||||
kie-wb.kieserverPassword=kieserver1!
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue