Skip to content

Commit

Permalink
ui: Add warning if dashboard accessed from incorrect domain
Browse files Browse the repository at this point in the history
_ref: #879
  • Loading branch information
sogehige committed Mar 30, 2018
1 parent 08d43a4 commit d2301a8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions public/index.html
Expand Up @@ -336,6 +336,26 @@ <h2>
<script src="/dist/velocity-animate/js/velocity.min.js"></script>

<script>
if (typeof token === 'undefined') {
$('body').empty().append(`
<div class="alert alert-danger ml-5 mr-5" role="alert">
This domain is not set as accessible in your <strong>config.json</strong>. Update your file and restart a bot to propagate changes. Example below:
</div>
<pre class="alert alert-info ml-5 mr-5" style="font-family: Monospace">
... config.json ...
"panel": {
"__COMMENT__": "set correctly your domain and to be safe, change your token",
"username": "***",
"password": "***",
"port": ***,
"domain": "yourdomain1, ${window.location.host.split(':')[0]}",
"token": "***"
},
... config.json ...
</pre>
`)
}

var socket = io({
query: "token=" + token
});
Expand Down

0 comments on commit d2301a8

Please sign in to comment.