Skip to content

Commit 65a2730

Browse files
committed
Changed uri of cyclic request to /webvisu.htm
A redirection to /webvisu.htm happens automatically on older controller Not so on linux controller. Has been fixed. Removed cross domain request Fixed a bug with getPath related to namespace .
1 parent 5d19bca commit 65a2730

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/controlcenter.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class HTML5Visu {
4747
async initCommunication(XML : XMLDocument, cycletime : number) : Promise<boolean> {
4848
return new Promise(resolve =>{
4949
let com = ComSocket.singleton();
50-
com.setServerURL(this.rootDir + '');
50+
com.setServerURL(this.rootDir + '/webvisu.htm');
5151
com.startCyclicUpdate(cycletime);
5252
this.appendVariables(XML);
5353
resolve(true);
@@ -73,26 +73,36 @@ export default class HTML5Visu {
7373
url: this.rootDir+'/visu_ini.xml',
7474
type: 'GET',
7575
dataType: 'xml',
76-
crossDomain: true
7776
})
7877
getPath.then((data) => {
7978
// Path is correct
8079
resolve(true);
8180
})
8281
getPath.fail(()=>{
83-
let getPath =$.ajax({
82+
let getPath2 =$.ajax({
8483
url: this.rootDir+'/PLC/visu_ini.xml',
8584
type: 'GET',
86-
dataType: 'xml',
87-
crossDomain: true
85+
dataType: 'xml'
8886
})
89-
getPath.then((data) => {
87+
getPath2.then((data) => {
9088
// Path must be adapted for an older Linux Controller without Linux
9189
this.rootDir = this.rootDir + '/PLC';
9290
resolve(true);
9391
})
94-
getPath.fail(()=>{
95-
resolve(false);
92+
getPath2.fail(()=>{
93+
let getPath3 =$.ajax({
94+
url: this.rootDir+'/webvisu/visu_ini.xml',
95+
type: 'GET',
96+
dataType: 'xml'
97+
})
98+
getPath3.then((data) => {
99+
// Path must be adapted for a Linux-PFC
100+
this.rootDir = this.rootDir + '/webvisu';
101+
resolve(true);
102+
})
103+
getPath3.fail(()=>{
104+
resolve(false);
105+
})
96106
})
97107
})
98108
})

0 commit comments

Comments
 (0)