Unverified Commit 8f5e5b8f authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

[Feature][web] Improve internationalization (#1156)

* [Feature][web] Improve internationalization

* [Feature][web] Improve internationalization

* [Feature][web] Improve internationalization

* [Feature][web] Improve internationalization
parent 7d66ec37
......@@ -36,6 +36,7 @@ target/*
dlink-web/node_modules/*
dlink-web/node/*
dlink-web/dist/*
dlink-web/.mfsu-production
dlink-admin/src/main/resources/static/*
dependency-reduced-pom.xml
......
......@@ -19,14 +19,14 @@
// https://umijs.org/config/
import { defineConfig } from 'umi';
import { join } from 'path';
import {defineConfig} from 'umi';
import {join} from 'path';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';
const { REACT_APP_ENV } = process.env;
const {REACT_APP_ENV} = process.env;
export default defineConfig({
hash: true,
......@@ -34,6 +34,7 @@ export default defineConfig({
dva: {
hmr: true,
},
mfsu: {production: {output: '.mfsu-production'}},
layout: {
// https://umijs.org/zh-CN/plugins/plugin-layout
locale: true,
......@@ -70,8 +71,8 @@ export default defineConfig({
manifest: {
basePath: '/',
},
history:{
type:'hash'
history: {
type: 'hash'
},
// Fast Refresh 热更新
fastRefresh: {},
......
......@@ -98,7 +98,7 @@ const BarChartSetting: React.FC<BarChartProps> = (props) => {
<Row>
<Col span={12}>
<Form.Item
label="x 轴" className={styles.form_item} name="xField"
label={l('chart.xAxis')} className={styles.form_item} name="xField"
>
{column && column.length > 0 ? (
<Select allowClear showSearch
......@@ -111,7 +111,7 @@ const BarChartSetting: React.FC<BarChartProps> = (props) => {
</Col>
<Col span={12}>
<Form.Item
label="y 轴" className={styles.form_item} name="yField"
label={l('chart.yAxis')} className={styles.form_item} name="yField"
>
{column && column.length > 1 ? (
<Select allowClear showSearch
......@@ -126,7 +126,7 @@ const BarChartSetting: React.FC<BarChartProps> = (props) => {
<Row>
<Col span={12}>
<Form.Item
label="分组字段" className={styles.form_item} name="seriesField"
label={l('chart.groupColumns')} className={styles.form_item} name="seriesField"
>
{column && column.length > 0 ? (
<Select allowClear showSearch>
......@@ -138,28 +138,25 @@ const BarChartSetting: React.FC<BarChartProps> = (props) => {
</Col>
<Col span={12}>
<Form.Item
label="分组" className={styles.form_item} name="isGroup" valuePropName="checked"
label={l('chart.group')} className={styles.form_item} name="isGroup" valuePropName="checked"
>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
/>
<Switch checkedChildren={l('button.enable')} unCheckedChildren={l('button.disable')}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="堆叠" className={styles.form_item} name="isStack" valuePropName="checked"
label={l('chart.stack')} className={styles.form_item} name="isStack" valuePropName="checked"
>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
/>
<Switch checkedChildren={l('button.enable')} unCheckedChildren={l('button.disable')}/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="百分比" className={styles.form_item} name="isPercent" valuePropName="checked"
label={l('chart.percentage')} className={styles.form_item} name="isPercent" valuePropName="checked"
>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
/>
<Switch checkedChildren={l('button.enable')} unCheckedChildren={l('button.disable')}/>
</Form.Item>
</Col>
</Row>
......
......@@ -98,7 +98,7 @@ const LineChartSetting: React.FC<LineChartProps> = (props) => {
<Row>
<Col span={12}>
<Form.Item
label="x 轴" className={styles.form_item} name="xField"
label={l('chart.xAxis')} className={styles.form_item} name="xField"
>
{column && column.length > 0 ? (
<Select allowClear showSearch
......@@ -111,7 +111,7 @@ const LineChartSetting: React.FC<LineChartProps> = (props) => {
</Col>
<Col span={12}>
<Form.Item
label="y 轴" className={styles.form_item} name="yField"
label={l('chart.yAxis')} className={styles.form_item} name="yField"
>
{column && column.length > 1 ? (
<Select allowClear showSearch
......@@ -126,7 +126,7 @@ const LineChartSetting: React.FC<LineChartProps> = (props) => {
<Row>
<Col span={12}>
<Form.Item
label="分组字段" className={styles.form_item} name="seriesField"
label={l('chart.xAxis')} className={styles.form_item} name="seriesField"
>
{column && column.length > 0 ? (
<Select allowClear showSearch>
......@@ -138,20 +138,20 @@ const LineChartSetting: React.FC<LineChartProps> = (props) => {
</Col>
<Col span={12}>
<Form.Item
label="缩略轴" className={styles.form_item} name="openSlider" valuePropName="checked"
label={l('chart.openSlider')} className={styles.form_item} name="openSlider" valuePropName="checked"
>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
/>
<Switch checkedChildren={l('button.enable')} unCheckedChildren={l('button.disable')}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="阶梯线" className={styles.form_item} name="openStepType" valuePropName="checked"
label={l('chart.openStepType')} className={styles.form_item} name="openStepType" valuePropName="checked"
>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
/>
<Switch checkedChildren={l('button.enable')} unCheckedChildren={l('button.disable')}/>
</Form.Item>
</Col>
</Row>
......
......@@ -94,7 +94,7 @@ const PieChartSetting: React.FC<PieChartProps> = (props) => {
<Row>
<Col span={12}>
<Form.Item
label="弧轴" className={styles.form_item} name="angleField"
label={l('chart.angle')} className={styles.form_item} name="angleField"
>
{column && column.length > 0 ? (
<Select allowClear showSearch
......@@ -107,7 +107,7 @@ const PieChartSetting: React.FC<PieChartProps> = (props) => {
</Col>
<Col span={12}>
<Form.Item
label="颜色" className={styles.form_item} name="colorField"
label={l('chart.color')} className={styles.form_item} name="colorField"
>
{column && column.length > 1 ? (
<Select allowClear showSearch
......
......@@ -23,7 +23,7 @@ import {StateType} from "@/pages/DataStudio/model";
import {connect, useIntl} from "umi";
import styles from "./index.less";
import {RedoOutlined} from '@ant-design/icons';
import {CHART, isSql} from "@/components/Studio/conf";
import {isSql} from "@/components/Studio/conf";
import {Bar, Line, Pie} from '@ant-design/plots';
import React, {useEffect, useState} from "react";
import LineChartSetting from "./LineChartSetting";
......@@ -40,6 +40,14 @@ const Chart = (props: any) => {
const intl = useIntl();
const l = (id: string, defaultMessage?: string, value?: {}) => intl.formatMessage({id, defaultMessage}, value);
const CHART = {
LINE: l('chart.lineChart'),
BAR: l('chart.barChart'),
PIE: l('chart.pieChart'),
};
const {current, result, height, dispatch} = props;
const [config, setConfig] = useState(undefined);
const [type, setType] = useState<string>(CHART.LINE);
......@@ -134,7 +142,7 @@ const Chart = (props: any) => {
<Row>
<Col span={12}>
<Form.Item
label="图形类型" className={styles.form_item} name="type"
label={l('chart.type')} className={styles.form_item} name="type"
>
<Select defaultValue={CHART.LINE} value={CHART.LINE}>
<Option value={CHART.LINE}>{CHART.LINE}</Option>
......@@ -145,7 +153,7 @@ const Chart = (props: any) => {
</Col>
{!isSql(current.task.dialect) ? <Col span={12}>
<Button type="primary" onClick={toRebuild} icon={<RedoOutlined/>}>
刷新数据
{l('button.refreshData')}
</Button>
</Col> : undefined}
</Row>
......
......@@ -53,11 +53,11 @@ const JobLifeCycle = (props: JobLifeCycleFormProps) => {
const renderJobLifeCycle = () => {
switch (step) {
case JOB_LIFE_CYCLE.DEVELOP:
return (<Tag icon={<EditOutlined/>} color="default">开发中</Tag>);
return (<Tag icon={<EditOutlined/>} color="default">{l('global.table.lifecycle.dev')}</Tag>);
case JOB_LIFE_CYCLE.RELEASE:
return (<Tag icon={<CameraOutlined/>} color="green">已发布</Tag>);
return (<Tag icon={<CameraOutlined/>} color="green">{l('global.table.lifecycle.publish')}</Tag>);
case JOB_LIFE_CYCLE.ONLINE:
return (<Tag icon={<CarryOutOutlined/>} color="blue">已上线</Tag>);
return (<Tag icon={<CarryOutOutlined/>} color="blue">{l('global.table.lifecycle.online')}</Tag>);
default:
return undefined;
}
......
......@@ -27,27 +27,28 @@ import {
QuestionCircleOutlined,
SyncOutlined
} from "@ant-design/icons";
import {useIntl} from "@@/plugin-locale/localeExports";
export type JobStatusFormProps = {
status: string|undefined;
status: string | undefined;
};
export const JOB_STATUS = {
FINISHED:'FINISHED',
RUNNING:'RUNNING',
FAILED:'FAILED',
CANCELED:'CANCELED',
INITIALIZING:'INITIALIZING',
RESTARTING:'RESTARTING',
CREATED:'CREATED',
FAILING:'FAILING',
SUSPENDED:'SUSPENDED',
CANCELLING:'CANCELLING',
UNKNOWN:'UNKNOWN',
FINISHED: 'FINISHED',
RUNNING: 'RUNNING',
FAILED: 'FAILED',
CANCELED: 'CANCELED',
INITIALIZING: 'INITIALIZING',
RESTARTING: 'RESTARTING',
CREATED: 'CREATED',
FAILING: 'FAILING',
SUSPENDED: 'SUSPENDED',
CANCELLING: 'CANCELLING',
UNKNOWN: 'UNKNOWN',
};
export function isStatusDone(type: string){
if(!type){
export function isStatusDone(type: string) {
if (!type) {
return true;
}
switch (type) {
......@@ -63,34 +64,37 @@ export function isStatusDone(type: string){
const JobStatus = (props: JobStatusFormProps) => {
const intl = useIntl();
const l = (id: string, defaultMessage?: string, value?: {}) => intl.formatMessage({id, defaultMessage}, value);
const {status} = props;
return (<>
{ (status === 'FINISHED') ?
{(status === 'FINISHED') ?
(<Tag icon={<CheckCircleOutlined/>} color="blue">
FINISHED
{l('pages.devops.jobstatus.FINISHED')}
</Tag>) : (status === 'RUNNING') ?
(<Tag icon={<SyncOutlined spin/>} color="green">
RUNNING
{l('pages.devops.jobstatus.RUNNING')}
</Tag>) : (status === 'FAILED') ?
(<Tag icon={<CloseCircleOutlined/>} color="error">
FAILED
{l('pages.devops.jobstatus.FAILED')}
</Tag>) : (status === 'CANCELED') ?
(<Tag icon={<MinusCircleOutlined/>} color="orange">
CANCELED
{l('pages.devops.jobstatus.CANCELED')}
</Tag>) : (status === 'INITIALIZING') ?
(<Tag icon={<ClockCircleOutlined/>} color="default">
INITIALIZING
{l('pages.devops.jobstatus.INITIALIZING')}
</Tag>) : (status === 'RESTARTING') ?
(<Tag icon={<ClockCircleOutlined/>} color="default">
RESTARTING
{l('pages.devops.jobstatus.RESTARTING')}
</Tag>) : (status === 'CREATED') ?
(<Tag icon={<ClockCircleOutlined/>} color="default">
CREATED
</Tag>) :
(<Tag icon={<QuestionCircleOutlined />} color="default">
UNKNOWEN
</Tag>)
(<Tag icon={<ClockCircleOutlined/>} color="default">
{l('pages.devops.jobstatus.CREATED')}
</Tag>) :
(<Tag icon={<QuestionCircleOutlined/>} color="default">
{l('pages.devops.jobstatus.UNKNOWN')}
</Tag>)
}
</>)
};
......
......@@ -18,6 +18,8 @@
*/
import {useIntl} from "umi";
export function parseByteStr(limit: number) {
let size = "";
if (limit < 0.1 * 1024) { //小于0.1KB,则转化成B
......@@ -45,27 +47,27 @@ export function parseNumStr(num: number) {
}
export function parseMilliSecondStr(second_time: number) {
if(((second_time/1000) %60) < 1){
return second_time + "毫秒";
if (((second_time / 1000) % 60) < 1) {
return second_time + useIntl().formatMessage({id: 'global.time.millisecond'});
}
return parseSecondStr(second_time/1000);
return parseSecondStr(second_time / 1000);
}
export function parseSecondStr(second_time: number) {
second_time = Math.floor(second_time);
let time = second_time + "秒";
let time = second_time + useIntl().formatMessage({id: 'global.time.second'});
if (second_time > 60) {
let second = second_time % 60;
let min = Math.floor(second_time / 60);
time = min + "分" + second + "秒";
time = min + useIntl().formatMessage({id: 'global.time.minute'}) + second + useIntl().formatMessage({id: 'global.time.second'});
if (min > 60) {
min = Math.floor(second_time / 60) % 60;
let hour = Math.floor(Math.floor(second_time / 60) / 60);
time = hour + "小时" + min + "分" + second + "秒";
time = hour + useIntl().formatMessage({id: 'global.time.hour'}) + min + useIntl().formatMessage({id: 'global.time.minute'}) + second + useIntl().formatMessage({id: 'global.time.second'});
if (hour > 24) {
hour = Math.floor(Math.floor(second_time / 60) / 60) % 24;
let day = Math.floor(Math.floor(Math.floor(second_time / 60) / 60) / 24);
time = day + "天" + hour + "小时" + min + "分" + second + "秒";
time = day + useIntl().formatMessage({id: 'global.time.day'}) + hour + useIntl().formatMessage({id: 'global.time.hour'}) + min + useIntl().formatMessage({id: 'global.time.minute'}) + second + useIntl().formatMessage({id: 'global.time.second'});
}
}
}
......
......@@ -21,11 +21,12 @@
import React from 'react';
import {Tooltip} from 'antd';
import {
FullscreenOutlined,
FullscreenExitOutlined,
FullscreenOutlined,
VerticalAlignBottomOutlined,
VerticalAlignTopOutlined
} from '@ant-design/icons';
import {useIntl} from "umi";
const LineageOps = ({
isExpand,
......@@ -35,25 +36,25 @@ const LineageOps = ({
}) => [
isExpand ?
{
tooltip: '收起血缘',
tooltip: useIntl().formatMessage({id: 'pages.datastudio.label.lineage.expand.lineage'}),
action: 'shrink',
component: <FullscreenExitOutlined/>
}
:
{
tooltip: '展开血缘',
tooltip: useIntl().formatMessage({id: 'pages.datastudio.label.lineage.collapse.lineage'}),
action: 'expand',
component: <FullscreenOutlined/>
},
isFold ?
{
tooltip: '展开字段',
tooltip: useIntl().formatMessage({id: 'pages.datastudio.label.lineage.expand.field'}),
action: 'fold',
component: <VerticalAlignBottomOutlined/>
}
:
{
tooltip: '收起字段',
tooltip: useIntl().formatMessage({id: 'pages.datastudio.label.lineage.collapse.field'}),
action: 'unfold',
component: <VerticalAlignTopOutlined/>
}
......
......@@ -210,18 +210,18 @@ const StudioFX = () => {
hideInTable: true,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -23,6 +23,7 @@ import FlinkSQL from "./FlinkSQL";
import {MetaStoreCatalogType, SessionType, TaskType} from "@/pages/DataStudio/model";
import {message, Modal} from "antd";
import {addOrUpdateData, getData, handleRemove, postAll} from "@/components/Common/crud";
import {useIntl} from "umi";
/*--- 保存sql ---*/
export function saveTask(current: any, dispatch: any) {
......@@ -80,9 +81,9 @@ export function quitSession(dispatch: any) {
/*--- 注销会话 ---*/
export function clearSession(session: string, dispatch: any) {
Modal.confirm({
title: '确认注销会话【' + session + '】?',
okText: '确认',
cancelText: '取消',
title: useIntl().formatMessage({id: 'tips.confirm.logout.session'}, {sessionName: session}),
okText: useIntl().formatMessage({id: 'button.confirm'}),
cancelText: useIntl().formatMessage({id: 'button.cancel'}),
onOk: async () => {
let para = {
id: session,
......@@ -124,9 +125,9 @@ export function showTables(session: string, dispatch: any) {
/*--- 移除 Catalog Table ---*/
export function removeTable(tablename: string, session: string, dispatch: any) {
Modal.confirm({
title: '确定删除表【' + tablename + '】吗?',
okText: '确认',
cancelText: '取消',
title: useIntl().formatMessage({id: 'tips.confirm.delete.table'}, {tableName: tablename}),
okText: useIntl().formatMessage({id: 'button.confirm'}),
cancelText: useIntl().formatMessage({id: 'button.cancel'}),
onOk: async () => {
const res = executeDDL({
statement: "drop table " + tablename,
......@@ -222,14 +223,15 @@ export function showAlertGroup(dispatch: any) {
export function showMetaDataTable(id: number) {
return getData('api/database/getSchemasAndTables', {id: id});
}
/*--- 清理 元数据表缓存 ---*/
export function clearMetaDataTable(id: number) {
return getData('api/database/unCacheSchemasAndTables', {id: id});
}
/*--- 刷新 数据表样例数据 ---*/
export function showTableData(id: number,schemaName:String,tableName:String,option:{}) {
return postAll('api/database/queryData', {id: id,schemaName:schemaName,tableName:tableName,option:option});
export function showTableData(id: number, schemaName: String, tableName: String, option: {}) {
return postAll('api/database/queryData', {id: id, schemaName: schemaName, tableName: tableName, option: option});
}
/*--- 刷新 Flink Jobs ---*/
......
......@@ -145,18 +145,18 @@ const StudioCluster = (props: any) => {
dataIndex: 'enabled',
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -138,18 +138,18 @@ const StudioDataBase = (props: any) => {
dataIndex: 'enabled',
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -95,25 +95,25 @@ const StudioFragment = (props: any) => {
hideInTable: true,
},
{
title: '是否启用',
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: false,
hideInSearch: true,
hideInTable: true,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -85,11 +85,11 @@ const EditorTabs = (props: any) => {
const menu = (pane) => (
<Menu onClick={(e) => handleClickMenu(e, pane)}>
<Menu.Item key="CLOSE_OTHER">
<span>关闭其他</span>
</Menu.Item>
<Menu.Item key="CLOSE_ALL">
<span>关闭所有</span>
<span>{l('right.menu.closeAll')}</span>
</Menu.Item>
<Menu.Item key="CLOSE_OTHER">
<span>{l('right.menu.closeOther')}</span>
</Menu.Item>
</Menu>
);
......@@ -128,7 +128,7 @@ const EditorTabs = (props: any) => {
tabsKey={pane.key}
sql={pane.value}
monaco={pane.monaco}
// sqlMetaData={pane.sqlMetaData}
sqlMetaData={pane.sqlMetaData}
height={height ? height : (toolHeight - 32)}
width={width}
language={getLanguage(current.task.dialect)}
......
......@@ -19,12 +19,12 @@
import React, {useEffect, useState} from 'react';
import {Button, Form, Input, Modal, Select, Cascader} from 'antd';
import {Button, Cascader, Form, Input, Modal, Select} from 'antd';
import type {TaskTableListItem} from '../data.d';
import {DIALECT} from "@/components/Studio/conf";
import {useIntl} from "umi";
import {postAll, postDataArray} from "@/components/Common/crud";
import {postAll} from "@/components/Common/crud";
const {Option} = Select;
......@@ -169,7 +169,7 @@ const SimpleTaskForm: React.FC<UpdateFormProps> = (props) => {
const renderFooter = () => {
return (
<>
<Button onClick={() => handleUpdateModalVisible(false, values)}>取消</Button>
<Button onClick={() => handleUpdateModalVisible(false, values)}>{l('button.cancel')}</Button>
<Button type="primary" onClick={() => submitForm()}>
{l('button.finish')}
</Button>
......
......@@ -84,7 +84,7 @@ const UpdateCatalogueForm: React.FC<UpdateFormProps> = (props) => {
const renderFooter = () => {
return (
<>
<Button onClick={() => handleUpdateModalVisible(false, values)}>取消</Button>
<Button onClick={() => handleUpdateModalVisible(false, values)}>{l('button.cancel')}</Button>
<Button type="primary" onClick={() => submitForm()}>
{l('button.finish')}
</Button>
......
......@@ -607,21 +607,21 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
<div className={style.tree_div}>
<Row>
<Col span={24}>
<Tooltip title="创建根目录">
<Tooltip title={l('right.menu.createRootCatalogue')}>
<Button
type="text"
icon={<FolderAddOutlined/>}
onClick={createRootCatalogue}
/>
</Tooltip>
<Tooltip title="折叠目录">
<Tooltip title={l('button.collapseDir')}>
<Button
type="text"
icon={<SwitcherOutlined/>}
onClick={offExpandAll}
/>
</Tooltip>
<Tooltip title="导出json">
<Tooltip title={l('right.menu.exportJson')}>
<Button
type="text"
icon={<DownloadOutlined/>}
......@@ -629,7 +629,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
/>
</Tooltip>
<Upload {...uProps}>
<Tooltip title="导入json">
<Tooltip title={l('right.menu.importJson')}>
<Button
type="text"
icon={<UploadOutlined/>}
......@@ -710,7 +710,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
getTreeData();
}} onCancel={() => {
setIsUploadModalVisible(false)
}} buttonTitle="上传zip包并创建工程"/>
}} buttonTitle={l('right.menu.uploadZipToCreate')}/>
</div>
);
};
......
......@@ -48,11 +48,6 @@ export const DIALECT = {
PYTHON: 'Python',
};
export const CHART = {
LINE: '折线图',
BAR: '条形图',
PIE: '饼图',
};
export const isSql = (dialect: string) => {
switch (dialect) {
......
......@@ -25,6 +25,7 @@ import pwa from './en-US/pwa';
import request from './en-US/request';
import settings from './en-US/settings';
import shortKey from './en-US/shortcutKey';
import chart from './en-US/chart';
export default {
'navBar.lang': 'Languages',
......@@ -43,4 +44,5 @@ export default {
...pages,
...request,
...shortKey,
...chart,
};
/*
*
* 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.
*
*/
export default {
'chart.lineChart': 'Line Chart',
'chart.barChart': 'Bar Chart',
'chart.pieChart': 'Pie Chart',
'chart.type': 'Chart Type',
'chart.xAxis': 'X Axis',
'chart.yAxis': 'Y Axis',
'chart.groupColumns': 'Group Columns',
'chart.stack': 'Stack',
'chart.group': 'Group',
'chart.percentage': 'Percentage',
'chart.openSlider': 'Abbreviated Axis',
'chart.openStepType': 'Step Line',
'chart.angleField': 'Arc Axis',
'chart.colorField': 'Color',
}
......@@ -46,27 +46,40 @@ export default {
'button.heartbeat': 'Heartbeat',
'button.recycle': 'Recycle',
'button.refresh': 'Refresh',
'button.refreshData': 'Refresh Data',
'button.collapseDir': 'Collapse Directory',
'right.menu.open': 'Open',
'right.menu.submit': 'Sync Submit',
'right.menu.exportJson': 'Export JSON',
'right.menu.importJson': 'Import JSON',
'right.menu.rename': 'Rename',
'right.menu.copy': 'Copy',
'right.menu.cut': 'Cut',
'right.menu.paste': 'Paste',
'right.menu.delete': 'Delete',
'right.menu.createCatalogue': 'Create Dir',
'right.menu.createRootCatalogue': 'Create Root Dir',
'right.menu.createCatalogue': 'Create Directory',
'right.menu.createRootCatalogue': 'Create Root Directory',
'right.menu.uploadZipToCreate': 'Upload Zip To Create',
'right.menu.createTask': 'Create Task',
'right.menu.closeAll': 'Close All',
'right.menu.closeOther': 'Close Others',
'tips.selected': 'Selected {total} Item',
'tips.notSelected': 'Not Select',
'tips.confirm.logout.session': 'Confirm logout session [{sessionName}] ?',
'tips.confirm.delete.table': ' Are you sure you want to delete table [{tableName}]?',
'tips.create.session.success': 'Create Session [{session}] success!',
'status.enabled': 'Enabled',
'status.disabled': 'Disabled',
'global.time.second': 'Second',
'global.time.minute': 'Minute',
'global.time.hour': 'Hour',
'global.time.day': 'Day',
'global.time.millisecond': 'millisecond',
'global.table.operate': 'Operation',
'global.table.config': 'Config',
......@@ -78,15 +91,14 @@ export default {
'global.table.createTime': 'Create Time',
'global.table.startTime': 'Start Time',
'global.table.endTime': 'End Time',
'global.table.useTime': 'Use Time',
'global.table.useTime': 'Duration',
'global.table.registType': 'Regist Type',
'global.table.registType.manual': 'Manual',
'global.table.registType.automatic': 'Automatic',
'global.table.isEnable': 'Is Enable',
'global.table.enabled': 'Enabled',
'global.table.disabled': 'Disabled',
'global.table.note': 'Note',
'global.table.status': 'Status',
'global.table.status.normal': 'Normal',
......@@ -125,7 +137,7 @@ export default {
'global.table.lifecycle.dev': 'Develop',
'global.table.lifecycle.publish': 'Publish',
'global.table.lifecycle.online': 'Online',
'global.table.lifecycle.unKnow': 'Unknow',
'global.table.lifecycle.unknown': 'Unknown',
'global.table.runmode': 'Run Mode',
......
......@@ -18,6 +18,7 @@
*/
export default {
'menu.login': 'Login',
'menu.account.center': 'Account Center',
'menu.account.settings': 'Account Settings',
'menu.account.changePassword': 'Change Password',
......
......@@ -88,6 +88,7 @@ export default {
'pages.searchTable.batchDeletion': 'Batch Deletion',
'pages.searchTable.batchApproval': 'Batch Approval',
'pages.devops.jobstatus.CREATED': 'Created',
'pages.devops.jobstatus.INITIALIZING': 'Initialize',
'pages.devops.jobstatus.RUNNING': 'Running',
......@@ -124,13 +125,10 @@ export default {
'pages.user.UserManger': 'User Management',
'pages.user.UserName': 'User Name',//用户名
'pages.user.UserJobNumber': 'Job Number',//工号
'pages.user.UserPhoneNumber': 'Phone Number',//手机号
'pages.user.UserNickName': 'Nick Name',//昵称
'pages.user.UserIsUse': 'Is Enable',//是否启用
'pages.user.UserUpdateTime': 'Update Time',//最近更新时间
'pages.user.UserCreateTime': 'Create Time',//创建时间
'pages.user.UserName': 'User Name',
'pages.user.UserJobNumber': 'Job Number',
'pages.user.UserPhoneNumber': 'Phone Number',
'pages.user.UserNickName': 'Nick Name',
'pages.user.UserDeleteUser': 'Delete User',
'pages.user.UserCreateUser': 'Create User',
......@@ -159,9 +157,6 @@ export default {
'pages.tenant.TenantManager': 'Tenant Management',
'pages.tenant.TenantCode': 'Tenant Code',
'pages.tenant.Note': 'Note',
'pages.tenant.CreateTime': 'Create Time',
'pages.tenant.UpdateTime': 'Update Time',
'pages.tenant.AssignUser': 'Assign Users',
'pages.tenant.assignUser.pleaseHolder': 'Please enter username/nickname Search',
'pages.tenant.create': 'Create Tenant',
......@@ -179,10 +174,6 @@ export default {
'pages.nameSpace.NameSpaceManagement': 'NameSpace Management',
'pages.nameSpace.NameSpaceCode': 'NameSpace Code',
'pages.nameSpace.belongTenant': 'Belong Tenant',
'pages.nameSpace.enable': 'Is Enable',
'pages.nameSpace.note': 'Note',
'pages.nameSpace.createTime': 'Create Time',
'pages.nameSpace.updateTime': 'Update Time',
'pages.nameSpace.deleteNameSpace': 'Delete NameSpace',
'pages.nameSpace.deleteNameSpaceConfirm': 'Are you sure you want to delete this NameSpace?',
'pages.nameSpace.enableNameSpace': 'Enable NameSpace',
......@@ -199,10 +190,7 @@ export default {
'pages.role.roleCode': 'Role Code',
'pages.role.roleName': 'Role Name',
'pages.role.namespaceIds': 'Namespace',
'pages.role.note': 'Note',
'pages.role.belongTenant': 'Belong Tenant',
'pages.role.createTime': 'Create Time',
'pages.role.updateTime': 'Update Time',
'pages.role.create': 'Create Role',
'pages.role.update': 'Update Role',
'pages.role.EnterRoleCode': 'Please enter Role Code!',
......@@ -234,7 +222,14 @@ export default {
'pages.datastudio.label.info': 'Info',
'pages.datastudio.label.result': 'Result',
'pages.datastudio.label.lineage': 'Lineage',
'pages.datastudio.label.lineage.expand.field': 'Expand Field',
'pages.datastudio.label.lineage.collapse.field': 'Collapse Field',
'pages.datastudio.label.lineage.expand.lineage': 'Expand Lineage',
'pages.datastudio.label.lineage.collapse.lineage': 'Collapse Lineage',
'pages.datastudio.label.process': 'Process',
'pages.datastudio.label.history': 'History',
'pages.datastudio.label.function': 'Function',
......@@ -268,5 +263,29 @@ export default {
'pages.devops.lable.onlinelist': 'Online List',
'pages.devops.lable.offlinelist': 'Offline List',
'pages.devops.lable.instance': 'Instance',
'pages.registerCenter.alert.instanceManagement': 'Alarm Instance Management',
'pages.registerCenter.alert.instance.name': 'Name',
'pages.registerCenter.alert.instance.type': 'Type',
'pages.registerCenter.alert.instance.delete': 'Delete the Alarm Instance ',
'pages.registerCenter.alert.instance.deleteConfirm': 'Are you sure to delete the selected Alarm Instance? ',
'pages.registerCenter.alert.instance.enable': 'Enable Alarm Instance ',
'pages.registerCenter.alert.instance.enableConfirm': 'Are you sure you want to enable this Alarm Instance? ',
'pages.registerCenter.alert.instance.disable': 'Disable the Alarm Instance ',
'pages.registerCenter.alert.instance.disableConfirm': 'Are you sure you want to disable this Alarm Instance? ',
'pages.registerCenter.alert.instance.disableTotalOf': 'Total Of {total} Alarm Instance Is Disabled',
'pages.registerCenter.alert.groupManagement': 'Alarm Group Management ',
'pages.registerCenter.alert.group.name': 'Alarm Group Name',
'pages.registerCenter.alert.group.groupid ': 'Alarm group ID ',
'pages.registerCenter.alert.group.alertInstanceIds': 'Alarm instance',
'pages.registerCenter.alert.group.delete': 'Delete the Alarm group ',
'pages.registerCenter.alert.group.deleteConfirm': 'Are you sure to delete the selected Alarm group? ',
'pages.registerCenter.alert.group.enable': 'Enable Alarm group ',
'pages.registerCenter.alert.group.enableConfirm': 'Are you sure you want to enable this Alarm group? ',
'pages.registerCenter.alert.group.disable': 'Disable the Alarm group ',
'pages.registerCenter.alert.group.disableConfirm': 'Are you sure you want to disable this Alarm group? ',
'pages.registerCenter.alert.group.disableTotalOf': 'Total Of {total} Alarm group Is Disabled',
};
......@@ -25,6 +25,7 @@ import request from './zh-CN/request';
import settings from './zh-CN/settings';
import pages from './zh-CN/pages';
import shortKey from './zh-CN/shortcutKey';
import chart from './zh-CN/chart';
export default {
'navBar.lang': '语言',
......@@ -43,4 +44,5 @@ export default {
...component,
...request,
...shortKey,
...chart,
};
/*
*
* 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.
*
*/
export default {
'chart.lineChart': '折线图',
'chart.barChart': '条形图',
'chart.pieChart': '饼图',
'chart.type': '图形类型',
'chart.xAxis': 'X 轴',
'chart.yAxis': 'Y 轴',
'chart.groupColumns': '分组字段',
'chart.stack': '堆叠',
'chart.group': '分组',
'chart.percentage': '百分比',
'chart.openSlider': '缩略轴',
'chart.openStepType': '阶梯线',
'chart.angle': '弧轴',
'chart.color': '颜色',
}
......@@ -46,10 +46,13 @@ export default {
'button.heartbeat': '心跳',
'button.recycle': '回收',
'button.refresh': '刷新',
'button.refreshData': '刷新数据',
'button.collapseDir': '折叠目录',
'right.menu.open': '打开',
'right.menu.submit': '异步提交',
'right.menu.exportJson': '导出 JSON',
'right.menu.importJson': '导入 JSON',
'right.menu.rename': '重命名',
'right.menu.copy': '复制',
'right.menu.cut': '剪切',
......@@ -59,14 +62,25 @@ export default {
'right.menu.createRootCatalogue': '创建根目录',
'right.menu.uploadZipToCreate': '上传zip包创建工程',
'right.menu.createTask': '创建作业',
'right.menu.closeAll': '关闭所有',
'right.menu.closeOther': '关闭其他',
'tips.selected': '已选择 {total} 项',
'tips.notSelected': '未选',
'tips.confirm.logout.session': '确认注销会话【{sessionName}】 吗?',
'tips.confirm.delete.table': '确定删除表【{tableName}】吗?',
'tips.create.session.success': '创建会话【{session}】成功!',
'status.enabled': '已启用',
'status.disabled': '已禁用',
'global.time.second': '秒',
'global.time.minute': '分',
'global.time.hour': '小时',
'global.time.day': '天',
'global.time.millisecond': '毫秒',
'global.table.operate': '操作',
'global.table.config': '配置',
......@@ -85,8 +99,7 @@ export default {
'global.table.registType.automatic': '自动',
'global.table.isEnable': '是否启用',
'global.table.enabled': '启用',
'global.table.disabled': '禁用',
'global.table.note': '备注',
'global.table.status': '状态',
'global.table.status.normal': '正常',
......@@ -125,7 +138,7 @@ export default {
'global.table.lifecycle.dev': '开发中',
'global.table.lifecycle.publish': '已发布',
'global.table.lifecycle.online': '已上线',
'global.table.lifecycle.unKnow': '未知',
'global.table.lifecycle.unknown': '未知',
'global.table.runmode': '运行模式',
};
......@@ -18,6 +18,7 @@
*/
export default {
'menu.login': '登录',
'menu.account.center': '个人中心',
'menu.account.settings': '个人设置',
'menu.account.changePassword': '修改密码',
......
......@@ -129,9 +129,6 @@ export default {
'pages.user.UserJobNumber': '工号',
'pages.user.UserPhoneNumber': '手机号',
'pages.user.UserNickName': '昵称',
'pages.user.UserIsUse': '是否启用',
'pages.user.UserUpdateTime': '最近更新时间',
'pages.user.UserCreateTime': '创建时间',
'pages.user.UserDeleteUser': '删除用户',
......@@ -161,9 +158,6 @@ export default {
'pages.tenant.TenantManager': '租户管理',
'pages.tenant.TenantCode': '租户编码',
'pages.tenant.Note': '备注/描述',
'pages.tenant.CreateTime': '创建时间',
'pages.tenant.UpdateTime': '最后更新时间',
'pages.tenant.AssignUser': '分配用户',
'pages.tenant.create': '创建租户',
'pages.tenant.update': '修改租户',
......@@ -180,10 +174,6 @@ export default {
'pages.nameSpace.NameSpaceManagement': '命名空间管理',
'pages.nameSpace.NameSpaceCode': '命名空间编码',
'pages.nameSpace.belongTenant': '所属租户',
'pages.nameSpace.enable': '是否启用',
'pages.nameSpace.note': '备注/描述',
'pages.nameSpace.createTime': '创建时间',
'pages.nameSpace.updateTime': '最后更新时间',
'pages.nameSpace.deleteNameSpace': '删除命名空间',
'pages.nameSpace.deleteNameSpaceConfirm': '您确定要删除此命名空间吗?',
'pages.nameSpace.enableNameSpace': '启用命名空间',
......@@ -200,10 +190,7 @@ export default {
'pages.role.roleCode': '角色编码',
'pages.role.roleName': '角色名称',
'pages.role.namespaceIds': '命名空间',
'pages.role.note': '备注/描述',
'pages.role.belongTenant': '所属租户',
'pages.role.createTime': '创建时间',
'pages.role.updateTime': '最后更新时间',
'pages.role.create': '创建角色',
'pages.role.update': '修改角色',
'pages.role.EnterRoleCode': '请输入角色编码!',
......@@ -235,9 +222,15 @@ export default {
'pages.TableData.data': '数据',
'pages.TableData.search': '搜索',
'pages.datastudio.label.info': '数据',
'pages.datastudio.label.info': '信息',
'pages.datastudio.label.result': '结果',
'pages.datastudio.label.lineage': '血缘',
'pages.datastudio.label.lineage.expand.field': '展开字段',
'pages.datastudio.label.lineage.collapse.field': '收起字段',
'pages.datastudio.label.lineage.expand.lineage': '收起血缘',
'pages.datastudio.label.lineage.collapse.lineage': '展开血缘',
'pages.datastudio.label.process': '进程',
'pages.datastudio.label.history': '历史',
'pages.datastudio.label.function': '函数',
......@@ -272,4 +265,29 @@ export default {
'pages.devops.lable.offlinelist': '下线明细',
'pages.devops.lable.instance': '实例',
'pages.registerCenter.alert.instanceManagement': '报警实例管理',
'pages.registerCenter.alert.instance.name': '名称',
'pages.registerCenter.alert.instance.type': '类型',
'pages.registerCenter.alert.instance.delete': '删除报警实例',
'pages.registerCenter.alert.instance.deleteConfirm': '确定删除选中的报警实例吗?',
'pages.registerCenter.alert.instance.enable': '启用报警实例',
'pages.registerCenter.alert.instance.enableConfirm': '您确定要启用此报警实例吗?',
'pages.registerCenter.alert.instance.disable': '禁用报警实例',
'pages.registerCenter.alert.instance.disableConfirm': '您确定要禁用此报警实例吗?',
'pages.registerCenter.alert.instance.disableTotalOf': '被禁用的报警实例共 {total} 个',
'pages.registerCenter.alert.groupManagement': '报警组管理',
'pages.registerCenter.alert.group.name': '报警组名称',
'pages.registerCenter.alert.group.groupid': '报警组ID',
'pages.registerCenter.alert.group.alertInstanceIds': '报警实例',
'pages.registerCenter.alert.group.delete': '删除报警组',
'pages.registerCenter.alert.group.deleteConfirm': '确定删除选中的报警组吗?',
'pages.registerCenter.alert.group.enable': '启用报警组',
'pages.registerCenter.alert.group.enableConfirm': '您确定要启用此报警组吗?',
'pages.registerCenter.alert.group.disable': '禁用报警组',
'pages.registerCenter.alert.group.disableConfirm': '您确定要禁用此报警组吗?',
'pages.registerCenter.alert.group.disableTotalOf': '被禁用的报警组共 {total} 个',
};
......@@ -111,7 +111,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => {
</Form.Item>
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formVals.enabled}/>
</Form.Item>
......
......@@ -54,8 +54,8 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
handleUpdateModalVisible(true);
} else if (key === 'delete') {
Modal.confirm({
title: '删除报警组配置',
content: '确定删除该报警组配置吗?',
title: l('pages.registerCenter.alert.group.delete'),
content: l('pages.registerCenter.alert.group.deleteConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -85,31 +85,22 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
const columns: ProColumns<AlertGroupTableListItem>[] = [
{
title: '名称',
title: l('pages.registerCenter.alert.group.name'),
dataIndex: 'name',
tip: '名称是唯一的',
sorter: true,
formItemProps: {
rules: [
{
required: true,
message: '名称为必填项',
},
],
},
render: (dom, entity) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
},
},
{
title: '报警组ID',
title: l('pages.registerCenter.alert.group.groupid'),
dataIndex: 'id',
hideInTable: true,
hideInForm: true,
hideInSearch: true,
},
{
title: '报警实例',
title: l('pages.registerCenter.alert.group.alertInstanceIds'),
sorter: true,
dataIndex: 'alertInstanceIds',
hideInTable: true,
......@@ -117,7 +108,7 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
hideInSearch: true,
},
{
title: '注释',
title: l('global.table.note'),
sorter: true,
valueType: 'textarea',
dataIndex: 'note',
......@@ -126,25 +117,25 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
hideInTable: true,
},
{
title: '是否启用',
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: true,
hideInSearch: true,
hideInTable: false,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......@@ -181,7 +172,7 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
return (
<PageContainer title={false}>
<ProTable<AlertGroupTableListItem>
headerTitle="报警组管理"
headerTitle={l('pages.registerCenter.alert.groupManagement')}
actionRef={actionRef}
rowKey="id"
search={{
......@@ -211,7 +202,10 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
total: <a
style={{fontWeight: 600}}>{selectedRowsState.length}</a>
})} &nbsp;&nbsp; <span>
被禁用的报警组共 {selectedRowsState.length - selectedRowsState.reduce((pre, item) => pre + (item.enabled ? 1 : 0), 0)}
{l('pages.registerCenter.alert.group.disableTotalOf', '', {
total:
selectedRowsState.length - selectedRowsState.reduce((pre, item) => pre + (item.enabled ? 1 : 0), 0)
})}
</span>
</div>
}
......@@ -219,8 +213,8 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
<Button type="primary" danger
onClick={() => {
Modal.confirm({
title: '删除报警组',
content: '确定删除选中的报警组吗?',
title: l('pages.registerCenter.alert.group.delete'),
content: l('pages.registerCenter.alert.group.deleteConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -236,8 +230,8 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
<Button type="primary"
onClick={() => {
Modal.confirm({
title: '启用报警组',
content: '确定启用选中的报警组吗?',
title: l('pages.registerCenter.alert.group.enable'),
content: l('pages.registerCenter.alert.group.enableConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -251,8 +245,8 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
<Button danger
onClick={() => {
Modal.confirm({
title: '禁用报警组',
content: '确定禁用选中的报警组吗?',
title: l('pages.registerCenter.alert.group.disable'),
content: l('pages.registerCenter.alert.group.disableConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......
......@@ -159,7 +159,7 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={vals.enabled}/>
</Form.Item>
......
......@@ -173,7 +173,7 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
}
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={vals.enabled}/>
</Form.Item>
......
......@@ -155,7 +155,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
}
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={vals.enabled}/>
</Form.Item>
......
......@@ -175,7 +175,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={vals.enabled}/>
</Form.Item>
......
......@@ -50,8 +50,8 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
handleModalVisible(true);
} else if (key === 'delete') {
Modal.confirm({
title: '删除报警实例',
content: '确定删除该报警实例吗?',
title: l('pages.registerCenter.alert.instance.delete'),
content: l('pages.registerCenter.alert.instance.deleteConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -81,31 +81,15 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
const columns: ProColumns<AlertInstanceTableListItem>[] = [
{
title: '名称',
title: l('pages.registerCenter.alert.instance.name'),
dataIndex: 'name',
tip: '名称是唯一的',
sorter: true,
formItemProps: {
rules: [
{
required: true,
message: '名称为必填项',
},
],
},
render: (dom, entity) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
},
},
{
title: '实例ID',
dataIndex: 'id',
hideInTable: true,
hideInForm: true,
hideInSearch: true,
},
{
title: '类型',
title: l('pages.registerCenter.alert.instance.type'),
sorter: true,
dataIndex: 'type',
hideInForm: false,
......@@ -135,32 +119,25 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
},
},
{
title: '配置',
dataIndex: 'params',
hideInForm: false,
hideInSearch: true,
hideInTable: true,
},
{
title: '是否启用',
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: true,
hideInSearch: true,
hideInTable: false,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......@@ -197,7 +174,7 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
return (
<PageContainer title={false}>
<ProTable<AlertInstanceTableListItem>
headerTitle="报警实例管理"
headerTitle={l('pages.registerCenter.alert.instanceManagement')}
actionRef={actionRef}
rowKey="id"
search={{
......@@ -228,16 +205,19 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
style={{fontWeight: 600}}>{selectedRowsState.length}</a>
})} &nbsp;&nbsp;
<span>
被禁用的报警实例共 {selectedRowsState.length - selectedRowsState.reduce((pre, item) => pre + (item.enabled ? 1 : 0), 0)}
</span>
{l('pages.registerCenter.alert.instance.disableTotalOf', '', {
total:
selectedRowsState.length - selectedRowsState.reduce((pre, item) => pre + (item.enabled ? 1 : 0), 0)
})}
</span>
</div>
}
>
<Button type="primary" danger
onClick={() => {
Modal.confirm({
title: '删除报警实例',
content: '确定删除选中的报警实例吗?',
title: l('pages.registerCenter.alert.instance.delete'),
content: l('pages.registerCenter.alert.instance.deleteConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -253,8 +233,8 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
<Button type="primary"
onClick={() => {
Modal.confirm({
title: '启用报警实例',
content: '确定启用选中的报警实例吗?',
title: l('pages.registerCenter.alert.instance.enable'),
content: l('pages.registerCenter.alert.instance.enableConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -268,8 +248,8 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
<Button danger
onClick={() => {
Modal.confirm({
title: '禁用报警实例',
content: '确定禁用选中的报警实例吗?',
title: l('pages.registerCenter.alert.instance.disable'),
content: l('pages.registerCenter.alert.instance.disableConfirm'),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......
......@@ -84,15 +84,15 @@ const NameSpaceForm: React.FC<TenantFormProps> = (props) => {
</Form.Item>
<Form.Item
name="note"
label={l('pages.nameSpace.note')}
label={l('global.table.note')}
>
<Input.TextArea placeholder={l('pages.nameSpace.EnterNameSpaceNote')} allowClear
autoSize={{minRows: 3, maxRows: 10}}/>
</Form.Item>
<Form.Item
name="enabled"
label={l('pages.nameSpace.enable')}>
<Switch checkedChildren={l('status.enabled')} unCheckedChildren={l('status.disabled')}
label={l('global.table.isEnable')}>
<Switch checkedChildren={l('button.enable')} unCheckedChildren={l('button.disable')}
defaultChecked={formValsPara.enabled}/>
</Form.Item>
</>
......
......@@ -105,7 +105,7 @@ const NameSpaceFormList: React.FC<{}> = (props: any) => {
},
},
{
title: l('pages.nameSpace.enable'),
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInTable: false,
hideInSearch: true,
......@@ -126,19 +126,19 @@ const NameSpaceFormList: React.FC<{}> = (props: any) => {
},
},
{
title: l('pages.nameSpace.note'),
title: l('global.table.note'),
dataIndex: 'note',
hideInSearch: true,
ellipsis: true,
},
{
title: l('pages.nameSpace.createTime'),
title: l('global.table.createTime'),
dataIndex: 'createTime',
sorter: true,
valueType: 'dateTime',
},
{
title: l('pages.nameSpace.updateTime'),
title: l('global.table.updateTime'),
dataIndex: 'updateTime',
sorter: true,
valueType: 'dateTime',
......
......@@ -126,7 +126,7 @@ const RoleForm: React.FC<TenantFormProps> = (props) => {
</Form.Item>
<Form.Item
name="note"
label={l('pages.role.note')}
label={l('global.table.note')}
>
<Input.TextArea placeholder={l('pages.role.EnterNote')} allowClear
autoSize={{minRows: 3, maxRows: 10}}/>
......
......@@ -134,19 +134,19 @@ const RoleFormList: React.FC<{}> = (props: any) => {
// },
// },
{
title: l('pages.role.note'),
title: l('global.table.note'),
dataIndex: 'note',
hideInSearch: true,
ellipsis: true,
},
{
title: l('pages.role.createTime'),
title: l('global.table.createTime'),
dataIndex: 'createTime',
sorter: true,
valueType: 'dateTime',
},
{
title: l('pages.role.updateTime'),
title: l('global.table.updateTime'),
dataIndex: 'updateTime',
sorter: true,
valueType: 'dateTime',
......
......@@ -77,7 +77,7 @@ const TenantForm: React.FC<TenantFormProps> = (props) => {
</FormItem>
<FormItem
name="note"
label={l('pages.tenant.Note')}
label={l('global.table.note')}
rules={[{required: true, message: l('pages.tenant.EnterTenantNote')}]}
>
<Input.TextArea placeholder={l('pages.tenant.EnterTenantNote')} allowClear
......
......@@ -158,18 +158,18 @@ const TenantFormList: React.FC<{}> = (props: any) => {
// },
// },
{
title: l('pages.tenant.Note'),
title: l('global.table.note'),
dataIndex: 'note',
hideInSearch: true,
ellipsis: true,
},
{
title: l('pages.tenant.CreateTime'),
title: l('global.table.createTime'),
dataIndex: 'createTime',
valueType: 'dateTime',
},
{
title: l('pages.tenant.UpdateTime'),
title: l('global.table.updateTime'),
dataIndex: 'updateTime',
valueType: 'dateTime',
},
......
......@@ -142,7 +142,7 @@ const TableTransferFrom = (props: TableTransferFromProps) => {
},
{
dataIndex: 'note',
title: l('pages.role.note'),
title: l('global.table.note'),
ellipsis: true,
},
];
......@@ -158,7 +158,7 @@ const TableTransferFrom = (props: TableTransferFromProps) => {
},
{
dataIndex: 'note',
title: l('pages.role.note'),
title: l('global.table.note'),
ellipsis: true,
},
];
......
......@@ -101,9 +101,9 @@ const UserForm: React.FC<UserFormProps> = (props) => {
</Form.Item>
<Form.Item
name="enabled"
label={l('pages.user.UserIsUse')}>
<Switch checkedChildren={l('status.enabled')}
unCheckedChildren={l('status.disabled')}
label={l('global.table.isEnable')}>
<Switch checkedChildren={l('button.enable')}
unCheckedChildren={l('button.disable')}
defaultChecked={formVals.enabled}/>
</Form.Item>
</>
......
......@@ -161,7 +161,7 @@ const UserTableList: React.FC<{}> = (props: any) => {
hideInTable: false,
},
{
title: l('pages.user.UserIsUse'),
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: true,
hideInSearch: true,
......@@ -183,14 +183,14 @@ const UserTableList: React.FC<{}> = (props: any) => {
},
},
{
title: l('pages.user.UserCreateTime'),
title: l('global.table.createTime'),
dataIndex: 'createTime',
sorter: true,
valueType: 'dateTime',
hideInTable: true,
},
{
title: l('pages.user.UserUpdateTime'),
title: l('global.table.updateTime'),
dataIndex: 'updateTime',
sorter: true,
valueType: 'dateTime',
......
......@@ -139,7 +139,7 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
</Form.Item>
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formValsPara.enabled}/>
</Form.Item>
......
......@@ -257,18 +257,18 @@ const ClusterTableList: React.FC<{}> = (props: any) => {
hideInTable: false,
filters: [
{
text: l('global.table.enabled'),
text: l('status.enabled'),
value: 1,
},
{
text: l('global.table.disabled'),
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: l('global.table.enabled'), status: 'Success'},
false: {text: l('global.table.disabled'), status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -343,7 +343,7 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
</Form.Item>
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formValsPara.enabled}/>
</Form.Item>
......
......@@ -172,25 +172,25 @@ const ClusterConfigurationTableList: React.FC<{}> = (props: any) => {
hideInTable: true,
},
{
title: '是否启用',
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: true,
hideInSearch: true,
hideInTable: false,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -162,7 +162,7 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
</Form.Item>
<Form.Item
name="enabled"
label="是否启用"
label={l('global.table.isEnable')}
>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formVals.enabled}/>
......
......@@ -147,7 +147,7 @@ const JobInstanceTable = (props: any) => {
status: JOB_LIFE_CYCLE.ONLINE,
},
0: {
text: l('global.table.lifecycle.unKnow'),
text: l('global.table.lifecycle.unknown'),
status: JOB_LIFE_CYCLE.UNKNOWN,
},
},
......
......@@ -191,7 +191,7 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
</FormItem>
<FormItem
name="enabled"
label="是否启用"
label={l('global.table.isEnable')}
rules={[{required: true, message: '请输入是否启用!'}]}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formVals.enabled}/>
......
......@@ -403,25 +403,25 @@ const DocumentTableList: React.FC<{}> = (props: any) => {
hideInTable: true,
},
{
title: '是否启用',
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: false,
hideInSearch: true,
hideInTable: false,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -104,7 +104,7 @@ const FragmentForm: React.FC<FragmentFormProps> = (props: any) => {
</FormItem>
<FormItem
name="enabled"
label="是否启用"
label={l('global.table.isEnable')}
rules={[{required: true, message: '请输入是否启用!'}]}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formVals.enabled}/>
......
......@@ -133,25 +133,25 @@ const FragmentTableList: React.FC<{}> = (props: any) => {
hideInTable: false,
},
{
title: '是否启用',
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: false,
hideInSearch: true,
hideInTable: false,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -124,7 +124,7 @@ const JarForm: React.FC<JarFormProps> = (props) => {
</Form.Item>
<Form.Item
name="enabled"
label="是否启用">
label={l('global.table.isEnable')}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formVals.enabled}/>
</Form.Item>
......
......@@ -178,25 +178,25 @@ const JarTableList: React.FC<{}> = (props: any) => {
hideInTable: true,
},
{
title: '是否启用',
title: l('global.table.isEnable'),
dataIndex: 'enabled',
hideInForm: true,
hideInSearch: true,
hideInTable: false,
filters: [
{
text: '已启用',
text: l('status.enabled'),
value: 1,
},
{
text: '已禁用',
text: l('status.disabled'),
value: 0,
},
],
filterMultiple: false,
valueEnum: {
true: {text: '已启用', status: 'Success'},
false: {text: '已禁用', status: 'Error'},
true: {text: l('status.enabled'), status: 'Success'},
false: {text: l('status.disabled'), status: 'Error'},
},
},
{
......
......@@ -132,7 +132,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
</FormItem>
<FormItem
name="enabled"
label="是否启用"
label={l('global.table.isEnable')}
rules={[{required: true, message: '请输入是否启用!'}]}>
<Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formVals.enabled}/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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
~
~ 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.
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
......@@ -87,7 +89,7 @@
<poi.version>4.1.2</poi.version>
<commons-email>1.5</commons-email>
<knife4j.version>3.0.3</knife4j.version>
<spotless.version>2.27.2</spotless.version>
<spotless.version>2.27.1</spotless.version>
</properties>
<dependencyManagement>
......@@ -539,7 +541,7 @@
<eclipse>
<file>style/spotless_dlink_formatter.xml</file>
</eclipse>
<removeUnusedImports />
<removeUnusedImports/>
<importOrder>
<order>com.dlink,org.apache,java,javax,org,com,,\#</order>
</importOrder>
......@@ -576,7 +578,7 @@
<includes>
<include>**/*.md</include>
</includes>
<flexmark />
<flexmark/>
</markdown>
</configuration>
<executions>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment