Browse Source

[Improvement#6655] [UI] remove registry monitor (#6789) (#6827)

2.0.7-release
Kirs 3 years ago committed by GitHub
parent
commit
37b11bf606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java
  2. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
  3. 14
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java
  4. 19
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java
  5. 18
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/MonitorControllerTest.java
  6. 7
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/MonitorServiceTest.java
  7. 67
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
  8. 9
      dolphinscheduler-ui/src/js/conf/home/router/index.js
  9. 9
      dolphinscheduler-ui/src/js/conf/home/store/monitor/actions.js
  10. 6
      dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

17
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java

@ -20,7 +20,6 @@ package org.apache.dolphinscheduler.api.controller;
import static org.apache.dolphinscheduler.api.enums.Status.LIST_MASTERS_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.LIST_WORKERS_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_DATABASE_STATE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ZOOKEEPER_STATE_ERROR;
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
import org.apache.dolphinscheduler.api.exceptions.ApiException;
@ -102,20 +101,4 @@ public class MonitorController extends BaseController {
return returnDataList(result);
}
/**
* query zookeeper state
*
* @param loginUser login user
* @return zookeeper information list
*/
@ApiOperation(value = "queryZookeeperState", notes = "QUERY_ZOOKEEPER_STATE_NOTES")
@GetMapping(value = "/zookeepers")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_ZOOKEEPER_STATE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryZookeeperState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) {
Map<String, Object> result = monitorService.queryZookeeperState(loginUser);
return returnDataList(result);
}
}

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java

@ -210,6 +210,8 @@ public enum Status {
QUERY_WORKER_ADDRESS_LIST_FAIL(10178, "query worker address list fail ", "查询worker地址列表失败"),
TRANSFORM_PROJECT_OWNERSHIP(10179, "Please transform project ownership [{0}]", "请先转移项目所有权[{0}]"),
QUERY_ALERT_GROUP_ERROR(10180, "query alert group error", "查询告警组错误"),
CURRENT_LOGIN_USER_TENANT_NOT_EXIST(10181, "the tenant of the currently login user is not specified", "未指定当前登录用户的租户"),
UDF_FUNCTION_NOT_EXIST(20001, "UDF function not found", "UDF函数不存在"),
UDF_FUNCTION_EXISTS(20002, "UDF function already exists", "UDF函数已存在"),

14
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java

@ -35,7 +35,7 @@ public interface MonitorService {
* @return data base state
*/
Map<String,Object> queryDatabaseState(User loginUser);
/**
* query master list
*
@ -43,15 +43,7 @@ public interface MonitorService {
* @return master information list
*/
Map<String,Object> queryMaster(User loginUser);
/**
* query zookeeper state
*
* @param loginUser login user
* @return zookeeper information list
*/
Map<String,Object> queryZookeeperState(User loginUser);
/**
* query worker list
*
@ -59,6 +51,6 @@ public interface MonitorService {
* @return worker information list
*/
Map<String,Object> queryWorker(User loginUser);
List<Server> getServerListFromRegistry(boolean isMaster);
}

19
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java

@ -85,25 +85,6 @@ public class MonitorServiceImpl extends BaseServiceImpl implements MonitorServic
return result;
}
/**
* query zookeeper state
*
* @param loginUser login user
* @return zookeeper information list
*/
@Override
public Map<String,Object> queryZookeeperState(User loginUser) {
Map<String, Object> result = new HashMap<>();
List<ZookeeperRecord> zookeeperRecordList = RegistryCenterUtils.zookeeperInfoList();
result.put(Constants.DATA_LIST, zookeeperRecordList);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query worker list
*

18
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/MonitorControllerTest.java

@ -75,23 +75,7 @@ public class MonitorControllerTest extends AbstractControllerTest {
@Test
public void testQueryDatabaseState() throws Exception {
MvcResult mvcResult = mockMvc.perform(get("/monitor/database")
.header(SESSION_ID, sessionId)
/* .param("type", ResourceType.FILE.name())*/)
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
result.getCode().equals(Status.SUCCESS.getCode());
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryZookeeperState() throws Exception {
MvcResult mvcResult = mockMvc.perform(get("/monitor/zookeeper/list")
MvcResult mvcResult = mockMvc.perform(get("/monitor/databases")
.header(SESSION_ID, sessionId)
/* .param("type", ResourceType.FILE.name())*/)
.andExpect(status().isOk())

7
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/MonitorServiceTest.java

@ -81,13 +81,6 @@ public class MonitorServiceTest {
/*Assert.assertEquals(Status.SUCCESS,result.get(Constants.STATUS));*/
}
@Test
public void testGetServerListFromZK() {
//TODO need zk
/*List<Server> serverList = monitorService.getServerListFromZK(true);*/
/*logger.info(serverList.toString());*/
}
private List<MonitorRecord> getList() {
List<MonitorRecord> monitorRecordList = new ArrayList<>();
monitorRecordList.add(getEntity());

67
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue

@ -1,67 +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>
<m-list-construction :title="'Zookeeper ' + $t('Manage')">
<template slot="content">
<template v-if="zookeeperList.length">
<m-list :list="zookeeperList"></m-list>
</template>
<template v-if="!zookeeperList.length">
<m-no-data></m-no-data>
</template>
<m-spin :is-spin="isLoading" ></m-spin>
</template>
</m-list-construction>
</template>
<script>
import { mapActions } from 'vuex'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default {
name: 'servers-zookeeper',
data () {
return {
isLoading: false,
zookeeperList: []
}
},
props: {},
methods: {
...mapActions('monitor', ['getZookeeperData'])
},
watch: {},
created () {
this.isLoading = true
this.getZookeeperData().then(res => {
this.zookeeperList = res
this.isLoading = false
}).catch(() => {
this.isLoading = false
})
},
mounted () {
},
components: { mList, mListConstruction, mSpin, mNoData }
}
</script>
<style lang="scss" rel="stylesheet/scss">
@import "./servers";
</style>

9
dolphinscheduler-ui/src/js/conf/home/router/index.js

@ -547,15 +547,6 @@ const router = new Router({
refreshInSwitchedTab: config.refreshInSwitchedTab
}
},
{
path: '/monitor/servers/zookeeper',
name: 'servers-zookeeper',
component: resolve => require(['../pages/monitor/pages/servers/zookeeper'], resolve),
meta: {
title: 'Zookeeper',
refreshInSwitchedTab: config.refreshInSwitchedTab
}
},
{
path: '/monitor/servers/apiserver',
name: 'servers-apiserver',

9
dolphinscheduler-ui/src/js/conf/home/store/monitor/actions.js

@ -44,14 +44,5 @@ export default {
reject(e)
})
})
},
getZookeeperData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get('monitor/zookeepers', payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
}
}

6
dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

@ -238,12 +238,6 @@ const menu = {
id: 1,
enabled: true
},
{
name: 'Zookeeper',
path: 'servers-zookeeper',
id: 4,
enabled: true
},
{
name: 'DB',
path: 'servers-db',

Loading…
Cancel
Save