Skip to content

Commit

Permalink
Merge branch 'dev-4.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Nov 22, 2023
2 parents a7501ce + 44e5809 commit 180df0e
Show file tree
Hide file tree
Showing 23 changed files with 588 additions and 481 deletions.
1 change: 1 addition & 0 deletions .secignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
https://ur.alipay.com*
http://editorconfig.org*
http://www.apache.org*
https://dev.mysql.com*

--------------------------------------------------------
# Should use GLOB wildcard to config and analysis the ignored folder
Expand Down
8 changes: 4 additions & 4 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ const config = {
proxy: {
// 本地开发或者对内 Site 应用的开发环境的代理配置
'/api/v1/webSocket/obclient': {
target: 'http://11.162.218.70:7001/proxy/96',
target: 'http://dev.odc-local.net:7001/proxy/96',
ws: true,
},
'/api/': {
target: 'http://11.162.218.70:7001/proxy/96',
target: 'http://dev.odc-local.net:7001/proxy/96',
},
'/oauth2/': {
target: 'http://11.162.218.70:7001/proxy/96',
target: 'http://dev.odc-local.net:7001/proxy/96',
},
'/login/': {
target: 'http://11.162.218.70:7001/proxy/96',
target: 'http://dev.odc-local.net:7001/proxy/96',
}
},

Expand Down
4 changes: 2 additions & 2 deletions src/component/CommonTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const CommonTable: <RecordType extends object = any>(
(tableProps?.pagination as TablePaginationConfig)?.pageSize ??
Math.max(
Math.floor(
(tableRef.current.offsetHeight -
(tableRef.current?.offsetHeight -
TOOLBAR_HEIGHT -
TABLE_HEAD_HEIGHT -
INFO_BAR_HEIGHT -
Expand All @@ -200,7 +200,7 @@ const CommonTable: <RecordType extends object = any>(
1,
);
setPageSize(computedPageSize);
setWrapperHeight(tableRef.current.offsetHeight);
setWrapperHeight(tableRef.current?.offsetHeight);
}

function computeTableScrollHeight() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ import styles from './index.less';

export const timeUnitOptions = [
{
label: formatMessage({ id: 'odc.DataArchiveTask.CreateModal.VariableConfig.Points' }), //分
label: '秒',
value: 's',
},
{
label: formatMessage({ id: 'odc.DataArchiveTask.CreateModal.VariableConfig.Points' }), //分
value: 'm',
},
{
label: formatMessage({ id: 'odc.DataArchiveTask.CreateModal.VariableConfig.Hours' }), //小时
value: 'h',
Expand All @@ -42,7 +46,7 @@ export const timeUnitOptions = [
},
{
label: formatMessage({ id: 'odc.DataArchiveTask.CreateModal.VariableConfig.Month' }), //月
value: 'm',
value: 'M',
},
{
label: formatMessage({ id: 'odc.DataArchiveTask.CreateModal.VariableConfig.Year' }), //年
Expand All @@ -51,7 +55,7 @@ export const timeUnitOptions = [
];

const ENABLE_PATTERN_OPERATOR = false;
const timeFormatOptions = ['yyyy-MM-dd', 'yyyyMMdd'].map((item) => ({
const timeFormatOptions = ['yyyy-MM-dd HH:mm:ss', 'yyyy-MM-dd', 'yyyyMMdd'].map((item) => ({
label: item,
value: item,
}));
Expand Down
48 changes: 3 additions & 45 deletions src/component/Task/DataClearTask/CreateModal/VariableConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,60 +22,18 @@ import { Button, Form, Input, InputNumber, Select, Space } from 'antd';
import classNames from 'classnames';
import { variable } from './index';
import styles from './index.less';
import { timeUnitOptions } from '../../DataArchiveTask/CreateModal/VariableConfig';
const ENABLE_PATTERN_OPERATOR = false;

const timeFormatOptions = ['yyyy-MM-dd', 'yyyyMMdd'].map((item) => ({
const timeFormatOptions = ['yyyy-MM-dd HH:mm:ss', 'yyyy-MM-dd', 'yyyyMMdd'].map((item) => ({
label: item,
value: item,
}));
const operatorOptions = ['+', '-'].map((item) => ({
label: item,
value: item,
}));
const timeUnitOptions = [
{
label: formatMessage({
id: 'odc.DataClearTask.CreateModal.VariableConfig.Points',
}),
//分
value: 's',
},
{
label: formatMessage({
id: 'odc.DataClearTask.CreateModal.VariableConfig.Hours',
}),
//小时
value: 'h',
},
{
label: formatMessage({
id: 'odc.DataClearTask.CreateModal.VariableConfig.Day',
}),
//日
value: 'd',
},
{
label: formatMessage({
id: 'odc.DataClearTask.CreateModal.VariableConfig.Zhou',
}),
//周
value: 'w',
},
{
label: formatMessage({
id: 'odc.DataClearTask.CreateModal.VariableConfig.Month',
}),
//月
value: 'm',
},
{
label: formatMessage({
id: 'odc.DataClearTask.CreateModal.VariableConfig.Year',
}),
//年
value: 'y',
},
];

interface IProps {}
const VariableConfig: React.FC<IProps> = (props) => {
//
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/component/VariableConfigTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { timeUnitOptions } from '@/component/Task/DataArchiveTask/CreateModal/Va
import { formatMessage } from '@/util/intl';
import React from 'react';

const oprationReg = /^[-+]\d+[shdwmy]$/;
const oprationReg = /^[-+]\d+[shdwmMy]$/;

const columns = [
{
Expand Down
1 change: 1 addition & 0 deletions src/d.ts/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum DatabaseSyncStatus {

export interface IDatabase {
id: number;
databaseId?: string;
name: string;
project: IProject;
dataSource: IDatasource;
Expand Down
17 changes: 11 additions & 6 deletions src/page/Auth/Role/component/FormModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Button, Drawer, message, Modal, Radio, Space } from 'antd';
import type { FormInstance } from 'antd/lib/form';
import { isNull, set } from 'lodash';
import React, { useContext, useEffect, useRef, useState } from 'react';
import odc from '@/plugins/odc';
import { ResourceContext } from '../../../context';
import { resourceManagementActionMap } from '../../../utils';
import { SystemAction, systemActionMap } from '../ResourceSelector/const';
Expand Down Expand Up @@ -330,13 +331,17 @@ const FormModal: React.FC<IProps> = (props) => {
systemActionMap,
);
if (createAbleResource?.length) {
createAbleResource?.forEach((type) => {
formData.resourceManagementPermissions?.push({
resourceType: type,
resourceId: null,
actions: ['create'],
createAbleResource
?.filter((resourceType) =>
odc.appConfig.manage.user.create ? true : resourceType !== IManagerResourceType.user,
)
?.forEach((type) => {
formData.resourceManagementPermissions?.push({
resourceType: type,
resourceId: null,
actions: ['create'],
});
});
});
}

if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import SSLItem from '../SSLItem';
import styles from './index.less';
import InitScriptItem from '../InitScriptItem';
import JDBCParamsItem from '../JDBCParamsItem';
import { haveOCP } from '@/util/env';
interface IProps {}
const ExtraConfig: React.FC<IProps> = function () {
const context = useContext(DatasourceFormContext);
Expand Down Expand Up @@ -84,12 +85,12 @@ const ExtraConfig: React.FC<IProps> = function () {
<Tabs
size="small"
type="card"
items={[
items={!haveOCP() ? [
config?.sys && sysItem,
config?.ssl && sslItem,
initScriptItem,
jdbcItem,
].filter(Boolean)}
].filter(Boolean) : [initScriptItem]}
/>
);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export default forwardRef<IFormRef, IProps>(function DatasourceForm(
})}
</Select>
</Form.Item>
{!haveOCP() && <ExtraConfig />}
<ExtraConfig />
</>
);
}}
Expand Down
6 changes: 6 additions & 0 deletions src/page/Project/Sensitive/SensitiveContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ interface ISensitiveContext {
sensitiveRuleIdMap: {
[key in any]: string;
};
setSensitiveRuleIdMap: (
sensitiveRuleIdMap: {
[key in any]: string;
},
) => void;
}

const SensitiveContext = React.createContext<Partial<ISensitiveContext>>({
Expand All @@ -58,6 +63,7 @@ const SensitiveContext = React.createContext<Partial<ISensitiveContext>>({
tables: [],
sensitiveRules: [],
sensitiveRuleIdMap: {},
setSensitiveRuleIdMap: (sensitiveRuleIdMap = {}) => {},
});

export default SensitiveContext;
Loading

0 comments on commit 180df0e

Please sign in to comment.