Le Business Proxy doit prendre sa configuration dans mongodb et ne plus exposer un rest d'administration
This commit is contained in:
parent
0025a7cec0
commit
824c4336b7
23 changed files with 250 additions and 458 deletions
|
|
@ -2,20 +2,13 @@ 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
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import org.drools.workbench.models.guided.template.backend.RuleTemplateModelXMLP
|
|||
import org.drools.workbench.models.guided.template.shared.TemplateModel;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RequestCallback;
|
||||
|
|
|
|||
|
|
@ -1,213 +0,0 @@
|
|||
package org.chtijbug.drools.console.service;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.vaadin.flow.component.UI;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.chtijbug.drools.console.AddLog;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieContainerInfo;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieServerJobStatus;
|
||||
import org.chtijbug.drools.console.service.model.kie.SpaceProject;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ProjectPersist;
|
||||
import org.kie.server.api.model.KieContainerResource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RequestCallback;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
|
||||
@Service
|
||||
public class KieServerRepositoryService {
|
||||
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(KieServerRepositoryService.class);
|
||||
|
||||
|
||||
private RestTemplate restTemplateKiewb = new RestTemplate();
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
///spaces/{spaceName}/projects/{projectName}
|
||||
|
||||
public void getProjectContent(String url, String username, String password, String space, String project) {
|
||||
String completeurl = url + "/spaces/" + space + "/projects/" + project;
|
||||
logger.info("url project content : " + completeurl);
|
||||
ResponseEntity<SpaceProject> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
SpaceProject extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
|
||||
SpaceProject values = mapper.readValue(result, SpaceProject.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<SpaceProject> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
SpaceProject reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
System.out.println(reponseMoteur);
|
||||
}
|
||||
|
||||
public List<KieContainerInfo> getContainerList(String url, String username, String password) {
|
||||
List<KieContainerInfo> results = new ArrayList<>();
|
||||
String completeurl = url ;
|
||||
logger.info("url kie server container : " + completeurl);
|
||||
ResponseEntity<Map<String, Object>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
Map<String, Object> extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
Map<String, Object> map = mapper.readValue(
|
||||
result,
|
||||
new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Map<String, Object> values = mapper.readValue(result, Map.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<Map<String, Object>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
Map<String, Object> reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
// Object resultMap = reponseMoteur.get("containers");
|
||||
// Object containersMap = ((Map) resultMap).get("kie-containers");
|
||||
// Map containerMap = ((Map) containersMap);
|
||||
if (reponseMoteur != null
|
||||
&& reponseMoteur.get("containers")!= null) {
|
||||
List<Map<String, Object>> listContainers = (List) reponseMoteur.get("containers");
|
||||
for (Map<String, Object> container : listContainers) {
|
||||
KieContainerInfo kieContainerInfo = new KieContainerInfo();
|
||||
System.out.println("coucou");
|
||||
kieContainerInfo.setContainerId((String) container.get("containerId"));
|
||||
Map artifact = (Map) container.get("resolvedReleaseId");
|
||||
if (artifact != null) {
|
||||
kieContainerInfo.setArtifactId((String) artifact.get("artifactId"));
|
||||
kieContainerInfo.setGroupId((String) artifact.get("groupId"));
|
||||
kieContainerInfo.setVersion((String) artifact.get("version"));
|
||||
}
|
||||
kieContainerInfo.setContainerAlias((String) container.get("container-alias"));
|
||||
results.add(kieContainerInfo);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public KieServerJobStatus stopContainer(String url, String username, String password, String containerId, AddLog workOnGoingView, UI ui) {
|
||||
KieServerJobStatus results = null;
|
||||
String completeurl = url +"/"+ containerId;
|
||||
logger.info("url kie server container : " + completeurl);
|
||||
ResponseEntity<KieServerJobStatus> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.DELETE, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
KieServerJobStatus extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
KieServerJobStatus values = mapper.readValue(result, KieServerJobStatus.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<KieServerJobStatus> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
KieServerJobStatus reponseMoteur;
|
||||
reponseMoteur = response.getBody();
|
||||
workOnGoingView.addRow(reponseMoteur.toString(),ui);
|
||||
return reponseMoteur;
|
||||
}
|
||||
|
||||
public KieContainerInfo createContainer(String url, String username, String password, String containerId, KieContainerResource request, AddLog workOnGoingView,UI ui) {
|
||||
String completeurl = url + "/"+containerId;
|
||||
logger.info("url kie server container : " + completeurl);
|
||||
ResponseEntity<Map<String, Object>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.PUT, requestCallback(request, username, password), clientHttpResponse -> {
|
||||
Map<String, Object> extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
Map<String, Object> map = mapper.readValue(
|
||||
result,
|
||||
new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Map<String, Object> values = mapper.readValue(result, Map.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<Map<String, Object>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
Map<String, Object> reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
workOnGoingView.addRow(reponseMoteur.toString(),ui);
|
||||
KieContainerInfo result = new KieContainerInfo();
|
||||
if (reponseMoteur.get("result") != null) {
|
||||
String containerID = (String) ((Map) ((Map) reponseMoteur.get("result")).get("kie-container")).get("container-id");
|
||||
result.setContainerId(containerID);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public KieContainerInfo createContainerWithBusinessInterface(String url, String username, String password, ProjectPersist projectPersist, KieContainerResource request, AddLog workOnGoingView, UI ui) {
|
||||
String completeurl = url + "/business/"+projectPersist.getContainerID()+"/"+projectPersist.getMainClass()+"/"+projectPersist.getProcessID();
|
||||
logger.info("url kie server business container : " + completeurl);
|
||||
ResponseEntity<Map<String, Object>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.POST, requestCallback(request, username, password), clientHttpResponse -> {
|
||||
Map<String, Object> extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
Map<String, Object> map = mapper.readValue(
|
||||
result,
|
||||
new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Map<String, Object> values = mapper.readValue(result, Map.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<Map<String, Object>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
Map<String, Object> reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
workOnGoingView.addRow(reponseMoteur.toString(),ui);
|
||||
KieContainerInfo result = new KieContainerInfo();
|
||||
if (reponseMoteur.get("result") != null) {
|
||||
String containerID = (String) ((Map) ((Map) reponseMoteur.get("result")).get("kie-container")).get("container-id");
|
||||
result.setContainerId(containerID);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private RequestCallback requestCallback(final Object content, String username, String password) {
|
||||
return clientHttpRequest -> {
|
||||
if (content != null) {
|
||||
mapper.writeValue(clientHttpRequest.getBody(), content);
|
||||
}
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
|
||||
String auth = username + ":" + password;
|
||||
byte[] encodedAuth = Base64.encodeBase64(
|
||||
auth.getBytes(Charset.forName("UTF-8")));
|
||||
String authHeader = "Basic " + new String(encodedAuth);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.AUTHORIZATION, authHeader);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -6,16 +6,15 @@ import org.chtijbug.drools.console.AddLog;
|
|||
import org.chtijbug.drools.console.service.model.UserConnected;
|
||||
import org.chtijbug.drools.console.service.model.kie.JobStatus;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieConfigurationData;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieContainerInfo;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieServerJobStatus;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.proxy.persistence.json.KeyProject;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ContainerPojoPersist;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ProjectPersist;
|
||||
import org.chtijbug.drools.proxy.persistence.model.RuntimePersist;
|
||||
import org.chtijbug.drools.proxy.persistence.repository.ContainerRepository;
|
||||
import org.chtijbug.drools.proxy.persistence.repository.ProjectRepository;
|
||||
import org.chtijbug.drools.proxy.persistence.repository.RuntimeRepository;
|
||||
import org.chtijbug.guvnor.server.jaxrs.model.PlatformProjectResponse;
|
||||
import org.kie.server.api.model.KieContainerResource;
|
||||
import org.kie.server.api.model.ReleaseId;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -38,9 +37,12 @@ public class ProjectPersistService {
|
|||
@Autowired
|
||||
private UserConnectedService userConnectedService;
|
||||
|
||||
@Autowired
|
||||
private KieServerRepositoryService kieServerRepositoryService;
|
||||
|
||||
@Autowired
|
||||
private ContainerRepository containerRepository;
|
||||
|
||||
@Autowired
|
||||
private RuntimeRepository runtimeRepository;
|
||||
|
||||
public ProjectPersistService(){
|
||||
this.config = AppContext.getApplicationContext().getBean(KieConfigurationData.class);
|
||||
|
|
@ -145,21 +147,44 @@ public class ProjectPersistService {
|
|||
userConnected.getUserPassword(), projectPersist.getProjectName().getSpaceName(), projectPersist.getProjectName().getName(), "install", workOnGoingView,ui);
|
||||
|
||||
executeWrite(url,username,password,workOnGoingView,result.getJobId(),ui);
|
||||
|
||||
/**
|
||||
if (projectPersist.getContainerID() != null) {
|
||||
KieServerJobStatus jobresult = kieServerRepositoryService.stopContainer(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword(), projectPersist.getContainerID(), workOnGoingView,ui);
|
||||
if (jobresult != null
|
||||
&& "SUCCESS".equals(jobresult.getType())) {
|
||||
}
|
||||
}
|
||||
KieContainerResource newContainer = new KieContainerResource();
|
||||
newContainer.setContainerId(projectPersist.getContainerID());
|
||||
newContainer.setReleaseId(new ReleaseId());
|
||||
newContainer.getReleaseId().setArtifactId(projectPersist.getArtifactID());
|
||||
newContainer.getReleaseId().setGroupId(projectPersist.getGroupID());
|
||||
newContainer.getReleaseId().setVersion(projectPersist.getProjectVersion());
|
||||
KieContainerInfo createdContainer = kieServerRepositoryService.createContainerWithBusinessInterface(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword(), projectPersist, newContainer, workOnGoingView,ui);
|
||||
**/
|
||||
// ContainerPojoPersist toto = containerRepository.findByServerNameAndContainerId(projectPersist.getContainerID());
|
||||
List<RuntimePersist> kieservers = runtimeRepository.findByServerName(projectPersist.getServerName());
|
||||
if (kieservers.size()==1) {
|
||||
ContainerPojoPersist existingContainer = containerRepository.findByServerNameAndContainerId(projectPersist.getServerName(),projectPersist.getContainerID());
|
||||
if (existingContainer==null) {
|
||||
ContainerPojoPersist newContainer = new ContainerPojoPersist();
|
||||
newContainer.setStatus(ContainerPojoPersist.STATUS.TODEPLOY.toString());
|
||||
newContainer.setClassName(projectPersist.getMainClass());
|
||||
newContainer.setProcessID(projectPersist.getProcessID());
|
||||
newContainer.setContainerId(projectPersist.getContainerID());
|
||||
newContainer.setServerName(projectPersist.getServerName());
|
||||
newContainer.setGroupId(projectPersist.getGroupID());
|
||||
newContainer.setArtifactId(projectPersist.getArtifactID());
|
||||
newContainer.setVersion(projectPersist.getProjectVersion());
|
||||
containerRepository.save(newContainer);
|
||||
}else{
|
||||
existingContainer.setStatus(ContainerPojoPersist.STATUS.TODEPLOY.toString());
|
||||
containerRepository.save(existingContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
KieContainerResource newContainer = new KieContainerResource();
|
||||
newContainer.setContainerId(projectPersist.getContainerID());
|
||||
newContainer.setReleaseId(new ReleaseId());
|
||||
newContainer.getReleaseId().setArtifactId(projectPersist.getArtifactID());
|
||||
newContainer.getReleaseId().setGroupId(projectPersist.getGroupID());
|
||||
newContainer.getReleaseId().setVersion(projectPersist.getProjectVersion());
|
||||
KieContainerInfo createdContainer = kieServerRepositoryService.createContainerWithBusinessInterface(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword(), projectPersist, newContainer, workOnGoingView, ui);
|
||||
**/
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import org.springframework.web.client.RestTemplate;
|
|||
public class RuntimeService {
|
||||
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(KieServerRepositoryService.class);
|
||||
private static Logger logger = LoggerFactory.getLogger(RuntimeService.class);
|
||||
|
||||
@Autowired
|
||||
private RuntimeRepository runtimeRepository;
|
||||
|
|
|
|||
|
|
@ -1,124 +0,0 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
|
||||
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.html.Label;
|
||||
import com.vaadin.flow.component.notification.Notification;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||
import org.chtijbug.drools.console.service.RuntimeService;
|
||||
import org.chtijbug.drools.console.service.model.ReturnPerso;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.TextFieldPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.proxy.persistence.model.RuntimePersist;
|
||||
import org.kie.server.api.model.KieServerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class AddRuntime extends VerticalLayout {
|
||||
|
||||
private TextFieldPerso host;
|
||||
|
||||
private TextFieldPerso port;
|
||||
|
||||
private Button testConnexion;
|
||||
|
||||
private Label label;
|
||||
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
public AddRuntime(Dialog dialog, SqueletteComposant squeletteComposant){
|
||||
|
||||
runtimeService = AppContext.getApplicationContext().getBean(RuntimeService.class);
|
||||
|
||||
setClassName("creation-runtime-content");
|
||||
|
||||
label=new Label("Add Runtime");
|
||||
label.setClassName("creation-runtime-title");
|
||||
add(label);
|
||||
|
||||
host=new TextFieldPerso("Host","http://111.111.1.111",VaadinIcon.HARDDRIVE.create());
|
||||
host.getTextField().setRequired(true);
|
||||
host.getTextField().setValueChangeMode(ValueChangeMode.EAGER);
|
||||
host.getTextField().addValueChangeListener(textFieldStringComponentValueChangeEvent -> {
|
||||
verify();
|
||||
});
|
||||
|
||||
add(host);
|
||||
|
||||
port=new TextFieldPerso("Port","",VaadinIcon.INBOX.create());
|
||||
port.getTextField().setRequired(true);
|
||||
port.getTextField().setValueChangeMode(ValueChangeMode.EAGER);
|
||||
port.getTextField().addValueChangeListener(textFieldStringComponentValueChangeEvent -> {
|
||||
verify();
|
||||
});
|
||||
|
||||
|
||||
add(port);
|
||||
|
||||
testConnexion=new Button("Tester connexion");
|
||||
testConnexion.setEnabled(false);
|
||||
testConnexion.setClassName("login-application-connexion");
|
||||
add(testConnexion);
|
||||
testConnexion.addClickListener(buttonClickEvent -> {
|
||||
|
||||
ReturnPerso<KieServerInfo> returnPerso= runtimeService.verifyIfKieServerExist(
|
||||
host.getTextField().getValue()+":"+port.getTextField().getValue()
|
||||
);
|
||||
|
||||
if(returnPerso.getaBoolean()){
|
||||
Notification.show(returnPerso.getError());
|
||||
runtimeService.saveRuntime(new RuntimePersist(
|
||||
returnPerso.getBody().getName(),
|
||||
returnPerso.getBody().getVersion(),host.getTextField().getValue()+":"+port.getTextField().getValue()
|
||||
));
|
||||
|
||||
List<RuntimePersist> runtimePersists=runtimeService.getRuntimeRepository().findAll();
|
||||
squeletteComposant.getLeftMenuGlobal().getInformationStructure().actualiseKieServer(runtimePersists!=null?runtimePersists.size():0);
|
||||
dialog.close();
|
||||
}else {
|
||||
Notification.show(returnPerso.getError());
|
||||
testConnexion.setClassName("login-application-connexion-error");
|
||||
testConnexion.setIcon(VaadinIcon.ROTATE_LEFT.create());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void verify(){
|
||||
if(port.getTextField().isInvalid()||port.getTextField().getValue().isEmpty()||port.getTextField().getValue()==null&&
|
||||
host.getTextField().isInvalid()||host.getTextField().getValue().isEmpty()||host.getTextField().getValue()==null){
|
||||
testConnexion.setEnabled(false);
|
||||
}else {
|
||||
testConnexion.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public TextFieldPerso getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(TextFieldPerso host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public TextFieldPerso getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(TextFieldPerso port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public Button getTestConnexion() {
|
||||
return testConnexion;
|
||||
}
|
||||
|
||||
public void setTestConnexion(Button testConnexion) {
|
||||
this.testConnexion = testConnexion;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +1,14 @@
|
|||
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.notification.Notification;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.component.textfield.TextField;
|
||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||
import org.chtijbug.drools.console.service.IndexerService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.TextFieldPerso;
|
||||
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.ActionLoggingView;
|
||||
import org.chtijbug.drools.console.view.LoggingView;
|
||||
import org.chtijbug.drools.indexer.persistence.model.BusinessTransactionPersistence;
|
||||
|
|
|
|||
|
|
@ -1,23 +1,19 @@
|
|||
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.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;
|
||||
|
||||
public class RuntimesAction extends VerticalLayout {
|
||||
|
||||
private Button addRuntime;
|
||||
// private Button addRuntime;
|
||||
|
||||
|
||||
public RuntimesAction(SqueletteComposant squeletteComposant){
|
||||
|
||||
setClassName("leftMenu-global-action");
|
||||
|
||||
|
||||
/**
|
||||
addRuntime=new Button("add runtime", VaadinIcon.PLUS.create());
|
||||
addRuntime.setClassName("leftMenu-global-button");
|
||||
add(addRuntime);
|
||||
|
|
@ -30,7 +26,9 @@ public class RuntimesAction extends VerticalLayout {
|
|||
|
||||
dialog.open();
|
||||
});
|
||||
**/
|
||||
}
|
||||
|
||||
private boolean isActive(Button button){
|
||||
return button.getClassNames().contains("active");
|
||||
}
|
||||
|
|
@ -41,7 +39,7 @@ public class RuntimesAction extends VerticalLayout {
|
|||
}
|
||||
}
|
||||
private void active(Button button){
|
||||
removeActive(addRuntime);
|
||||
// removeActive(addRuntime);
|
||||
button.getClassNames().add("active");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,9 @@ 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.dialog.Dialog;
|
||||
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.componentView.AddRuntime;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.DeploymentAction;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,9 @@ 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.dialog.Dialog;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AddRuntime;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.DeploymentAction;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.RuntimesAction;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
import org.chtijbug.drools.console.view.RuntimesView;
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue