Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
oldj committed Aug 28, 2017
1 parent add7e3f commit 91070dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app-ui/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ export default class App extends React.Component {
}

setHostsContent (v) {
if (this.state.current.content === v) return // not changed
let {current, list} = this.state
if (current.content === v) return // not changed

let current = Object.assign({}, this.state.current, {
current = Object.assign({}, current, {
content: v || ''
})
let list = this.state.list.slice(0)
list = list.slice(0)
let idx = list.findIndex(i => i.id === current.id)
if (idx !== -1) {
list.splice(idx, 1, current)
Expand Down
2 changes: 2 additions & 0 deletions app-ui/events/list_updated.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ module.exports = (app, new_list, hosts = null) => {
state.sys_hosts = sys_hosts
state.current = sys_hosts
})

} else if (hosts) {
state.current = hosts

} else if (current) {
let c = new_list.find(i => i.id === current.id)
if (c) {
Expand Down
1 change: 1 addition & 0 deletions app/server/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ module.exports = (cnt, pswd) => {
let after_cmd = pref.after_cmd

if (after_cmd) {
// todo 传入当前应用的模块名作为参数
exec(after_cmd, (error, stdout, stderr) => {
// command output is in stdout
if (error) {
Expand Down
2 changes: 1 addition & 1 deletion app/ui/bundle.js

Large diffs are not rendered by default.

0 comments on commit 91070dc

Please sign in to comment.