Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

App Live Status and App Actions Buttons #38

Closed
wants to merge 12 commits into from
Closed

App Live Status and App Actions Buttons #38

wants to merge 12 commits into from

Conversation

jcscottiii
Copy link
Contributor

No description provided.

@jcscottiii jcscottiii mentioned this pull request Aug 5, 2015
@jcscottiii
Copy link
Contributor Author

image

@geramirez
Copy link
Contributor

I really like the live data. 👍

@codecov-io
Copy link

Current coverage is 83.7%

Merging #38 into master will decrease coverage by -4.21% as of 64faad1

@@            master    #38   diff @@
=====================================
  Files            4      4       
  Stmts           91    135    +44
  Branches         9     13     +4
  Methods         62     88    +26
=====================================
+ Hit             80    113    +33
  Partial          0      0       
- Missed          11     22    +11

Review entire Coverage Diff as of 64faad1

Powered by Codecov. Updated on successful CI builds.

this.restartApp = function(app) {
return this.changeAppState(app, "STOPPED")
.then(function() {
return changeAppState(app, "STARTED");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The restart function isn't working for me b/c changeAppState isn't defined. I think you'll have to declare ChangeAppState with var in order to make it accessible to the scope on line 197. Like below:

    // Internal generic function that actually submits the request to backend to change the app.
    var changeAppState = function(app, desired_state) {
        setPollAppStatusProperty(false); // prevent UI from refreshing.
        return $http.put("/v2/apps/" + app.guid + "?async=false&inline-relations-depth=1", {"state":desired_state})
            .then(function(response) {
                // Success
                // Set the state immediately to stop so that UI will force a load of the new options.
                // UI will change the buttons based on the state.
                app.state = desired_state;
            }, function(response) {
                // Failure
            }).finally(function() {
                setPollAppStatusProperty(true); // allow UI to refresh via polling again.
            });
    }
    // Wrapper function that will submit a request to start an app.
    this.startApp = function(app) {
        return changeAppState(app, "STARTED");
    };
    // Wrapper function that will submit a request to stop an app.
    this.stopApp = function(app) {
        return changeAppState(app, "STOPPED");
    };
    // Wrapper function that will submit a request to restart an app.
    this.restartApp = function(app) {
        return changeAppState(app, "STOPPED")
            .then(function() {
                return changeAppState(app, "STARTED");
            });
    };

Before this patch, the restart failed to work completely. This patch
fixes that.
Also, during the restart case, the number of running instances would
animate to -1. This patch forces them to 0.
@jcscottiii
Copy link
Contributor Author

Merged into #45

@jcscottiii jcscottiii closed this Aug 10, 2015
@jcscottiii jcscottiii deleted the live_v3 branch August 10, 2015 15:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants