diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index 94af094c2e..3a04e01d4b 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -13,6 +13,7 @@ block content h3 #{translate("loading")}... .progress .progress-bar(style="width: 20%", ng-style="{'width': state.load_progress + '%'}") + p.text-center.text-danger(ng-if="state.error").ng-cloak {{ state.error }} .global-alerts(ng-cloak) .alert.alert-danger.small(ng-if="connection.forced_disconnect") @@ -74,7 +75,7 @@ block content .modal-footer button.btn.btn-info(ng-click="done()") #{translate("ok")} - script(src='#{settings.websocketsUrl}/socket.io/socket.io.js') + script(src='/socket.io/socket.io.js') //- We need to do .replace(/\//g, '\\/') do that '' -> '<\/script>' //- and doesn't prematurely end the script tag. diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index c80cf86f3b..3f41b741d3 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -51,6 +51,7 @@ define [ $scope.state = { loading: true load_progress: 40 + error: null } $scope.ui = { leftMenuShown: false diff --git a/services/web/public/coffee/ide/connection/ConnectionManager.coffee b/services/web/public/coffee/ide/connection/ConnectionManager.coffee index 804fdea366..01bc6275bd 100644 --- a/services/web/public/coffee/ide/connection/ConnectionManager.coffee +++ b/services/web/public/coffee/ide/connection/ConnectionManager.coffee @@ -1,6 +1,14 @@ define [], () -> class ConnectionManager constructor: (@ide, @$scope) -> + if !io? + console.error "Socket.io javascript not loaded. Please check that the real-time service is running and accessible." + @ide.socket = + on: () -> + $scope.$apply () => + @$scope.state.error = "Could not connect to websocket server :(" + return + @connected = false @$scope.connection =