-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add view controller * Some fixes to the position of the dynamic properties in the request, changes to the controller, and added comments to the config table * improve somme method name * Sync the modification of #85 * Sync the modification of #85 * Removed the use of delete annotations --------- Co-authored-by: 周倬贤 <[email protected]>
- Loading branch information
1 parent
6f268a0
commit b65a406
Showing
84 changed files
with
2,176 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...le/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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.eventmesh.dashboard.console.controller; | ||
|
||
|
||
import org.apache.eventmesh.dashboard.console.modle.vo.cluster.GetClusterBaseMessageVO; | ||
import org.apache.eventmesh.dashboard.console.modle.vo.cluster.ResourceNumVO; | ||
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
|
||
public class ClusterController { | ||
|
||
@Autowired | ||
ClusterService clusterService; | ||
|
||
@GetMapping("/cluster/getResourceNum") | ||
public ResourceNumVO getResourceNumByClusterId(Long clusterId) { | ||
return clusterService.getResourceNumByCluster(clusterId); | ||
} | ||
|
||
|
||
@GetMapping("/cluster/getBaseMessage") | ||
public GetClusterBaseMessageVO getClusterBaseMessage(Long clusterId) { | ||
return clusterService.getClusterBaseMessage(clusterId); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
...ole/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConfigController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* 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.eventmesh.dashboard.console.controller; | ||
|
||
import org.apache.eventmesh.dashboard.console.entity.config.ConfigEntity; | ||
import org.apache.eventmesh.dashboard.console.modle.dto.config.DetailConfigsVO; | ||
import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO; | ||
import org.apache.eventmesh.dashboard.console.modle.dto.config.UpdateConfigDTO; | ||
import org.apache.eventmesh.dashboard.console.service.config.ConfigService; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class ConfigController { | ||
|
||
@Autowired | ||
private ConfigService configService; | ||
|
||
@PostMapping("/cluster/config/updateConfigs") | ||
public String updateConfigsByTypeAndId(@Validated @RequestBody UpdateConfigDTO updateConfigDTO) { | ||
try { | ||
configService.updateConfigsByInstanceId(updateConfigDTO.getUsername(), updateConfigDTO.getClusterId(), updateConfigDTO.getInstanceType(), | ||
updateConfigDTO.getInstanceId(), updateConfigDTO.getChangeConfigDTOS()); | ||
} catch (Exception e) { | ||
return e.getMessage(); | ||
} | ||
return "success"; | ||
} | ||
|
||
|
||
@PostMapping("/cluster/config/getInstanceDetailConfigs") | ||
public List<DetailConfigsVO> getInstanceDetailConfigs(@Validated @RequestBody GetConfigsListDTO getConfigsListDTO) { | ||
List<ConfigEntity> configEntityList = configService.selectToFront(getConfigsListDTO.getInstanceId(), | ||
getConfigsListDTO.getInstanceType(), getConfigsListDTO); | ||
Map<String, String> stringStringConcurrentHashMap = configService.selectDefaultConfig(getConfigsListDTO.getBusinessType(), | ||
getConfigsListDTO.getInstanceId(), getConfigsListDTO.getInstanceType()); | ||
ArrayList<DetailConfigsVO> showDetailConfigsVOS = new ArrayList<>(); | ||
configEntityList.forEach(n -> { | ||
DetailConfigsVO showDetailConfigsVO = new DetailConfigsVO(); | ||
showDetailConfigsVO.setDefaultValue(stringStringConcurrentHashMap.get(n.getConfigName())); | ||
showDetailConfigsVO.setIsModify(n.getIsModify()); | ||
showDetailConfigsVO.setConfigName(n.getConfigName()); | ||
showDetailConfigsVO.setConfigValue(n.getConfigValue()); | ||
showDetailConfigsVO.setAlreadyUpdate(n.getAlreadyUpdate()); | ||
showDetailConfigsVOS.add(showDetailConfigsVO); | ||
}); | ||
return showDetailConfigsVOS; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ole/src/main/java/org/apache/eventmesh/dashboard/console/controller/HealthController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* 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.eventmesh.dashboard.console.controller; | ||
|
||
import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; | ||
import org.apache.eventmesh.dashboard.console.modle.vo.health.InstanceLiveProportionVo; | ||
import org.apache.eventmesh.dashboard.console.service.health.HealthDataService; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class HealthController { | ||
|
||
@Autowired | ||
HealthDataService healthDataService; | ||
|
||
@GetMapping("/cluster/health/getHistoryLiveStatus") | ||
public List<HealthCheckResultEntity> getHistoryLiveStatusById(Integer type, Long instanceId, String startTime) { | ||
Timestamp timestamp = Timestamp.valueOf(startTime); | ||
return healthDataService.getInstanceLiveStatusHistory(type, instanceId, timestamp); | ||
} | ||
|
||
@GetMapping("/cluster/health/getInstanceLiveProportion") | ||
public InstanceLiveProportionVo getInstanceLiveProportion(Integer instanceType, Long theClusterId) { | ||
return healthDataService.getInstanceLiveProportion(theClusterId, instanceType); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...onsole/src/main/java/org/apache/eventmesh/dashboard/console/controller/LogController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* 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.eventmesh.dashboard.console.controller; | ||
|
||
import org.apache.eventmesh.dashboard.console.entity.log.LogEntity; | ||
import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO; | ||
import org.apache.eventmesh.dashboard.console.service.log.LogService; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class LogController { | ||
|
||
@Autowired | ||
private LogService logService; | ||
|
||
@PostMapping("/cluster/log/getList") | ||
public List<LogEntity> getLogLIstToFront(@Validated @RequestBody GetLogListDTO getLogListDTO) { | ||
return logService.getLogListByCluster(getLogListDTO); | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
...le/src/main/java/org/apache/eventmesh/dashboard/console/controller/RuntimeController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* 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.eventmesh.dashboard.console.controller; | ||
|
||
import org.apache.eventmesh.dashboard.console.entity.runtime.RuntimeEntity; | ||
import org.apache.eventmesh.dashboard.console.modle.dto.runtime.GetRuntimeListDTO; | ||
import org.apache.eventmesh.dashboard.console.service.runtime.RuntimeService; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
|
||
@RestController | ||
public class RuntimeController { | ||
|
||
@Autowired | ||
private RuntimeService runtimeService; | ||
|
||
@PostMapping("/clusterId/runtime/getList") | ||
public List<RuntimeEntity> getRuntimeList(@Validated @RequestBody GetRuntimeListDTO getRuntimeListDTO) { | ||
return runtimeService.getRuntimeToFrontByClusterId(getRuntimeListDTO.getClusterId(), getRuntimeListDTO); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.