Skip to content

Commit ab3d9ac

Browse files
committed
修复组合部分有时内容没有清空的问题。
1 parent 7f91243 commit ab3d9ac

File tree

7 files changed

+32
-15
lines changed

7 files changed

+32
-15
lines changed

app/ui/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
exports.version = [3,3,5,5263];
1+
exports.version = [3,3,5,5263];

ui/frame/edit.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export default class EditPrompt extends React.Component {
5656
Agent.on('add_hosts', () => {
5757
this.setState({
5858
show: true,
59-
is_add: true
59+
is_add: true,
60+
include: []
6061
})
6162
setTimeout(() => {
6263
this.tryToFocus()
@@ -136,6 +137,9 @@ export default class EditPrompt extends React.Component {
136137
if (this.state.is_add) {
137138
this.props.justAdd(new_id)
138139
}
140+
if (this.state.where !== 'group') {
141+
data.include = []
142+
}
139143

140144
delete data['is_add']
141145
Agent.emit('update_hosts', data)

ui/frame/frame.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class MyFrame extends React.Component {
6565
return (
6666
<Modal
6767
visible={show}
68-
title={title}
68+
title={(<h3>{title}</h3>)}
6969
onOk={this.onOK.bind(this)}
7070
onCancel={this.onCancel.bind(this)}
7171
wrapClassName="frame"

ui/frame/frame.less

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.frame {
22
@bg: #f5f5f5;
33
@btn_default: #05a;
4-
@lh: 24px;
4+
@lh: 28px;
55

66
&:before {
77
content: '';
@@ -11,6 +11,12 @@
1111
width: 0;
1212
}
1313

14+
h3 {
15+
font-size: 14px;
16+
margin: 0;
17+
padding: 0;
18+
}
19+
1420
.ant-modal {
1521
//display: inline-block;
1622
//vertical-align: middle;
@@ -22,13 +28,13 @@
2228
//max-width: 600px;
2329
//background: #fff;
2430
//box-shadow: 0 0 4px 4px rgba(0, 0, 0, 0.1);
25-
line-height: 30px;
31+
line-height: @lh;
2632

2733
.prompt-body {
2834
//padding: 20px 20px;
2935

3036
.ln {
31-
line-height: 30px;
37+
line-height: @lh;
3238
padding: 2px 0;
3339
margin-bottom: 10px;
3440

@@ -39,7 +45,7 @@
3945
}
4046
.cnt {
4147
margin-left: 100px;
42-
line-height: 30px;
48+
line-height: @lh;
4349
//input[type=text] {
4450
// width: 240px;
4551
// outline: none;

ui/frame/group.jsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import React from 'react'
99
import { Icon } from 'antd'
10-
import classnames from 'classnames'
1110
import Sortable from 'sortablejs'
1211
import listToArray from 'wheel-js/src/common/listToArray'
1312
import './group.less'
@@ -33,14 +32,21 @@ export default class Group extends React.Component {
3332
let attrs = {
3433
'data-id': item.id || ''
3534
}
35+
36+
let icon_type
37+
if (item.where === 'remote') {
38+
icon_type = 'global'
39+
} else if (item.where === 'group') {
40+
icon_type = 'copy'
41+
} else {
42+
icon_type = 'file-text'
43+
}
44+
3645
return (
3746
<div className="hosts-item" {...attrs}>
38-
<i className={classnames({
39-
'iconfont': 1
40-
, 'item-icon': 1
41-
, 'icon-file': item.where !== 'group'
42-
, 'icon-files': item.where === 'group'
43-
})}
47+
<Icon
48+
type={icon_type}
49+
className="iconfont"
4450
/>
4551
<span>{item.title || 'untitled'}</span>
4652
</div>

ui/frame/group.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
.hosts-item {
3636
cursor: move;
3737
padding: 2px 6px;
38+
line-height: 24px;
3839

3940
&:hover {
4041
background: #f5f5f5;

0 commit comments

Comments
 (0)