Skip to content
Snippets Groups Projects
Commit 005bf446 authored by James Allen's avatar James Allen
Browse files

Show initializing message

parent 438f359c
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,12 @@ div.full-size(ng-controller="ScriptOutputController")
i.fa.fa-level-up.fa-flip-horizontal.fa-2x
|   Click here to run your script!
.alert.alert-info(ng-show="running && stillIniting && !inited")
p
i.fa.fa-spinner.fa-spin.fa-fw
| Initializing environment...
p.small (This can take a while the first time you run a script)
span.output(ng-repeat="part in output | orderBy:'msg_id' track by $index ")
span(ng-if="part.output_type == 'stdout'").stdout {{ part.text }}
span(ng-if="part.output_type == 'stderr'").stderr {{ part.text }}
......
......@@ -10,6 +10,8 @@ define [
$scope.error = false
$scope.timedout = false
$scope.session_id = Math.random().toString().slice(2)
$scope.stillIniting = false
$scope.inited = false
reset()
$scope.uncompiled = true
......@@ -21,6 +23,10 @@ define [
# We get messages from other user's compiles in this project. Ignore them
return if message.header?.session != $scope.session_id
if message.msg_type == "system_status" and message.content.status == "starting_run"
$scope.inited = true
$scope.$apply()
else
output = parseOutputMessage(message)
if output?
$scope.output.push output
......@@ -31,6 +37,10 @@ define [
return if $scope.needToUpgrade
reset()
initing = setTimeout () ->
$scope.stillIniting = true
$scope.$apply()
, 1000
$scope.running = true
$scope.uncompiled = false
......@@ -42,11 +52,13 @@ define [
doCompile(rootDoc_id, compiler)
.success (data) ->
clearTimeout(initing)
$scope.running = false
if data?.status == "timedout"
$scope.timedout = true
.error () ->
clearTimeout(initing)
$scope.running = false
$scope.error = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment