Skip to content

Commit

Permalink
[INLONG-9185][Dashboard] Cluster management supports sort_cls, sort_e…
Browse files Browse the repository at this point in the history
…s, sort_pulsar types (#9189)
  • Loading branch information
bluewang authored Nov 3, 2023
1 parent 1968152 commit f97389b
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 0 deletions.
27 changes: 27 additions & 0 deletions inlong-dashboard/src/plugins/clusters/defaults/SortCls.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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 { DataWithBackend } from '@/plugins/DataWithBackend';
import { RenderRow } from '@/plugins/RenderRow';
import { RenderList } from '@/plugins/RenderList';
import { ClusterInfo } from '../common/ClusterInfo';

export default class SortClsCluster
extends ClusterInfo
implements DataWithBackend, RenderRow, RenderList {}
27 changes: 27 additions & 0 deletions inlong-dashboard/src/plugins/clusters/defaults/SortEs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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 { DataWithBackend } from '@/plugins/DataWithBackend';
import { RenderRow } from '@/plugins/RenderRow';
import { RenderList } from '@/plugins/RenderList';
import { ClusterInfo } from '../common/ClusterInfo';

export default class SortEsCluster
extends ClusterInfo
implements DataWithBackend, RenderRow, RenderList {}
27 changes: 27 additions & 0 deletions inlong-dashboard/src/plugins/clusters/defaults/SortPulsar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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 { DataWithBackend } from '@/plugins/DataWithBackend';
import { RenderRow } from '@/plugins/RenderRow';
import { RenderList } from '@/plugins/RenderList';
import { ClusterInfo } from '../common/ClusterInfo';

export default class SortPulsarCluster
extends ClusterInfo
implements DataWithBackend, RenderRow, RenderList {}
15 changes: 15 additions & 0 deletions inlong-dashboard/src/plugins/clusters/defaults/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,19 @@ export const allDefaultClusters: MetaExportWithBackendList<ClusterMetaType> = [
value: 'TUBEMQ',
LoadEntity: () => import('./TubeMq'),
},
{
label: 'Sort CLS',
value: 'SORT_CLS',
LoadEntity: () => import('./SortCls'),
},
{
label: 'Sort ES',
value: 'SORT_ES',
LoadEntity: () => import('./SortEs'),
},
{
label: 'Sort Pulsar',
value: 'SORT_PULSAR',
LoadEntity: () => import('./SortPulsar'),
},
];
3 changes: 3 additions & 0 deletions inlong-dashboard/src/ui/pages/Clusters/CreateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ const Comp: React.FC<Props> = ({ id, defaultType, ...modalProps }) => {
inCharges: values.inCharges?.join(','),
clusterTags: values.clusterTags?.join(','),
};
if (values.type === 'SORT_CLS' || values.type === 'SORT_ES' || values.type === 'SORT_PULSAR') {
submitData.name = values.displayName;
}
if (isUpdate) {
submitData.id = id;
submitData.version = savedData?.version;
Expand Down

0 comments on commit f97389b

Please sign in to comment.