This is an automated email from the ASF dual-hosted git repository.

leonbao pushed a commit to branch 2.0.0-release-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/2.0.0-release-prepare by this 
push:
     new 37b11bf  [Improvement#6655] [UI] remove registry monitor  (#6789) 
(#6827)
37b11bf is described below

commit 37b11bf6064401bbd9073daf52a6982af779b085
Author: Kirs <[email protected]>
AuthorDate: Fri Nov 12 14:46:47 2021 +0800

    [Improvement#6655] [UI] remove registry monitor  (#6789) (#6827)
---
 .../api/controller/MonitorController.java          | 17 ------
 .../apache/dolphinscheduler/api/enums/Status.java  |  2 +
 .../api/service/MonitorService.java                | 14 +----
 .../api/service/impl/MonitorServiceImpl.java       | 19 ------
 .../api/controller/MonitorControllerTest.java      | 18 +-----
 .../api/service/MonitorServiceTest.java            |  7 ---
 .../home/pages/monitor/pages/servers/zookeeper.vue | 67 ----------------------
 .../src/js/conf/home/router/index.js               |  9 ---
 .../src/js/conf/home/store/monitor/actions.js      |  9 ---
 .../components/secondaryMenu/_source/menu.js       |  6 --
 10 files changed, 6 insertions(+), 162 deletions(-)

diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java
index 92a9ffa..9240ac4 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java
+++ 
b/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);
-    }
-
 }
diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
index 7ea8f9b..6f8b2d6 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
+++ 
b/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函数已存在"),
diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java
index 0dbdc80..c63e273 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java
+++ 
b/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);
 }
diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java
index cb3b0b2..329f625 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java
+++ 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java
@@ -86,25 +86,6 @@ public class MonitorServiceImpl extends BaseServiceImpl 
implements MonitorServic
     }
 
     /**
-     * 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
      *
      * @param loginUser login user
diff --git 
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/MonitorControllerTest.java
 
b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/MonitorControllerTest.java
index 057a73a..0730ce8 100644
--- 
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/MonitorControllerTest.java
+++ 
b/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())
diff --git 
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/MonitorServiceTest.java
 
b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/MonitorServiceTest.java
index dc04cd0..2401f2b 100644
--- 
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/MonitorServiceTest.java
+++ 
b/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());
diff --git 
a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
 
b/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
deleted file mode 100644
index 215b905..0000000
--- 
a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
+++ /dev/null
@@ -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>
diff --git a/dolphinscheduler-ui/src/js/conf/home/router/index.js 
b/dolphinscheduler-ui/src/js/conf/home/router/index.js
index 9c93560..2c82a83 100644
--- a/dolphinscheduler-ui/src/js/conf/home/router/index.js
+++ b/dolphinscheduler-ui/src/js/conf/home/router/index.js
@@ -548,15 +548,6 @@ const router = new Router({
           }
         },
         {
-          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',
           component: resolve => 
require(['../pages/monitor/pages/servers/apiserver'], resolve),
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/monitor/actions.js 
b/dolphinscheduler-ui/src/js/conf/home/store/monitor/actions.js
index c4014ec..163549b 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/monitor/actions.js
+++ b/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)
-      })
-    })
   }
 }
diff --git 
a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js 
b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
index 371326c..ca58dd0 100644
--- a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
+++ b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
@@ -239,12 +239,6 @@ const menu = {
           enabled: true
         },
         {
-          name: 'Zookeeper',
-          path: 'servers-zookeeper',
-          id: 4,
-          enabled: true
-        },
-        {
           name: 'DB',
           path: 'servers-db',
           id: 6,

Reply via email to