error message for internet edge and other browsers that block CORS POSTs

This commit is contained in:
lone-cloud 2015-10-31 13:03:42 -07:00
parent bcb5c0ad8f
commit 3abc5990f5
2 changed files with 17 additions and 6 deletions

View file

@ -23,6 +23,7 @@ export default Em.Component.extend({
manualBridgeIp: null, manualBridgeIp: null,
manualBridgeIpNotFound: false, manualBridgeIpNotFound: false,
multipleBridgeIps: [], multipleBridgeIps: [],
error: false,
actions: { actions: {
retry(){ retry(){
@ -126,6 +127,9 @@ export default Em.Component.extend({
} }
this.set('bridgeAuthenticateReachedStatus', status); this.set('bridgeAuthenticateReachedStatus', status);
}).fail(()=>{
this.clearBridgePingIntervalHandle();
this.set('error', true);
}); });
this.incrementProperty('bridgeUserNamePingIntervalProgress', this.get('bridgeUsernamePingIntervalTime')/bridgeUsernamePingMaxTime*100); this.incrementProperty('bridgeUserNamePingIntervalProgress', this.get('bridgeUsernamePingIntervalTime')/bridgeUsernamePingMaxTime*100);

View file

@ -1,13 +1,20 @@
<div class="title">Huegasm</div> <div class="title">Huegasm</div>
{{#unless bridgeUsername}} {{#unless bridgeUsername}}
{{#if bridgeIp}} {{#if bridgeIp}}
<img src="assets/images/pressButtonBridge.png" id="pressButtonBridgeImg"> {{#if error}}
{{paper-progress-linear warn=true value=bridgeUserNamePingIntervalProgress}} <p>Huegasm encountered a critical error while trying to connect to your bridge.<br><br>
{{#if isAuthenticating}} This likely happened because you're using an outdated browser and/or because your browser does not support <a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">CORS</a>. Feel free to contact me through the link at the bottom of the page if you feel like this is not the case.<br>
<p>Your bridge IP is <b>{{bridgeIp}}</b> <br> For the best browsing experience on this site ( and every other one known to man ) please switch to <a href="https://www.google.com/chrome/">Google Chrome</a> or <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a></p>.
Press the button on your bridge to authenticate this application.</p>
{{else}} {{else}}
<p>You failed to press the button. <a class="noTextDecoration" href="#" {{action 'retry'}}>RETRY</a></p> <img src="assets/images/pressButtonBridge.png" id="pressButtonBridgeImg">
{{paper-progress-linear warn=true value=bridgeUserNamePingIntervalProgress}}
{{#if isAuthenticating}}
<p>Your bridge IP is <b>{{bridgeIp}}</b> <br>
Press the button on your bridge to authenticate this application.</p>
{{else}}
<p>You failed to press the button. <a class="noTextDecoration" href="#" {{action 'retry'}}>RETRY</a></p>
{{/if}}
{{/if}} {{/if}}
{{else}} {{else}}
{{#unless bridgeFindStatus}} {{#unless bridgeFindStatus}}