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

zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 899fb37813 [Fix-16903] Fix monitor page cannot display well (#16968)
899fb37813 is described below

commit 899fb378137582ef9a20663318c79f9f95cf855e
Author: Wenjun Ruan <[email protected]>
AuthorDate: Fri Jan 24 08:56:55 2025 +0800

    [Fix-16903] Fix monitor page cannot display well (#16968)
---
 .../alert/registry/AlertHeartbeatTask.java         |  1 +
 .../api/controller/MonitorController.java          |  2 +-
 .../meter/metrics/DefaultMetricsProvider.java      |  6 ++
 .../registry/api/RegistryConstants.java            | 26 ++------
 .../plugin/registry/jdbc/JdbcRegistry.java         | 41 ++++++------
 .../plugin/registry/jdbc/KeyUtils.java             | 76 ++++++++++++++++++++++
 .../jdbc/server/JdbcRegistryDataManager.java       |  6 +-
 .../plugin/registry/jdbc/KeyUtilsTest.java         | 40 ++++++------
 dolphinscheduler-ui/src/locales/en_US/monitor.ts   |  6 +-
 dolphinscheduler-ui/src/locales/zh_CN/monitor.ts   |  6 +-
 .../src/service/modules/monitor/types.ts           |  4 +-
 .../monitor/servers/alert_server/index.module.scss |  5 --
 .../views/monitor/servers/alert_server/index.tsx   | 35 ++++------
 .../views/monitor/servers/master/index.module.scss |  5 --
 .../src/views/monitor/servers/master/index.tsx     | 35 ++++------
 .../views/monitor/servers/worker/index.module.scss |  5 --
 .../src/views/monitor/servers/worker/index.tsx     | 64 ++++++------------
 17 files changed, 179 insertions(+), 184 deletions(-)

diff --git 
a/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/registry/AlertHeartbeatTask.java
 
b/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/registry/AlertHeartbeatTask.java
index 8b9775e6d8..95d26b1558 100644
--- 
a/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/registry/AlertHeartbeatTask.java
+++ 
b/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/registry/AlertHeartbeatTask.java
@@ -75,6 +75,7 @@ public class AlertHeartbeatTask extends 
BaseHeartBeatTask<AlertServerHeartBeat>
                 .cpuUsage(systemMetrics.getSystemCpuUsagePercentage())
                 .memoryUsage(systemMetrics.getSystemMemoryUsedPercentage())
                 .jvmMemoryUsage(systemMetrics.getJvmMemoryUsedPercentage())
+                .diskUsage(systemMetrics.getDiskUsedPercentage())
                 .serverStatus(ServerStatus.NORMAL)
                 .isActive(alertHAServer.isActive())
                 .host(NetUtils.getHost())
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 4bf952d006..be714032cc 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
@@ -65,7 +65,7 @@ public class MonitorController extends BaseController {
     @ResponseStatus(HttpStatus.OK)
     @ApiException(LIST_MASTERS_ERROR)
     public Result<List<Server>> listServer(@PathVariable("nodeType") 
RegistryNodeType nodeType) {
-        List<Server> servers = monitorService.listServer(nodeType);
+        final List<Server> servers = monitorService.listServer(nodeType);
         return Result.success(servers);
     }
 
diff --git 
a/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/metrics/DefaultMetricsProvider.java
 
b/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/metrics/DefaultMetricsProvider.java
index d227679446..0db50ba95e 100644
--- 
a/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/metrics/DefaultMetricsProvider.java
+++ 
b/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/metrics/DefaultMetricsProvider.java
@@ -65,6 +65,9 @@ public class DefaultMetricsProvider implements 
MetricsProvider {
         long totalSystemMemory = OSUtils.getTotalSystemMemory();
         long systemMemoryAvailable = OSUtils.getSystemAvailableMemoryUsed();
 
+        double diskToTalBytes = 
meterRegistry.get("disk.total").gauge().value();
+        double diskFreeBytes = meterRegistry.get("disk.free").gauge().value();
+
         systemMetrics = SystemMetrics.builder()
                 .systemCpuUsagePercentage(systemCpuUsage)
                 .jvmCpuUsagePercentage(processCpuUsage)
@@ -74,6 +77,9 @@ public class DefaultMetricsProvider implements 
MetricsProvider {
                 .systemMemoryUsed(totalSystemMemory - systemMemoryAvailable)
                 .systemMemoryMax(totalSystemMemory)
                 .systemMemoryUsedPercentage((double) (totalSystemMemory - 
systemMemoryAvailable) / totalSystemMemory)
+                .diskUsed(diskToTalBytes - diskFreeBytes)
+                .diskTotal(diskToTalBytes)
+                .diskUsedPercentage((diskToTalBytes - diskFreeBytes) / 
diskToTalBytes)
                 .build();
         lastRefreshTime = System.currentTimeMillis();
         return systemMetrics;
diff --git 
a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss 
b/dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryConstants.java
similarity index 69%
copy from 
dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss
copy to 
dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryConstants.java
index 7bde891f5b..93d28576bd 100644
--- 
a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss
+++ 
b/dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryConstants.java
@@ -15,29 +15,11 @@
  * limitations under the License.
  */
 
- @mixin base {
-  font-size: 5vw;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  min-height: 400px;
-}
-
-.card {
-  @include base;
-}
+package org.apache.dolphinscheduler.registry.api;
 
-.load-average {
-  @include base;
-  color: var(--n-color-target);
-}
+public class RegistryConstants {
 
-.link-btn {
-  color: var(--n-color-target);
-  cursor: pointer;
+    public static final String PATH_SEPARATOR = "/";
+    public static final char PATH_SEPARATOR_CHAR = '/';
 
-  &:hover {
-    color: var(--n-color-target);
-    opacity: 0.8;
-  }
 }
diff --git 
a/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java
 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java
index bd468f58b7..37a301bcad 100644
--- 
a/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java
+++ 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java
@@ -97,19 +97,19 @@ public final class JdbcRegistry implements Registry {
     }
 
     @Override
-    public void subscribe(String path, SubscribeListener listener) {
-        checkNotNull(path);
+    public void subscribe(String subscribePath, SubscribeListener listener) {
+        checkNotNull(subscribePath);
         checkNotNull(listener);
         jdbcRegistryClient.subscribeJdbcRegistryDataChange(new 
JdbcRegistryDataChangeListener() {
 
             @Override
-            public void onJdbcRegistryDataChanged(String key, String value) {
-                if (!key.startsWith(path)) {
+            public void onJdbcRegistryDataChanged(String eventPath, String 
value) {
+                if (!isPathMatch(subscribePath, eventPath)) {
                     return;
                 }
-                Event event = Event.builder()
-                        .key(key)
-                        .path(path)
+                final Event event = Event.builder()
+                        .key(subscribePath)
+                        .path(eventPath)
                         .data(value)
                         .type(Event.Type.UPDATE)
                         .build();
@@ -117,31 +117,35 @@ public final class JdbcRegistry implements Registry {
             }
 
             @Override
-            public void onJdbcRegistryDataDeleted(String key) {
-                if (!key.startsWith(path)) {
+            public void onJdbcRegistryDataDeleted(String eventPath) {
+                if (!isPathMatch(subscribePath, eventPath)) {
                     return;
                 }
-                Event event = Event.builder()
-                        .key(key)
-                        .path(key)
+                final Event event = Event.builder()
+                        .key(subscribePath)
+                        .path(eventPath)
                         .type(Event.Type.REMOVE)
                         .build();
                 listener.notify(event);
             }
 
             @Override
-            public void onJdbcRegistryDataAdded(String key, String value) {
-                if (!key.startsWith(path)) {
+            public void onJdbcRegistryDataAdded(String eventPath, String 
value) {
+                if (!isPathMatch(subscribePath, eventPath)) {
                     return;
                 }
-                Event event = Event.builder()
-                        .key(key)
-                        .path(key)
+                final Event event = Event.builder()
+                        .key(subscribePath)
+                        .path(eventPath)
                         .data(value)
                         .type(Event.Type.ADD)
                         .build();
                 listener.notify(event);
             }
+
+            private boolean isPathMatch(String subscribePath, String 
eventPath) {
+                return KeyUtils.isParent(subscribePath, eventPath) || 
KeyUtils.isSamePath(subscribePath, eventPath);
+            }
         });
     }
 
@@ -206,11 +210,10 @@ public final class JdbcRegistry implements Registry {
     @Override
     public Collection<String> children(String key) {
         try {
-            List<JdbcRegistryDataDTO> children = 
jdbcRegistryClient.listJdbcRegistryDataChildren(key);
+            final List<JdbcRegistryDataDTO> children = 
jdbcRegistryClient.listJdbcRegistryDataChildren(key);
             return children
                     .stream()
                     .map(JdbcRegistryDataDTO::getDataKey)
-                    .filter(fullPath -> fullPath.length() > key.length())
                     .map(fullPath -> 
StringUtils.substringBefore(fullPath.substring(key.length() + 1), "/"))
                     .distinct()
                     .collect(Collectors.toList());
diff --git 
a/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java
 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java
new file mode 100644
index 0000000000..84576243ca
--- /dev/null
+++ 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java
@@ -0,0 +1,76 @@
+/*
+ * 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.dolphinscheduler.plugin.registry.jdbc;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.apache.dolphinscheduler.registry.api.RegistryConstants;
+
+import org.apache.commons.lang3.StringUtils;
+
+import lombok.experimental.UtilityClass;
+
+@UtilityClass
+public class KeyUtils {
+
+    /**
+     * Whether the path is the parent path of the child
+     * <p> Only the parentPath is the parent path of the childPath, return true
+     * <p> If the parentPath is equal to the childPath, return false
+     */
+    public static boolean isParent(final String parentPath, final String 
childPath) {
+        if (StringUtils.isEmpty(parentPath)) {
+            throw new IllegalArgumentException("Invalid parent path " + 
parentPath);
+        }
+        if (StringUtils.isEmpty(childPath)) {
+            throw new IllegalArgumentException("Invalid child path " + 
childPath);
+        }
+        final String[] parentSplit = 
parentPath.split(RegistryConstants.PATH_SEPARATOR);
+        final String[] childSplit = 
childPath.split(RegistryConstants.PATH_SEPARATOR);
+        if (parentSplit.length >= childSplit.length) {
+            return false;
+        }
+        for (int i = 0; i < parentSplit.length; i++) {
+            if (!parentSplit[i].equals(childSplit[i])) {
+                return false;
+            }
+        }
+        return true;
+
+    }
+
+    public static boolean isSamePath(final String path1, final String path2) {
+        return removeLastSlash(path1).equals(path2);
+    }
+
+    private static String removeLastSlash(final String path) {
+        checkNotNull(path, "path is null");
+        if (!path.startsWith(RegistryConstants.PATH_SEPARATOR)) {
+            throw new IllegalArgumentException("Invalid path " + path);
+        }
+        int length = path.length() - 1;
+        while (length >= 0 && path.charAt(length) == 
RegistryConstants.PATH_SEPARATOR_CHAR) {
+            length--;
+        }
+        if (length == -1) {
+            return RegistryConstants.PATH_SEPARATOR;
+        }
+        return path.substring(0, length + 1);
+    }
+
+}
diff --git 
a/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/server/JdbcRegistryDataManager.java
 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/server/JdbcRegistryDataManager.java
index e0f091bde7..b31780cf7f 100644
--- 
a/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/server/JdbcRegistryDataManager.java
+++ 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/server/JdbcRegistryDataManager.java
@@ -21,6 +21,7 @@ import static 
com.google.common.base.Preconditions.checkNotNull;
 
 import org.apache.dolphinscheduler.plugin.registry.jdbc.JdbcRegistryProperties;
 import 
org.apache.dolphinscheduler.plugin.registry.jdbc.JdbcRegistryThreadFactory;
+import org.apache.dolphinscheduler.plugin.registry.jdbc.KeyUtils;
 import org.apache.dolphinscheduler.plugin.registry.jdbc.model.DTO.DataType;
 import 
org.apache.dolphinscheduler.plugin.registry.jdbc.model.DTO.JdbcRegistryDataChanceEventDTO;
 import 
org.apache.dolphinscheduler.plugin.registry.jdbc.model.DTO.JdbcRegistryDataDTO;
@@ -147,12 +148,11 @@ public class JdbcRegistryDataManager
     }
 
     @Override
-    public List<JdbcRegistryDataDTO> listJdbcRegistryDataChildren(String key) {
+    public List<JdbcRegistryDataDTO> listJdbcRegistryDataChildren(final String 
key) {
         checkNotNull(key);
         return jdbcRegistryDataRepository.selectAll()
                 .stream()
-                .filter(jdbcRegistryDataDTO -> 
jdbcRegistryDataDTO.getDataKey().startsWith(key)
-                        && !jdbcRegistryDataDTO.getDataKey().equals(key))
+                .filter(jdbcRegistryDataDTO -> KeyUtils.isParent(key, 
jdbcRegistryDataDTO.getDataKey()))
                 .collect(Collectors.toList());
     }
 
diff --git 
a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/test/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtilsTest.java
similarity index 53%
copy from 
dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss
copy to 
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/test/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtilsTest.java
index 7bde891f5b..0a8c591dc2 100644
--- 
a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss
+++ 
b/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/test/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtilsTest.java
@@ -15,29 +15,27 @@
  * limitations under the License.
  */
 
- @mixin base {
-  font-size: 5vw;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  min-height: 400px;
-}
+package org.apache.dolphinscheduler.plugin.registry.jdbc;
 
-.card {
-  @include base;
-}
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-.load-average {
-  @include base;
-  color: var(--n-color-target);
-}
+import org.junit.jupiter.api.Test;
+
+class KeyUtilsTest {
+
+    @Test
+    void isParent() {
+        assertFalse(KeyUtils.isParent("/a", "/b"));
+        assertFalse(KeyUtils.isParent("/a", "/a"));
+        assertFalse(KeyUtils.isParent("/b/c", "/b"));
+        assertFalse(KeyUtils.isParent("/b/c", "/b/"));
+
+        assertTrue(KeyUtils.isParent("/", "/b"));
+        assertTrue(KeyUtils.isParent("/b/c", "/b/c/d"));
+        assertTrue(KeyUtils.isParent("/b", "/b/c/d"));
+        assertTrue(KeyUtils.isParent("/b/", "/b/c/d"));
 
-.link-btn {
-  color: var(--n-color-target);
-  cursor: pointer;
+    }
 
-  &:hover {
-    color: var(--n-color-target);
-    opacity: 0.8;
-  }
 }
diff --git a/dolphinscheduler-ui/src/locales/en_US/monitor.ts 
b/dolphinscheduler-ui/src/locales/en_US/monitor.ts
index 561b40d64b..5443153432 100644
--- a/dolphinscheduler-ui/src/locales/en_US/monitor.ts
+++ b/dolphinscheduler-ui/src/locales/en_US/monitor.ts
@@ -19,8 +19,7 @@ export default {
   master: {
     cpu_usage: 'CPU Usage',
     memory_usage: 'Memory Usage',
-    disk_available: 'Disk Available',
-    load_average: 'Load Average',
+    disk_usage: 'Disk Usage',
     create_time: 'Create Time',
     last_heartbeat_time: 'Last Heartbeat Time',
     directory_detail: 'Directory Detail',
@@ -33,8 +32,7 @@ export default {
   worker: {
     cpu_usage: 'CPU Usage',
     memory_usage: 'Memory Usage',
-    disk_available: 'Disk Available',
-    load_average: 'Load Average',
+    disk_usage: 'Disk Usage',
     thread_pool_usage: 'Thread Pool Usage',
     create_time: 'Create Time',
     last_heartbeat_time: 'Last Heartbeat Time',
diff --git a/dolphinscheduler-ui/src/locales/zh_CN/monitor.ts 
b/dolphinscheduler-ui/src/locales/zh_CN/monitor.ts
index 2ef6a9c460..ef78068a61 100644
--- a/dolphinscheduler-ui/src/locales/zh_CN/monitor.ts
+++ b/dolphinscheduler-ui/src/locales/zh_CN/monitor.ts
@@ -19,8 +19,7 @@ export default {
   master: {
     cpu_usage: '处理器使用量',
     memory_usage: '内存使用量',
-    disk_available: '磁盘可用容量',
-    load_average: '平均负载量',
+    disk_usage: '磁盘使用量',
     create_time: '创建时间',
     last_heartbeat_time: '最后心跳时间',
     directory_detail: '目录详情',
@@ -33,8 +32,7 @@ export default {
   worker: {
     cpu_usage: '处理器使用量',
     memory_usage: '内存使用量',
-    disk_available: '磁盘可用容量',
-    load_average: '平均负载量',
+    disk_usage: '磁盘使用量',
     thread_pool_usage: '线程池使用量',
     create_time: '创建时间',
     last_heartbeat_time: '最后心跳时间',
diff --git a/dolphinscheduler-ui/src/service/modules/monitor/types.ts 
b/dolphinscheduler-ui/src/service/modules/monitor/types.ts
index 0a689019ce..11a707789a 100644
--- a/dolphinscheduler-ui/src/service/modules/monitor/types.ts
+++ b/dolphinscheduler-ui/src/service/modules/monitor/types.ts
@@ -31,8 +31,8 @@ interface ServerNode {
   id: number
   host: string
   port: number
-  zkDirectory: string
-  resInfo: string
+  serverDirectory: string
+  heartBeatInfo: string
   createTime: string
   lastHeartbeatTime: string
 }
diff --git 
a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss 
b/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss
index 7bde891f5b..deedab61c0 100644
--- 
a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss
+++ 
b/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.module.scss
@@ -27,11 +27,6 @@
   @include base;
 }
 
-.load-average {
-  @include base;
-  color: var(--n-color-target);
-}
-
 .link-btn {
   color: var(--n-color-target);
   cursor: pointer;
diff --git 
a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.tsx 
b/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.tsx
index a223fcb8a8..d9f876b8c6 100644
--- a/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.tsx
+++ b/dolphinscheduler-ui/src/views/monitor/servers/alert_server/index.tsx
@@ -16,7 +16,7 @@
  */
 
 import { defineComponent, onMounted, ref, toRefs } from 'vue'
-import { NGrid, NGi, NCard, NNumberAnimation, NSpace, NTag } from 'naive-ui'
+import { NGrid, NGi, NCard, NSpace, NTag } from 'naive-ui'
 import { useI18n } from 'vue-i18n'
 import { useServerNode } from './use-server-node'
 import styles from './index.module.scss'
@@ -64,7 +64,7 @@ const alertServer = defineComponent({
       this
 
     const renderNodeServerStatusTag = (item: AlertNode) => {
-      const serverStatus = JSON.parse(item.resInfo)?.serverStatus
+      const serverStatus = JSON.parse(item.heartBeatInfo)?.serverStatus
 
       if (!serverStatus) return ''
 
@@ -103,7 +103,7 @@ const alertServer = defineComponent({
                       }`}</span>
                       <span
                         class={styles['link-btn']}
-                        onClick={() => clickDetails(item.zkDirectory)}
+                        onClick={() => clickDetails(item.serverDirectory)}
                       >
                         {t('monitor.master.directory_detail')}
                       </span>
@@ -125,7 +125,7 @@ const alertServer = defineComponent({
                         {item && (
                           <Gauge
                             data={(
-                              JSON.parse(item.resInfo).cpuUsage * 100
+                              JSON.parse(item.heartBeatInfo).cpuUsage * 100
                             ).toFixed(2)}
                           />
                         )}
@@ -138,7 +138,7 @@ const alertServer = defineComponent({
                         {item && (
                           <Gauge
                             data={(
-                              JSON.parse(item.resInfo).memoryUsage * 100
+                              JSON.parse(item.heartBeatInfo).memoryUsage * 100
                             ).toFixed(2)}
                           />
                         )}
@@ -146,26 +146,13 @@ const alertServer = defineComponent({
                     </Card>
                   </NGi>
                   <NGi>
-                    <Card title={t('monitor.master.disk_available')}>
-                      <div class={[styles.card, styles['load-average']]}>
+                    <Card title={t('monitor.master.disk_usage')}>
+                      <div class={[styles.card]}>
                         {item && (
-                          <NNumberAnimation
-                            precision={2}
-                            from={0}
-                            to={JSON.parse(item.resInfo).diskAvailable}
-                          />
-                        )}
-                      </div>
-                    </Card>
-                  </NGi>
-                  <NGi>
-                    <Card title={t('monitor.master.load_average')}>
-                      <div class={[styles.card, styles['load-average']]}>
-                        {item && (
-                          <NNumberAnimation
-                            precision={2}
-                            from={0}
-                            to={JSON.parse(item.resInfo).loadAverage}
+                          <Gauge
+                            data={(
+                              JSON.parse(item.heartBeatInfo).diskUsage * 100
+                            ).toFixed(2)}
                           />
                         )}
                       </div>
diff --git 
a/dolphinscheduler-ui/src/views/monitor/servers/master/index.module.scss 
b/dolphinscheduler-ui/src/views/monitor/servers/master/index.module.scss
index 7bde891f5b..deedab61c0 100644
--- a/dolphinscheduler-ui/src/views/monitor/servers/master/index.module.scss
+++ b/dolphinscheduler-ui/src/views/monitor/servers/master/index.module.scss
@@ -27,11 +27,6 @@
   @include base;
 }
 
-.load-average {
-  @include base;
-  color: var(--n-color-target);
-}
-
 .link-btn {
   color: var(--n-color-target);
   cursor: pointer;
diff --git a/dolphinscheduler-ui/src/views/monitor/servers/master/index.tsx 
b/dolphinscheduler-ui/src/views/monitor/servers/master/index.tsx
index cf29109c27..0766681ddf 100644
--- a/dolphinscheduler-ui/src/views/monitor/servers/master/index.tsx
+++ b/dolphinscheduler-ui/src/views/monitor/servers/master/index.tsx
@@ -16,7 +16,7 @@
  */
 
 import { defineComponent, onMounted, ref, toRefs } from 'vue'
-import { NGrid, NGi, NCard, NNumberAnimation, NSpace, NTag } from 'naive-ui'
+import { NGrid, NGi, NCard, NSpace, NTag } from 'naive-ui'
 import { useI18n } from 'vue-i18n'
 import { useMaster } from './use-master'
 import styles from './index.module.scss'
@@ -64,7 +64,7 @@ const master = defineComponent({
       this
 
     const renderNodeServerStatusTag = (item: MasterNode) => {
-      const serverStatus = JSON.parse(item.resInfo)?.serverStatus
+      const serverStatus = JSON.parse(item.heartBeatInfo)?.serverStatus
 
       if (!serverStatus) return ''
 
@@ -103,7 +103,7 @@ const master = defineComponent({
                       }`}</span>
                       <span
                         class={styles['link-btn']}
-                        onClick={() => clickDetails(item.zkDirectory)}
+                        onClick={() => clickDetails(item.serverDirectory)}
                       >
                         {t('monitor.master.directory_detail')}
                       </span>
@@ -125,7 +125,7 @@ const master = defineComponent({
                         {item && (
                           <Gauge
                             data={(
-                              JSON.parse(item.resInfo).cpuUsage * 100
+                              JSON.parse(item.heartBeatInfo).cpuUsage * 100
                             ).toFixed(2)}
                           />
                         )}
@@ -138,7 +138,7 @@ const master = defineComponent({
                         {item && (
                           <Gauge
                             data={(
-                              JSON.parse(item.resInfo).memoryUsage * 100
+                              JSON.parse(item.heartBeatInfo).memoryUsage * 100
                             ).toFixed(2)}
                           />
                         )}
@@ -146,26 +146,13 @@ const master = defineComponent({
                     </Card>
                   </NGi>
                   <NGi>
-                    <Card title={t('monitor.master.disk_available')}>
-                      <div class={[styles.card, styles['load-average']]}>
+                    <Card title={t('monitor.master.disk_usage')}>
+                      <div class={[styles.card]}>
                         {item && (
-                          <NNumberAnimation
-                            precision={2}
-                            from={0}
-                            to={JSON.parse(item.resInfo).diskAvailable}
-                          />
-                        )}
-                      </div>
-                    </Card>
-                  </NGi>
-                  <NGi>
-                    <Card title={t('monitor.master.load_average')}>
-                      <div class={[styles.card, styles['load-average']]}>
-                        {item && (
-                          <NNumberAnimation
-                            precision={2}
-                            from={0}
-                            to={JSON.parse(item.resInfo).loadAverage}
+                          <Gauge
+                            data={(
+                              JSON.parse(item.heartBeatInfo).diskUsage * 100
+                            ).toFixed(2)}
                           />
                         )}
                       </div>
diff --git 
a/dolphinscheduler-ui/src/views/monitor/servers/worker/index.module.scss 
b/dolphinscheduler-ui/src/views/monitor/servers/worker/index.module.scss
index f0a52382ee..5f6a7c62d4 100644
--- a/dolphinscheduler-ui/src/views/monitor/servers/worker/index.module.scss
+++ b/dolphinscheduler-ui/src/views/monitor/servers/worker/index.module.scss
@@ -27,11 +27,6 @@
   @include base;
 }
 
-.load-average {
-  @include base;
-  color: var(--n-color-target);
-}
-
 .link-btn {
   color: var(--n-color-target);
   cursor: pointer;
diff --git a/dolphinscheduler-ui/src/views/monitor/servers/worker/index.tsx 
b/dolphinscheduler-ui/src/views/monitor/servers/worker/index.tsx
index 6971e78f1b..34ff4786ac 100644
--- a/dolphinscheduler-ui/src/views/monitor/servers/worker/index.tsx
+++ b/dolphinscheduler-ui/src/views/monitor/servers/worker/index.tsx
@@ -16,7 +16,7 @@
  */
 
 import { defineComponent, onMounted, ref, toRefs } from 'vue'
-import { NGrid, NGi, NCard, NNumberAnimation, NSpace, NTag } from 'naive-ui'
+import { NGrid, NGi, NCard, NSpace, NTag } from 'naive-ui'
 import { useI18n } from 'vue-i18n'
 import { useWorker } from './use-worker'
 import styles from './index.module.scss'
@@ -64,7 +64,7 @@ const worker = defineComponent({
       this
 
     const renderNodeServerStatusTag = (item: WorkerNode) => {
-      const serverStatus = JSON.parse(item.resInfo)?.serverStatus
+      const serverStatus = JSON.parse(item.heartBeatInfo)?.serverStatus
 
       if (!serverStatus) return ''
 
@@ -103,7 +103,7 @@ const worker = defineComponent({
                       }`}</span>
                       <span
                         class={styles['link-btn']}
-                        onClick={() => clickDetails(item.zkDirectory)}
+                        onClick={() => clickDetails(item.serverDirectory)}
                       >
                         {t('monitor.worker.directory_detail')}
                       </span>
@@ -118,14 +118,14 @@ const worker = defineComponent({
                     </NSpace>
                   </NSpace>
                 </NCard>
-                <NGrid x-gap='12' cols='5'>
+                <NGrid x-gap='12' cols='4'>
                   <NGi>
                     <Card title={t('monitor.worker.cpu_usage')}>
                       <div class={styles.card}>
                         {item && (
                           <Gauge
                             data={(
-                              JSON.parse(item.resInfo).cpuUsage * 100
+                              JSON.parse(item.heartBeatInfo).cpuUsage * 100
                             ).toFixed(2)}
                           />
                         )}
@@ -138,7 +138,7 @@ const worker = defineComponent({
                         {item && (
                           <Gauge
                             data={(
-                              JSON.parse(item.resInfo).memoryUsage * 100
+                              JSON.parse(item.heartBeatInfo).memoryUsage * 100
                             ).toFixed(2)}
                           />
                         )}
@@ -146,54 +146,28 @@ const worker = defineComponent({
                     </Card>
                   </NGi>
                   <NGi>
-                    <Card title={t('monitor.worker.disk_available')}>
-                      <div class={[styles.card, styles['load-average']]}>
+                    <Card title={t('monitor.worker.disk_usage')}>
+                      <div class={[styles.card]}>
                         {item && (
-                          <NNumberAnimation
-                            precision={2}
-                            from={0}
-                            to={JSON.parse(item.resInfo).diskAvailable}
-                          />
-                        )}
-                      </div>
-                    </Card>
-                  </NGi>
-                  <NGi>
-                    <Card title={t('monitor.worker.load_average')}>
-                      <div class={[styles.card, styles['load-average']]}>
-                        {item && (
-                          <NNumberAnimation
-                            precision={2}
-                            from={0}
-                            to={JSON.parse(item.resInfo).loadAverage}
+                          <Gauge
+                            data={(
+                              JSON.parse(item.heartBeatInfo).diskUsage * 100
+                            ).toFixed(2)}
                           />
                         )}
                       </div>
                     </Card>
                   </NGi>
-
                   <NGi>
                     <Card title={t('monitor.worker.thread_pool_usage')}>
-                      <div
-                        class={[styles.card, styles['load-average']]}
-                        style={{
-                          'font-size': '90px'
-                        }}
-                      >
+                      <div class={[styles.card]}>
                         {item && (
-                          <>
-                            <NNumberAnimation
-                              precision={0}
-                              from={0}
-                              to={JSON.parse(item.resInfo).threadPoolUsage}
-                            />
-                            /
-                            <NNumberAnimation
-                              precision={0}
-                              from={0}
-                              to={JSON.parse(item.resInfo).workerHostWeight}
-                            />
-                          </>
+                          <Gauge
+                            data={(
+                              JSON.parse(item.heartBeatInfo).threadPoolUsage *
+                              100
+                            ).toFixed(2)}
+                          />
                         )}
                       </div>
                     </Card>


Reply via email to