Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support devops card checkstyle #2702

Merged
merged 3 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

import { SuggestionInfo } from '@/types/Public/data';

import { loader } from '@monaco-editor/react';
import * as monaco from 'monaco-editor';
import { editor, languages } from 'monaco-editor';
import keyWordJsonData from './keyword.json';
import ITextModel = editor.ITextModel;
import ProviderResult = languages.ProviderResult;
import CompletionList = languages.CompletionList;
import CompletionItem = languages.CompletionItem;
import {loader} from "@monaco-editor/react";
// 导入 lodash
loader.config({ monaco });

Expand Down
2 changes: 1 addition & 1 deletion dinky-web/src/components/CustomEditor/CodeEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { handleInitEditorAndLanguageOnBeforeMount } from '@/components/CustomEdi
import { StateType } from '@/pages/DataStudio/model';
import { MonacoEditorOptions, SuggestionInfo } from '@/types/Public/data';
import { convertCodeEditTheme } from '@/utils/function';
import {Editor, loader, Monaco, OnChange} from '@monaco-editor/react';
import { Editor, loader, Monaco, OnChange } from '@monaco-editor/react';
import { connect } from '@umijs/max';
import useMemoCallback from 'rc-menu/es/hooks/useMemoCallback';
import { memo, useCallback, useRef } from 'react';
Expand Down
5 changes: 2 additions & 3 deletions dinky-web/src/components/CustomEditor/CodeShow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ import { EditorLanguage } from 'monaco-editor/esm/metadata';

import FullscreenBtn from '@/components/CustomEditor/FullscreenBtn';
import { handleInitEditorAndLanguageOnBeforeMount } from '@/components/CustomEditor/function';
import {Editor, loader, Monaco} from '@monaco-editor/react';
import { Editor, loader, Monaco } from '@monaco-editor/react';
import * as monaco from 'monaco-editor';
import { CSSProperties, useRef, useState } from 'react';
import * as monaco from "monaco-editor";

loader.config({ monaco });


export type CodeShowFormProps = {
height?: string | number;
width?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import {
} from '@/pages/DataStudio/MiddleContainer/StudioEditor/constants';
import { convertCodeEditTheme } from '@/utils/function';
import { l } from '@/utils/intl';
import {DiffEditor, loader} from '@monaco-editor/react';
import { DiffEditor, loader } from '@monaco-editor/react';
import { Col, Modal, Row, Space, Table, Tabs, Typography } from 'antd';
import * as monaco from 'monaco-editor';
import React, { memo } from 'react';
import styles from './index.less';
import * as monaco from "monaco-editor";

loader.config({ monaco });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,28 @@ type StatisticsCardParams = {
extra?: any;
divider?: boolean;
atClick?: () => void;
isChecked?: boolean; // 是否选中
};
const StatisticsCard = (props: StatisticsCardParams) => {
const { title, value, icon, extra = <></>, divider = true, link, atClick } = props;
const {
title,
value,
isChecked = false,
icon,
extra = <></>,
divider = true,
link,
atClick
} = props;
return (
<>
<ProCard layout={'center'} onClick={() => (atClick ? atClick() : {})} hoverable={true}>
<ProCard
checked={isChecked}
boxShadow={isChecked}
layout={'center'}
onClick={() => (atClick ? atClick() : {})}
hoverable={true}
>
<Space size={20}>
{icon}
<Space direction='vertical'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(undefined);
}}
isChecked={!statusFilter}
extra={
<Space direction='vertical'>
<Button type={'text'} icon={<BatchIcons size={20} />}>
Expand All @@ -85,6 +86,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.RUNNING);
}}
isChecked={statusFilter === JOB_STATUS.RUNNING}
/>
<StatisticsCard
title={l('devops.joblist.status.cancelled')}
Expand All @@ -93,6 +95,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.CANCELED);
}}
isChecked={statusFilter === JOB_STATUS.CANCELED}
/>
<StatisticsCard
title={l('devops.joblist.status.failed')}
Expand All @@ -101,6 +104,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.FAILED);
}}
isChecked={statusFilter === JOB_STATUS.FAILED}
/>
<StatisticsCard
title={l('devops.joblist.status.restarting')}
Expand All @@ -109,6 +113,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.RESTARTING);
}}
isChecked={statusFilter === JOB_STATUS.RESTARTING}
/>
<StatisticsCard
title={l('devops.joblist.status.finished')}
Expand All @@ -117,6 +122,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.FINISHED);
}}
isChecked={statusFilter === JOB_STATUS.FINISHED}
/>
<StatisticsCard
title={l('devops.joblist.status.unknown')}
Expand All @@ -126,6 +132,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.UNKNOWN);
}}
isChecked={statusFilter === JOB_STATUS.UNKNOWN}
/>
</ProCard>
</Col>
Expand Down
1 change: 0 additions & 1 deletion dinky-web/src/requestErrorConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export const errorConfig: RequestConfig = {
},
// 错误接收及处理
errorHandler: (error: any, opts: any) => {

if (opts?.skipErrorHandler) throw error;
// 我们的 errorThrower 抛出的错误。
if (error.name === 'BizError') {
Expand Down
Loading