Skip to content

Commit 4ae3146

Browse files
author
chenyunan
committed
modify search websocket url and some css style
1 parent e29bc87 commit 4ae3146

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

app/backendAPI/websocketClients.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ class SearchSocketClient {
191191
const firstSlashIdx = wsUrl.indexOf('/', 8)
192192
const [host, path] = firstSlashIdx === -1 ? [wsUrl, ''] : [wsUrl.substring(0, firstSlashIdx), wsUrl.substring(firstSlashIdx)]
193193

194-
const url = `${host}:8066/search/sockjs`
195-
194+
// const url = `${host}:8066/search/sockjs`
195+
const url = `${host}${path}/search/sockjs/${config.spaceKey}`
196+
// http://dev.coding.ide/ide-ws/search/sockjs/kfddvb/info
196197
this.sockJSConfigs = [url, {}, {server: `${config.spaceKey}`, transports: 'websocket'}]
197198

198199
this.backoff = getBackoff({

app/components/Search/search.new.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component } from "react";
22
import { observer } from 'mobx-react'
33
import subscribeToSearch from 'commons/Search/subscribeToSearch'
44
import state from 'commons/Search/state'
5+
import cx from 'classnames'
56
import { openFile } from 'commands/commandBindings/file'
67
import * as delegate from 'commons/Search/action'
78
import icons from 'file-icons-js'
@@ -31,7 +32,6 @@ export class SearchResultItem extends Component {
3132
openFile({ path, editor: { filePath: path, selection } })
3233
}
3334

34-
3535
render() {
3636
const {fileName, pattern, path, results} = this.props;
3737
const resultSize = results.length;
@@ -40,7 +40,7 @@ export class SearchResultItem extends Component {
4040
<div className='search-item' key={path}>
4141
<div className='search-item-path' onClick={this.handlePathClick}>
4242
<i
43-
className={({
43+
className={cx({
4444
'fa fa-caret-right': this.state.isFolded,
4545
'fa fa-caret-down': !this.state.isFolded
4646
})}
@@ -85,6 +85,9 @@ class SearchPanel extends Component {
8585
}
8686

8787
searchTxt = () => {
88+
if(state.searching.pattern.length == 0 || state.searching.pattern.trim() == '') {
89+
return ;
90+
}
8891
if(state.ws.first) {
8992
state.ws.first = false
9093
}
@@ -148,7 +151,7 @@ class SearchPanel extends Component {
148151
placeholder={i18n.get('panel.left.find')}
149152
/>
150153
</div>
151-
<div className='search-checkbox'>
154+
{/* <div className='search-checkbox'>
152155
<input
153156
title={i18n.get('panel.checkbox.case')}
154157
label={i18n.get('panel.checkbox.case')}
@@ -166,7 +169,7 @@ class SearchPanel extends Component {
166169
className='search-control-pattern'
167170
onChange={this.pattern}
168171
type='checkbox'/>
169-
</div>
172+
</div> */}
170173
</div>
171174
{this.renderResult()}
172175
</div>

app/styles/core-ui/Search.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
margin-bottom: 14px;
1111
background-color: #1e1e1e
1212
border: 1px solid #333
13-
display: flex
13+
// display: flex
1414
.search-controls {
1515
border: none
1616
}

0 commit comments

Comments
 (0)