Skip to content

Commit bffdd1f

Browse files
fadmarinafr0l
authored andcommitted
Set agent endpoint via inspector interface
1 parent c981b6f commit bffdd1f

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

js/http.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import Ajax from 'simple-ajax';
1111

1212
class Http {
1313
static get(path, callback) {
14+
var url = window._da_address || 'http://localhost:27753'
1415
const ajax = new Ajax({
15-
url: `http://localhost:27753/${path}`,
16+
url: `${url}/${path}`,
1617
method: 'GET',
1718
});
1819
ajax.on('success', event => {
@@ -23,8 +24,9 @@ class Http {
2324
}
2425

2526
static post(path, data, callback) {
27+
var url = window._da_address || 'http://localhost:27753'
2628
const ajax = new Ajax({
27-
url: `http://localhost:27753/${path}`,
29+
url: `${url}/${path}`,
2830
method: 'POST',
2931
data: data,
3032
});

js/screen.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class Screen extends React.Component {
3232
<div className="section-caption">
3333
Screen
3434
</div>
35+
<div className="port selection">
36+
<input type="text" id="device-agent-endpoint" defaultValue="http://localhost:41799"></input>
37+
<Button onClick={(ev) => {this.setDeviceAgentPort();}} >
38+
Set DA endpoint
39+
</Button>
40+
</div>
3541
<div>
3642
<Button onClick={(ev) => {this.home(ev); }} >
3743
Home
@@ -68,6 +74,11 @@ class Screen extends React.Component {
6874
return this._gestureRecognizer;
6975
}
7076

77+
setDeviceAgentPort() {
78+
window._da_address = document.getElementById("device-agent-endpoint").value;
79+
this.props.refreshApp();
80+
}
81+
7182
styleWithScreenSize() {
7283
var screenshot = this.screenshot();
7384
return {

0 commit comments

Comments
 (0)