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
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
I really like the live data. 👍 |
Current coverage is
|
this.restartApp = function(app) { | ||
return this.changeAppState(app, "STOPPED") | ||
.then(function() { | ||
return changeAppState(app, "STARTED"); |
There was a problem hiding this comment.
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.
Merged into #45 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.