Skip to content

Commit

Permalink
[INLONG-9723][Dashboard] Module audit id query item optimization (#9724)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluewang authored Feb 26, 2024
1 parent f58de13 commit d66ff34
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion inlong-dashboard/src/plugins/sinks/common/sourceFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const sourceFields: ColumnsItemProps[] = [
rules: [
{ required: true },
{
pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/,
pattern: /^[_a-zA-Z][a-zA-Z0-9_]*$/,
message: i18n.t('meta.Sinks.SourceFieldNameRule'),
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class StreamDefaultInfo implements DataWithBackend, RenderRow, RenderList
rules: [
{ required: true },
{
pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/,
pattern: /^[_a-zA-Z][a-zA-Z0-9_]*$/,
message: i18n.t('meta.Stream.FieldNameRule'),
},
],
Expand Down
9 changes: 6 additions & 3 deletions inlong-dashboard/src/ui/pages/GroupDetail/Audit/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Button } from 'antd';
import dayjs from 'dayjs';
import i18n from '@/i18n';
import { sinks } from '@/plugins/sinks';
import request from '@/core/utils/request';

export const timeStaticsDimList = [
{
Expand Down Expand Up @@ -213,12 +214,14 @@ export const getFormContent = (inlongGroupId, initialValues, onSearch, onDataStr
mode: 'multiple',
maxTagCount: 3,
allowClear: true,
showSearch: true,
dropdownMatchSelectWidth: false,
options: {
requestAuto: true,
requestService: {
url: '/audit/getAuditBases',
method: 'GET',
requestTrigger: ['onOpen', 'onSearch'],
requestService: async keyword => {
const res = await request('/audit/getAuditBases');
return keyword === undefined ? res : res.filter(audit => audit.name.includes(keyword));
},
requestParams: {
formatResult: result =>
Expand Down
35 changes: 23 additions & 12 deletions inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import dayjs from 'dayjs';
import i18n from '@/i18n';
import request from '@/core/utils/request';

export const timeStaticsDimList = [
{
Expand Down Expand Up @@ -51,17 +52,20 @@ export const getFormContent = initialValues => [
name: 'inlongGroupId',
props: {
dropdownMatchSelectWidth: false,
showSearch: true,
options: {
requestAuto: true,
requestService: {
requestTrigger: ['onOpen', 'onSearch'],
requestService: keyword => ({
url: '/group/list',
method: 'POST',
data: {
keyword,
pageNum: 1,
pageSize: 1000,
pageSize: 100,
inlongGroupMode: 0,
},
},
}),
requestParams: {
formatResult: result =>
result?.list.map(item => ({
Expand All @@ -78,17 +82,20 @@ export const getFormContent = initialValues => [
name: 'inlongStreamId',
props: values => ({
dropdownMatchSelectWidth: false,
showSearch: true,
options: {
requestAuto: true,
requestService: {
requestTrigger: ['onOpen', 'onSearch'],
requestService: keyword => ({
url: '/stream/list',
method: 'POST',
data: {
keyword,
pageNum: 1,
pageSize: 1000,
pageSize: 100,
inlongGroupId: values.inlongGroupId,
},
},
}),
requestParams: {
formatResult: result =>
result?.list.map(item => ({
Expand Down Expand Up @@ -127,12 +134,14 @@ export const getFormContent = initialValues => [
name: 'benchmark',
props: {
allowClear: true,
showSearch: true,
dropdownMatchSelectWidth: false,
options: {
requestAuto: true,
requestService: {
url: '/audit/getAuditBases',
method: 'GET',
requestTrigger: ['onOpen', 'onSearch'],
requestService: async keyword => {
const res = await request('/audit/getAuditBases');
return keyword === undefined ? res : res.filter(audit => audit.name.includes(keyword));
},
requestParams: {
formatResult: result =>
Expand All @@ -150,12 +159,14 @@ export const getFormContent = initialValues => [
name: 'compared',
props: {
allowClear: true,
showSearch: true,
dropdownMatchSelectWidth: false,
options: {
requestAuto: true,
requestService: {
url: '/audit/getAuditBases',
method: 'GET',
requestTrigger: ['onOpen', 'onSearch'],
requestService: async keyword => {
const res = await request('/audit/getAuditBases');
return keyword === undefined ? res : res.filter(audit => audit.name.includes(keyword));
},
requestParams: {
formatResult: result =>
Expand Down
17 changes: 11 additions & 6 deletions inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import dayjs from 'dayjs';
import i18n from '@/i18n';
import request from '@/core/utils/request';

export const toChartData = (source, sourceDataMap) => {
const xAxisData = Object.keys(sourceDataMap);
Expand Down Expand Up @@ -87,12 +88,14 @@ export const getFormContent = (initialValues, onSearch) => [
name: 'benchmark',
props: {
allowClear: true,
showSearch: true,
dropdownMatchSelectWidth: false,
options: {
requestAuto: true,
requestService: {
url: '/audit/getAuditBases',
method: 'GET',
requestTrigger: ['onOpen', 'onSearch'],
requestService: async keyword => {
const res = await request('/audit/getAuditBases');
return keyword === undefined ? res : res.filter(audit => audit.name.includes(keyword));
},
requestParams: {
formatResult: result =>
Expand All @@ -110,12 +113,14 @@ export const getFormContent = (initialValues, onSearch) => [
name: 'compared',
props: {
allowClear: true,
showSearch: true,
dropdownMatchSelectWidth: false,
options: {
requestAuto: true,
requestService: {
url: '/audit/getAuditBases',
method: 'GET',
requestTrigger: ['onOpen', 'onSearch'],
requestService: async keyword => {
const res = await request('/audit/getAuditBases');
return keyword === undefined ? res : res.filter(audit => audit.name.includes(keyword));
},
requestParams: {
formatResult: result =>
Expand Down

0 comments on commit d66ff34

Please sign in to comment.