Skip to content

Commit

Permalink
Merge pull request #66 from qJake/project-updates
Browse files Browse the repository at this point in the history
Fixed JS path
  • Loading branch information
qJake authored Feb 10, 2020
2 parents 4aa7477 + e304fc5 commit 6211584
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HADotNet.CommandCenter/wwwroot/js/HAConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ class HAConnection

private parseSocketUrl(baseUrl: string): string
{
if (/core\/websocket/i.test(baseUrl))
{
return baseUrl;
}

let aTag = document.createElement('a');
aTag.href = baseUrl;

Expand Down
3 changes: 3 additions & 0 deletions HADotNet.CommandCenter/wwwroot/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ class HAConnection {
}
}
parseSocketUrl(baseUrl) {
if (/core\/websocket/i.test(baseUrl)) {
return baseUrl;
}
let aTag = document.createElement('a');
aTag.href = baseUrl;
return `${(aTag.protocol.toLowerCase() === 'https:' ? 'wss' : 'ws')}://${aTag.host}/api/websocket`;
Expand Down
Loading

0 comments on commit 6211584

Please sign in to comment.