Merge pull request #12 from menghaoranss/issue7106-4
Remove config center
diff --git a/README.md b/README.md
index dc2f021..8c80d34 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
[![Build Status](https://builds.apache.org/job/shardingsphere-ui-dev/badge/icon)](https://builds.apache.org/job/shardingsphere-ui-dev/)
## Overview
-ShardingSphere UI is a management background for [ShardingSphere](https://shardingsphere.apache.org/), including: dynamic configuration, Data orchestration, etc.
+ShardingSphere UI is a management background for [ShardingSphere](https://shardingsphere.apache.org/), including: dynamic configuration, Data governance, etc.
### ShardingSphere UI Frontend
diff --git a/shardingsphere-ui-backend/shardingsphere-ui-backend-API.md b/shardingsphere-ui-backend/shardingsphere-ui-backend-API.md
index 4dc36b6..9c9a1fa 100644
--- a/shardingsphere-ui-backend/shardingsphere-ui-backend-API.md
+++ b/shardingsphere-ui-backend/shardingsphere-ui-backend-API.md
@@ -62,9 +62,11 @@
| name | String | Name of Registration Center |
| registryCenterType | String | Registry type: "zookeeper" / "etcd" |
| serverLists | String | Service address of Registration Center |
-| namespace | String | Namespace of the registry |
-| orchestrationName | String | Data governance instance name |
+| governanceName | String | Governance instance name |
| digest | String | Permission token to connect to the registry |
+| additionalConfigCenterType | String | Additional config center type: "zookeeper" / "etcd" |
+| additionalConfigCenterServerList | String | Service address of additional config center |
+| additionalDigest | String | Permission token to connect to the additional config center |
| activated | Boolean | Is it active |
```
@@ -77,18 +79,22 @@
"name": "string",
"registryCenterType": "Zookeeper",
"serverLists": "string",
- "namespace": "string",
- "orchestrationName": "string",
+ "governanceName": "string",
"digest": "string",
+ "additionalConfigCenterType": "Zookeeper",
+ "additionalConfigCenterServerList": "string",
+ "additionalDigest": "string",
"activated": true
},
{
"name": "string",
"registryCenterType": "Etcd",
"serverLists": "string",
- "namespace": "string",
- "orchestrationName": "string",
+ "governanceName": "string",
"digest": "string",
+ "additionalConfigCenterType": "Zookeeper",
+ "additionalConfigCenterServerList": "string",
+ "additionalDigest": "string",
"activated": false
}
]
@@ -110,19 +116,22 @@
| Parameter | Field type | Essential | Describe |
| ------------------ | ---------- | --------- | ------------------------------------------- |
| name | String | Y | Name of Registration Center |
+| governanceName | String | Y | Data governance instance name |
| registryCenterType | String | Y | Registry type: "zookeeper" / "etcd" |
| serverLists | String | Y | Service address of Registration Center |
-| namespace | String | Y | Namespace of the registry |
-| orchestrationName | String | Y | Data governance instance name |
| digest | String | N | Permission token to connect to the registry |
+| additionalConfigCenterType | String | N | Additional config center type: "zookeeper" / "etcd" |
+| additionalConfigCenterServerList | String | N | Service address of additional config center |
+| additionalDigest | String | N | Permission token to connect to the additional config center |
```
{
"name": "string",
- "namespace": "string",
- "orchestrationName": "string",
+ "governanceName": "string",
"registryCenterType": "Zookeeper",
"serverLists": "string"
+ "additionalConfigCenterType": "Zookeeper",
+ "additionalConfigCenterServerList": "string"
}
```
@@ -210,9 +219,11 @@
| name | String | Name of Registration Center |
| registryCenterType | String | Registry type: "zookeeper" / "etcd" |
| serverLists | String | Service address of Registration Center |
-| namespace | String | Namespace of the registry |
-| orchestrationName | String | Data governance instance name |
+| governanceName | String | Data governance instance name |
| digest | String | Permission token to connect to the registry |
+| additionalConfigCenterType | String | Additional config center type: "zookeeper" / "etcd" |
+| additionalConfigCenterServerList | String | Service address of additional config center |
+| additionalDigest | String | Permission token to connect to the additional config center |
| activated | Boolean | Is it active |
```
@@ -224,9 +235,11 @@
"name": "string",
"registryCenterType": "Zookeeper",
"serverLists": "string",
- "namespace": "string",
- "orchestrationName": "string",
+ "governanceName": "string",
"digest": "string",
+ "additionalConfigCenterType": "Zookeeper",
+ "additionalConfigCenterServerList": "string",
+ "additionalDigest": "string",
"activated": true
}
}
@@ -534,7 +547,7 @@
### 7.1 Get running instance information
-`GET /api/orchestration/instance`
+`GET /api/governance/instance`
#### Request
@@ -564,7 +577,7 @@
### 7.2 Modify running instance status
-`PUT /api/orchestration/instance`
+`PUT /api/governance/instance`
#### Request
@@ -591,7 +604,7 @@
### 7.3 Get from library information
-`GET /api/orchestration/datasource`
+`GET /api/governance/datasource`
#### Request
@@ -635,7 +648,7 @@
### 7.4 Modify slave status
-`PUT /api/orchestration/datasource`
+`PUT /api/governance/datasource`
#### Request
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/constant/InstanceType.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/constant/InstanceType.java
index 407ef16..eaaf719 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/constant/InstanceType.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/constant/InstanceType.java
@@ -20,7 +20,7 @@
import org.apache.shardingsphere.ui.common.exception.ShardingSphereUIException;
/**
- * Orchestration instance type.
+ * Governance instance type.
*/
public enum InstanceType {
@@ -44,6 +44,6 @@
return each;
}
}
- throw new ShardingSphereUIException(ShardingSphereUIException.SERVER_ERROR, String.format("Unsupported orchestration instance type `%s`", name));
+ throw new ShardingSphereUIException(ShardingSphereUIException.SERVER_ERROR, String.format("Unsupported governance instance type `%s`", name));
}
}
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/domain/CenterConfig.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/domain/CenterConfig.java
index c627511..2a0fcc2 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/domain/CenterConfig.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/domain/CenterConfig.java
@@ -35,7 +35,7 @@
private String serverLists;
- private String orchestrationName;
+ private String governanceName;
private String digest;
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/dto/CenterConfigDTO.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/dto/CenterConfigDTO.java
index 5eebbb8..8e8b546 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/dto/CenterConfigDTO.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/common/dto/CenterConfigDTO.java
@@ -35,9 +35,9 @@
private String namespace;
- private String orchestrationName;
+ private String governanceName;
- private String orchestrationType;
+ private String governanceType;
private String digest;
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/OrchestrationService.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/GovernanceService.java
similarity index 95%
rename from shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/OrchestrationService.java
rename to shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/GovernanceService.java
index fbf5071..f0ff9c0 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/OrchestrationService.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/GovernanceService.java
@@ -23,9 +23,9 @@
import java.util.Collection;
/**
- * Orchestration operation service.
+ * Governance operation service.
*/
-public interface OrchestrationService {
+public interface GovernanceService {
/**
* Get all instances.
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/CenterConfigServiceImpl.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/CenterConfigServiceImpl.java
index 3da4ee6..71f3690 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/CenterConfigServiceImpl.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/CenterConfigServiceImpl.java
@@ -104,7 +104,7 @@
toBeUpdatedConfig.setName(config.getName());
toBeUpdatedConfig.setInstanceType(config.getInstanceType());
toBeUpdatedConfig.setServerLists(config.getServerLists());
- toBeUpdatedConfig.setOrchestrationName(config.getOrchestrationName());
+ toBeUpdatedConfig.setGovernanceName(config.getGovernanceName());
toBeUpdatedConfig.setDigest(config.getDigest());
toBeUpdatedConfig.setAdditionalConfigCenterServerList(config.getAdditionalConfigCenterServerList());
toBeUpdatedConfig.setAdditionalConfigCenterType(config.getAdditionalConfigCenterType());
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/OrchestrationServiceImpl.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/GovernanceServiceImpl.java
similarity index 97%
rename from shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/OrchestrationServiceImpl.java
rename to shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/GovernanceServiceImpl.java
index 46f1713..85d0c4e 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/OrchestrationServiceImpl.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/GovernanceServiceImpl.java
@@ -24,7 +24,7 @@
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
import org.apache.shardingsphere.ui.common.dto.InstanceDTO;
import org.apache.shardingsphere.ui.common.dto.SlaveDataSourceDTO;
-import org.apache.shardingsphere.ui.servcie.OrchestrationService;
+import org.apache.shardingsphere.ui.servcie.GovernanceService;
import org.apache.shardingsphere.ui.servcie.RegistryCenterService;
import org.apache.shardingsphere.ui.servcie.ShardingSchemaService;
import org.apache.shardingsphere.ui.util.ConfigurationYamlConverter;
@@ -38,10 +38,10 @@
import java.util.stream.Collectors;
/**
- * Implementation of orchestration operation service.
+ * Implementation of governance operation service.
*/
@Service
-public final class OrchestrationServiceImpl implements OrchestrationService {
+public final class GovernanceServiceImpl implements GovernanceService {
@Resource
private RegistryCenterService registryCenterService;
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java
index abd3c69..374de71 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java
@@ -53,8 +53,8 @@
if (null != result) {
return result;
}
- result = (RegistryRepository) createOrchestrationRepository(config.getInstanceType());
- result.init(config.getOrchestrationName(), convert(config));
+ result = (RegistryRepository) createGovernanceRepository(config.getInstanceType());
+ result.init(config.getGovernanceName(), convert(config));
REGISTRY_REPOSITORY_MAP.put(config.getName(), result);
return result;
}
@@ -72,16 +72,16 @@
}
if (!Strings.isNullOrEmpty(config.getAdditionalConfigCenterServerList())
&& !Strings.isNullOrEmpty(config.getAdditionalConfigCenterType())) {
- result = (ConfigurationRepository) createOrchestrationRepository(config.getAdditionalConfigCenterType());
+ result = (ConfigurationRepository) createGovernanceRepository(config.getAdditionalConfigCenterType());
} else {
- RegistryRepository registryRepository = (RegistryRepository) createOrchestrationRepository(config.getInstanceType());
+ RegistryRepository registryRepository = (RegistryRepository) createGovernanceRepository(config.getInstanceType());
if (registryRepository instanceof ConfigurationRepository) {
result = (ConfigurationRepository) registryRepository;
} else {
throw new IllegalArgumentException("Registry repository is not suitable for config center and no additional config center configuration provided.");
}
}
- result.init(config.getOrchestrationName(), convert(config));
+ result.init(config.getGovernanceName(), convert(config));
CONFIG_REPOSITORY_MAP.put(config.getName(), result);
return result;
}
@@ -92,7 +92,7 @@
return result;
}
- private static GovernanceRepository createOrchestrationRepository(final String instanceType) {
+ private static GovernanceRepository createGovernanceRepository(final String instanceType) {
RegistryRepository result;
InstanceType type = InstanceType.nameOf(instanceType);
switch (type) {
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/ConfigurationYamlConverter.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/ConfigurationYamlConverter.java
index 6795bc3..1a03c86 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/ConfigurationYamlConverter.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/ConfigurationYamlConverter.java
@@ -53,7 +53,7 @@
@SuppressWarnings("unchecked")
public static Map<String, DataSourceConfiguration> loadDataSourceConfigurations(final String data) {
Map<String, YamlDataSourceConfiguration> result = (Map) YamlEngine.unmarshal(data);
- Preconditions.checkState(null != result && !result.isEmpty(), "No available data sources to load for orchestration.");
+ Preconditions.checkState(null != result && !result.isEmpty(), "No available data sources to load for governance.");
return Maps.transformValues(result, new DataSourceConfigurationYamlSwapper()::swapToObject);
}
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/ConfigCenterController.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/ConfigCenterController.java
deleted file mode 100644
index 0f7eb84..0000000
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/ConfigCenterController.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.shardingsphere.ui.web.controller;
-
-import org.apache.shardingsphere.ui.common.domain.CenterConfig;
-import org.apache.shardingsphere.ui.common.dto.CenterConfigDTO;
-import org.apache.shardingsphere.ui.servcie.CenterConfigService;
-import org.apache.shardingsphere.ui.util.CenterRepositoryFactory;
-import org.apache.shardingsphere.ui.web.response.ResponseResult;
-import org.apache.shardingsphere.ui.web.response.ResponseResultUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * RESTful API of config center configuration.
- */
-@RestController
-@RequestMapping("/api/config-center")
-public final class ConfigCenterController {
-
- @Autowired
- private CenterConfigService centerConfigService;
-
- /**
- * Load all config center configs.
- *
- * @return response result
- */
- @RequestMapping(value = "", method = RequestMethod.GET)
- public ResponseResult<List<CenterConfig>> loadConfigs() {
- return ResponseResultUtil.build(centerConfigService.loadAll().getCenterConfigs());
- }
-
- /**
- * Add config center config.
- *
- * @param config config center config
- * @return response result
- */
- @RequestMapping(value = "", method = RequestMethod.POST)
- public ResponseResult add(@RequestBody final CenterConfig config) {
- centerConfigService.add(config);
- return ResponseResultUtil.success();
- }
-
- /**
- * Delete config center config.
- *
- * @param config config center config
- * @return response result
- */
- @RequestMapping(value = "", method = RequestMethod.DELETE)
- public ResponseResult delete(@RequestBody final CenterConfig config) {
- centerConfigService.delete(config.getName());
- return ResponseResultUtil.success();
- }
-
- /**
- * Connect config center.
- *
- * @param config config center config
- * @return response result
- */
- @RequestMapping(value = "/connect", method = RequestMethod.POST)
- public ResponseResult<Boolean> connect(@RequestBody final CenterConfig config) {
- CenterRepositoryFactory.createConfigurationRepository(centerConfigService.load(config.getName()));
- centerConfigService.setActivated(config.getName());
- return ResponseResultUtil.build(Boolean.TRUE);
- }
-
- /**
- * Get activated config center config.
- *
- * @return response result
- */
- @RequestMapping(value = "/activated", method = RequestMethod.GET)
- public ResponseResult<CenterConfig> activated() {
- return ResponseResultUtil.build(centerConfigService.loadActivated().orElse(null));
- }
-
- /**
- * Update config center.
- *
- * @param config config center config
- * @return response result
- */
- @RequestMapping(value = "/update", method = RequestMethod.POST)
- public ResponseResult update(@RequestBody final CenterConfigDTO config) {
- centerConfigService.update(config);
- return ResponseResultUtil.success();
- }
-}
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/OrchestrationController.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/GovernanceController.java
similarity index 79%
rename from shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/OrchestrationController.java
rename to shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/GovernanceController.java
index ef93d55..1b587f1 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/OrchestrationController.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/GovernanceController.java
@@ -19,7 +19,7 @@
import org.apache.shardingsphere.ui.common.dto.InstanceDTO;
import org.apache.shardingsphere.ui.common.dto.SlaveDataSourceDTO;
-import org.apache.shardingsphere.ui.servcie.OrchestrationService;
+import org.apache.shardingsphere.ui.servcie.GovernanceService;
import org.apache.shardingsphere.ui.web.response.ResponseResult;
import org.apache.shardingsphere.ui.web.response.ResponseResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -31,14 +31,14 @@
import java.util.Collection;
/**
- * RESTful API of orchestration operation.
+ * RESTful API of governance operation.
*/
@RestController
-@RequestMapping("/api/orchestration")
-public final class OrchestrationController {
+@RequestMapping("/api/governance")
+public final class GovernanceController {
@Autowired
- private OrchestrationService orchestrationService;
+ private GovernanceService governanceService;
/**
* Load all instances.
@@ -47,7 +47,7 @@
*/
@RequestMapping(value = "/instance", method = RequestMethod.GET)
public ResponseResult<Collection<InstanceDTO>> loadAllInstances() {
- return ResponseResultUtil.build(orchestrationService.getALLInstance());
+ return ResponseResultUtil.build(governanceService.getALLInstance());
}
/**
@@ -58,7 +58,7 @@
*/
@RequestMapping(value = "/instance", method = RequestMethod.PUT)
public ResponseResult updateInstanceStatus(@RequestBody final InstanceDTO instanceDTO) {
- orchestrationService.updateInstanceStatus(instanceDTO.getInstanceId(), instanceDTO.isEnabled());
+ governanceService.updateInstanceStatus(instanceDTO.getInstanceId(), instanceDTO.isEnabled());
return ResponseResultUtil.success();
}
@@ -69,7 +69,7 @@
*/
@RequestMapping(value = "/datasource", method = RequestMethod.GET)
public ResponseResult<Collection<SlaveDataSourceDTO>> loadAllSlaveDataSources() {
- return ResponseResultUtil.build(orchestrationService.getAllSlaveDataSource());
+ return ResponseResultUtil.build(governanceService.getAllSlaveDataSource());
}
/**
@@ -80,7 +80,7 @@
*/
@RequestMapping(value = "/datasource", method = RequestMethod.PUT)
public ResponseResult updateSlaveDataSourceStatus(@RequestBody final SlaveDataSourceDTO slaveDataSourceDTO) {
- orchestrationService.updateSlaveDataSourceStatus(slaveDataSourceDTO.getSchema(), slaveDataSourceDTO.getSlaveDataSourceName(), slaveDataSourceDTO.isEnabled());
+ governanceService.updateSlaveDataSourceStatus(slaveDataSourceDTO.getSchema(), slaveDataSourceDTO.getSlaveDataSourceName(), slaveDataSourceDTO.isEnabled());
return ResponseResultUtil.success();
}
diff --git a/shardingsphere-ui-frontend/src/lang/en-US.js b/shardingsphere-ui-frontend/src/lang/en-US.js
index 3798553..12b1580 100644
--- a/shardingsphere-ui-frontend/src/lang/en-US.js
+++ b/shardingsphere-ui-frontend/src/lang/en-US.js
@@ -93,7 +93,7 @@
additionalCenterType: 'Additional Type',
address: 'Address',
additionalAddress: 'Additional Address',
- orchestrationName: 'Governance Name',
+ governanceName: 'Governance Name',
namespaces: 'Namespace',
digest: 'Digest',
btnConfirmTxt: 'Confirm',
@@ -111,37 +111,7 @@
address: 'Please enter the registration center Address',
namespaces: 'Please enter a Namespace',
centerType: 'Please select a Center Type',
- orchestrationName: 'Please enter a Governance Name',
- digest: 'Please enter a digest'
- }
- },
- configCenter: {
- btnTxt: 'ADD',
- configDialog: {
- title: 'Add a config center',
- editTitle: 'Edit config center',
- name: 'Name',
- centerType: 'Instance Type',
- address: 'Address',
- orchestrationName: 'Governance Name',
- namespaces: 'Namespace',
- digest: 'Digest',
- btnConfirmTxt: 'Confirm',
- btnCancelTxt: 'Cancel'
- },
- table: {
- operate: 'Operate',
- operateConnect: 'Connect',
- operateConnected: 'Connected',
- operateDel: 'Del',
- operateEdit: 'Edit'
- },
- rules: {
- name: 'Please enter the name of the config center',
- address: 'Please enter the config center Address',
- namespaces: 'Please enter a Namespace',
- centerType: 'Please select a Center Type',
- orchestrationName: 'Please enter a Governance Name',
+ governanceName: 'Please enter a Governance Name',
digest: 'Please enter a digest'
}
},
diff --git a/shardingsphere-ui-frontend/src/lang/zh-CN.js b/shardingsphere-ui-frontend/src/lang/zh-CN.js
index 3245206..e2187c8 100644
--- a/shardingsphere-ui-frontend/src/lang/zh-CN.js
+++ b/shardingsphere-ui-frontend/src/lang/zh-CN.js
@@ -93,7 +93,7 @@
additionalCenterType: '扩展配置中心类型',
additionalAddress: '扩展配置中心地址',
address: '注册中心地址',
- orchestrationName: '治理实例名称',
+ governanceName: '治理实例名称',
namespaces: '命名空间',
digest: '登录凭证',
btnConfirmTxt: '确定',
@@ -111,37 +111,7 @@
centerType: '请选择注册中心类型',
namespaces: '请输入命名空间',
address: '请输入注册中心地址',
- orchestrationName: '请输入数据治理实例名称',
- digest: '请输入登录凭证'
- }
- },
- configCenter: {
- btnTxt: '添加',
- configDialog: {
- title: '添加配置中心',
- editTitle: '编辑配置中心',
- name: '配置中心名称',
- centerType: '配置中心类型',
- address: '配置中心地址',
- orchestrationName: '数据治理实例',
- namespaces: '命名空间',
- digest: '登录凭证',
- btnConfirmTxt: '确定',
- btnCancelTxt: '取消'
- },
- table: {
- operate: '操作',
- operateConnect: '连接',
- operateConnected: '已激活',
- operateDel: '删除',
- operateEdit: '编辑'
- },
- rules: {
- name: '请输入配置中心名称',
- centerType: '请选择配置中心类型',
- namespaces: '请输入命名空间',
- address: '请输入配置中心地址',
- orchestrationName: '请输入数据治理实例名称',
+ governanceName: '请输入治理实例名称',
digest: '请输入登录凭证'
}
},
diff --git a/shardingsphere-ui-frontend/src/router/index.js b/shardingsphere-ui-frontend/src/router/index.js
index 6b65ab0..ebc6e83 100644
--- a/shardingsphere-ui-frontend/src/router/index.js
+++ b/shardingsphere-ui-frontend/src/router/index.js
@@ -26,12 +26,6 @@
redirect: '/registry-center'
},
{
- path: '/config-center',
- component: () => import('@/views/config-center'),
- hidden: true,
- name: 'Config center'
- },
- {
path: '/registry-center',
component: () => import('@/views/registry-center'),
hidden: true,
diff --git a/shardingsphere-ui-frontend/src/views/config-center/api.js b/shardingsphere-ui-frontend/src/views/config-center/api.js
deleted file mode 100644
index 61874e8..0000000
--- a/shardingsphere-ui-frontend/src/views/config-center/api.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.
- */
-
-import API from '@/utils/api'
-
-export default {
- getConfigCenter: (params = {}) => API.get(`/api/config-center`, params),
- deleteConfigCenter: (params = {}) => API.delete(`/api/config-center`, params),
- postConfigCenter: (params = {}) => API.post(`/api/config-center`, params),
- getConfigCenterActivated: (params = {}) => API.get(`/api/config-center/activated`, params),
- postConfigCenterConnect: (params = {}) => API.post(`/api/config-center/connect`, params),
- updateConfigCenter: (config = {}) => API.post(`/api/config-center/update`, config)
-}
diff --git a/shardingsphere-ui-frontend/src/views/config-center/index.vue b/shardingsphere-ui-frontend/src/views/config-center/index.vue
deleted file mode 100644
index 99e3ffe..0000000
--- a/shardingsphere-ui-frontend/src/views/config-center/index.vue
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
- - 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.
- -->
-
-<template>
- <s-config-center/>
-</template>
-
-<script>
-import SConfigCenter from './module/configCenter'
-export default {
- name: 'ConfigCenter',
- components: {
- SConfigCenter
- }
-}
-</script>
-
-<style lang="scss" scoped>
-</style>
diff --git a/shardingsphere-ui-frontend/src/views/config-center/module/configCenter.vue b/shardingsphere-ui-frontend/src/views/config-center/module/configCenter.vue
deleted file mode 100644
index 999f9cf..0000000
--- a/shardingsphere-ui-frontend/src/views/config-center/module/configCenter.vue
+++ /dev/null
@@ -1,408 +0,0 @@
-<!--
- - 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.
- -->
-
-<template>
- <el-row class="box-card">
- <div class="btn-group">
- <el-button
- class="btn-plus"
- type="primary"
- icon="el-icon-plus"
- @click="add"
- >{{ $t("configCenter.btnTxt") }}</el-button>
- </div>
- <div class="table-wrap">
- <el-table :data="tableData" border style="width: 100%">
- <el-table-column
- v-for="(item, index) in column"
- :key="index"
- :prop="item.prop"
- :label="item.label"
- :width="item.width"
- />
- <el-table-column :label="$t('configCenter.table.operate')" fixed="right" width="200">
- <template slot-scope="scope">
- <el-tooltip
- :content="$t('configCenter.table.operateEdit')"
- class="item"
- effect="dark"
- placement="top"
- >
- <el-button
- :disabled="scope.row.activated"
- size="small"
- type="primary"
- icon="el-icon-edit"
- @click="handleEdit(scope.row)"
- />
- </el-tooltip>
- <el-tooltip
- :content="!scope.row.activated ? $t('configCenter.table.operateConnect'): $t('configCenter.table.operateConnected')"
- class="item"
- effect="dark"
- placement="top"
- >
- <el-button
- type="primary"
- icon="el-icon-link"
- size="small"
- @click="handleConnect(scope.row)"
- />
- </el-tooltip>
- <el-tooltip
- :content="$t('configCenter.table.operateDel')"
- class="item"
- effect="dark"
- placement="top"
- >
- <el-button
- size="small"
- type="danger"
- icon="el-icon-delete"
- @click="handlerDel(scope.row)"
- />
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagination">
- <el-pagination
- :total="total"
- :current-page="currentPage"
- background
- layout="prev, pager, next"
- @current-change="handleCurrentChange"
- />
- </div>
- </div>
- <el-dialog
- :title="$t('configCenter.configDialog.title')"
- :visible.sync="regustDialogVisible"
- width="1010px"
- >
- <el-form ref="form" :model="form" :rules="rules" label-width="170px">
- <el-form-item :label="$t('configCenter.configDialog.name')" prop="name">
- <el-input :placeholder="$t('configCenter.rules.name')" v-model="form.name" autocomplete="off" />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.centerType')" prop="instanceType">
- <el-radio-group v-model="form.instanceType">
- <el-radio label="Zookeeper">Zookeeper</el-radio>
- <el-radio label="Etcd">Etcd</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.address')" prop="serverLists">
- <el-input
- :placeholder="$t('configCenter.rules.address')"
- v-model="form.serverLists"
- autocomplete="off"
- />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.orchestrationName')" prop="orchestrationName">
- <el-input
- :placeholder="$t('configCenter.rules.orchestrationName')"
- v-model="form.orchestrationName"
- autocomplete="off"
- />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.namespaces')" prop="namespace">
- <el-input
- :placeholder="$t('configCenter.rules.namespaces')"
- v-model="form.namespace"
- autocomplete="off"
- />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.digest')">
- <el-input
- :placeholder="$t('configCenter.rules.digest')"
- v-model="form.digest"
- autocomplete="off"
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="regustDialogVisible = false">{{ $t("configCenter.configDialog.btnCancelTxt") }}</el-button>
- <el-button
- type="primary"
- @click="onConfirm('form')"
- >{{ $t("configCenter.configDialog.btnConfirmTxt") }}</el-button>
- </div>
- </el-dialog>
- <el-dialog
- :title="$t('configCenter.configDialog.editTitle')"
- :visible.sync="editDialogVisible"
- width="1010px"
- >
- <el-form ref="editForm" :model="editForm" :rules="rules" label-width="170px">
- <el-form-item :label="$t('configCenter.configDialog.name')" prop="name">
- <el-input :placeholder="$t('configCenter.rules.name')" v-model="editForm.name" autocomplete="off" />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.centerType')" prop="instanceType">
- <el-radio-group v-model="editForm.instanceType">
- <el-radio label="Zookeeper">Zookeeper</el-radio>
- <el-radio label="Etcd">Etcd</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.address')" prop="serverLists">
- <el-input
- :placeholder="$t('configCenter.rules.address')"
- v-model="editForm.serverLists"
- autocomplete="off"
- />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.orchestrationName')" prop="orchestrationName">
- <el-input
- :placeholder="$t('configCenter.rules.orchestrationName')"
- v-model="editForm.orchestrationName"
- autocomplete="off"
- />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.namespaces')" prop="namespace">
- <el-input
- :placeholder="$t('configCenter.rules.namespaces')"
- v-model="editForm.namespace"
- autocomplete="off"
- />
- </el-form-item>
- <el-form-item :label="$t('configCenter.configDialog.digest')">
- <el-input
- :placeholder="$t('configCenter.rules.digest')"
- v-model="editForm.digest"
- autocomplete="off"
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelEdit">{{ $t("configCenter.configDialog.btnCancelTxt") }}</el-button>
- <el-button
- type="primary"
- @click="confirmEdit('editForm')"
- >{{ $t("configCenter.configDialog.btnConfirmTxt") }}</el-button>
- </div>
- </el-dialog>
- </el-row>
-</template>
-<script>
-import { mapActions } from 'vuex'
-import clone from 'lodash/clone'
-import API from '../api'
-export default {
- name: 'ConfigCenter',
- data() {
- return {
- regustDialogVisible: false,
- editDialogVisible: false,
- column: [
- {
- label: this.$t('configCenter').configDialog.name,
- prop: 'name'
- },
- {
- label: this.$t('configCenter').configDialog.centerType,
- prop: 'instanceType'
- },
- {
- label: this.$t('configCenter').configDialog.address,
- prop: 'serverLists'
- },
- {
- label: this.$t('configCenter').configDialog.namespaces,
- prop: 'namespace'
- },
- {
- label: this.$t('configCenter').configDialog.orchestrationName,
- prop: 'orchestrationName'
- }
- ],
- form: {
- name: '',
- serverLists: '',
- namespace: '',
- instanceType: 'Zookeeper',
- orchestrationName: '',
- orchestrationType: 'config_center',
- digest: ''
- },
- editForm: {
- primaryName: '',
- name: '',
- serverLists: '',
- namespace: '',
- instanceType: 'Zookeeper',
- orchestrationName: '',
- orchestrationType: 'config_center',
- digest: ''
- },
- rules: {
- name: [
- {
- required: true,
- message: this.$t('configCenter').rules.name,
- trigger: 'change'
- }
- ],
- serverLists: [
- {
- required: true,
- message: this.$t('configCenter').rules.address,
- trigger: 'change'
- }
- ],
- namespace: [
- {
- required: true,
- message: this.$t('configCenter').rules.namespace,
- trigger: 'change'
- }
- ],
- instanceType: [
- {
- required: true,
- message: this.$t('configCenter').rules.centerType,
- trigger: 'change'
- }
- ],
- orchestrationName: [
- {
- required: true,
- message: this.$t('configCenter').rules.orchestrationName,
- trigger: 'change'
- }
- ]
- },
- tableData: [],
- cloneTableData: [],
- currentPage: 1,
- pageSize: 10,
- total: null
- }
- },
- created() {
- this.getRegCenter()
- },
- methods: {
- ...mapActions(['setRegCenterActivated']),
- handleCurrentChange(val) {
- const data = clone(this.cloneTableData)
- this.tableData = data.splice(val - 1, this.pageSize)
- },
- getRegCenter() {
- API.getConfigCenter().then(res => {
- const data = res.model
- this.total = data.length
- this.cloneTableData = clone(res.model)
- this.tableData = data.splice(0, this.pageSize)
- })
- this.getRegCenterActivated()
- },
- getRegCenterActivated() {
- API.getConfigCenterActivated().then(res => {
- this.setRegCenterActivated(res.model.name)
- })
- },
- handleConnect(row) {
- if (row.activated) {
- this.$notify({
- title: this.$t('common').notify.title,
- message: this.$t('common').connected,
- type: 'success'
- })
- } else {
- const params = {
- name: row.name
- }
- API.postConfigCenterConnect(params).then(res => {
- this.$notify({
- title: this.$t('common').notify.title,
- message: this.$t('common').notify.conSucMessage,
- type: 'success'
- })
- this.getRegCenter()
- })
- }
- },
- handlerDel(row) {
- const params = {
- name: row.name
- }
- API.deleteConfigCenter(params).then(res => {
- this.$notify({
- title: this.$t('common').notify.title,
- message: this.$t('common').notify.delSucMessage,
- type: 'success'
- })
- this.getRegCenter()
- })
- },
- onConfirm(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- API.postConfigCenter(this.form).then(res => {
- this.regustDialogVisible = false
- this.$notify({
- title: this.$t('common').notify.title,
- message: this.$t('common').notify.addSucMessage,
- type: 'success'
- })
- this.getRegCenter()
- })
- } else {
- console.log('error submit!!')
- return false
- }
- })
- },
- add() {
- this.regustDialogVisible = true
- },
- handleEdit(row) {
- this.editDialogVisible = true
- this.editForm = Object.assign({}, row)
- this.editForm.primaryName = row.name
- },
- confirmEdit(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- API.updateConfigCenter(this.editForm).then(res => {
- this.editDialogVisible = false
- this.$notify({
- title: this.$t('common').notify.title,
- message: this.$t('common').notify.editSucMessage,
- type: 'success'
- })
- this.getRegCenter()
- })
- } else {
- console.log('error submit!!')
- return false
- }
- })
- },
- cancelEdit() {
- this.editDialogVisible = false
- }
- }
-}
-</script>
-<style lang='scss' scoped>
-.btn-group {
- margin-bottom: 20px;
-}
-.pagination {
- float: right;
- margin: 10px -10px 10px 0;
-}
-</style>
diff --git a/shardingsphere-ui-frontend/src/views/registry-center/module/registryCenter.vue b/shardingsphere-ui-frontend/src/views/registry-center/module/registryCenter.vue
index ea57b36..84911e4 100644
--- a/shardingsphere-ui-frontend/src/views/registry-center/module/registryCenter.vue
+++ b/shardingsphere-ui-frontend/src/views/registry-center/module/registryCenter.vue
@@ -98,10 +98,10 @@
<el-form-item :label="$t('registryCenter.registDialog.name')" prop="name">
<el-input :placeholder="$t('registryCenter.rules.name')" v-model="form.name" autocomplete="off" />
</el-form-item>
- <el-form-item :label="$t('registryCenter.registDialog.orchestrationName')" prop="orchestrationName">
+ <el-form-item :label="$t('registryCenter.registDialog.governanceName')" prop="governanceName">
<el-input
- :placeholder="$t('registryCenter.rules.orchestrationName')"
- v-model="form.orchestrationName"
+ :placeholder="$t('registryCenter.rules.governanceName')"
+ v-model="form.governanceName"
autocomplete="off"
/>
</el-form-item>
@@ -163,10 +163,10 @@
<el-form-item :label="$t('registryCenter.registDialog.name')" prop="name">
<el-input :placeholder="$t('registryCenter.rules.name')" v-model="editForm.name" autocomplete="off" />
</el-form-item>
- <el-form-item :label="$t('registryCenter.registDialog.orchestrationName')" prop="orchestrationName">
+ <el-form-item :label="$t('registryCenter.registDialog.governanceName')" prop="governanceName">
<el-input
- :placeholder="$t('registryCenter.rules.orchestrationName')"
- v-model="editForm.orchestrationName"
+ :placeholder="$t('registryCenter.rules.governanceName')"
+ v-model="editForm.governanceName"
autocomplete="off"
/>
</el-form-item>
@@ -241,6 +241,10 @@
prop: 'name'
},
{
+ label: this.$t('registryCenter').registDialog.governanceName,
+ prop: 'governanceName'
+ },
+ {
label: this.$t('registryCenter').registDialog.centerType,
prop: 'instanceType'
},
@@ -249,10 +253,6 @@
prop: 'serverLists'
},
{
- label: this.$t('registryCenter').registDialog.orchestrationName,
- prop: 'orchestrationName'
- },
- {
label: this.$t('registryCenter').registDialog.additionalCenterType,
prop: 'additionalConfigCenterType'
},
@@ -265,7 +265,7 @@
name: '',
serverLists: '',
instanceType: 'Zookeeper',
- orchestrationName: '',
+ governanceName: '',
digest: '',
additionalConfigCenterType: '',
additionalConfigCenterServerList: '',
@@ -276,7 +276,7 @@
name: '',
serverLists: '',
instanceType: 'Zookeeper',
- orchestrationName: '',
+ governanceName: '',
digest: '',
additionalConfigCenterType: '',
additionalConfigCenterServerList: '',
@@ -311,10 +311,10 @@
trigger: 'change'
}
],
- orchestrationName: [
+ governanceName: [
{
required: true,
- message: this.$t('registryCenter').rules.orchestrationName,
+ message: this.$t('registryCenter').rules.governanceName,
trigger: 'change'
}
]
diff --git a/shardingsphere-ui-frontend/src/views/runtime-status/api.js b/shardingsphere-ui-frontend/src/views/runtime-status/api.js
index 2893fdb..f411b36 100644
--- a/shardingsphere-ui-frontend/src/views/runtime-status/api.js
+++ b/shardingsphere-ui-frontend/src/views/runtime-status/api.js
@@ -18,8 +18,8 @@
import API from '@/utils/api'
export default {
- getOrcheData: (params = {}) => API.get(`/api/orchestration/datasource`, params),
- putOrcheData: (params = {}) => API.put(`/api/orchestration/datasource`, params),
- getOrcheInstance: (params = {}) => API.get(`/api/orchestration/instance`, params),
- putOrcheInstance: (params = {}) => API.put(`/api/orchestration/instance`, params)
+ getOrcheData: (params = {}) => API.get(`/api/governance/datasource`, params),
+ putOrcheData: (params = {}) => API.put(`/api/governance/datasource`, params),
+ getOrcheInstance: (params = {}) => API.get(`/api/governance/instance`, params),
+ putOrcheInstance: (params = {}) => API.put(`/api/governance/instance`, params)
}