Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.x' into summer-code-raft-con…
Browse files Browse the repository at this point in the history
…fig-centerV2
  • Loading branch information
LegendGasai committed Feb 9, 2025
2 parents 04448f1 + b11cc1d commit 13ef429
Show file tree
Hide file tree
Showing 60 changed files with 2,191 additions and 155 deletions.
7 changes: 6 additions & 1 deletion changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7112](https://github.com/apache/incubator-seata/pull/7112)] bugfix: remove the condition that IPv6 must start with fe80
- [[#7107](https://github.com/apache/incubator-seata/pull/7107)] fix the issue of failing to parse annotations in TCC mode when the business object is a proxy object.
- [[#7124](https://github.com/apache/incubator-seata/pull/7124)] bugfix: GlobalTransactionScanner.afterPropertiesSet need do scanner check

- [[#7135](https://github.com/apache/incubator-seata/pull/7135)] treating a unique index conflict during rollback as a dirty write

### optimize:

Expand All @@ -27,6 +27,10 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7089](https://github.com/apache/incubator-seata/pull/7089)] support instance registration to the registry center
- [[#7093](https://github.com/apache/incubator-seata/pull/7093)] add a test workflow for JDK 21
- [[#7131](https://github.com/apache/incubator-seata/pull/7131)] Remove org.codehaus.jackson dependency
- [[#7134](https://github.com/apache/incubator-seata/pull/7134)] upgrade tomcat-embed to 9.0.98
- [[#7138](https://github.com/apache/incubator-seata/pull/7138)] Remove org.eclipse.jetty dependency
- [[#7139](https://github.com/apache/incubator-seata/pull/7139)] upgrade xstream to 1.4.21
- [[#7141](https://github.com/apache/incubator-seata/pull/7141)] remove unused dependencies


### security:
Expand Down Expand Up @@ -58,5 +62,6 @@ Thanks to these contributors for their code commits. Please report an unintended
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
- [wxrqforever](https://github.com/wxrqforever)
- [xingfudeshi](https://github.com/xingfudeshi)
- [YongGoose](https://github.com/YongGoose)

Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
8 changes: 7 additions & 1 deletion changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [[#7112](https://github.com/apache/incubator-seata/pull/7112)] 校验是否IPv6网络ip取消必须以fe80开始的条件
- [[#7107](https://github.com/apache/incubator-seata/pull/7107)] 修复tcc模式下,当业务对象为代理对象时,解析注解失败问题。
- [[#7124](https://github.com/apache/incubator-seata/pull/7124)] GlobalTransactionScanner.afterPropertiesSet方法需要做扫描检查
- [[#7135](https://github.com/apache/incubator-seata/pull/7135)] 回滚时遇到唯一索引冲突视为脏写

### optimize:

Expand All @@ -26,6 +27,10 @@
- [[#7089](https://github.com/apache/incubator-seata/pull/7089)] 新增instance注册到注册中心的接口
- [[#7093](https://github.com/apache/incubator-seata/pull/7093)] 增加jdk21的工作流测试
- [[#7131](https://github.com/apache/incubator-seata/pull/7131)] 移除 org.codehaus.jackson 依赖
- [[#7134](https://github.com/apache/incubator-seata/pull/7134)] 升级 tomcat-embed 至 9.0.98 版本
- [[#7138](https://github.com/apache/incubator-seata/pull/7138)] 移除 org.eclipse.jetty 依赖
- [[#7139](https://github.com/apache/incubator-seata/pull/7139)] 升级 xstream 至 1.4.21 版本
- [[#7141](https://github.com/apache/incubator-seata/pull/7141)] 去除未使用的依赖


### security:
Expand Down Expand Up @@ -57,5 +62,6 @@
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
- [wxrqforever](https://github.com/wxrqforever)
- [xingfudeshi](https://github.com/xingfudeshi)
-
- [YongGoose](https://github.com/YongGoose)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class Result<T> implements Serializable {

public static final String SUCCESS_CODE = "200";
public static final String SUCCESS_MSG = "success";
public static final String FAIL_CODE = "500";


private String code = SUCCESS_CODE;
private String message = SUCCESS_MSG;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ public static <T> SingleResult<T> failure(Code errorCode) {
return new SingleResult(errorCode.getCode(), errorCode.getMsg());
}

public static <T> SingleResult<T> failure(String msg) {
return new SingleResult<>(FAIL_CODE, msg);
}

public static <T> SingleResult<T> success(T data) {
return new SingleResult<>(SUCCESS_CODE, SUCCESS_MSG,data);
}

public static <T> SingleResult<T> success() {
return new SingleResult<>(SUCCESS_CODE, SUCCESS_MSG, null);
}

public T getData() {
return data;
}
Expand Down
2 changes: 1 addition & 1 deletion console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<spring-boot-for-server.version>2.7.18</spring-boot-for-server.version>
<spring-framework-for-server.version>5.3.39</spring-framework-for-server.version>
<snakeyaml-for-server.version>2.0</snakeyaml-for-server.version>
<tomcat-embed.version>9.0.90</tomcat-embed.version>
<tomcat-embed.version>9.0.98</tomcat-embed.version>
</properties>

<dependencyManagement>
Expand Down
12 changes: 12 additions & 0 deletions console/src/main/resources/static/console-fe/src/locales/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ const enUs: ILocale = {
showBranchSessionTitle: 'View branch session',
showGlobalLockTitle: 'View global lock',
branchSessionDialogTitle: 'Branch session info',
deleteGlobalSessionTitle: 'Delete global session',
forceDeleteGlobalSessionTitle: 'Force delete global session',
stopGlobalSessionTitle: 'Stop global session retry',
startGlobalSessionTitle: 'Start global session retry',
sendGlobalSessionTitle: 'Commit or rollback global session',
changeGlobalSessionTitle: 'Change global session status',
deleteBranchSessionTitle: 'Delete branch session',
forceDeleteBranchSessionTitle: 'force delete branch session',
stopBranchSessionTitle: 'Stop branch session retry',
startBranchSessionTitle: 'Start branch session retry',
},
GlobalLockInfo: {
title: 'GlobalLockInfo',
Expand All @@ -70,6 +80,8 @@ const enUs: ILocale = {
inputFilterPlaceholder: 'Please enter filter criteria',
resetButtonLabel: 'Reset',
searchButtonLabel: 'Search',
operateTitle: 'operate',
deleteGlobalLockTitle: 'Delete global lock',
},
ConfigInfo: {
title: 'ConfigurationInfo',
Expand Down
12 changes: 12 additions & 0 deletions console/src/main/resources/static/console-fe/src/locales/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ const zhCn: ILocale = {
showBranchSessionTitle: '查看分支信息',
showGlobalLockTitle: '查看全局锁',
branchSessionDialogTitle: '分支事务信息',
deleteGlobalSessionTitle: '删除全局事务',
forceDeleteGlobalSessionTitle: '强制删除全局事务',
stopGlobalSessionTitle: '停止全局事务重试',
startGlobalSessionTitle: '开启全局事务重试',
sendGlobalSessionTitle: '提交或回滚全局事务',
changeGlobalSessionTitle: '更新全局事务状态',
deleteBranchSessionTitle: '删除分支事务',
forceDeleteBranchSessionTitle: '强制删除分支事务',
stopBranchSessionTitle: '停止分支事务重启',
startBranchSessionTitle: '开启分支事务重试',
},
GlobalLockInfo: {
title: '全局锁信息',
Expand All @@ -70,6 +80,8 @@ const zhCn: ILocale = {
inputFilterPlaceholder: '请输入筛选条件',
resetButtonLabel: '重置',
searchButtonLabel: '搜索',
operateTitle: '操作',
deleteGlobalLockTitle: '删除全局锁',
},
ConfigInfo: {
title: '配置信息',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
* limitations under the License.
*/
import React from 'react';
import { ConfigProvider, Table, Button, DatePicker, Form, Icon, Pagination, Input } from '@alicloud/console-components';
import { ConfigProvider, Table, Button, DatePicker, Form, Icon, Pagination, Input, Dialog, Message } from '@alicloud/console-components';
import Actions, { LinkButton } from '@alicloud/console-components-actions';
import { withRouter } from 'react-router-dom';
import Page from '@/components/Page';
import { GlobalProps } from '@/module';
import styled, { css } from 'styled-components';
import getData, { GlobalLockParam } from '@/service/globalLockInfo';
import getData, {checkData, deleteData, GlobalLockParam } from '@/service/globalLockInfo';
import PropTypes from 'prop-types';
import moment from 'moment';

import './index.scss';
import {get} from "lodash";
import {enUsKey, getCurrentLanguage} from "@/reducers/locale";

const { RangePicker } = DatePicker;
const FormItem = Form.Item;
Expand All @@ -37,7 +39,7 @@ type GlobalLockInfoState = {
globalLockParam: GlobalLockParam;
}

class GlobalLockInfo extends React.Component<GlobalProps, GlobalLockInfoState> {
class GlobalLockInfo extends React.Component<GlobalProps, GlobalLockInfoState> {
static displayName = 'GlobalLockInfo';

static propTypes = {
Expand Down Expand Up @@ -148,12 +150,53 @@ type GlobalLockInfoState = {
this.search();
}

deleteCell = (val: string, index: number, record: any) => {
const {locale = {}} = this.props;
const {
deleteGlobalLockTitle
} = locale;
let width = getCurrentLanguage() === enUsKey ? '120px' : '80px'
return (
<Actions style={{width: width}}>
<Button onClick={() => {
let addWarnning = ''
Dialog.confirm({
title: 'Confirm',
content: 'Are you sure you want to delete the global lock',
onOk: () => {
checkData(record).then((rsp) => {
addWarnning = rsp.data ? 'The branch transactions may be affected' : ''
Dialog.confirm({
title: 'Warnning',
content: <div dangerouslySetInnerHTML={{ __html: 'Dirty write problem exists' + '<br>' + addWarnning }}/>,
onOk: () => {
deleteData(record).then(() => {
Message.success("Delete success")
this.search()
}).catch((rsp) => {
Message.error(get(rsp, 'data.message'))
})
}
})
}).catch((rsp) => {
Message.error(get(rsp, 'data.message'))
})
}
});
}}>
{deleteGlobalLockTitle}
</Button>
</Actions>)
}


render() {
const { locale = {} } = this.props;
const { title, subTitle, createTimeLabel,
inputFilterPlaceholder,
searchButtonLabel,
resetButtonLabel,
operateTitle,
} = locale;
return (
<Page
Expand Down Expand Up @@ -221,27 +264,28 @@ type GlobalLockInfoState = {
</Form>
{/* global lock table */}
<div>
<Table dataSource={this.state.list} loading={this.state.loading}>
<Table.Column title="xid" dataIndex="xid" />
<Table.Column title="transactionId" dataIndex="transactionId" />
<Table.Column title="branchId" dataIndex="branchId" />
<Table.Column title="resourceId" dataIndex="resourceId" />
<Table.Column title="tableName" dataIndex="tableName" />
<Table.Column title="pk" dataIndex="pk" />
<Table.Column title="rowKey" dataIndex="rowKey" />
<Table.Column title="gmtCreate" dataIndex="gmtCreate" />
<Table.Column title="gmtModified" dataIndex="gmtModified" />
</Table>
<Pagination
total={this.state.total}
defaultCurrent={1}
current={this.state.globalLockParam.pageNum}
onChange={this.paginationOnChange}
pageSize={this.state.globalLockParam.pageSize}
pageSizeSelector="dropdown"
pageSizeList={[10, 20, 30, 40, 50]}
onPageSizeChange={this.paginationOnPageSizeChange}
/>
<Table dataSource={this.state.list} loading={this.state.loading}>
<Table.Column title="xid" dataIndex="xid" />
<Table.Column title="transactionId" dataIndex="transactionId" />
<Table.Column title="branchId" dataIndex="branchId" />
<Table.Column title="resourceId" dataIndex="resourceId" />
<Table.Column title="tableName" dataIndex="tableName" />
<Table.Column title="pk" dataIndex="pk" />
<Table.Column title="rowKey" dataIndex="rowKey" />
<Table.Column title="gmtCreate" dataIndex="gmtCreate" />
<Table.Column title="gmtModified" dataIndex="gmtModified" />
<Table.Column title={operateTitle} cell={this.deleteCell}/>
</Table>
<Pagination
total={this.state.total}
defaultCurrent={1}
current={this.state.globalLockParam.pageNum}
onChange={this.paginationOnChange}
pageSize={this.state.globalLockParam.pageSize}
pageSizeSelector="dropdown"
pageSizeList={[10, 20, 30, 40, 50]}
onPageSizeChange={this.paginationOnPageSizeChange}
/>
</div>
</Page>
);
Expand Down
Loading

0 comments on commit 13ef429

Please sign in to comment.