Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reset app status properly on ever start/stop change.

Fixes problems with the way status was shown after start/stop.
  • Loading branch information...
commit b5990bef4775b5656d186bb12abc63d14e6d7dac 1 parent 94a40fe
@akavlie akavlie authored
Showing with 10 additions and 5 deletions.
  1. +9 −4 public/javascripts/main.js
  2. +1 −1  views/frontend-templates.jade
View
13 public/javascripts/main.js
@@ -46,15 +46,20 @@
idAttribute: 'name',
initialize: function() {
+ this.setStatus();
+ this.on('change:running', this.setStatus, this);
+ },
+
+ setStatus: function() {
var appStatus = this._parseRunning(this.get('running'));
- this.set({up: appStatus[0], status: appStatus[1]});
+ this.set({up: appStatus[0], appStatus: appStatus[1]});
},
-
+
_parseRunning: function(running) {
- if(running === undefined){
+ if (running === undefined) {
running = 'Application failed to start';
}
- switch(running) {
+ switch (running) {
case 'true':
case true:
return [true, 'running'];
View
2  views/frontend-templates.jade
@@ -12,7 +12,7 @@ script(id="app-tmpl", type="text/html")
a(href="http://{{name}}.nodester.com", target="_blank") {{name}}
td.port {{port}}
td.status <span class="label {{#up}}label-success{{/up}}
- | {{^up}}label-important{{/up}}">{{status}}</span>
+ | {{^up}}label-important{{/up}}">{{appStatus}}</span>
td.actions
a.start(href="/app") start
a.stop(href="/app") stop
Please sign in to comment.
Something went wrong with that request. Please try again.