Skip to content

Commit dba7103

Browse files
author
Yang Zhen
committed
Merge branch 'new-url-ui' of github.com:Coding/WebIDE-Plugin-Access-Url into new-url-ui
2 parents e27e58d + 85e9999 commit dba7103

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

i18n/en_US/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sidebar": "Access URL",
33
"port": "Port",
4-
"generate": "Generate",
4+
"generate": "Generate URL",
55
"refresh": "Refresh",
66
"description": "Access links create a link for external access for your application. Before you create an access link, map the application port you want to access to address 0.0.0.0 in the terminal. ",
77
"help": "View help",

i18n/zh_CN/global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sidebar": "访问链接",
33
"port": "端口",
4-
"generate": "生成",
4+
"generate": "创建链接",
55
"refresh": "刷新",
6-
"description": "访问链接可为应用程序创建一个供外部访问的链接,创建访问链接前,请在终端(Terminal)中将需要被访问的应用程序端口映射到0.0.0.0地址",
6+
"description": "访问链接可为应用程序创建一个供外部访问的链接,创建访问链接前,请在终端(Terminal)中将需要被访问的应用程序端口映射到 0.0.0.0 地址",
77
"help": "查看帮助",
88
"handleDelete": {
99
"header": "你确定删除此端口吗",

src/AccessUrl.jsx

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class AccessUrl extends Component {
2424
this.handlePort = this.handlePort.bind(this);
2525
this.handlePortIncrease = this.handlePortIncrease.bind(this);
2626
this.handlePortDecrease = this.handlePortDecrease.bind(this);
27+
this.handleEnterGenerate = this.handleEnterGenerate.bind(this);
2728
this.handleGenerate = this.handleGenerate.bind(this);
2829
}
2930
componentWillMount () {
@@ -58,23 +59,6 @@ class AccessUrl extends Component {
5859
<i className="icon fa fa-external-link" />
5960
{i18n`global.sidebar`}
6061
</div>
61-
{/*<div className="panel-title-right">
62-
{i18n`global.port`}
63-
<input type="number" min="0" max="65535" defaultValue="8080" ref={(input) => { this.portInput = input; }} onKeyDown={(e) => {
64-
if (e.keyCode === 13) {
65-
if (!generateDisabled) {
66-
this.handleGenerate(e)
67-
}
68-
}
69-
}} />
70-
<label className="opt-label" onClick={(e) => {
71-
if (!generateDisabled) {
72-
this.handleGenerate(e)
73-
}
74-
}}>
75-
<i className="fa fa-plus" title={i18n.get('global.generate')} />
76-
</label>
77-
</div>*/}
7862
<i className="fa fa-refresh" onClick={this.handleRefrash} title={i18n.get('global.refresh:=Refresh')} />
7963
</div>
8064
<div className="panel-body">
@@ -86,7 +70,7 @@ class AccessUrl extends Component {
8670
<div className="url-generate">
8771
<div className="port">
8872
<span>0.0.0.0&nbsp;:</span>
89-
<input type="text" value={this.state.port} onChange={this.handlePort} />
73+
<input type="text" value={this.state.port} onChange={this.handlePort} onKeyUp={this.handleEnterGenerate} />
9074
<div className="change">
9175
<div className="fa fa-angle-up" onClick={this.handlePortIncrease}></div>
9276
<div className="fa fa-angle-down" onClick={this.handlePortDecrease}></div>
@@ -199,6 +183,12 @@ class AccessUrl extends Component {
199183
}
200184
}
201185

186+
handleEnterGenerate(e) {
187+
if (e.keyCode === 13) {
188+
this.handleGenerate(e);
189+
}
190+
}
191+
202192
handleGenerate = (e) => {
203193
e.preventDefault()
204194
this.props.actions.createPort({ port: this.state.port}).then((res) => {

src/base-theme/styles/accessUrl.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
.url-tip {
7474
padding: 10px;
7575
line-height: 20px;
76-
font-size: 12px;
76+
font-size: 14px;
7777
color: #737373;
7878
}
7979
.url-generate {

0 commit comments

Comments
 (0)