Fix safari websocket warning

This commit is contained in:
Vincent Fiduccia 2016-05-23 14:18:56 -07:00
parent fdd9e1db51
commit bde93f57c1
5 changed files with 15 additions and 13 deletions

View File

@ -169,6 +169,7 @@ export default Ember.Route.extend(Subscribe, {
reset() {
// Forget all the things
console.log('Store Reset');
this.get('userStore').reset();
this.get('store').reset();
// Service has extra special hackery to cache relationships

View File

@ -2,7 +2,7 @@
<table class="grid fixed no-lines r-mb0">
<thead>
<tr>
<th>{{t 'k8s.containersSection.containersName'}}</th>
<th>{{t 'k8s.containersSection.containerName'}}</th>
<th>{{t 'generic.image'}}</th>
<th width="120">{{t 'k8s.containersSection.status'}}</th>
<th>{{t 'k8s.containersSection.message'}}</th>

View File

@ -27,7 +27,7 @@ export default Ember.Mixin.create({
var metadata = socket.getMetadata();
var socketProject = metadata.projectId;
if ( currentProject !== socketProject ) {
console.error(`Subscribe ignoring message, current=${currentProject} socket=${socketProject}`, this.forStr());
console.error(`Subscribe ignoring message, current=${currentProject} socket=${socketProject} ` + this.forStr());
this.connectSubscribe();
return;
}
@ -84,7 +84,7 @@ export default Ember.Mixin.create({
var socket = this.get('subscribeSocket');
if ( socket )
{
console.log('Subscribe disconnect', this.forStr());
console.log('Subscribe disconnect ' + this.forStr());
socket.disconnect();
}
},
@ -127,14 +127,14 @@ export default Ember.Mixin.create({
// WebSocket disconnected (unexpectedly)
subscribeDisconnected: function() {
console.log('Subscribe disconnected', this.forStr());
console.log('Subscribe disconnected ' + this.forStr());
if ( this.get('reconnect') ) {
this.connectSubscribe();
}
},
subscribePing: function() {
console.log('Subscribe ping', this.forStr());
console.log('Subscribe ping ' + this.forStr());
},
hostChanged: function(change) {

View File

@ -14,8 +14,6 @@ const CLOSING = 'closing';
const RECONNECTING = 'reconnecting';
export default Ember.Object.extend(Ember.Evented, {
growl: Ember.inject.service(),
url: null,
autoReconnect: true,
frameTimeout: 11000,
@ -170,7 +168,7 @@ export default Ember.Object.extend(Ember.Evented, {
},
_closed() {
console.log('Socket', this.get('_closingId'), 'closed');
console.log(`Socket ${this.get('_closingId')} closed`);
let wasConnected = false;
if ( [CONNECTED, CLOSING].indexOf(this.get('_state')) >= 0 )
@ -189,12 +187,15 @@ export default Ember.Object.extend(Ember.Evented, {
this.set('_disconnectedAt', (new Date()).getTime());
}
if ( isSafari && !safariWarningShown && !wasConnected && this.get('url').indexOf('wss://') === 0 )
if ( isSafari && !wasConnected && this.get('url').indexOf('wss://') === 0 )
{
this.set('autoReconnect', false);
this.set('_state', DISCONNECTED);
if ( !safariWarningShown )
{
safariWarningShown = true;
this.get('growl').error('Error connecting to WebSocket','Safari does not support WebSockets connecting to a self-signed or unrecognized certificate. Use http:// instead of https:// or reconfigure the server with a valid certificate from a recognized certificate authority. Streaming stats, logs, shell/console, and auto-updating of the state of resources in the UI will not work until this is resolved.');
window.l('service:growl').error('Error connecting to WebSocket','Safari does not support WebSockets connecting to a self-signed or unrecognized certificate. Use http:// instead of https:// or reconfigure the server with a valid certificate from a recognized certificate authority. Streaming stats, logs, shell/console, and auto-updating of the state of resources in the UI will not work until this is resolved.');
}
}
else if ( this.get('autoReconnect') )
{
@ -218,6 +219,6 @@ export default Ember.Object.extend(Ember.Evented, {
args.push(`(state=${this.get('_state')}, id=${this.get('_socket.__sockId')})`);
console.log.apply(console, args);
console.log(args.join(" "));
},
});

View File

@ -1,6 +1,6 @@
{
"name": "ui",
"version": "1.0.12",
"version": "1.1.0",
"private": true,
"directories": {
"doc": "doc",