Skip to content

Commit 1c54d56

Browse files
authored
Merge pull request #456 from chunqiuyiyu/dashboard
Add some iPad support and slash for newFile path.
2 parents b104d78 + a0a979c commit 1c54d56

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

app/commands/commandBindings/file.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export function openFile (obj, callback) {
220220

221221
function createFileWithContent (content) {
222222
return function createFileAtPath (path) {
223+
path = path.startsWith('/') ? path : `/${path}`
223224
if (content) {
224225
return api.createFile(path, content)
225226
.then((res) => {

app/commons/Tree/TreeNode.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class TreeNode extends Component {
153153
ref={r => (this.nodeDOM = r)}
154154
onClick={e => selectNode(node)}
155155
onDoubleClick={e => openNode(node)}
156+
onTouchStart={e => openNode(node)}
156157
style={{ paddingLeft: `${1 + node.depth}em` }}
157158
>
158159
{node.isLoading && <i className='fa fa-spinner fa-pulse fa-fw' />}

app/components/Terminal/actions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ export function inputPath (inputPath) {
106106
*/
107107

108108
export const addTerminal = registerAction('terminal:add', (props) => {
109-
state.tabGroups.get('terminalGroup').addTab(new Tab(props))
109+
const group = state.tabGroups.get('terminalGroup')
110+
if (!group.tabs.find(tab => tab.id === props.id)) {
111+
group.addTab(new Tab(props))
112+
}
110113
})
111114

112115
// 如果没有,添加一个

app/extensions/Terminal.ext.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class Terminal {
55
constructor (xterm) {
66
this.name = xterm.id
77
this.sendText = (text) => {
8-
const textArr = text.split(' ')
9-
xterm.emit('data', textArr)
8+
xterm.emit('data', 'clear\r')
9+
xterm.emit('data', text + '\r')
1010
}
1111

1212
this.active = () => {
@@ -34,5 +34,10 @@ export function registerTerminalOpenHandler (fn) {
3434

3535
export function createTerminal (id, shellPath) {
3636
addTerminal({ id, cwd: shellPath })
37-
return new Terminal(state.terminalManager.getTermById(id))
37+
return new Promise(resolve => {
38+
setTimeout(() => {
39+
const term = state.tabs.get(id).terminal
40+
resolve(new Terminal(term))
41+
}, 0)
42+
})
3843
}

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="zh-cn">
33
<head>
44
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1">
5+
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1, shrink-to-fit=no">
66
<title>Cloud Studio - 开启云端开发模式 WebIDE</title>
77
<meta name="Keywords" content="Coding.net,Coding,WebIDE,Web IDE,IDE,Git,代码托管,在线开发,在线调试,Terminal,开发环境分享,软件团队协作,Cloud Studio">
88
<meta name="Description" content="Cloud Studio 是Coding自主研发的在线集成开发环境。用户可以通过 Cloud Studio 创建项目的工作空间,进行在线开发,调试等操作。与此同时,Cloud Studio 还提供了可分享的开发环境功能,用户可以保存当前的 Terminal 环境,分享给团队的其他成员。">

0 commit comments

Comments
 (0)