Skip to content

Commit aa90432

Browse files
author
dushixiang
committed
移除js中未使用的变量
1 parent 2e0bb63 commit aa90432

File tree

9 files changed

+21
-53
lines changed

9 files changed

+21
-53
lines changed

src/main/web/src/components/Broker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Broker extends Component {
1717
let clusterId = urlParams.get('clusterId');
1818
let clusterName = urlParams.get('clusterName');
1919
this.setState({
20-
clusterId: clusterId,
2120
clusterName: clusterName
2221
})
2322
this.loadItems(clusterId);

src/main/web/src/components/Cluster.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ class Cluster extends Component {
9393
} catch (e) {
9494
console.log(e);
9595
} finally {
96-
const items = data.items.map(item => {
97-
return {'key': item['id'], ...item}
98-
})
96+
const items = data.items;
9997
this.setState({
10098
items: items,
10199
total: data.total,

src/main/web/src/components/ConsumerGroup.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,13 @@ class ConsumerGroup extends Component {
3131

3232
state = {
3333
items: [],
34-
selectedRowKeys: [],
3534
queryParams: {
3635
pageIndex: 1,
3736
pageSize: 10
3837
},
3938
loading: false,
40-
modalVisible: false,
4139
clusterId: undefined,
4240
clusterName: undefined,
43-
selectedRow: {},
44-
createPartitionConfirmLoading: false
4541
}
4642

4743
componentDidMount() {

src/main/web/src/components/Info.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class Info extends Component {
3333

3434
onNewPassword2Change = (value) => {
3535
this.setState({
36-
...this.validateNewPassword(value.target.value),
37-
'newPassword2': value.target.value
36+
...this.validateNewPassword(value.target.value)
3837
})
3938
}
4039

src/main/web/src/components/Topic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ class Topic extends Component {
331331
handleOk={this.handleOk}
332332
handleCancel={this.handleCancelModal}
333333
confirmLoading={this.state.modalConfirmLoading}
334-
model={this.state.model}
334+
model={null}
335335
brokerCount={this.state.brokerCount}
336336
/> : undefined
337337
}

src/main/web/src/components/TopicConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class TopicConfig extends Component {
3333
<List
3434
itemLayout="horizontal"
3535
dataSource={this.state.items}
36+
loading={this.state.loading}
3637
renderItem={item => (
3738
<List.Item>
3839
<List.Item.Meta

src/main/web/src/components/TopicConsumerGroupOffset.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ class TopicConsumerGroupOffset extends Component {
3232
resetOffsetVisible: false,
3333
selectedRow: {},
3434
seek: 'end',
35-
resetting: false,
36-
createPartitionVisible: false
35+
resetting: false
3736
}
3837

3938
componentDidMount() {

src/main/web/src/components/TopicInfo.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,22 @@ class TopicInfo extends Component {
6464
}
6565

6666
handleSendMessage = async (values) => {
67-
let offset = await request.post(`/topics/${this.state.topic}/data?clusterId=${this.state.clusterId}`, values);
68-
notification['success']({
69-
message: '提示',
70-
description: `发送数据成功,位于 offset ${offset}。`,
71-
});
7267
this.setState({
73-
modalVisible: false
74-
});
68+
'modalConfirmLoading': true
69+
})
70+
try {
71+
let offset = await request.post(`/topics/${this.state.topic}/data?clusterId=${this.state.clusterId}`, values);
72+
notification['success']({
73+
message: '提示',
74+
description: `发送数据成功,位于 offset ${offset}。`,
75+
});
76+
} finally {
77+
this.setState({
78+
modalVisible: false,
79+
modalConfirmLoading: true
80+
});
81+
}
82+
7583
if (this.state.topicPartitionRef) {
7684
this.state.topicPartitionRef.refresh();
7785
}
@@ -81,6 +89,7 @@ class TopicInfo extends Component {
8189
if (this.state.topicConsumerGroupRef) {
8290
this.state.topicConsumerGroupRef.refresh();
8391
}
92+
8493
return true;
8594
}
8695

src/main/web/src/utils/utils.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -178,39 +178,6 @@ export function difference(a, b) {
178178
return Array.from(new Set(a.concat(b).filter(v => !aSet.has(v) || !bSet.has(v))))
179179
}
180180

181-
export function requestFullScreen(element) {
182-
// 判断各种浏览器,找到正确的方法
183-
const requestMethod = element.requestFullScreen || //W3C
184-
element.webkitRequestFullScreen || //FireFox
185-
element.mozRequestFullScreen || //Chrome等
186-
element.msRequestFullScreen; //IE11
187-
if (requestMethod) {
188-
requestMethod.call(element);
189-
} else if (typeof window.ActiveXObject !== "undefined") { //for Internet Explorer
190-
const wScript = new window.ActiveXObject("WScript.Shell");
191-
if (wScript !== null) {
192-
wScript.SendKeys("{F11}");
193-
}
194-
}
195-
}
196-
197-
//退出全屏 判断浏览器种类
198-
export function exitFull() {
199-
// 判断各种浏览器,找到正确的方法
200-
const exitMethod = document.exitFullscreen || //W3C
201-
document.mozCancelFullScreen || //FireFox
202-
document.webkitExitFullscreen || //Chrome等
203-
document.webkitExitFullscreen; //IE11
204-
if (exitMethod) {
205-
exitMethod.call(document);
206-
} else if (typeof window.ActiveXObject !== "undefined") { //for Internet Explorer
207-
const wScript = new window.ActiveXObject("WScript.Shell");
208-
if (wScript !== null) {
209-
wScript.SendKeys("{F11}");
210-
}
211-
}
212-
}
213-
214181
export function renderSize(value) {
215182
if (null == value || value === '' || value === 0) {
216183
return "0 Bytes";

0 commit comments

Comments
 (0)