You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2023/01/04 01:59:07 UTC

[GitHub] [inlong] bluewang opened a new pull request, #7137: [INLONG-7133][Dashboard] The sink's data node supports jumping to the node page

bluewang opened a new pull request, #7137:
URL: https://github.com/apache/inlong/pull/7137

   
   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   - Title Example: [INLONG-XYZ][Component] Title of the pull request
   
   *(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
   
   - Fixes https://github.com/apache/inlong/issues/7133
   
   ### Modifications
   
   ![image](https://user-images.githubusercontent.com/88174078/210470812-21db4de7-8755-4a2e-b156-3865172f4390.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] leezng commented on a diff in pull request #7137: [INLONG-7133][Dashboard] The sink's data node supports jumping to the node page

Posted by GitBox <gi...@apache.org>.
leezng commented on code in PR #7137:
URL: https://github.com/apache/inlong/pull/7137#discussion_r1061089392


##########
inlong-dashboard/src/metas/sinks/defaults/Elasticsearch.ts:
##########
@@ -52,33 +53,14 @@ export default class ElasticsearchSink
   implements DataWithBackend, RenderRow, RenderList
 {
   @FieldDecorator({
-    type: 'select',
+    type: NodeSelect,
     rules: [{ required: true }],
     props: values => ({
-      showSearch: true,
       disabled: [110, 130].includes(values?.status),
-      options: {
-        requestTrigger: ['onOpen', 'onSearch'],
-        requestService: {
-          url: '/node/list',
-          method: 'POST',
-          data: {
-            type: 'ELASTICSEARCH',
-            pageNum: 1,
-            pageSize: 20,
-          },
-        },
-        requestParams: {
-          formatResult: result =>
-            result?.list?.map(item => ({
-              label: item.name,
-              value: item.name,
-            })),
-        },
-      },
+      asyncValueLabel: 'ELASTICSEARCH',
     }),
   })
-  @I18n('meta.Sinks.ES.DataNodeName')
+  @I18n('meta.Sinks.ClickHouse.DataNodeName')

Review Comment:
   All using `@I18n('meta.Sinks.DataNodeName')`



##########
inlong-dashboard/src/components/NodeSelect/index.tsx:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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 React from 'react';
+import HighSelect, { HighSelectProps } from '@/components/HighSelect';
+import i18n from '@/i18n';
+import { Link } from 'react-router-dom';
+
+const NodeSelect: React.FC<HighSelectProps> = _props => {
+  const props: HighSelectProps = {
+    ..._props,
+    showSearch: true,
+    allowClear: true,
+    filterOption: false,
+    options: {
+      ..._props.options,
+      requestTrigger: ['onOpen', 'onSearch'],
+      requestService: keyword => ({
+        url: '/node/list',
+        method: 'POST',
+        data: {
+          keyword,
+          type: props.asyncValueLabel,

Review Comment:
   Try using a new key, such as `nodeType`, don't use `asyncValueLabel`, it has other meanings.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] leezng merged pull request #7137: [INLONG-7133][Dashboard] The sink's data node supports jumping to the node page

Posted by GitBox <gi...@apache.org>.
leezng merged PR #7137:
URL: https://github.com/apache/inlong/pull/7137


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] leezng commented on a diff in pull request #7137: [INLONG-7133][Dashboard] The sink's data node supports jumping to the node page

Posted by GitBox <gi...@apache.org>.
leezng commented on code in PR #7137:
URL: https://github.com/apache/inlong/pull/7137#discussion_r1061110106


##########
inlong-dashboard/src/components/HighSelect/index.tsx:
##########
@@ -48,6 +48,7 @@ export interface HighSelectProps extends Omit<SelectProps<any>, 'options'> {
         requestTrigger?: ('onOpen' | 'onSearch')[];
       };
   asyncValueLabel?: string;
+  nodeType?: string;

Review Comment:
   Proprietary properties should not be added to the base component.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org